mirror of
https://github.com/unraid/webgui.git
synced 2026-04-23 18:48:49 -05:00
Add "reset sorting" to docker and VM list
This commit is contained in:
@@ -111,7 +111,7 @@ div.PanelText{display:none;}
|
||||
th.five{width:5%}
|
||||
</style>
|
||||
<table class="tablesorter shift kvm" id="kvm_table">
|
||||
<thead><tr><th><i class="fa fa-th-list"></i></th><th>Name</th><th>Description</th><th>CPUs</th><th>Memory</th><th>vDisks</th><th>Graphics</th><th class="five">Autostart</th><th class="five" style="text-align:right;padding-right:24px"><i class="fa fa-sort"></i></th></tr></thead>
|
||||
<thead><tr><th><i class="fa fa-th-list"></i></th><th>Name</th><th>Description</th><th>CPUs</th><th>Memory</th><th>vDisks</th><th>Graphics</th><th class="five">Autostart</th><th class="five" style="text-align:right;padding-right:24px"><a href="#" style="cursor:hand" onclick="resetSorting()" title="Reset sorting"><i class="fa fa-sort"></i></a></th></tr></thead>
|
||||
<tbody id="kvm_list"><tr><td colspan='9' style='text-align:center;padding:24px'><i class='fa fa-circle-o-notch fa-spin fa-3x fa-fw'></i></td></tr></tbody>
|
||||
</table>
|
||||
<input type="button" onclick="addVM()" id="btnAddVM" value="Add VM" style="display:none">
|
||||
@@ -136,6 +136,10 @@ function resize(bind) {
|
||||
}
|
||||
}
|
||||
<?endif;?>
|
||||
function resetSorting() {
|
||||
$('input[type=button]').prop('disabled',true);
|
||||
$.post('/plugins/dynamix.vm.manager/include/UserPrefs.php',{reset:true},function(){loadlist();});
|
||||
}
|
||||
function loadlist() {
|
||||
$.get('/plugins/dynamix.vm.manager/include/VMMachines.php',function(d) {
|
||||
var data = d.split(/\0/);
|
||||
|
||||
@@ -12,12 +12,17 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$prefs = '/boot/config/plugins/dynamix.vm.manager';
|
||||
$names = explode(';',$_POST['names']);
|
||||
$index = explode(';',$_POST['index']);
|
||||
$save = []; $i = 0;
|
||||
$user_prefs = '/boot/config/plugins/dynamix.vm.manager/userprefs.cfg';
|
||||
|
||||
foreach ($names as $name) if ($name) $save[] = $index[$i++]."=\"".$name."\""; else $i++;
|
||||
if (!is_dir($prefs)) mkdir($prefs);
|
||||
file_put_contents("$prefs/userprefs.cfg", implode("\n",$save)."\n");
|
||||
if (isset($_POST['reset'])) {
|
||||
@unlink($user_prefs);
|
||||
} else {
|
||||
$names = explode(';',$_POST['names']);
|
||||
$index = explode(';',$_POST['index']);
|
||||
$save = []; $i = 0;
|
||||
|
||||
foreach ($names as $name) if ($name) $save[] = $index[$i++]."=\"".$name."\""; else $i++;
|
||||
if (!is_dir(dirname($user_prefs))) mkdir(dirname($user_prefs));
|
||||
file_put_contents($user_prefs, implode("\n",$save)."\n");
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user