mirror of
https://github.com/jpros/tacticalrmm-web.git
synced 2026-02-16 17:20:22 +00:00
rework bulk action modal. start running bulk actions on next agent checkin
This commit is contained in:
@@ -5,7 +5,8 @@ import { formatAgentOptions } from "@/utils/format"
|
||||
|
||||
// agent dropdown
|
||||
export function useAgentDropdown() {
|
||||
|
||||
const agent = ref(null)
|
||||
const agents = ref([])
|
||||
const agentOptions = ref([])
|
||||
|
||||
// specifing flat returns an array of hostnames versus {value:id, label: hostname}
|
||||
@@ -15,6 +16,8 @@ export function useAgentDropdown() {
|
||||
|
||||
return {
|
||||
//data
|
||||
agent,
|
||||
agents,
|
||||
agentOptions,
|
||||
|
||||
//methods
|
||||
|
||||
@@ -4,7 +4,8 @@ import { fetchClients } from "@/api/clients"
|
||||
import { formatClientOptions, formatSiteOptions } from "@/utils/format"
|
||||
|
||||
export function useClientDropdown() {
|
||||
|
||||
const client = ref(null)
|
||||
const clients = ref([])
|
||||
const clientOptions = ref([])
|
||||
|
||||
async function getClientOptions(flat = false) {
|
||||
@@ -13,6 +14,8 @@ export function useClientDropdown() {
|
||||
|
||||
return {
|
||||
//data
|
||||
client,
|
||||
clients,
|
||||
clientOptions,
|
||||
|
||||
//methods
|
||||
@@ -21,14 +24,18 @@ export function useClientDropdown() {
|
||||
}
|
||||
|
||||
export function useSiteDropdown() {
|
||||
const site = ref(null)
|
||||
const sites = ref([])
|
||||
const siteOptions = ref([])
|
||||
|
||||
async function getSiteOptions() {
|
||||
siteOptions.value = formatSiteOptions(await fetchSites())
|
||||
siteOptions.value = formatSiteOptions(await fetchClients())
|
||||
}
|
||||
|
||||
return {
|
||||
//data
|
||||
site,
|
||||
sites,
|
||||
siteOptions,
|
||||
|
||||
//methods
|
||||
|
||||
@@ -7,7 +7,7 @@ export function useScriptDropdown() {
|
||||
const scriptOptions = ref([])
|
||||
const defaultTimeout = ref(30)
|
||||
const defaultArgs = ref([])
|
||||
const scriptPK = ref(null)
|
||||
const script = ref(null)
|
||||
|
||||
// specifing flat returns an array of script names versus {value:id, label: hostname}
|
||||
async function getScriptOptions(showCommunityScripts = false, flat = false) {
|
||||
@@ -15,17 +15,17 @@ export function useScriptDropdown() {
|
||||
}
|
||||
|
||||
// watch scriptPk for changes and update the default timeout and args
|
||||
watch(scriptPK, (newValue, oldValue) => {
|
||||
watch(script, (newValue, oldValue) => {
|
||||
if (newValue) {
|
||||
const script = scriptOptions.value.find(i => i.value === newValue);
|
||||
defaultTimeout.value = script.timeout;
|
||||
defaultArgs.value = script.args;
|
||||
const tmpScript = scriptOptions.value.find(i => i.value === newValue);
|
||||
defaultTimeout.value = tmpScript.timeout;
|
||||
defaultArgs.value = tmpScript.args;
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
//data
|
||||
scriptPK,
|
||||
script,
|
||||
scriptOptions,
|
||||
defaultTimeout,
|
||||
defaultArgs,
|
||||
|
||||
Reference in New Issue
Block a user