Skip to content

Commit a0eaacc

Browse files
v1.2.1
1 parent a58de52 commit a0eaacc

21 files changed

+140
-171
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# v1.2.1
2+
- improvements to the UI on the index.html page
3+
- set default value for possible undeclared variable in cluster-list-select.php
4+
- fixed DataTables reloading first page of results after table refresh
5+
- removed lxc executable privileges in docker builds
6+
- allowed for empty instances to be created with an image selection of none
7+
18
# v1.2.0
29
- removed the adding certificates option temporarily due to it causing an error
310
- added the option to create instances from snapshots

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ COPY lxc /usr/bin/
3131
EXPOSE 80
3232

3333
#Set the no password option for running lxc commands
34-
RUN echo "www-data ALL=(ALL) NOPASSWD: /usr/bin/lxc, /usr/bin/curl" >> /etc/sudoers
34+
RUN echo "www-data ALL=(ALL) NOPASSWD: /usr/bin/curl" >> /etc/sudoers
3535

3636
#Setup web directory and files
3737
COPY default /etc/nginx/sites-available/

admin/about.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<html lang="en">
33
<body>
44
<p><strong>About</strong>: The LXD Dashboard by LXDWARE is open source software that provides a web-based user interface for controlling your LXD infrastructure.</p>
5-
<p><strong>Version</strong>: 1.2.0</p>
5+
<p><strong>Version</strong>: 1.2.1</p>
66
<p><strong>License</strong>: GPL-3.0</p>
7-
<p><strong>Source Code</strong>: https://github.com/lxdware/lxd-dashboard</p>
7+
<p><strong>URL</strong>: https://lxdware.com</p>
88
</body>
99
</html>

admin/certificates.html

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,10 @@
138138
<!-- Card Header - Dropdown -->
139139
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
140140
<h6 class="m-0 font-weight-bold text-primary">Certificates</h6>
141-
<!-- <div class="dropdown no-arrow">
142-
<a class="dropdown-toggle" href="#" data-toggle="modal" data-target="#addCertificateModal">
143-
<i class="fas fa-plus fa-sm fa-fw"></i>
144-
New Certificate
145-
</a>
146-
</div> -->
141+
<div class="dropdown no-arrow">
142+
<!--<a class="dropdown-toggle mr-2" href="#" data-toggle="modal" data-target="#addCertificateModal" title="New Certificate" aria-hidden="true">
143+
<i class="fas fa-plus fa-sm fa-fw"></i></a>-->
144+
</div>
147145
</div>
148146
<!-- Card Body -->
149147
<div class="card-body">
@@ -321,10 +319,7 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
321319
}
322320

323321
function reloadPageContent(){
324-
$('#certificateListTable').DataTable().ajax.reload();
325-
326-
//Set the page content to reload again in 5 more seconds
327-
setTimeout(() => { reloadPageContent(); }, 5000);
322+
$('#certificateListTable').DataTable().ajax.reload(null, false);
328323
}
329324

330325
function loadPageContent(){
@@ -353,8 +348,8 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
353348
//Check for any running operations
354349
operationStatusCheck();
355350

356-
//Set the page content to reload once in 5 seconds
357-
setTimeout(() => { reloadPageContent(); }, 5000);
351+
//Set the page content to reload in 5 seconds
352+
setInterval(() => { reloadPageContent(); }, 5000);
358353
}
359354

360355
//API uses sync

admin/cluster.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@
138138
<!-- Card Header - Dropdown -->
139139
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
140140
<h6 class="m-0 font-weight-bold text-primary">Cluster Members</h6>
141+
<div class="dropdown no-arrow">
142+
</div>
141143
</div>
142144
<!-- Card Body -->
143145
<div class="card-body">
@@ -286,10 +288,7 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
286288
}
287289

288290
function reloadPageContent() {
289-
$('#clusterMemberListTable').DataTable().ajax.reload();
290-
291-
//Set the page content to reload again in 5 more seconds
292-
setTimeout(() => { reloadPageContent(); }, 5000);
291+
$('#clusterMemberListTable').DataTable().ajax.reload(null, false);
293292
}
294293

