Fix linter errors

This commit is contained in:
ESPGranEdu 2024-08-16 23:26:09 +02:00
parent 59d941f128
commit 2674226ce3
2 changed files with 15 additions and 17 deletions

View file

@ -1,7 +1,7 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<div class="group-header"> <div class="group-header">
{{ agentName ?? this.$t("currentEndpoint") }} {{ agentName }}
</div> </div>
<slot /> <slot />
@ -12,7 +12,7 @@
<script setup lang="ts"> <script setup lang="ts">
interface AgentStackListProps { interface AgentStackListProps {
agentName?: string; agentName: string;
} }
defineProps<AgentStackListProps>(); defineProps<AgentStackListProps>();
@ -21,7 +21,6 @@ defineProps<AgentStackListProps>();
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../styles/vars.scss"; @import "../styles/vars.scss";
.group-header { .group-header {
border-bottom: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6;
border-radius: 10px; border-radius: 10px;
@ -44,4 +43,4 @@ defineProps<AgentStackListProps>();
} }
} }
</style> </style>

View file

@ -43,8 +43,8 @@
</div> </div>
</div> </div>
<div v-if="searchText === '' && this.$root.agentCount > 1" :style="stackListStyle" ref="stackList" class="stack-list"> <div v-if="searchText === '' && $root.agentCount > 1" ref="stackList" :style="stackListStyle" class="stack-list">
<AgentStackList :agentName="agentName" v-for="[agentName, stacks] in stackListByAgent"> <AgentStackList v-for="[agentName, stacks] in stackListByAgent" :agentName="agentName" :key="agentName">
<StackListItem <StackListItem
v-for="(stack, index) in stacks" v-for="(stack, index) in stacks"
:key="index" :key="index"
@ -52,8 +52,8 @@
:isSelectMode="selectMode" :isSelectMode="selectMode"
:isSelected="isSelected" :isSelected="isSelected"
:select="select" :select="select"
:deselect="deselect"/> :deselect="deselect"
/>
</AgentStackList> </AgentStackList>
</div> </div>
@ -61,7 +61,7 @@
<div v-if="Object.keys(sortedStackList).length === 0" class="text-center mt-3"> <div v-if="Object.keys(sortedStackList).length === 0" class="text-center mt-3">
<router-link to="/compose">{{ $t("addFirstStackMsg") }}</router-link> <router-link to="/compose">{{ $t("addFirstStackMsg") }}</router-link>
</div> </div>
<StackListItem <StackListItem
v-for="(item, index) in sortedStackList" v-for="(item, index) in sortedStackList"
:key="index" :key="index"
@ -83,7 +83,6 @@
import Confirm from "../components/Confirm.vue"; import Confirm from "../components/Confirm.vue";
import StackListItem from "../components/StackListItem.vue"; import StackListItem from "../components/StackListItem.vue";
import { CREATED_FILE, CREATED_STACK, EXITED, RUNNING, UNKNOWN } from "../../../common/util-common"; import { CREATED_FILE, CREATED_STACK, EXITED, RUNNING, UNKNOWN } from "../../../common/util-common";
import AgentStackList from "./AgentStackList.vue";
export default { export default {
components: { components: {
@ -212,21 +211,21 @@ export default {
stackListByAgent() { stackListByAgent() {
const stacksByAgent = new Map(); const stacksByAgent = new Map();
const stacks = this.$root.completeStackList; const stacks = this.$root.completeStackList;
for (const key of Object.keys(stacks)) { for (const key of Object.keys(stacks)) {
// Handle stacks with no suffix (from the current endpoint) // Handle stacks with no suffix (from the current endpoint)
let [stackName, agent] = key.split("_"); let [ stackName, agent ] = key.split("_");
const stackHasEndpoint = agent !== ""; const stackHasEndpoint = agent !== "";
agent = stackHasEndpoint ? agent: this.$t("currentEndpoint"); agent = stackHasEndpoint ? agent : this.$t("currentEndpoint");
if (!stacksByAgent.has(agent)) { if (!stacksByAgent.has(agent)) {
stacksByAgent.set(agent, []); stacksByAgent.set(agent, []);
} }
const stack = stacks[!stackHasEndpoint ? `${stackName}_` : `${stackName}_${agent}`] const stack = stacks[!stackHasEndpoint ? `${stackName}_` : `${stackName}_${agent}`];
stacksByAgent.get(agent).push(stack); stacksByAgent.get(agent).push(stack);
} }
return stacksByAgent; return stacksByAgent;
}, },
isDarkTheme() { isDarkTheme() {