sort urlactions by name closes amidaware/tacticalrmm#1795
This commit is contained in:
@@ -302,9 +302,9 @@ export default {
|
||||
async function getURLActions() {
|
||||
menuLoading.value = true;
|
||||
try {
|
||||
urlActions.value = (await fetchURLActions()).filter(
|
||||
(action) => action.action_type === "web",
|
||||
);
|
||||
urlActions.value = (await fetchURLActions())
|
||||
.filter((action) => action.action_type === "web")
|
||||
.sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
if (urlActions.value.length === 0) {
|
||||
notifyWarning(
|
||||
@@ -312,8 +312,11 @@ export default {
|
||||
);
|
||||
return;
|
||||
}
|
||||
} catch (e) {}
|
||||
menuLoading.value = true;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
menuLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function showSendCommand(agent) {
|
||||
|
@@ -313,18 +313,19 @@ export default {
|
||||
},
|
||||
getURLActions() {
|
||||
this.$axios.get("/core/urlaction/").then((r) => {
|
||||
if (r.data.length === 0) {
|
||||
this.notifyWarning(
|
||||
"No URL Actions configured. Go to Settings > Global Settings > URL Actions",
|
||||
);
|
||||
return;
|
||||
}
|
||||
this.urlActions = r.data
|
||||
.filter((action) => action.action_type === "web")
|
||||
.sort((a, b) => a.name.localeCompare(b.name))
|
||||
.map((action) => ({
|
||||
label: action.name,
|
||||
value: action.id,
|
||||
}));
|
||||
|
||||
if (this.urlActions.length === 0) {
|
||||
this.notifyWarning(
|
||||
"No URL Actions configured. Go to Settings > Global Settings > URL Actions",
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
getUserPrefs() {
|
||||
|
@@ -818,15 +818,14 @@ export default {
|
||||
},
|
||||
getURLActions() {
|
||||
this.$axios.get("/core/urlaction/").then((r) => {
|
||||
if (r.data.length === 0) {
|
||||
this.urlActions = r.data
|
||||
.filter((action) => action.action_type === "web")
|
||||
.sort((a, b) => a.name.localeCompare(b.name));
|
||||
if (this.urlActions.length === 0) {
|
||||
this.notifyWarning(
|
||||
"No URL Actions configured. Go to Settings > Global Settings > URL Actions",
|
||||
);
|
||||
return;
|
||||
}
|
||||
this.urlActions = r.data.filter(
|
||||
(action) => action.action_type === "web",
|
||||
);
|
||||
});
|
||||
},
|
||||
runURLAction(id, action, model) {
|
||||
|
Reference in New Issue
Block a user