295294
function loadPageContent(){
@@ -320,8 +319,8 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
320319
//Check for any running operations
321320
operationStatusCheck();
322321

323-
//Set the page content to reload once in 5 seconds
324-
setTimeout(() => { reloadPageContent(); }, 5000);
322+
//Set the page content to reload in 5 seconds
323+
setInterval(() => { reloadPageContent(); }, 5000);
325324
}
326325

327326

admin/host.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@
134134
<!-- Card Header - Dropdown -->
135135
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
136136
<h6 class="m-0 font-weight-bold text-primary">Host Details</h6>
137+
<div class="dropdown no-arrow">
138+
</div>
137139
</div>
138140

139141
<div class="row">
@@ -384,6 +386,7 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
384386
}
385387

386388
function reloadPageContent() {
389+
387390
$("#instanceCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=instanceInfo");
388391
$("#imageCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=imageInfo");
389392
$("#networkCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=networkInfo");
@@ -394,9 +397,6 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
394397

395398
//On some servers the Driver/Driver Version field keep alternating. No need to refresh this data
396399
//$("#lxdCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=lxdInfo");
397-
398-
//Set the page content to reload again in 5 more seconds
399-
setTimeout(() => { reloadPageContent(); }, 5000);
400400
}
401401

402402
function loadPageContent(){
@@ -417,8 +417,8 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
417417
//Check for any running operations
418418
operationStatusCheck();
419419

420-
//Set the page content to reload once in 5 seconds
421-
setTimeout(() => { reloadPageContent(); }, 5000);
420+
//Set the page content to reload in 5 seconds
421+
setInterval(() => { reloadPageContent(); }, 5000);
422422
}
423423

424424
$(document).ready(function(){

admin/images.html

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,8 @@
139139
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
140140
<h6 class="m-0 font-weight-bold text-primary">Images</h6>
141141
<div class="dropdown no-arrow">
142-
<a class="dropdown-toggle" href="#" data-toggle="modal" data-target="#downloadImageModal">
143-
<i class="fas fa-plus fa-sm fa-fw"></i>
144-
Download Image
145-
</a>
142+
<a class="dropdown-toggle mr-2" href="#" data-toggle="modal" data-target="#downloadImageModal" title="Download Image" aria-hidden="true">
143+
<i class="fas fa-plus fa-sm fa-fw"></i> Image</a>
146144
</div>
147145
</div>
148146
<!-- Card Body -->
@@ -343,7 +341,7 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
343341
}
344342

345343
function reloadPageContent() {
346-
$('#imageListTable').DataTable().ajax.reload();
344+
$('#imageListTable').DataTable().ajax.reload(null, false);
347345

348346
//Load the select List for Download Image Modal
349347
$.get("./php/lxd/simplestreams-list-select.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName), function (data) {
@@ -352,9 +350,6 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
352350
selectList = data;
353351
}
354352
});
355-
356-
//Set the page content to reload again in 5 more seconds
357-
setTimeout(() => { reloadPageContent(); }, 5000);
358353
}
359354

360355
function loadPageContent(){
@@ -392,8 +387,8 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
392387
//Check for any running operations
393388
operationStatusCheck();
394389

395-
//Set the page content to reload once in 5 seconds
396-
setTimeout(() => { reloadPageContent(); }, 5000);
390+
//Set the page content to reload in 5 seconds
391+
setInterval(() => { reloadPageContent(); }, 5000);
397392
}
398393

399394
//API uses async

admin/index.html

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,6 @@
8585
<!-- Topbar Navbar -->
8686
<ul class="navbar-nav ml-auto">
8787

88-
<li class="nav-item">
89-
<a class="nav-link" href="#" data-toggle="modal" data-target="#clientCertModal">
90-
<span class="mr-2 d-none d-lg-inline text-primary">
91-
Client Certificate
92-
</span>
93-
</a>
94-
</li>
95-
96-
<li class="nav-item">
97-
<a class="nav-link" href="#" data-toggle="modal" data-target="#addLxdModal">
98-
<span class="mr-2 d-none d-lg-inline text-primary">
99-
Add Remote Host
100-
</span>
101-
</a>
102-
</li>
103-
10488
<div class="topbar-divider d-none d-sm-block"></div>
10589

