mirror of
https://github.com/louislam/dockge.git
synced 2024-11-30 22:24:03 +00:00
Group stacks by agent
This commit is contained in:
parent
f08ba9b889
commit
bd4a012404
1 changed files with 22 additions and 0 deletions
|
@ -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");
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue