Added 'Reset View' to dashCard

This commit is contained in:
lllllllillllllillll 2023-12-13 01:04:56 -08:00
parent 23ec95c6a6
commit 22d769bcc3
4 changed files with 18 additions and 7 deletions

7
app.js
View file

@ -113,6 +113,13 @@ io.on('connection', (socket) => {
}
});
socket.on('reset', (data) => {
// set visibility to true for all containers
Containers.update({ visibility: true }, { where: {} });
console.log('All containers visible');
hiddenContainers();
});
// Container logs
socket.on('logs', (data) => {

View file

@ -152,6 +152,7 @@ module.exports.dashCard = function dashCard(data) {
</a>
<div class="dropdown-menu dropdown-menu-end">
<a class="dropdown-item" onclick="hideContainer(this)" name="${name}" href="#">Hide</a>
<a class="dropdown-item" onclick="resetView()" name="${name}" href="#">Reset View</a>
</div>
</div>
</div>

View file

@ -115,12 +115,14 @@ function buttonAction(button) {
socket.emit('clicked', {container: button.name, state: button.id, action: button.value});
}
// container button actions
function hideContainer(button) {
socket.emit('hide', {container: button.name});
}
function resetView() {
socket.emit('reset');
}
let containerLogs;

View file

@ -58,23 +58,24 @@
</h1>
<div class="navbar-nav flex-row order-md-last">
<div class="nav-item d-none d-md-flex me-3">
<div class="btn-list">
<!-- <div class="btn-list">
<a href="#" class="btn text-green">
<!-- Download SVG icon from http://tabler-icons.io/i/lock -->
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-lock" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z"></path> <path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path> <path d="M8 11v-4a4 4 0 1 1 8 0v4"></path> </svg>
VPN
</a>
<a href="#" class="btn text-green">
<!-- Download SVG icon from http://tabler-icons.io/i/shield -->
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-shield" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3"></path> </svg>
Firewall
</a>
<a href="#" class="btn text-green">
<!-- Download SVG icon from http://tabler-icons.io/i/shield -->
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-screen-share" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M21 12v3a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10a1 1 0 0 1 1 -1h9"></path> <path d="M7 20l10 0"></path> <path d="M9 16l0 4"></path> <path d="M15 16l0 4"></path> <path d="M17 4h4v4"></path> <path d="M16 9l5 -5"></path> </svg>
VNC
</a>
</div>
</div> -->
</div>
<div class="d-none d-md-flex">