Compare commits

...

9 Commits

Author SHA1 Message Date
wh1te909
f518043d8d Release 0.100.7 2022-08-01 17:36:11 +00:00
wh1te909
e67c1ff331 bump version 2022-08-01 17:36:00 +00:00
wh1te909
137a5648ce run as user 2022-07-31 22:02:50 +00:00
wh1te909
cc2335558d Release 0.100.6 2022-07-27 06:15:49 +00:00
wh1te909
a944bc50d1 bump version 2022-07-27 06:14:59 +00:00
wh1te909
0a4b00298d update reqs 2022-07-26 08:07:41 +00:00
wh1te909
1eaed284a3 run day off by one day fixes amidaware/tacticalrmm#1193 2022-07-18 15:39:17 +00:00
wh1te909
b278e0bed4 display the nice time from django 2022-07-18 07:02:19 +00:00
wh1te909
6ee3df7e4e fix timezone when editing task amidaware/tacticalrmm#1189 2022-07-18 05:49:42 +00:00
11 changed files with 143 additions and 73 deletions

111
package-lock.json generated
View File

@@ -1,35 +1,35 @@
{
"name": "web",
"version": "0.100.2-dev",
"version": "0.100.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "web",
"version": "0.100.2-dev",
"version": "0.100.5",
"dependencies": {
"@quasar/extras": "1.14.2",
"apexcharts": "3.35.3",
"@quasar/extras": "1.15.0",
"apexcharts": "3.35.4",
"axios": "0.27.2",
"dotenv": "16.0.1",
"qrcode.vue": "3.3.3",
"quasar": "2.7.5",
"vue": "3.2.37",
"vue-router": "4.1.1",
"vue-router": "4.1.2",
"vue3-ace-editor": "2.2.2",
"vue3-apexcharts": "1.4.1",
"vuedraggable": "4.1.0",
"vuex": "4.0.2"
},
"devDependencies": {
"@intlify/vite-plugin-vue-i18n": "^3.4.0",
"@intlify/vite-plugin-vue-i18n": "^5.0.1",
"@quasar/app-vite": "^1.0.5",
"@quasar/cli": "^1.3.2",
"@types/node": "^18.0.3",
"@types/node": "^18.6.1",
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"autoprefixer": "^10.4.7",
"eslint": "^8.18.0",
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-vue": "^8.5.0",
"prettier": "^2.7.1",
@@ -162,30 +162,33 @@
}
},
"node_modules/@intlify/vite-plugin-vue-i18n": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/@intlify/vite-plugin-vue-i18n/-/vite-plugin-vue-i18n-3.4.0.tgz",
"integrity": "sha512-XXcZBgwJ+3FRu11c4ARoY9N00kElPii0/jNZ49qR045Ka7/YGCwb1Ku14BBlMSEHiHDSjLQknLwrJKSQGVZLyA==",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@intlify/vite-plugin-vue-i18n/-/vite-plugin-vue-i18n-5.0.1.tgz",
"integrity": "sha512-+LAUdm5PxGtLrUYgD2Wg9SINmLmhZqrcTnzccfqopca5NvaXWOPnQR4cQOkn82qLuyjWdCYC1BoqMHWBWX/MyQ==",
"dev": true,
"dependencies": {
"@intlify/bundle-utils": "^2.2.2",
"@intlify/shared": "^9.1.0",
"@rollup/pluginutils": "^4.1.0",
"@intlify/bundle-utils": "next",
"@intlify/shared": "next",
"@rollup/pluginutils": "^4.2.0",
"debug": "^4.3.1",
"fast-glob": "^3.2.5",
"source-map": "0.6.1"
},
"engines": {
"node": ">= 12"
"node": ">= 14.6"
},
"peerDependencies": {
"petite-vue-i18n": "^9.1.0",
"vite": "^2.0.0",
"vue-i18n": "^9.1.0"
"petite-vue-i18n": "*",
"vite": "^2.9.0 || ^3.0.0",
"vue-i18n": "*"
},
"peerDependenciesMeta": {
"petite-vue-i18n": {
"optional": true
},
"vite": {
"optional": true
},
"vue-i18n": {
"optional": true
}
@@ -395,9 +398,9 @@
}
},
"node_modules/@quasar/extras": {
"version": "1.14.2",
"resolved": "https://registry.npmjs.org/@quasar/extras/-/extras-1.14.2.tgz",
"integrity": "sha512-F9T1aIhRIiuJeuxPCu2CBlPj5js6mBZWQOAHHyVlreNa5qhVEHhr/9GfljG6RTnjvTNOjJraTl0hi8g0IuUfLw==",
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/@quasar/extras/-/extras-1.15.0.tgz",
"integrity": "sha512-e5IHHqo3i/u7yWdcdspBbthnrDDZ3VRXaQoyhEEy526lzITFAw3hnlt4h7YnZ6Ck6gVIM0YbCaZbKaQYfKPOzQ==",
"funding": {
"type": "github",
"url": "https://donate.quasar.dev"
@@ -581,9 +584,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "18.0.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.3.tgz",
"integrity": "sha512-HzNRZtp4eepNitP+BD6k2L6DROIDG4Q0fm4x+dwfsr6LGmROENnok75VGw40628xf+iR24WeMFcHuuBDUAzzsQ==",
"version": "18.6.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.1.tgz",
"integrity": "sha512-z+2vB6yDt1fNwKOeGbckpmirO+VBDuQqecXkgeIqDlaOtmKn6hPR/viQ8cxCfqLU4fTlvM3+YjM367TukWdxpg==",
"dev": true
},
"node_modules/@types/qs": {
@@ -1029,9 +1032,9 @@
}
},
"node_modules/apexcharts": {
"version": "3.35.3",
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.35.3.tgz",
"integrity": "sha512-UDlxslJr3DG63I/SgoiivIu4lpP25GMaKFK8NvCHmTksTQshx4ng3oPPrYvdsBFOvD/ajPYIh/p7rNB0jq8vXg==",
"version": "3.35.4",
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.35.4.tgz",
"integrity": "sha512-dsXjETHF2OmKtxNv66wBeFGU2qtZQnr6kp/vcNY05GWs4vcBepg54qNgOJ2Gp/gXskiGw/frrmIKGi8lJ/UDnQ==",
"dependencies": {
"svg.draggable.js": "^2.2.2",
"svg.easing.js": "^2.0.0",
@@ -3011,9 +3014,9 @@
}
},
"node_modules/eslint": {
"version": "8.18.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.18.0.tgz",
"integrity": "sha512-As1EfFMVk7Xc6/CvhssHUjsAQSkpfXvUGMFC3ce8JDe6WvqCgRrLOBQbVpsBFr1X1V+RACOadnzVvcUS5ni2bA==",
"version": "8.20.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.20.0.tgz",
"integrity": "sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA==",
"dev": true,
"dependencies": {
"@eslint/eslintrc": "^1.3.0",
@@ -7324,9 +7327,9 @@
}
},
"node_modules/vue-router": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.1.tgz",
"integrity": "sha512-Wp1mEf2xCwT0ez7o9JvgpfBp9JGnVb+dPERzXDbugTatzJAJ60VWOhJKifQty85k+jOreoFHER4r5fu062PhPw==",
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.2.tgz",
"integrity": "sha512-5BP1qXFncVRwgV/XnqzsKApdMjQPqWIpoUBdL1ynz8HyLxIX/UDAx7Ql2BjmA5CXT/p61JfZvkpiFWFpaqcfag==",
"dependencies": {
"@vue/devtools-api": "^6.1.4"
},
@@ -7698,14 +7701,14 @@
"dev": true
},
"@intlify/vite-plugin-vue-i18n": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/@intlify/vite-plugin-vue-i18n/-/vite-plugin-vue-i18n-3.4.0.tgz",
"integrity": "sha512-XXcZBgwJ+3FRu11c4ARoY9N00kElPii0/jNZ49qR045Ka7/YGCwb1Ku14BBlMSEHiHDSjLQknLwrJKSQGVZLyA==",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@intlify/vite-plugin-vue-i18n/-/vite-plugin-vue-i18n-5.0.1.tgz",
"integrity": "sha512-+LAUdm5PxGtLrUYgD2Wg9SINmLmhZqrcTnzccfqopca5NvaXWOPnQR4cQOkn82qLuyjWdCYC1BoqMHWBWX/MyQ==",
"dev": true,
"requires": {
"@intlify/bundle-utils": "^2.2.2",
"@intlify/shared": "^9.1.0",
"@rollup/pluginutils": "^4.1.0",
"@intlify/bundle-utils": "next",
"@intlify/shared": "next",
"@rollup/pluginutils": "^4.2.0",
"debug": "^4.3.1",
"fast-glob": "^3.2.5",
"source-map": "0.6.1"
@@ -7846,9 +7849,9 @@
}
},
"@quasar/extras": {
"version": "1.14.2",
"resolved": "https://registry.npmjs.org/@quasar/extras/-/extras-1.14.2.tgz",
"integrity": "sha512-F9T1aIhRIiuJeuxPCu2CBlPj5js6mBZWQOAHHyVlreNa5qhVEHhr/9GfljG6RTnjvTNOjJraTl0hi8g0IuUfLw=="
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/@quasar/extras/-/extras-1.15.0.tgz",
"integrity": "sha512-e5IHHqo3i/u7yWdcdspBbthnrDDZ3VRXaQoyhEEy526lzITFAw3hnlt4h7YnZ6Ck6gVIM0YbCaZbKaQYfKPOzQ=="
},
"@quasar/fastclick": {
"version": "1.1.5",
@@ -8004,9 +8007,9 @@
"dev": true
},
"@types/node": {
"version": "18.0.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.3.tgz",
"integrity": "sha512-HzNRZtp4eepNitP+BD6k2L6DROIDG4Q0fm4x+dwfsr6LGmROENnok75VGw40628xf+iR24WeMFcHuuBDUAzzsQ==",
"version": "18.6.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.1.tgz",
"integrity": "sha512-z+2vB6yDt1fNwKOeGbckpmirO+VBDuQqecXkgeIqDlaOtmKn6hPR/viQ8cxCfqLU4fTlvM3+YjM367TukWdxpg==",
"dev": true
},
"@types/qs": {
@@ -8321,9 +8324,9 @@
}
},
"apexcharts": {
"version": "3.35.3",
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.35.3.tgz",
"integrity": "sha512-UDlxslJr3DG63I/SgoiivIu4lpP25GMaKFK8NvCHmTksTQshx4ng3oPPrYvdsBFOvD/ajPYIh/p7rNB0jq8vXg==",
"version": "3.35.4",
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.35.4.tgz",
"integrity": "sha512-dsXjETHF2OmKtxNv66wBeFGU2qtZQnr6kp/vcNY05GWs4vcBepg54qNgOJ2Gp/gXskiGw/frrmIKGi8lJ/UDnQ==",
"requires": {
"svg.draggable.js": "^2.2.2",
"svg.easing.js": "^2.0.0",
@@ -9760,9 +9763,9 @@
"dev": true
},
"eslint": {
"version": "8.18.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.18.0.tgz",
"integrity": "sha512-As1EfFMVk7Xc6/CvhssHUjsAQSkpfXvUGMFC3ce8JDe6WvqCgRrLOBQbVpsBFr1X1V+RACOadnzVvcUS5ni2bA==",
"version": "8.20.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.20.0.tgz",
"integrity": "sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA==",
"dev": true,
"requires": {
"@eslint/eslintrc": "^1.3.0",
@@ -13011,9 +13014,9 @@
}
},
"vue-router": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.1.tgz",
"integrity": "sha512-Wp1mEf2xCwT0ez7o9JvgpfBp9JGnVb+dPERzXDbugTatzJAJ60VWOhJKifQty85k+jOreoFHER4r5fu062PhPw==",
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.2.tgz",
"integrity": "sha512-5BP1qXFncVRwgV/XnqzsKApdMjQPqWIpoUBdL1ynz8HyLxIX/UDAx7Ql2BjmA5CXT/p61JfZvkpiFWFpaqcfag==",
"requires": {
"@vue/devtools-api": "^6.1.4"
}

View File

@@ -1,6 +1,6 @@
{
"name": "web",
"version": "0.100.5",
"version": "0.100.7",
"private": true,
"productName": "Tactical RMM",
"scripts": {
@@ -10,8 +10,8 @@
"format": "prettier --write \"**/*.{js,ts,vue,,html,md,json}\" --ignore-path .gitignore"
},
"dependencies": {
"@quasar/extras": "1.14.2",
"apexcharts": "3.35.3",
"@quasar/extras": "1.15.0",
"apexcharts": "3.35.4",
"axios": "0.27.2",
"dotenv": "16.0.1",
"qrcode.vue": "3.3.3",
@@ -20,18 +20,18 @@
"vue3-ace-editor": "2.2.2",
"vue3-apexcharts": "1.4.1",
"vuedraggable": "4.1.0",
"vue-router": "4.1.1",
"vue-router": "4.1.2",
"vuex": "4.0.2"
},
"devDependencies": {
"@quasar/cli": "^1.3.2",
"@intlify/vite-plugin-vue-i18n": "^3.4.0",
"@intlify/vite-plugin-vue-i18n": "^5.0.1",
"@quasar/app-vite": "^1.0.5",
"@types/node": "^18.0.3",
"@types/node": "^18.6.1",
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"autoprefixer": "^10.4.7",
"eslint": "^8.18.0",
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-vue": "^8.5.0",
"prettier": "^2.7.1",

View File

@@ -135,6 +135,11 @@
:rules="[(val) => !!val || '*Required']"
/>
</q-card-section>
<q-card-section v-if="supportsRunAsUser()" class="q-pt-none">
<q-checkbox v-model="state.run_as_user" label="Run As User">
<q-tooltip>{{ runAsUserToolTip }}</q-tooltip>
</q-checkbox>
</q-card-section>
<q-card-section v-if="mode === 'script' || mode === 'command'">
<q-input
@@ -203,6 +208,7 @@ import { runBulkAction } from "@/api/agents";
import { notifySuccess } from "@/utils/notify";
import { cmdPlaceholder } from "@/composables/agents";
import { removeExtraOptionCategories } from "@/utils/format";
import { runAsUserToolTip } from "@/constants/constants";
// ui imports
import TacticalDropdown from "@/components/ui/TacticalDropdown.vue";
@@ -300,6 +306,7 @@ export default {
script,
timeout: defaultTimeout,
args: defaultArgs,
run_as_user: false,
});
const loading = ref(false);
@@ -316,6 +323,7 @@ export default {
() => state.value.osType,
(newValue) => {
state.value.custom_shell = null;
state.value.run_as_user = false;
if (newValue === "windows") {
state.value.shell = "cmd";
@@ -337,6 +345,13 @@ export default {
loading.value = false;
}
const supportsRunAsUser = () => {
const modes = ["script", "command"];
return (
state.value.osType === "windows" && modes.includes(state.value.mode)
);
};
// set modal title and caption
const modalTitle = computed(() => {
return props.mode === "command"
@@ -387,6 +402,7 @@ export default {
osTypeOptions,
targetOptions,
patchModeOptions,
runAsUserToolTip,
//computed
modalTitle,
@@ -394,6 +410,7 @@ export default {
//methods
submit,
cmdPlaceholder,
supportsRunAsUser,
// quasar dialog plugin
dialogRef,

View File

@@ -129,37 +129,37 @@
<div class="q-gutter-sm">
<q-checkbox
v-model="winupdatepolicy.run_time_days"
:val="1"
:val="0"
label="Monday"
/>
<q-checkbox
v-model="winupdatepolicy.run_time_days"
:val="2"
:val="1"
label="Tuesday"
/>
<q-checkbox
v-model="winupdatepolicy.run_time_days"
:val="3"
:val="2"
label="Wednesday"
/>
<q-checkbox
v-model="winupdatepolicy.run_time_days"
:val="4"
:val="3"
label="Thursday"
/>
<q-checkbox
v-model="winupdatepolicy.run_time_days"
:val="5"
:val="4"
label="Friday"
/>
<q-checkbox
v-model="winupdatepolicy.run_time_days"
:val="6"
:val="5"
label="Saturday"
/>
<q-checkbox
v-model="winupdatepolicy.run_time_days"
:val="0"
:val="6"
label="Sunday"
/>
</div>

View File

@@ -63,11 +63,14 @@ export default {
loading.value = true;
try {
await scheduleAgentReboot(props.agent.agent_id, state.value);
const ret = await scheduleAgentReboot(
props.agent.agent_id,
state.value
);
$q.dialog({
title: "Reboot pending",
style: "width: 40vw",
message: `A reboot has been scheduled for <strong>${state.value.datetime}</strong> on ${props.agent.hostname}.
message: `A reboot has been scheduled for <strong>${ret.time}</strong> on ${props.agent.hostname}.
<br />It can be cancelled from the Pending Actions menu until the scheduled time.`,
html: true,
}).onDismiss(onDialogOK);

View File

@@ -128,6 +128,11 @@
/>
<q-checkbox v-model="state.save_all_output" label="Save all output" />
</q-card-section>
<q-card-section v-if="agent.plat === 'windows'">
<q-checkbox v-model="state.run_as_user" label="Run As User">
<q-tooltip>{{ runAsUserToolTip }}</q-tooltip>
</q-checkbox>
</q-card-section>
<q-card-section>
<q-input
v-model.number="state.timeout"
@@ -173,6 +178,7 @@ import { useScriptDropdown } from "@/composables/scripts";
import { useCustomFieldDropdown } from "@/composables/core";
import { runScript } from "@/api/agents";
import { notifySuccess } from "@/utils/notify";
import { runAsUserToolTip } from "@/constants/constants";
import {
formatScriptSyntax,
removeExtraOptionCategories,
@@ -220,6 +226,7 @@ export default {
script,
args: defaultArgs,
timeout: defaultTimeout,
run_as_user: false,
});
const ret = ref(null);
@@ -273,6 +280,7 @@ export default {
// non-reactive data
outputOptions,
runAsUserToolTip,
//methods
formatScriptSyntax,

View File

@@ -51,6 +51,11 @@
/>
</div>
</q-card-section>
<q-card-section v-if="agent.plat === 'windows'">
<q-checkbox v-model="state.run_as_user" label="Run As User">
<q-tooltip>{{ runAsUserToolTip }}</q-tooltip>
</q-checkbox>
</q-card-section>
<q-card-section v-if="state.shell === 'custom'">
<q-input
v-model="state.custom_shell"
@@ -117,6 +122,7 @@ import { ref } from "vue";
import { useDialogPluginComponent } from "quasar";
import { sendAgentCommand } from "@/api/agents";
import { cmdPlaceholder } from "@/composables/agents";
import { runAsUserToolTip } from "@/constants/constants";
export default {
name: "SendCommand",
@@ -134,6 +140,7 @@ export default {
cmd: null,
timeout: 30,
custom_shell: null,
run_as_user: false,
});
const loading = ref(false);
@@ -156,6 +163,9 @@ export default {
loading,
ret,
// non reactivete data
runAsUserToolTip,
// methods
submit,
cmdPlaceholder,

View File

@@ -128,6 +128,18 @@
:rules="[(val) => val >= 5 || 'Minimum is 5']"
hide-bottom-space
/>
<q-checkbox
v-model="formScript.run_as_user"
label="Run As User (Windows only)"
>
<q-tooltip
>Setting this value on the script model will always override any
'Run As User' checkboxes in the UI and force this script to
always be run in the context of the logged in user. If no user
is logged in, the script will not run and an error will be
returned. Not supported on Windows Server.
</q-tooltip>
</q-checkbox>
<q-input
label="Syntax"
type="textarea"
@@ -253,6 +265,7 @@ export default {
default_timeout: 90,
args: [],
script_body: "",
run_as_user: false,
});
if (props.clone) script.value.name = `(Copy) ${script.value.name}`;

View File

@@ -44,6 +44,7 @@ export default {
timeout: props.script.default_timeout,
args: props.script.args,
shell: props.script.shell,
run_as_user: props.script.run_as_user,
};
try {
ret.value = await testScript(props.agent, data);

View File

@@ -991,10 +991,16 @@ export default {
: [];
// remove milliseconds and Z to work with native date input
task.value.run_time_date = formatDateInputField(task.value.run_time_date);
task.value.run_time_date = formatDateInputField(
task.value.run_time_date,
true
);
if (task.value.expire_date)
task.value.expire_date = formatDateInputField(task.value.expire_date);
task.value.expire_date = formatDateInputField(
task.value.expire_date,
true
);
// set task type if monthlydow is being used
if (task.value.task_type === "monthlydow") {

View File

@@ -3,4 +3,13 @@ const GOARCH_i386 = "386";
const GOARCH_ARM64 = "arm64";
const GOARCH_ARM32 = "arm";
export { GOARCH_AMD64, GOARCH_i386, GOARCH_ARM64, GOARCH_ARM32 };
const runAsUserToolTip =
"Run in the context of the logged in user. If no user is logged in, the script will not run and an error will be returned. Not supported on Windows Server.";
export {
GOARCH_AMD64,
GOARCH_i386,
GOARCH_ARM64,
GOARCH_ARM32,
runAsUserToolTip,
};