diff --git a/src/components/AgentTable.vue b/src/components/AgentTable.vue
index 0b0d2e7..90d98a1 100644
--- a/src/components/AgentTable.vue
+++ b/src/components/AgentTable.vue
@@ -109,6 +109,30 @@
Take Control
+
+
+
+
+ Run URL Action
+
+
+
+
+
+
+ {{ action.name }}
+
+
+
+
+
@@ -438,6 +462,7 @@ export default {
showPendingActions: false,
pendingActionAgentPk: null,
favoriteScripts: [],
+ urlActions: [],
};
},
methods: {
@@ -526,17 +551,24 @@ export default {
},
getFavoriteScripts() {
this.favoriteScripts = [];
- this.$axios.get("/scripts/scripts/").then(r => {
- if (r.data.filter(k => k.favorite === true).length === 0) {
- this.notifyWarning("You don't have any scripts favorited!");
- return;
- }
- this.favoriteScripts = r.data
- .filter(k => k.favorite === true)
- .map(script => ({ label: script.name, value: script.id, timeout: script.default_timeout, args: script.args }))
- .sort((a, b) => a.label.localeCompare(b.label));
- })
- .catch(e => {});
+ this.$axios
+ .get("/scripts/scripts/")
+ .then(r => {
+ if (r.data.filter(k => k.favorite === true).length === 0) {
+ this.notifyWarning("You don't have any scripts favorited!");
+ return;
+ }
+ this.favoriteScripts = r.data
+ .filter(k => k.favorite === true)
+ .map(script => ({
+ label: script.name,
+ value: script.id,
+ timeout: script.default_timeout,
+ args: script.args,
+ }))
+ .sort((a, b) => a.label.localeCompare(b.label));
+ })
+ .catch(e => {});
},
runPatchStatusScan(pk, hostname) {
this.$axios
@@ -740,6 +772,28 @@ export default {
rowSelectedClass(id) {
if (this.selectedRow === id) return this.$q.dark.isActive ? "highlight-dark" : "highlight";
},
+ getURLActions() {
+ this.$axios
+ .get("/core/urlaction/")
+ .then(r => {
+ if (r.data.length === 0) {
+ this.notifyWarning("No URL Actions configured. Go to Settings > Global Settings > URL Actions");
+ return;
+ }
+ this.urlActions = r.data;
+ })
+ .catch(() => {});
+ },
+ runURLAction(agentid, action) {
+ const data = {
+ agent: agentid,
+ action: action.id,
+ };
+ this.$axios
+ .patch("/core/urlaction/run", data)
+ .then(r => {})
+ .catch(() => {});
+ },
},
computed: {
...mapGetters(["selectedAgentPk", "agentTableHeight"]),
diff --git a/src/components/modals/coresettings/EditCoreSettings.vue b/src/components/modals/coresettings/EditCoreSettings.vue
index cab1f65..5cd1d4c 100644
--- a/src/components/modals/coresettings/EditCoreSettings.vue
+++ b/src/components/modals/coresettings/EditCoreSettings.vue
@@ -9,6 +9,7 @@
+
@@ -300,6 +301,10 @@
+
+
+
+
@@ -324,12 +329,14 @@ import mixins from "@/mixins/mixins";
import ResetPatchPolicy from "@/components/modals/coresettings/ResetPatchPolicy";
import CustomFields from "@/components/modals/coresettings/CustomFields";
import KeyStoreTable from "@/components/modals/coresettings/KeyStoreTable";
+import URLActionsTable from "@/components/modals/coresettings/URLActionsTable";
export default {
name: "EditCoreSettings",
components: {
CustomFields,
KeyStoreTable,
+ URLActionsTable,
},
mixins: [mixins],
data() {
diff --git a/src/components/modals/coresettings/KeyStoreForm.vue b/src/components/modals/coresettings/KeyStoreForm.vue
index ba23d29..0a56a28 100644
--- a/src/components/modals/coresettings/KeyStoreForm.vue
+++ b/src/components/modals/coresettings/KeyStoreForm.vue
@@ -14,7 +14,7 @@
-
+
diff --git a/src/components/modals/coresettings/URLActionsForm.vue b/src/components/modals/coresettings/URLActionsForm.vue
new file mode 100644
index 0000000..db4fd96
--- /dev/null
+++ b/src/components/modals/coresettings/URLActionsForm.vue
@@ -0,0 +1,117 @@
+
+
+
+
+ {{ title }}
+
+
+ Close
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/modals/coresettings/URLActionsTable.vue b/src/components/modals/coresettings/URLActionsTable.vue
new file mode 100644
index 0000000..b57f427
--- /dev/null
+++ b/src/components/modals/coresettings/URLActionsTable.vue
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Edit
+
+
+
+
+
+ Delete
+
+
+
+
+
+ Close
+
+
+
+
+
+ {{ props.row.name }}
+
+
+
+ {{ props.row.desc }}
+
+
+
+ {{ props.row.pattern }}
+
+
+
+
+
+
+
+
\ No newline at end of file