diff --git a/src/options/Run.vue b/src/options/Run.vue
index f35626b..67e2289 100644
--- a/src/options/Run.vue
+++ b/src/options/Run.vue
@@ -27,18 +27,18 @@
-
-
@@ -75,7 +75,7 @@
- Save Script
+ Save Script
Run
@@ -111,7 +111,7 @@
Save {{ actionMode === 'request' ? 'Action' : 'Script' }}
- Cancel
+ Cancel
@@ -174,6 +174,7 @@ export default {
action: {
name: null,
args: [],
+ defaultArgs: {},
},
};
},
@@ -244,6 +245,7 @@ export default {
clearAction() {
this.action.name = null;
this.action.args = [];
+ this.action.defaultArgs = {};
this.actionResponse = null;
this.actionError = null;
},
@@ -287,6 +289,14 @@ export default {
});
},
+ removeActionArgument(i) {
+ this.action.args.splice(i, 1);
+ },
+
+ toggleSaveMode() {
+ this.saveMode = !this.saveMode;
+ },
+
async loadPlugins() {
this.pluginsLoading = true;
@@ -377,12 +387,21 @@ export default {
},
onActionChange(action) {
+ if (action === this.action.name) {
+ return;
+ }
+
this.action.name = action;
this.action.args = [];
- },
- onCategoryInput(event) {
- console.log(event);
+ if (action in this.actions) {
+ this.action.defaultArgs = Object.entries(this.actions[action].args).reduce((obj, [name, arg]) => {
+ obj[name] = { ...arg, value: arg.default };
+ return obj;
+ }, {});
+ } else {
+ this.action.defaultArgs = {};
+ }
},
},