Skip to content

Commit f8a0bad

Browse files
committed
Add a check-all-ethoscopes box to the updater interface
1 parent f853202 commit f8a0bad

File tree

2 files changed

+287
-259
lines changed

2 files changed

+287
-259
lines changed
+163-155
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
<!-- index.html -->
2-
<!DOCTYPE html>
3-
<html ng-app="updater">
4-
<head>
5-
<meta charset="utf-8">
6-
<base href="/">
7-
<!-- SCROLLS -->
8-
<!-- load bootstrap and fontawesome via CDN -->
9-
<link rel="stylesheet" href="/static/css/bootstrap.min.css" />
10-
<link rel="stylesheet" href="/static/css/font-awesome.min.css" />
11-
<link rel="stylesheet" href="/static/css/main.css" />
12-
<link rel="stylesheet" href="/static/css/toggle_switch.css" />
13-
14-
15-
</head>
16-
<body ng-controller="mainController">
17-
18-
<!-- HEADER AND NAVBAR -->
19-
<header>
20-
<nav class="navbar navbar-default">
2+
<!DOCTYPE html>
3+
<html ng-app="updater">
4+
5+
<head>
6+
<meta charset="utf-8">
7+
<base href="/">
8+
<!-- SCROLLS -->
9+
<!-- load bootstrap and fontawesome via CDN -->
10+
<link rel="stylesheet" href="/static/css/bootstrap.min.css" />
11+
<link rel="stylesheet" href="/static/css/font-awesome.min.css" />
12+
<link rel="stylesheet" href="/static/css/main.css" />
13+
<link rel="stylesheet" href="/static/css/toggle_switch.css" />
14+
15+
16+
</head>
17+
18+
<body ng-controller="mainController">
19+
20+
<!-- HEADER AND NAVBAR -->
21+
<header>
22+
<nav class="navbar navbar-default">
2123
<div class="container">
2224
<div class="navbar-header">
2325
<a class="navbar-brand" href="/">Ethoscope Updater</a>
@@ -27,152 +29,158 @@
2729
<li><a href=""><i class="fa fa-cog"></i> Help</a></li>
2830
</ul>
2931
</div>
30-
</nav>
31-
</header>
32-
33-
<!-- MAIN CONTENT AND INJECTED VIEWS -->
34-
<div id="main" class="container">
35-
<!-- home.html -->
36-
<div class="jumbotron text-center" ng-cloak>
37-
<h3>Available version</h3>
38-
<div class="intro"><span class = "fa fa-code-fork"></span> <b>[{{node.active_branch}}]</b>, {{node.check_update.origin_commit.id.substring(0,6)}}... ({{node.check_update.origin_commit.date}})</div>
39-
40-
<div id="loading_devices" class="spinner"><h2>{{spinner_text}}</h2></div>
32+
</nav>
33+
</header>
34+
35+
<!-- MAIN CONTENT AND INJECTED VIEWS -->
36+
<div id="main" class="container">
37+
<!-- home.html -->
38+
<div class="jumbotron text-center" ng-cloak>
39+
<h3>Available version</h3>
40+
<div class="intro"><span class="fa fa-code-fork"></span> <b>[{{node.active_branch}}]</b>, {{node.check_update.origin_commit.id.substring(0,6)}}... ({{node.check_update.origin_commit.date}})</div>
41+
42+
<div id="loading_devices" class="spinner">
43+
<h2>{{spinner_text}}</h2>
44+
</div>
4145

