diff options
Diffstat (limited to 'src/components/services/Portainer.vue')
-rw-r--r-- | src/components/services/Portainer.vue | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/components/services/Portainer.vue b/src/components/services/Portainer.vue index 176d92e..c7e9962 100644 --- a/src/components/services/Portainer.vue +++ b/src/components/services/Portainer.vue | |||
@@ -8,7 +8,11 @@ | |||
8 | <strong v-if="dead > 0" class="notif dead" title="Dead"> | 8 | <strong v-if="dead > 0" class="notif dead" title="Dead"> |
9 | {{ dead }} | 9 | {{ dead }} |
10 | </strong> | 10 | </strong> |
11 | <strong v-if="misc > 0" class="notif misc" title="Other (creating, paused, exited, etc.)"> | 11 | <strong |
12 | v-if="misc > 0" | ||
13 | class="notif misc" | ||
14 | title="Other (creating, paused, exited, etc.)" | ||
15 | > | ||
12 | {{ misc }} | 16 | {{ misc }} |
13 | </strong> | 17 | </strong> |
14 | </div> | 18 | </div> |
@@ -55,7 +59,10 @@ export default { | |||
55 | return ""; | 59 | return ""; |
56 | } | 60 | } |
57 | return this.containers.filter((container) => { | 61 | return this.containers.filter((container) => { |
58 | return container.State.toLowerCase() !== "running" && container.State.toLowerCase() !== "dead"; | 62 | return ( |
63 | container.State.toLowerCase() !== "running" && | ||
64 | container.State.toLowerCase() !== "dead" | ||
65 | ); | ||
59 | }).length; | 66 | }).length; |
60 | }, | 67 | }, |
61 | }, | 68 | }, |
@@ -68,18 +75,20 @@ export default { | |||
68 | "X-Api-Key": this.item.apikey, | 75 | "X-Api-Key": this.item.apikey, |
69 | }; | 76 | }; |
70 | 77 | ||
71 | this.endpoints = await this.fetch("/api/endpoints", { headers }) | 78 | this.endpoints = await this.fetch("/api/endpoints", { headers }).catch( |
72 | .catch((e) => { | 79 | (e) => { |
73 | console.error(e); | 80 | console.error(e); |
74 | }); | 81 | } |
82 | ); | ||
75 | 83 | ||
76 | let containers = []; | 84 | let containers = []; |
77 | for (let endpoint of this.endpoints) { | 85 | for (let endpoint of this.endpoints) { |
78 | const uri = `/api/endpoints/${endpoint.Id}/docker/containers/json?all=1`; | 86 | const uri = `/api/endpoints/${endpoint.Id}/docker/containers/json?all=1`; |
79 | const endpointContainers = await this.fetch(uri, { headers }) | 87 | const endpointContainers = await this.fetch(uri, { headers }).catch( |
80 | .catch((e) => { | 88 | (e) => { |
81 | console.error(e); | 89 | console.error(e); |
82 | }); | 90 | } |
91 | ); | ||
83 | 92 | ||
84 | containers = containers.concat(endpointContainers); | 93 | containers = containers.concat(endpointContainers); |
85 | } | 94 | } |