-
Notifications
You must be signed in to change notification settings - Fork 0
/
wid-card-progress-value.html
100 lines (81 loc) · 3.12 KB
/
wid-card-progress-value.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<html><head><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="../paper-material/paper-material.html">
<link rel="import" href="../paper-progress/paper-progress.html">
<link rel="import" href="../paper-styles/paper-styles-classes.html">
<link rel="import" href="../iron-icon/iron-icon.html">
<link rel="import" href="../wid-card-standard-behavior/wid-card-standard-behavior.html">
<link rel="import" href="../wid-card-weight-behavior/wid-card-weight-behavior.html">
<link rel="import" href="../wid-card-theme-behavior/wid-card-theme-behavior.html">
<link rel="import" href="../wid-versatile-websocket/wid-versatile-websocket.html">
<link rel="import" href="../wid-card-subscriptions-behavior/wid-card-subscriptions-behavior.html">
<!--
This element is a card for `wid-cards-grid`. It displays the status of a server process
Example:
<wid-card-progress-value
subscriptions="[{"key": "datetime", "value": "la.wid.chan.cloud.prod.database.archer.datetime"}]"
importance="2">
</wid-card-progress-value>
@group Wid
@element wid-websocket
@demo demo/index.html
@hero hero.svg
-->
</head><body><dom-module id="wid-card-progress-value">
<template>
<style>
:host {
display: block;
box-sizing: border-box;
height: 100%;
}
paper-material {
overflow-y: auto;
height: 100%;
background-color: #fff;
overflow: visible;
}
#percentage-container{
position: relative;
border-top-style: solid;
border-top-color: #BBBBBB;
border-top-width: 1px;
}
#websockets {
display: none;
}
.paperProgressValue {
z-index: 1;
font-weight: bold;
font-size: 1.5vw;
}
.custom-progess {
width: 100%;
height: 100%;
position: absolute;
left: 0px;
}
.custom-paper-progess {
--paper-progress-height: 100%;
}
</style>
<div id="websockets">
<!-- This is a requirement of `wid-card-subscriptions-behavior` -->
<!-- one websocket element for each subscribed channel -->
<template is="dom-repeat" items="[[websockets]]" as="ws">
<wid-versatile-websocket url="[[ws.url]]" token="[[ws.token]]" subscription="[[ws.subscription]]" on-data="_onData">
</wid-versatile-websocket>
</template>
</div>
<paper-material id="mainContent" class="layout vertical flex" elevation="3">
<div id="header-container" auto-fit-on-attach="" class="layout horizontal flex-2 center-center">
<iron-icon class="scale-icon flex" src="[[_getIconImage(icon)]]"></iron-icon>
</div>
<div id="percentage-container" class="layout horizontal flex center-center">
<div class="paperProgressValue">[[_percentValue(value)]]</div>
<paper-progress id="paperProgress" class="custom-progess custom-paper-progess transiting flex" value="[[value]]"></paper-progress>
</div>
</paper-material>
</template>
</dom-module>
<script src="wid-card-progress-value.js"></script></body></html>