Skip to content

Commit

Permalink
feat: add filtering to lock page (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkaser authored Nov 5, 2024
1 parent d352662 commit 5a67e88
Showing 1 changed file with 36 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,45 @@
return;
}
?>

<form markdown="1" method="POST" action="/update.php" target="progressFrame">
<input type="hidden" name="#command" value="/usr/local/emhttp/plugins/tailscale/approve-nodes.php" />
<table style="margin-top: 5px;">
<?php
foreach ($tailscaleInfo->getTailscaleLockPending() as $lockHost => $lockKey) {
echo "<tr><td><input type='checkbox' name='#arg[]' value='{$lockKey}' /></td><td>{$lockHost}<br />{$lockKey}</td></tr>";
}
<table class="unraid t2 tablesorter" id="t2">
<thead>
<tr>
<th class="filter-false">&nbsp;</th>
<th>Name</th>
<th class="filter-false">Key</th>
</tr>
</thead>
<tbody>
<?php
foreach ($tailscaleInfo->getTailscaleLockPending() as $lockHost => $lockKey) {
echo "<tr><td><input type='checkbox' name='#arg[]' value='{$lockKey}' /></td><td>{$lockHost}</td><td>{$lockKey}</td></tr>";
}
?>
</tbody>
</table>

<input type="submit" name="#apply" value="<?= $tr->tr('Sign'); ?>">
</form>
</form>
<script>
function showLocks() {
$('#t2').tablesorter({
widthFixed : true,
sortList: [[0,0]],
sortAppend: [[0,0]],
widgets: ['stickyHeaders','filter','zebra'],
widgetOptions: {
// on black and white, offset is height of #menu
// on azure and gray, offset is height of #header
stickyHeaders_offset: ($('#menu').height() < 50) ? $('#menu').height() : $('#header').height(),
filter_columnFilters: true,
filter_liveSearch: true,

zebra: ["normal-row","alt-row"]
}
});
}
showLocks();
</script>

0 comments on commit 5a67e88

Please sign in to comment.