aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/services
diff options
context:
space:
mode:
authorluixal <luixal@gmail.com>2022-10-11 19:00:53 +0200
committerBastien Wirtz <bastien.wirtz@gmail.com>2022-10-13 21:51:06 +0200
commit13069da195950d2598492ea9f4a8bb4585fcb71f (patch)
tree0f34b16c486bf43f7758139571f91781a0d81d21 /src/components/services
parent0a03fcd9cd508514a6e2d5e3a6bb62bae6252331 (diff)
downloadhomer-13069da195950d2598492ea9f4a8bb4585fcb71f.tar.gz
homer-13069da195950d2598492ea9f4a8bb4585fcb71f.tar.zst
homer-13069da195950d2598492ea9f4a8bb4585fcb71f.zip
Adds loading and errors icons/msgs. Adds docs.
Diffstat (limited to 'src/components/services')
-rw-r--r--src/components/services/Proxmox.vue16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/components/services/Proxmox.vue b/src/components/services/Proxmox.vue
index 981bdf1..092d077 100644
--- a/src/components/services/Proxmox.vue
+++ b/src/components/services/Proxmox.vue
@@ -7,8 +7,11 @@
7 {{ item.subtitle }} 7 {{ item.subtitle }}
8 </template> 8 </template>
9 <template v-else-if="vms"> 9 <template v-else-if="vms">
10 <div v-if="error"> 10 <div v-if="loading">
11 <strong class="danger">Error loading info!</strong> 11 <strong>Loading...</strong>
12 </div>
13 <div v-else-if="error">
14 <strong class="danger">Error loading info</strong>
12 </div> 15 </div>
13 <div v-else class="metrics"> 16 <div v-else class="metrics">
14 <span>VMs: <span class="is-number"><strong>{{ vms.running }}</strong>/{{vms.total}}</span></span> 17 <span>VMs: <span class="is-number"><strong>{{ vms.running }}</strong>/{{vms.total}}</span></span>
@@ -19,6 +22,10 @@
19 </template> 22 </template>
20 </p> 23 </p>
21 </template> 24 </template>
25 <template #indicator>
26 <i v-if="loading" class="fa fa-circle-notch fa-spin fa-2xl"></i>
27 <i v-if="error" class="fa fa-exclamation-circle fa-2xl danger"></i>
28 </template>
22 </Generic> 29 </Generic>
23 </template> 30 </template>
24 31
@@ -43,7 +50,8 @@
43 memoryUsed: 0, 50 memoryUsed: 0,
44 diskUsed: 0, 51 diskUsed: 0,
45 cpuUsed: 0, 52 cpuUsed: 0,
46 error: false 53 error: false,
54 loading: true
47 }), 55 }),
48 created() { 56 created() {
49 this.fetchStatus(); 57 this.fetchStatus();
@@ -71,8 +79,10 @@
71 this.vms.total += vms.data.length; 79 this.vms.total += vms.data.length;
72 this.vms.running += vms.data.filter( i => i.status === 'running' ).length; 80 this.vms.running += vms.data.filter( i => i.status === 'running' ).length;
73 this.error = false; 81 this.error = false;
82 this.loading = false;
74 } catch(err) { 83 } catch(err) {
75 console.log(err); 84 console.log(err);
85 this.loading = false;
76 this.error = true; 86 this.error = true;
77 } 87 }
78 }, 88 },