more loading fixes

This commit is contained in:
wh1te909
2021-11-09 01:23:01 +00:00
parent c3c2763ff0
commit ac9b5e2b5c
3 changed files with 21 additions and 8 deletions

View File

@@ -115,9 +115,13 @@ export default {
onMounted(async () => {
$q.loading.show();
const fields = await fetchCustomFields({ model: "site" });
customFields.value = fields.filter(field => !field.hide_in_ui);
if (props.site) getSiteCustomFieldValues();
try {
const fields = await fetchCustomFields({ model: "site" });
customFields.value = fields.filter(field => !field.hide_in_ui);
if (props.site) getSiteCustomFieldValues();
} catch (e) {
console.error(e);
}
$q.loading.hide();
});

View File

@@ -128,7 +128,12 @@ export default {
const showCompleted = ref(false);
const loading = ref(false);
const completedCount = computed(() => {
return actions.value.filter(action => action.status === "completed").length;
try {
return actions.value.filter(action => action.status === "completed").length;
} catch (e) {
console.error(e);
return 0;
}
});
const visibleColumns = computed(() => {

View File

@@ -66,10 +66,14 @@ export default {
async function getMeshURLs() {
$q.loading.show();
const data = await fetchAgentMeshCentralURLs(params.agent_id);
control.value = data.control;
status.value = data.status;
useMeta({ title: `${data.hostname} - ${data.client} - ${data.site} | Remote Background` });
try {
const data = await fetchAgentMeshCentralURLs(params.agent_id);
control.value = data.control;
status.value = data.status;
useMeta({ title: `${data.hostname} - ${data.client} - ${data.site} | Remote Background` });
} catch (e) {
console.error(e);
}
$q.loading.hide();
}