42-
<div id="error" ng-if="system.error != null">
43-
<p>{{system.error}}</p>
46+
<div id="error" ng-if="system.error != null">
47+
<p>{{system.error}}</p>
48+
</div>
4449
</div>
45-
</div>
46-
47-
<div class="alert alert-neutral" style="background-color:#f2f2f2;">
48-
<label class="toggle-check">Show all machines, also those thare are running and up to date
49-
<input name="showAll" type="checkbox" class="toggle-check-input" ng-model="showAll" ng-checked="false" >
50-
<span class="toggle-check-text"></span>
51-
</label>
52-
</div>
53-
54-
55-
<div class="jumbotron table-background" ng-cloak>
56-
<h3>Select some devices to perform the actions below:</h3>
57-
<button class="btn btn-success btn-xl" ng-click="activate_modal(selected_devices, 'update')">Update</button>
58-
<button class="btn btn-default" ng-click="activate_modal(selected_devices, 'restart')">Restart</button>
59-
<button class="btn btn-default" ng-click="activate_modal(selected_devices, 'swBranch')">Switch Branch</button>
60-
<hr>
61-
62-
<div id="scanning_devices" class="spinner_scan"></div>
63-
<table class="table table-striped" ng-cloak>
64-
<thead>
65-
<th>Name</th>
66-
<th>Status</th>
67-
<th>Software Version</th>
68-
<th>ip</th>
69-
<th>id</th>
70-
<th><center>Select</center></th>
71-
</thead>
72-
<tbody>
73-
<tr>
74-
<td>
75-
76-
<span ng-if="node.check_update.up_to_date==false" class="fa fa-circle color-red"></span> <span ng-if="node.check_update.up_to_date==true" class="fa fa-circle color-green"></span><span> Node <span ng-if="node.check_update.up_to_date==false" > [Outdated]</span> <span ng-if="node.check_update.up_to_date==true" >[Up to Date]</span></span>
77-
78-
</td>
79-
<td>{{node.status}}</td>
80-
<td>[{{node.active_branch}}] {{node.check_update.local_commit.id.substring(0,6)}}...
81-
({{node.check_update.local_commit.date}})</td>
82-
<td>{{node.ip}}</td>
83-
<td>N/A<!--{{node.info.id.substring(0,6)}}--></td>
84-
<td><center>
85-
<input type="checkbox" checklist-model="selected_devices" checklist-value="node"></center>
86-
</td>
87-
</tr>
88-
<tr ng-repeat="(id,device) in devices" ng-if="(device.status == 'stopped' && device.up_to_date == false) || showAll">
89-
90-
<td>
91-
92-
<span ng-if="device.up_to_date==false" class="fa fa-circle color-red"></span> <span ng-if="device.up_to_date==true" class="fa fa-circle color-green"></span>
93-
<span> {{device.name}}<span ng-if="device.up_to_date==false" > [Outdated]</span> <span ng-if="device.up_to_date==true" >[Up to Date]</span></span>
94-
95-
</td>
96-
<td> {{device.status}}</td>
97-
<td>[{{device.active_branch}}] {{device.version.id.substring(0,6)}}... ({{device.version.date}})</td>
98-
<td>{{device.ip}}</td>
99-
<td>{{device.id.substring(0,6)}}</td>
100-
<td><center>
101-
<input type="checkbox" checklist-model="selected_devices" checklist-value="device"></center>
102-
</td>
103-
</tr>
104-
</tbody>
105-
</table>
106-
107-
</div>
108-
109-
<!--Modal-->
110-
<div class="modal fade" id="Modal" tabindex="-1" role="dialog" aria-labelledby="startModal" aria-hidden="true">
111-
<div class="modal-dialog">
112-
<div class="modal-content">
113-
<div class="modal-header">
114-
{{modal.title}}
115-
</div>
116-
<div class = "model-body" ng-if="system.modal_error != ''">
117-
<h3>{{system.modal_error}}</h3>
50+
51+
<div class="alert alert-neutral" style="background-color:#f2f2f2;">
52+
<label class="toggle-check">Show all machines, also those thare are running and up to date
53+
<input name="showAll" type="checkbox" class="toggle-check-input" ng-model="showAll" ng-checked="false">
54+
<span class="toggle-check-text"></span>
55+
</label>
11856
</div>
11957

