add supported_platforms and hidden field to scripts and filter in script dialogs and allow editing in script forms

This commit is contained in:
sadnub
2022-03-10 20:01:24 -05:00
parent 57be74bb42
commit ebd9512d4d
8 changed files with 125 additions and 38 deletions

View File

@@ -38,6 +38,16 @@
map-options
label="Shell Type"
/>
<tactical-dropdown
v-model="formScript.supported_platforms"
:options="agentPlatformOptions"
label="Supported Platforms (All supported if blank)"
clearable
mapOptions
filled
multiple
:readonly="readonly"
/>
<tactical-dropdown
filled
v-model="formScript.category"
@@ -127,10 +137,10 @@
<script>
// composable imports
import { ref, computed, watch, onMounted } from "vue";
import { ref, computed, onMounted } from "vue";
import { useQuasar, useDialogPluginComponent } from "quasar";
import { saveScript, editScript, downloadScript } from "@/api/scripts";
import { useAgentDropdown } from "@/composables/agents";
import { useAgentDropdown, agentPlatformOptions } from "@/composables/agents";
import { notifySuccess } from "@/utils/notify";
// ui imports
@@ -186,16 +196,6 @@ export default {
const loading = ref(false);
const agentLoading = ref(false);
// watch(script.value, (newValue, oldValue) => {
// if (!props.script && script.value.script_body === "") {
// if (newValue.shell === "shell") {
// script.value.script_body = "#!/bin/bash\n\n# don't forget to include the shebang above!\n\n";
// } else if (newValue.shell === "python") {
// script.value.script_body = "#!/usr/bin/python3\n\n# don't forget to include the shebang above!\n\n";
// }
// }
// });
const title = computed(() => {
if (props.script) {
return props.readonly
@@ -274,6 +274,7 @@ export default {
// non-reactive data
shellOptions,
agentPlatformOptions,
//computed
title,