10690
<!-- Nav Item - User Information -->
@@ -135,33 +119,25 @@
135119

136120
<!-- Page Heading -->
137121
<div class="d-sm-flex align-items-center justify-content-between mb-4">
138-
<h1 class="h3 mb-0 text-gray-800">Remote Host Configuration</h1>
122+
<h1 class="h3 mb-0 text-gray-800">Remote LXD Hosts</h1>
139123
</div>
140124

141125

142126
<div class="row">
143127
<div class="col-12">
144128
<!-- LXD Host List -->
145-
146-
<p><i class="fas fa-question-circle fa-fw"></i> Before adding a remote host, first copy the client <a href="#" data-toggle="modal" data-target="#clientCertModal">certificate</a>
147-
information and paste it into a new file on your remote LXD server such as <strong><em>lxdware.crt</em></strong>.
148-
Then import the certificate on your remote LXD server by running the command: <code>lxc config trust add lxdware.crt</code>.
149-
For LXD hosts that are not part of a cluster, use the <code>lxc config set core.https_address [::]</code> command
150-
to listen for incoming connections.</p>
151129

152130
<div class="card shadow mb-4">
153131
<!-- Card Header - Dropdown -->
154132
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
155-
<h6 class="m-0 font-weight-bold text-primary">LXD Remote Hosts</h6>
133+
<h6 class="m-0 font-weight-bold text-primary">LXD Hosts</h6>
156134
<div class="dropdown no-arrow">
157-
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
158-
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
159-
</a>
160-
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
161-
<div class="dropdown-header">Options:</div>
162-
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#clientCertModal">Client Certificate</a>
163-
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addLxdModal">Add Remote Host</a>
164-
</div>
135+
<a class="dropdown-toggle mr-3" href="#" data-toggle="modal" data-target="#clientCertModal">
136+
View Certificate</a>
137+
<a class="dropdown-toggle mr-3" href="#" data-toggle="modal" data-target="#addLxdModal">
138+
Add Host</a>
139+
<a class="dropdown-toggle mr-2" href="#" data-toggle="modal" data-target="#helpModal" title="Help" aria-hidden="true">
140+
<i class="fas fa-question-circle fa-sm fa-fw"></i></a>
165141
</div>
166142
</div>
167143
<!-- Card Body -->
@@ -209,12 +185,40 @@ <h6 class="m-0 font-weight-bold text-primary">LXD Remote Hosts</h6>
209185
<i class="fas fa-angle-up"></i>
210186
</a>
211187

188+
<!-- Help Modal-->
189+
<div class="modal fade" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
190+
<div class="modal-dialog modal-lg" role="document">
191+
<div class="modal-content">
192+
<div class="modal-header">
193+
<h5 class="modal-title" id="exampleModalLabel">Instructions</h5>
194+
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
195+
<span aria-hidden="true">×</span>
196+
</button>
197+
</div>
198+
<div class="modal-body">
199+
<div class="row">
200+
<div class="col-12">
201+
<p>Before adding a remote host, first copy the client <a href="#" data-toggle="modal" data-target="#clientCertModal">certificate</a>
202+
and paste it into a new file on your remote LXD server such as <strong><em>lxdware.crt</em></strong>.</p>
203+
<p>Import the certificate on your remote LXD server by running the command: <code>lxc config trust add lxdware.crt</code></p>
204+
<p>For LXD hosts that are not part of a cluster, use the <code>lxc config set core.https_address [::]</code>
205+
command to listen for incoming connections.</p>
206+
</div>
207+
</div>
208+
</div>
209+
<div class="modal-footer">
210+
<button class="btn btn-secondary" type="button" data-dismiss="modal">Dismiss</button>
211+
</div>
212+
</div>
213+
</div>
214+
</div>
215+
212216
<!-- Client Cert Modal-->
213217
<div class="modal fade" id="clientCertModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
214218
<div class="modal-dialog modal-lg" role="document">
215219
<div class="modal-content">
216220
<div class="modal-header">
217-
<h5 class="modal-title" id="exampleModalLabel">LXD Client Cert</h5>
221+
<h5 class="modal-title" id="exampleModalLabel">LXD Client Certificate</h5>
218222
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
219223
<span aria-hidden="true">×</span>
220224
</button>
@@ -351,10 +355,7 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
351355
}
352356

