Group stacks by agent

This commit is contained in:
ESPGranEdu 2024-08-16 22:53:23 +02:00
parent f08ba9b889
commit bd4a012404

View file

@ -189,7 +189,29 @@ export default {
return result; return result;
}, },
stackListByAgent() {
const stacksByAgent = new Map();
const stacks = this.$root.completeStackList;
for (const key of Object.keys(stacks)) {
// Handle stacks with no suffix (from the current endpoint)
let [stackName, agent] = key.split("_");
const stackHasEndpoint = agent !== "";
agent = stackHasEndpoint ? agent: this.$t("currentEndpoint");
if (!stacksByAgent.has(agent)) {
stacksByAgent.set(agent, []);
}
const stack = stacks[!stackHasEndpoint ? `${stackName}_` : `${stackName}_${agent}`]
stacksByAgent.get(agent).push(stack);
}
// console.log(stacksByAgent);
// console.log(stacks);
return stacksByAgent;
},
isDarkTheme() { isDarkTheme() {
return document.body.classList.contains("dark"); return document.body.classList.contains("dark");
}, },