120-
<div class="modal-body " ng-if="system.modal_error == ''">
121-
{{modal.info}}
122-
<select ng-show="modal.action=='swBranch'" name="branch_to_switch" ng-model="modal.branch_to_switch">
123-
<option ng-repeat="(key, name) in system.status" value="{{key}}">{{key}}</option>
124-
</select>
58+
59+
<div class="jumbotron table-background" ng-cloak>
60+
<h3>Select some devices to perform the actions below:</h3>
61+
<button class="btn btn-success btn-xl" ng-click="activate_modal(selected_devices, 'update')">Update</button>
62+
<button class="btn btn-default" ng-click="activate_modal(selected_devices, 'restart')">Restart</button>
63+
<button class="btn btn-default" ng-click="activate_modal(selected_devices, 'swBranch')">Switch Branch</button>
64+
<hr>
65+
66+
<div id="scanning_devices" class="spinner_scan"></div>
12567
<table class="table table-striped" ng-cloak>
126-
<thead>
127-
<th>Name</th>
128-
<th>Status</th>
129-
<th>Software Version</th>
130-
<th>ip</th>
131-
<th>id</th>
132-
</thead>
133-
<tbody>
134-
135-
<tr ng-repeat="(id,device) in selected_devices">
136-
137-
<td>
138-
<a ng-href="/#ethoscope/{{device.id}}" target="_blank">
139-
<span ng-if="device.up_to_date==false" class="fa fa-circle colour-red"></span> <span ng-if="device.up_to_date==true" class="fa fa-circle colour-green"></span>
140-
<span> {{device.name}}</span>
141-
</a>
142-
</td>
143-
<td> {{device.status}}</td>
144-
<td>[{{device.active_branch}}] {{device.version.id.substring(0,6)}}... ({{device.version.date}})</td>
145-
<td>{{device.ip}}</td>
146-
<td>{{device.id.substring(0,6)}}</td>
147-
</tr>
148-
</tbody>
149-
</table>
68+
<thead>
69+
<th>Name</th>
70+
<th>Status</th>
71+
<th>Software Version</th>
72+
<th>ip</th>
73+
<th>id</th>
74+
<th>
75+
<center><input type="checkbox" ng-model="selectAll" ng-change="toggleAll(selectAll, devices)"></center>
76+
</th>
77+
</thead>
78+
<tbody>
79+
<tr>
80+
<td>
81+
82+
<span ng-if="node.check_update.up_to_date==false" class="fa fa-circle color-red"></span> <span ng-if="node.check_update.up_to_date==true" class="fa fa-circle color-green"></span><span> Node <span ng-if="node.check_update.up_to_date==false"> [Outdated]</span> <span ng-if="node.check_update.up_to_date==true">[Up to Date]</span></span>
83+
84+
</td>
85+
<td>{{node.status}}</td>
86+
<td>[{{node.active_branch}}] {{node.check_update.local_commit.id.substring(0,6)}}...
87+
({{node.check_update.local_commit.date}})</td>
88+
<td>{{node.ip}}</td>
89+
<td>N/A
90+
<!--{{node.info.id.substring(0,6)}}-->
91+
</td>
92+
<td>
93+
<center>
94+
<input type="checkbox" checklist-model="selected_devices" checklist-value="node"></center>
95+
</td>
96+
</tr>
97+
<tr ng-repeat="(id,device) in devices" ng-if="(device.status == 'stopped' && device.up_to_date == false) || showAll">
98+
99+
<td>
100+
101+
<span ng-if="device.up_to_date==false" class="fa fa-circle color-red"></span> <span ng-if="device.up_to_date==true" class="fa fa-circle color-green"></span>
102+
<span> {{device.name}}<span ng-if="device.up_to_date==false"> [Outdated]</span> <span ng-if="device.up_to_date==true">[Up to Date]</span></span>
103+
104+
</td>
105+
<td> {{device.status}}</td>
106+
<td>[{{device.active_branch}}] {{device.version.id.substring(0,6)}}... ({{device.version.date}})</td>
107+
<td>{{device.ip}}</td>
108+
<td>{{device.id.substring(0,6)}}</td>
109+
<td>
110+
<center><input type="checkbox" checklist-model="selected_devices" checklist-value="device" ng-model="device.selected" ng-change="checkAllSelected()"></center>
111+
</td>
112+
</tr>
113+
</tbody>
114+
</table>
115+
116+
</div>
117+
118+
<!--Modal-->
119+
<div class="modal fade" id="Modal" tabindex="-1" role="dialog" aria-labelledby="startModal" aria-hidden="true">
120+
<div class="modal-dialog">
121+
<div class="modal-content">
122+
<div class="modal-header">
123+
{{modal.title}}
124+
</div>
125+
<div class="model-body" ng-if="system.modal_error != ''">
126+
<h3>{{system.modal_error}}</h3>
127+
</div>
128+
129+
<div class="modal-body " ng-if="system.modal_error == ''">
130+
{{modal.info}}
131+
<select ng-show="modal.action=='swBranch'" name="branch_to_switch" ng-model="modal.branch_to_switch">
132+
<option ng-repeat="(key, name) in system.status" value="{{key}}">{{key}}</option>
133+
</select>
134+
<table class="table table-striped" ng-cloak>
135+
<thead>
136+
<th>Name</th>
137+
<th>Status</th>
138+
<th>Software Version</th>
139+
<th>ip</th>
140+
<th>id</th>
141+
</thead>
142+
<tbody>
143+
144+
<tr ng-repeat="(id,device) in selected_devices">
145+
146+
<td>
147+
<a ng-href="/#ethoscope/{{device.id}}" target="_blank">
148+
<span ng-if="device.up_to_date==false" class="fa fa-circle colour-red"></span> <span ng-if="device.up_to_date==true" class="fa fa-circle colour-green"></span>
149+
<span> {{device.name}}</span>
150+
</a>
151+
</td>
152+
<td> {{device.status}}</td>
153+
<td>[{{device.active_branch}}] {{device.version.id.substring(0,6)}}... ({{device.version.date}})</td>
154+
<td>{{device.ip}}</td>
155+
<td>{{device.id.substring(0,6)}}</td>
156+
</tr>
157+
</tbody>
158+
</table>
159+
</div>
160+
<div class="modal-footer">
161+
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
162+
<button ng-click="modal_action(selected_devices, modal.action)" target="_blank" type="button" class="btn btn-primary" ng-if="system.modal_error == ''">{{modal.action_text}}</button>
163+
</div>
164+
</div>
165+
</div>
150166
</div>
151-
<div class="modal-footer">
152-
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
153-
<button ng-click="modal_action(selected_devices, modal.action)" target="_blank" type="button" class="btn btn-primary" ng-if="system.modal_error == ''">{{modal.action_text}}</button>
154-
</div>
155-
</div>
156-
</div>
157-
</div>
158-
159167

