Skip to content

Commit

Permalink
add syntax hover icon to bulk script closes amidaware/tacticalrmm#1946
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Oct 17, 2024
1 parent ddb7c82 commit a53a3b3
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions src/components/modals/agents/BulkAction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,24 @@
outlined
mapOptions
filterable
/>
>
<template v-slot:after>
<q-btn
size="sm"
round
dense
flat
icon="info"
@click="openScriptURL"
>
<q-tooltip
v-if="syntax"
class="bg-white text-primary text-body1"
v-html="formatScriptSyntax(syntax)"
/>
</q-btn>
</template>
</tactical-dropdown>
</q-card-section>
<q-card-section v-if="mode === 'script'" class="q-pt-none">
<tactical-dropdown
Expand Down Expand Up @@ -251,13 +268,14 @@ import {
onMounted,
defineComponent,
} from "vue";
import { useDialogPluginComponent } from "quasar";
import { useDialogPluginComponent, openURL } from "quasar";
import { useScriptDropdown } from "@/composables/scripts";
import { useAgentDropdown } from "@/composables/agents";
import { useClientDropdown, useSiteDropdown } from "@/composables/clients";
import { useCustomFieldDropdown } from "@/composables/core";
import { runBulkAction } from "@/api/agents";
import { notifySuccess } from "@/utils/notify";
import { formatScriptSyntax } from "@/utils/format";
import { cmdPlaceholder } from "@/composables/agents";
import { envVarsLabel, runAsUserToolTip } from "@/constants/constants";
Expand Down Expand Up @@ -331,13 +349,19 @@ export default defineComponent({
defaultTimeout,
defaultArgs,
defaultEnvVars,
syntax,
link,
getScriptOptions,
} = useScriptDropdown();
const { agents, agentOptions, getAgentOptions } = useAgentDropdown();
const { site, siteOptions, getSiteOptions } = useSiteDropdown();
const { client, clientOptions, getClientOptions } = useClientDropdown();
const { customFieldOptions } = useCustomFieldDropdown({ onMount: true });
function openScriptURL() {
link.value ? openURL(link.value) : null;
}
// bulk action logic
const state = reactive({
mode: props.mode,
Expand Down Expand Up @@ -449,6 +473,7 @@ export default defineComponent({
patchModeOptions,
runAsUserToolTip,
envVarsLabel,
syntax,
//computed
modalTitle,
Expand All @@ -457,6 +482,8 @@ export default defineComponent({
submit,
cmdPlaceholder,
supportsRunAsUser,
openScriptURL,
formatScriptSyntax,
// quasar dialog plugin
dialogRef,
Expand Down

0 comments on commit a53a3b3

Please sign in to comment.