Compare commits

...

11 Commits

Author SHA1 Message Date
wh1te909
a8a171ba2c Release 0.100.5 2022-07-10 00:00:08 +00:00
wh1te909
7ee87da3b6 bump version 2022-07-09 23:59:43 +00:00
wh1te909
7bce958633 don't show if hosted 2022-07-09 23:53:14 +00:00
wh1te909
24a63f477e Release 0.100.4 2022-07-07 16:38:14 +00:00
wh1te909
57963f6d1a bump version 2022-07-07 16:33:33 +00:00
wh1te909
c9d76bdddc update reqs 2022-07-07 03:05:57 +00:00
wh1te909
c279a44679 make filename consistent with deployment exe 2022-07-03 04:50:00 +00:00
wh1te909
974ba53926 add delete token and move to comp api 2022-07-03 01:34:29 +00:00
wh1te909
021fbbe14f update reqs 2022-07-03 01:05:49 +00:00
wh1te909
bbd74c34b7 improve error message when backend is offline or dns issues 2022-06-28 00:46:41 +00:00
wh1te909
ddeb6293a1 init 2022-05-17 20:46:22 +00:00
6 changed files with 470 additions and 472 deletions

774
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "web",
"version": "0.100.1-dev",
"version": "0.100.5",
"private": true,
"productName": "Tactical RMM",
"scripts": {
@@ -10,26 +10,26 @@
"format": "prettier --write \"**/*.{js,ts,vue,,html,md,json}\" --ignore-path .gitignore"
},
"dependencies": {
"@quasar/extras": "1.14.1",
"@quasar/extras": "1.14.2",
"apexcharts": "3.35.3",
"axios": "0.27.2",
"dotenv": "16.0.1",
"qrcode.vue": "3.3.3",
"quasar": "2.7.3",
"quasar": "2.7.5",
"vue": "3.2.37",
"vue3-ace-editor": "2.2.2",
"vue3-apexcharts": "1.4.1",
"vuedraggable": "4.1.0",
"vue-router": "4.0.16",
"vue-router": "4.1.1",
"vuex": "4.0.2"
},
"devDependencies": {
"@quasar/cli": "^1.3.2",
"@intlify/vite-plugin-vue-i18n": "^3.4.0",
"@quasar/app-vite": "^1.0.2",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"@quasar/app-vite": "^1.0.5",
"@types/node": "^18.0.3",
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"autoprefixer": "^10.4.7",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",

View File

@@ -31,6 +31,17 @@ export default function ({ app, router, store }) {
return response;
},
async function (error) {
if (error.code && error.code === "ERR_NETWORK") {
Notify.create({
color: "negative",
message: "Backend is offline (network error)",
caption:
"Open your browser's dev tools and check the console tab for more detailed error messages",
timeout: 5000,
});
return Promise.reject({ ...error });
}
let text;
if (!error.response) {

View File

@@ -249,10 +249,7 @@ export default {
.toLowerCase()
.replace(/([^a-zA-Z0-9]+)/g, "");
const fileName =
this.goarch === GOARCH_AMD64
? `rmm-${clientStripped}-${siteStripped}-${this.agenttype}.exe`
: `rmm-${clientStripped}-${siteStripped}-${this.agenttype}-x86.exe`;
const fileName = `trmm-${clientStripped}-${siteStripped}-${this.agenttype}-${this.goarch}.exe`;
const data = {
installMethod: this.installMethod,

View File

@@ -12,11 +12,15 @@
color="positive"
class="full-width"
@click="doCodeSign"
:loading="loading"
>
<q-tooltip
>Force all existing agents to be updated to the code-signed
version</q-tooltip
>
<template v-slot:loading>
<q-spinner-facebook />
</template>
</q-btn>
</q-card-section>
<q-form @submit.prevent="editToken">
@@ -33,56 +37,92 @@
</q-card-section>
<q-card-section class="row items-center">
<q-btn label="Save" color="primary" type="submit" />
<q-space />
<q-btn label="Delete" color="negative" @click="confirmDelete" />
</q-card-section>
</q-form>
</q-card>
</template>
<script>
import mixins from "@/mixins/mixins";
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import axios from "axios";
import { notifySuccess } from "@/utils/notify";
const endpoint = "/core/codesign/";
export default {
name: "CodeSign",
mixins: [mixins],
data() {
return {
settings: {
token: "",
},
};
},
methods: {
getToken() {
this.$axios.get("/core/codesign/").then((r) => {
this.settings = r.data;
setup() {
const $q = useQuasar();
const settings = ref({ token: "" });
const loading = ref(false);
async function getToken() {
try {
const { data } = await axios.get(endpoint);
settings.value = data;
} catch (e) {
console.error(e);
}
}
async function deleteToken() {
try {
await axios.delete(endpoint);
notifySuccess("Token was deleted!");
await getToken();
} catch (e) {
console.error(e);
}
}
function confirmDelete() {
$q.dialog({
title: "Delete token?",
cancel: true,
persistent: true,
}).onOk(() => {
deleteToken();
});
},
editToken() {
this.$q.loading.show();
this.$axios
.patch("/core/codesign/", this.settings)
.then((r) => {
this.$q.loading.hide();
this.notifySuccess(r.data);
})
.catch(() => {
this.$q.loading.hide();
});
},
doCodeSign() {
this.$q.loading.show();
this.$axios
.post("/core/codesign/")
.then((r) => {
this.$q.loading.hide();
this.notifySuccess(r.data);
})
.catch(() => {
this.$q.loading.hide();
});
},
},
mounted() {
this.getToken();
}
async function doCodeSign() {
loading.value = true;
try {
const { data } = await axios.post(endpoint);
loading.value = false;
notifySuccess(data);
} catch (e) {
loading.value = false;
console.error(e);
}
}
async function editToken() {
$q.loading.show();
try {
const { data } = await axios.patch(endpoint, settings.value);
$q.loading.hide();
notifySuccess(data);
} catch (e) {
$q.loading.hide();
console.error(e);
}
}
onMounted(() => {
getToken();
});
return {
settings,
loading,
confirmDelete,
doCodeSign,
editToken,
};
},
};
</script>

View File

@@ -35,12 +35,7 @@
Tactical RMM<span class="text-overline q-ml-sm"
>v{{ currentTRMMVersion }}</span
>
<span
class="text-overline q-ml-md"
v-if="
latestTRMMVersion !== 'error' &&
currentTRMMVersion !== latestTRMMVersion
"
<span class="text-overline q-ml-md" v-if="updateAvailable()"
><q-badge color="warning"
><a :href="latestReleaseURL" target="_blank"
>v{{ latestTRMMVersion }} available</a
@@ -171,6 +166,7 @@ export default {
const latestTRMMVersion = computed(() => store.state.latestTRMMVersion);
const needRefresh = computed(() => store.state.needrefresh);
const user = computed(() => store.state.username);
const hosted = computed(() => store.state.hosted);
const latestReleaseURL = computed(() => {
return latestTRMMVersion.value
@@ -233,6 +229,11 @@ export default {
}, 60 * 5 * 1000);
}
function updateAvailable() {
if (latestTRMMVersion.value === "error" || hosted.value) return false;
return currentTRMMVersion.value !== latestTRMMVersion.value;
}
onMounted(() => {
setupWS();
store.dispatch("getDashInfo");
@@ -261,6 +262,7 @@ export default {
// methods
showUserPreferences,
updateAvailable,
};
},
};