File tree Expand file tree Collapse file tree 9 files changed +70
-9
lines changed Expand file tree Collapse file tree 9 files changed +70
-9
lines changed Original file line number Diff line number Diff line change
1
+ # v3.4.0
2
+ - Added additional delete option for powered-off instances on the containers and virtual machines pages
3
+ - Fixed bug in populating both profile and cluster member options in drop-down box for virtual machine configurations
4
+ - Added verification for numeric values in instance memory gauge display
5
+
1
6
# v3.3.0
2
7
- Updated PDO try-catch exception for PHP 8
3
8
- Created recursive PHP in_array for SQLite Pragma array search in PHP 8
Original file line number Diff line number Diff line change 43
43
<body class="">
44
44
<p>The open source LXD Dashboard is developed by LXDWARE and provides a web-based user interface capable of managing multiple LXD servers from a single location.</p>
45
45
<p>
46
- <strong>Version</strong>: <span id="versionNumber">v3.3 .0</span> <br />
46
+ <strong>Version</strong>: <span id="versionNumber">v3.4 .0</span> <br />
47
47
<strong>License</strong>: AGPL-3.0 <br />
48
48
<strong>URL</strong>: https://lxdware.com <br />
49
49
</p>
Original file line number Diff line number Diff line change 1432
1432
$ results [0 ] = null ;
1433
1433
}
1434
1434
1435
- $ results [1 ] = number_format ($ results [1 ],1 );
1435
+ if (is_numeric ($ results [1 ])){
1436
+ $ results [1 ] = number_format ($ results [1 ],1 );
1437
+ }
1438
+ else {
1439
+ $ results [1 ] = null ;
1440
+ }
1441
+
1436
1442
$ results = json_encode ($ results );
1437
1443
1438
1444
echo $ results ;
Original file line number Diff line number Diff line change 678
678
switch ($ instance_data ['status ' ]) {
679
679
case "Running " :
680
680
echo '" ' ;
681
- echo "<a href='#' onclick=stopInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-stop fa-lg' style='color:#ddd' title='Stop' aria-hidden='true'></i> </a> " ;
681
+ echo "<a href='#' onclick=stopInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-stop fa-lg' style='color:#cdcdcd' title='Stop' aria-hidden='true'></i> </a> " ;
682
+ echo "   " ;
683
+ echo "<a href='#'><i class='fas fa-trash-alt fa-lg' style='color:#ededed' title='Delete (disabled)' aria-hidden='true'></i></a> " ;
682
684
echo '" ' ;
683
685
break ;
684
686
case "Frozen " :
685
687
echo '" ' ;
686
- echo "<a href='#' onclick=unfreezeInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-pause fa-lg' style='color:#ddd' title='Unfreeze' aria-hidden='true'></i> </a> " ;
688
+ echo "<a href='#' onclick=unfreezeInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-pause fa-lg' style='color:#cdcdcd' title='Unfreeze' aria-hidden='true'></i> </a> " ;
689
+ echo "   " ;
690
+ echo "<a href='#'><i class='fas fa-trash-alt fa-lg' style='color:#ededed' title='Delete (disabled)' aria-hidden='true'></i></a> " ;
687
691
echo '" ' ;
688
692
break ;
689
693
case "Stopped " :
690
694
echo '" ' ;
691
- echo "<a href='#' onclick=startInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-play fa-lg' style='color:#ddd' title='Start' aria-hidden='true'></i> </a> " ;
695
+ echo "<a href='#' onclick=startInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-play fa-lg' style='color:#cdcdcd' title='Start' aria-hidden='true'></i> </a> " ;
696
+ echo "   " ;
697
+ echo "<a href='#' onclick=confirmDeleteInstance(' " .$ instance_data ['name ' ]."')><i class='fas fa-trash-alt fa-lg' style='color:#cdcdcd' title='Delete' aria-hidden='true'></i></a> " ;
692
698
echo '" ' ;
693
699
break ;
694
700
default :
Original file line number Diff line number Diff line change 1320
1320
$ results [0 ] = null ;
1321
1321
}
1322
1322
1323
- $ results [1 ] = number_format ($ results [1 ],1 );
1323
+ if (is_numeric ($ results [1 ])){
1324
+ $ results [1 ] = number_format ($ results [1 ],1 );
1325
+ }
1326
+ else {
1327
+ $ results [1 ] = null ;
1328
+ }
1329
+
1324
1330
$ results = json_encode ($ results );
1325
1331
1326
1332
echo $ results ;
Original file line number Diff line number Diff line change 599
599
switch ($ instance_data ['status ' ]) {
600
600
case "Running " :
601
601
echo '" ' ;
602
- echo "<a href='#' onclick=stopInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-stop fa-lg' style='color:#ddd' title='Stop' aria-hidden='true'></i> </a> " ;
602
+ echo "<a href='#' onclick=stopInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-stop fa-lg' style='color:#cdcdcd' title='Stop' aria-hidden='true'></i> </a> " ;
603
+ echo "   " ;
604
+ echo "<a href='#'><i class='fas fa-trash-alt fa-lg' style='color:#ededed' title='Delete (disabled)' aria-hidden='true'></i></a> " ;
603
605
echo '" ' ;
604
606
break ;
605
607
case "Frozen " :
606
608
echo '" ' ;
607
- echo "<a href='#' onclick=unfreezeInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-pause fa-lg' style='color:#ddd' title='Unfreeze' aria-hidden='true'></i> </a> " ;
609
+ echo "<a href='#' onclick=unfreezeInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-pause fa-lg' style='color:#cdcdcd' title='Unfreeze' aria-hidden='true'></i> </a> " ;
610
+ echo "   " ;
611
+ echo "<a href='#'><i class='fas fa-trash-alt fa-lg' style='color:#ededed' title='Delete (disabled)' aria-hidden='true'></i></a> " ;
608
612
echo '" ' ;
609
613
break ;
610
614
case "Stopped " :
611
615
echo '" ' ;
612
- echo "<a href='#' onclick=startInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-play fa-lg' style='color:#ddd' title='Start' aria-hidden='true'></i> </a> " ;
616
+ echo "<a href='#' onclick=startInstance(' " .$ instance_data ['name ' ]."')> <i class='fas fa-play fa-lg' style='color:#cdcdcd' title='Start' aria-hidden='true'></i> </a> " ;
617
+ echo "   " ;
618
+ echo "<a href='#' onclick=confirmDeleteInstance(' " .$ instance_data ['name ' ]."')><i class='fas fa-trash-alt fa-lg' style='color:#cdcdcd' title='Delete' aria-hidden='true'></i></a> " ;
613
619
echo '" ' ;
614
620
break ;
615
621
default :
Original file line number Diff line number Diff line change @@ -1640,6 +1640,20 @@ function unfreezeInstance(instanceName){
1640
1640
} );
1641
1641
}
1642
1642
1643
+ function confirmDeleteInstance(instanceName){
1644
+ console . log (" Info: confirming deletion of container " + instanceName );
1645
+ if (confirm (" Are you sure you want to delete container " + instanceName + " ?" ) == true ) {
1646
+ $. get (" ./backend/lxd/containers.php?remote=" + encodeURI (remoteId ) + " &project=" + encodeURI (projectName ) + " &instance=" + encodeURI (instanceName ) + " &action=deleteInstance" , function (data ) {
1647
+ var operationData = JSON . parse (data );
1648
+ console . log (operationData );
1649
+ if (operationData . metadata . status_code >= 400 ){
1650
+ alert (operationData . metadata . err )
1651
+ }
1652
+ setTimeout (() => { reloadPageContent (); }, 1000 );
1653
+ });
1654
+ }
1655
+ }
1656
+
1643
1657
function setSidebarToggleValue(){
1644
1658
sidebarState = localStorage . getItem (' sidebarState' );
1645
1659
if (sidebarState == " collapsed" ){
Original file line number Diff line number Diff line change @@ -4883,6 +4883,10 @@ function percentageToDegrees(percentage) {
4883
4883
// Load Page Content
4884
4884
loadPageContent ();
4885
4885
4886
+ // Populate the select options fields used in modals
4887
+ $(" #selectProfileInput" ). load (" ./backend/lxd/profiles.php?remote=" + encodeURI (remoteId ) + " &project=" + encodeURI (projectName ) + " &action=listProfilesForSelectOption" );
4888
+ $(" #selectClusterInput" ). load (" ./backend/lxd/cluster-members.php?remote=" + encodeURI (remoteId ) + " &action=listClusterMembersForSelectOption" );
4889
+
4886
4890
// When tab changes, set active tab for content refresh
4887
4891
$(' a[data-toggle="pill"]' ). on (' shown.bs.tab' , function (e ) {
4888
4892
clearTimeout (pageReloadTimeout ); // clear reload because new tab is being loaded
Original file line number Diff line number Diff line change @@ -1101,6 +1101,20 @@ function unfreezeInstance(instanceName){
1101
1101
} );
1102
1102
}
1103
1103
1104
+ function confirmDeleteInstance(instanceName){
1105
+ console . log (" Info: confirming deletion of virtual machine " + instanceName );
1106
+ if (confirm (" Are you sure you want to delete virtual machine " + instanceName + " ?" ) == true ) {
1107
+ $. get (" ./backend/lxd/virtual-machines.php?remote=" + encodeURI (remoteId ) + " &project=" + encodeURI (projectName ) + " &instance=" + encodeURI (instanceName ) + " &action=deleteInstance" , function (data ) {
1108
+ var operationData = JSON . parse (data );
1109
+ console . log (operationData );
1110
+ if (operationData . metadata . status_code >= 400 ){
1111
+ alert (operationData . metadata . err )
1112
+ }
1113
+ setTimeout (() => { reloadPageContent (); }, 1000 );
1114
+ });
1115
+ }
1116
+ }
1117
+
1104
1118
function setSidebarToggleValue(){
1105
1119
sidebarState = localStorage . getItem (' sidebarState' );
1106
1120
if (sidebarState == " collapsed" ){
You can’t perform that action at this time.
0 commit comments