160-
<!--JS-->
161168

162-
<!-- load angular and angular route via CDN -->
163-
<script src="static/js/vendor/angular.min.js"></script>
164-
<script src="static/js/vendor/angular-route.min.js"></script>
165-
<script src="static/js/vendor/spinner.js"></script>
166-
<script src="static/js/vendor/jquery.min.js"></script>
167-
<script src="static/js/vendor/bootstrap.min.js"></script>
168-
<script src="/static/js/script.js"></script>
169-
<script src="/static/js/vendor/dataTables/jquery.dataTables.js"></script>
170-
<script src="/static/js/vendor/dataTables/dataTables.bootstrap.js"></script>
171-
<script src="static/js/directives/checkboxes.js"></script>
169+
<!--JS-->
172170

171+
<!-- load angular and angular route via CDN -->
172+
<script src="static/js/vendor/angular.min.js"></script>
173+
<script src="static/js/vendor/angular-route.min.js"></script>
174+
<script src="static/js/vendor/spinner.js"></script>
175+
<script src="static/js/vendor/jquery.min.js"></script>
176+
<script src="static/js/vendor/bootstrap.min.js"></script>
177+
<script src="/static/js/script.js"></script>
178+
<script src="/static/js/vendor/dataTables/jquery.dataTables.js"></script>
179+
<script src="/static/js/vendor/dataTables/dataTables.bootstrap.js"></script>
180+
<script src="static/js/directives/checkboxes.js"></script>
173181

174182

175-
</body>
176-
</html>
177183

184+
</body>
178185

186+
</html>

0 commit comments

Comments
 (0)