-
Notifications
You must be signed in to change notification settings - Fork 0
/
diskfree.html
executable file
·54 lines (49 loc) · 1.57 KB
/
diskfree.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<diskfree-panel>
<pigod-panel>
<yield to="title">
Disk Usage ({last_udpated})
</yield>
<yield to="body">
<riot-table rows={rows} defaultsort="^Use">
<riot-col key="Filesystem" />
<riot-col key="Size" cls="text-right"/>
<riot-col key="Used" cls="text-right"/>
<riot-col key="Avail" cls="text-right"/>
<riot-col key="Use" header="Use%" cls="text-right"
tpl={'{row.Use}<div class="use-bar" style="width: {row.Use}"></div>'} />
<riot-col key="Mountedon" header="Mounted on"/>
</riot-table>
</yield>
</pigod-panel>
<style scoped>
.column-Use .use-bar {
background-color: rgba(51, 122, 183, 0.25);
position: absolute;
top: 0;
bottom: 0;
left: 0;
z-index: 1;
}
td.column-Use {
min-width: 120px;
}
td.column-Use raw {
display: block;
position: relative;
}
</style>
<script type="text/es6arrow">
start() {
opts.pubsub.subscribe('diskfree', this.handler = data => this.updateProc(data));
}
stop() {
opts.pubsub.unsubscribe('diskfree', this.handler);
}
updateProc(data) {
this.update({
last_udpated : new Date().toLocaleString(),
rows : data.rows
});
}
</script>
</diskfree-panel>