353357
function reloadPageContent() {
354-
$('#lxdListTable').DataTable().ajax.reload();
355-
356-
//Set the page content to reload again in 5 more seconds
357-
setTimeout(() => { reloadPageContent(); }, 5000);
358+
$('#lxdListTable').DataTable().ajax.reload(null, false);
358359
}
359360

360361
function loadPageContent(){
@@ -387,8 +388,9 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
387388
$("#clientCert").html(data);
388389
});
389390

390-
//Set the page content to reload once in 5 seconds
391-
setTimeout(() => { reloadPageContent(); }, 5000);
391+
//Set the page content to reload in 5 seconds
392+
setInterval(() => { reloadPageContent(); }, 5000);
393+
392394
}
393395

394396
function addRemote(){

admin/instance.html

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,16 @@
135135
<div class="card shadow mb-4">
136136
<!-- Card Header - Dropdown -->
137137
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
138-
<h6 class="m-0 font-weight-bold text-primary">Details</h6>
138+
<h6 class="m-0 font-weight-bold text-primary">Instance Details</h6>
139139
<div class="dropdown no-arrow">
140-
<a class="dropdown-toggle" href="#" role="button" id="startLink" onclick="startInstance()" style="display: none;">
141-
<i class="fas fa-play fa-sm fa-fw"></i> Start
142-
</a>
143-
<a class="dropdown-toggle" href="#" role="button" id="stopLink" onclick="stopInstance()" style="display: none;">
144-
<i class="fas fa-stop fa-sm fa-fw"></i> Stop
145-
</a>
146-
<a class="dropdown-toggle" href="#" role="button" id="unfreezeLink" onclick="unfreezeInstance()" style="display: none;">
147-
<i class="fas fa-pause fa-sm fa-fw"></i> Unfreeze
148-
</a>
149-
<span>&nbsp; | &nbsp;</span>
150-
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
151-
<i class="fas fa-cog fa-sm fa-fw"></i> Actions
152-
</a>
140+
<a class="dropdown-toggle mr-2" href="#" role="button" id="startLink" onclick="startInstance()" style="display: none;" Title="Start">
141+
<i class="fas fa-play fa-sm fa-fw"></i></a>
142+
<a class="dropdown-toggle mr-2" href="#" role="button" id="stopLink" onclick="stopInstance()" style="display: none;" title="Stop">
143+
<i class="fas fa-stop fa-sm fa-fw"></i></a>
144+
<a class="dropdown-toggle mr-2" href="#" role="button" id="unfreezeLink" onclick="unfreezeInstance()" style="display: none;" title="UnFreeze">
145+
<i class="fas fa-pause fa-sm fa-fw"></i></a>
146+
<a class="dropdown-toggle mr-2" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Actions">
147+
<i class="fas fa-bars fa-sm fa-fw"></i></a>
153148
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
154149
<!--<div class="dropdown-header">Options:</div>-->
155150
<a class="dropdown-item" href="#" onclick="restartInstance()" id="restartInstanceOption">Restart</a>
@@ -849,9 +844,6 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
849844
logDetails = data;
850845
}
851846
});
852-
853-
//Set the page content to reload again in 5 more seconds
854-
setTimeout(() => { reloadPageContent(); }, 5000);
855847
}
856848

857849
function loadPageContent(){
@@ -941,8 +933,8 @@ <h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
941933
//Check for any running operations
942934
operationStatusCheck();
943935

944-
//Set the page content to reload once in 5 seconds
945-
setTimeout(() => { reloadPageContent(); }, 5000);
936+
//Set the page content to reload in 5 seconds
937+
setInterval(() => { reloadPageContent(); }, 5000);
946938
}
947939

948940
function startInstance(){

0 commit comments

Comments
 (0)