-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.html
265 lines (251 loc) · 14.9 KB
/
main.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<!doctype html>
<!--
Material Design Lite
Copyright 2015 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Lebaguette - Home">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Lebaguette - Status</title>
<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" sizes="192x192" href="images/android-desktop.png">
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Material Design Lite">
<link rel="apple-touch-icon-precomposed" href="images/ios-desktop.png">
<!-- Tile icon for Win8 (144x144 + tile color) -->
<meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">
<meta name="msapplication-TileColor" content="#3372DF">
<link rel="shortcut icon" href="images/favicon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.1.1/material.cyan-light_blue.min.css">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="layout mdl-layout mdl-js-layout mdl-layout--fixed-drawer mdl-layout--fixed-header">
<header class="header mdl-layout__header mdl-color--grey-100 mdl-color-text--grey-600">
<div class="mdl-layout__header-row">
<span class="mdl-layout-title">Services status</span>
<div class="mdl-layout-spacer"></div>
<label id="logout" class="mdl-button mdl-js-button mdl-button--icon" for="search">
<i class="material-icons">power_settings_new</i>
</label>
<div class="mdl-tooltip" for="logout">
Bye bye
</div>
</div>
</header>
<div class="drawer mdl-layout__drawer mdl-color--blue-grey-900 mdl-color-text--blue-grey-50">
<header class="drawer-header">
<span class="mdl-layout-title">Welcome</span>
<div class="mdl-layout-spacer"></div>
<img src="images/ninja.png" class="avatar">
<div>
<span>user@gmail.com</span>
</div>
</header>
<nav class="navigation mdl-navigation mdl-color--blue-grey-800">
<a class="mdl-navigation__link" href="/owncloud"><i class="material-icons" role="presentation">backup</i>OwnCloud</a>
<a class="mdl-navigation__link" href="/plex"><i class="material-icons" role="presentation">movie</i>Plex</a>
<a class="mdl-navigation__link" href="/transmission"><i class="material-icons" role="presentation">file_download</i>Transmission</a>
<div class="mdl-layout-spacer"></div>
<a class="mdl-navigation__link" href=""><i class="material-icons" role="presentation">help_outline</i><span class="visuallyhidden">Help</span></a>
</nav>
</div>
<main class="mdl-layout__content mdl-color--grey-100">
<div class="mdl-grid content">
<div class="mdl-cell mdl-cell--12-col mdl-typography--font-light mdl-typography--display-1 mdl-color-text--grey-600">Server status</div>
<div class="charts mdl-color--white mdl-shadow--2dp mdl-cell mdl-cell--12-col mdl-grid">
<svg viewBox="0 0 100 100" width="200px" height="200px" class="chart mdl-cell mdl-cell--4-col mdl-cell--3-col-desktop">
<path d="M 50,50 m 0,-45 a 45,45 0 1 1 0,90 a 45,45 0 1 1 0,-90" stroke="#FBCDDD" stroke-width="10" fill-opacity="0"/>
<path id="circles-1" data-value="75" d="M 50,50 m 0,-45 a 45,45 0 1 1 0,90 a 45,45 0 1 1 0,-90" stroke="#ACEC00" stroke-width="10" fill-opacity="0" style="stroke-dasharray: 282.783px, 282.783px; stroke-dashoffset: 282.783px;"></path>
<text id="circles-1-text" x="50" y="60" font-family="Roboto" font-size="25" fill="#888" text-anchor="middle" dy="0.1">0</text>
</svg>
<svg viewBox="0 0 100 100" width="200px" height="200px" class="chart mdl-cell mdl-cell--4-col mdl-cell--3-col-desktop">
<path d="M 50,50 m 0,-45 a 45,45 0 1 1 0,90 a 45,45 0 1 1 0,-90" stroke="#FBCDDD" stroke-width="10" fill-opacity="0"/>
<path id="circles-2" data-value="25" d="M 50,50 m 0,-45 a 45,45 0 1 1 0,90 a 45,45 0 1 1 0,-90" stroke="#00BBD6" stroke-width="10" fill-opacity="0" style="stroke-dasharray: 282.783px, 282.783px; stroke-dashoffset: 282.783px;"></path>
</svg>
<svg viewBox="0 0 100 100" width="200px" height="200px" class="chart mdl-cell mdl-cell--4-col mdl-cell--3-col-desktop">
<path d="M 50,50 m 0,-45 a 45,45 0 1 1 0,90 a 45,45 0 1 1 0,-90" stroke="#FBCDDD" stroke-width="10" fill-opacity="0"/>
<path id="circles-3" data-value="15" d="M 50,50 m 0,-45 a 45,45 0 1 1 0,90 a 45,45 0 1 1 0,-90" stroke="#BA65C9" stroke-width="10" fill-opacity="0" style="stroke-dasharray: 282.783px, 282.783px; stroke-dashoffset: 282.783px;"></path>
</svg>
<svg viewBox="0 0 100 100" width="200px" height="200px" class="chart mdl-cell mdl-cell--4-col mdl-cell--3-col-desktop">
<path d="M 50,50 m 0,-45 a 45,45 0 1 1 0,90 a 45,45 0 1 1 0,-90" stroke="#FBCDDD" stroke-width="10" fill-opacity="0"/>
<path id="circles-4" data-value="5" d="M 50,50 m 0,-45 a 45,45 0 1 1 0,90 a 45,45 0 1 1 0,-90" stroke="#EF3C79" stroke-width="10" fill-opacity="0" style="stroke-dasharray: 282.783px, 282.783px; stroke-dashoffset: 282.783px;"></path>
</svg>
<div id="circles-5" data-value="55" viewBox="0 0 100 100" width="200px" height="200px" class="chart mdl-cell mdl-cell--4-col mdl-cell--3-col-desktop"></div>
</div>
<div class="mdl-cell mdl-cell--8-col">
<div class="graphs mdl-shadow--2dp mdl-color--white mdl-cell mdl-cell--12-col">
<svg fill="currentColor" viewBox="0 0 500 250" class="graph">
<use xlink:href="#chart" />
</svg>
<svg fill="currentColor" viewBox="0 0 500 250" class="graph">
<use xlink:href="#chart" />
</svg>
</div>
<div class="mdl-cell mdl-cell--8-col mdl-typography--font-light mdl-typography--display-1 mdl-color-text--grey-600">Plex</div>
</div>
<div class="cards mdl-cell mdl-cell--4-col mdl-cell--8-col-tablet mdl-grid mdl-grid--no-spacing">
<div class="updates mdl-card mdl-shadow--2dp mdl-cell mdl-cell--4-col mdl-cell--4-col-tablet mdl-cell--12-col-desktop">
<div class="mdl-card__title mdl-card--expand mdl-color--red-400">
<h2 class="mdl-card__title-text">Warning</h2>
</div>
<div class="mdl-card__supporting-text mdl-color-text--grey-600">
Server admin message
</div>
<div class="mdl-card__actions mdl-card--border">
<a href="#" class="mdl-button mdl-js-button mdl-js-ripple-effect">Button for action if needed</a>
</div>
</div>
<div class="separator mdl-cell--1-col"></div>
<div class="options mdl-card mdl-color--deep-purple-500 mdl-shadow--2dp mdl-cell mdl-cell--4-col mdl-cell--3-col-tablet mdl-cell--12-col-desktop">
<div class="mdl-card__supporting-text mdl-color-text--blue-grey-50">
<h3>Filter by service</h3>
<ul>
<li>
<label for="chkbox1" class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect">
<input type="checkbox" id="chkbox1" class="mdl-checkbox__input">
<span class="mdl-checkbox__label">OwnCloud</span>
</label>
</li>
<li>
<label for="chkbox2" class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect">
<input type="checkbox" id="chkbox2" class="mdl-checkbox__input">
<span class="mdl-checkbox__label">Plex</span>
</label>
</li>
<li>
<label for="chkbox3" class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect">
<input type="checkbox" id="chkbox3" class="mdl-checkbox__input">
<span class="mdl-checkbox__label">Transmission</span>
</label>
</li>
</ul>
</div>
<div class="mdl-card__actions mdl-card--border">
<a href="#" class="mdl-button mdl-js-button mdl-js-ripple-effect">RESET FILTER</a>
</div>
</div>
</div>
</div>
</main>
</div>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" style="position: fixed; left: -1000px; height: -1000px;">
<defs>
<mask id="piemask" maskContentUnits="objectBoundingBox">
<circle cx=0.5 cy=0.5 r=0.49 fill="white" />
<circle cx=0.5 cy=0.5 r=0.40 fill="black" />
</mask>
<g id="piechart">
<circle cx=0.5 cy=0.5 r=0.5 />
<path d="M 0.5 0.5 0.5 0 A 0.5 0.5 0 0 1 0.95 0.28 z" stroke="none" fill="rgba(255, 255, 255, 0.75)" />
</g>
</defs>
</svg>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 250" style="position: fixed; left: -1000px; height: -1000px;">
<defs>
<g id="chart">
<g id="Gridlines">
<line fill="#888888" stroke="#888888" stroke-miterlimit="10" x1="0" y1="27.3" x2="468.3" y2="27.3" />
<line fill="#888888" stroke="#888888" stroke-miterlimit="10" x1="0" y1="66.7" x2="468.3" y2="66.7" />
<line fill="#888888" stroke="#888888" stroke-miterlimit="10" x1="0" y1="105.3" x2="468.3" y2="105.3" />
<line fill="#888888" stroke="#888888" stroke-miterlimit="10" x1="0" y1="144.7" x2="468.3" y2="144.7" />
<line fill="#888888" stroke="#888888" stroke-miterlimit="10" x1="0" y1="184.3" x2="468.3" y2="184.3" />
</g>
<g id="Numbers">
<text transform="matrix(1 0 0 1 485 29.3333)" fill="#888888" font-family="'Roboto'" font-size="9">500</text>
<text transform="matrix(1 0 0 1 485 69)" fill="#888888" font-family="'Roboto'" font-size="9">400</text>
<text transform="matrix(1 0 0 1 485 109.3333)" fill="#888888" font-family="'Roboto'" font-size="9">300</text>
<text transform="matrix(1 0 0 1 485 149)" fill="#888888" font-family="'Roboto'" font-size="9">200</text>
<text transform="matrix(1 0 0 1 485 188.3333)" fill="#888888" font-family="'Roboto'" font-size="9">100</text>
<text transform="matrix(1 0 0 1 0 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">1</text>
<text transform="matrix(1 0 0 1 78 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">2</text>
<text transform="matrix(1 0 0 1 154.6667 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">3</text>
<text transform="matrix(1 0 0 1 232.1667 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">4</text>
<text transform="matrix(1 0 0 1 309 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">5</text>
<text transform="matrix(1 0 0 1 386.6667 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">6</text>
<text transform="matrix(1 0 0 1 464.3333 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">7</text>
</g>
<g id="Layer_5">
<polygon opacity="0.36" stroke-miterlimit="10" points="0,223.3 48,138.5 154.7,169 211,88.5
294.5,80.5 380,165.2 437,75.5 469.5,223.3 "/>
</g>
<g id="Layer_4">
<polygon stroke-miterlimit="10" points="469.3,222.7 1,222.7 48.7,166.7 155.7,188.3 212,132.7
296.7,128 380.7,184.3 436.7,125 "/>
</g>
</g>
</defs>
</svg>
<script type = "text/javascript" src="https://code.getmdl.io/1.1.1/material.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type = "text/javascript" src="https://rawgit.com/kimmobrunfeldt/progressbar.js/master/dist/progressbar.js"></script>
<script type = "text/javascript" src="app.js"></script>
<script type = "text/javascript">
// function updateStatus() {
// for (var i = 1; i <= 4; i++) {
// var svgPath = document.getElementById('circles-' + i);
// var path = new ProgressBar.Path(svgPath, {
// easing: 'easeInOut'
// });
//
// percent = svgPath.getAttribute('data-value').substring(0,2)
// path.animate(percent / 100);
// }
// };
// updateStatus();
//START AJAX REQUEST TO RETRIEVE DATA
$.getJSON('http://127.0.0.1:8000/status/cpu', function(data){
var items = [];
$.each( data, function( key, val ) {
items.push( "<li id='" + key + "'>" + val + "</li>" );
console.log(key);
});
$( "<ul/>", {
"class": "my-new-list",
html: items.join( "" )
}).appendTo( "body" );
});
//END AJAX REQUEST TO RETRIEVE DATA
for (var i = 1; i <= 4; i++) {
var svgPath = document.getElementById('circles-' + i);
var path = new ProgressBar.Path(svgPath, {
easing: 'easeInOut',
text: 'asd'
});
percent = svgPath.getAttribute('data-value').substring(0,2)
path.animate(percent / 100)
}
// var circleContainer = document.getElementById('circles-5');
// var circle = new ProgressBar.Circle(circleContainer, {
// // color: '#FCB03C',
// strokeWidth: 10,
// trailWidth: 10,
// text: {
// value: '0'
// },
// step: function(state, bar) {
// bar.setText((bar.value() * 100).toFixed(0));
// }
// });
// percent = circleContainer.getAttribute('data-value').substring(0,2)
// circle.animate(percent / 100);
</script>
</body>
</html>