Fixed list sort on images, networks, volumes

This commit is contained in:
lllllllillllllillll 2024-02-17 00:37:07 -08:00
parent 97481b0b75
commit 666f820a1f
6 changed files with 42 additions and 37 deletions

View file

@ -5,6 +5,7 @@ import { modal } from '../components/modal.js';
import { permissionsModal } from '../components/permissions_modal.js';
import { cpu, ram, tx, rx, disk } from '../server.js';
import { dockerContainerStats } from 'systeminformation';
import { containerCard } from '../components/containerCard.js';
@ -241,4 +242,23 @@ export const Chart = async (req, res) => {
}])
</script>`
res.send(chart);
}
export const Installing = (req, res) => {
let install_info = {
name: 'App Name',
service: '',
id: '',
state: 'Installing',
image: '',
external_port: 0,
internal_port: 0,
ports: '',
link: 'localhost',
}
let card = containerCard(install_info);
res.send(card);
}

View file

@ -8,13 +8,13 @@ export const Images = async function(req, res) {
<thead>
<tr>
<th class="w-1"><input class="form-check-input m-0 align-middle" name="select" type="checkbox" aria-label="Select all" onclick="selectAll()"></th>
<th><button class="table-sort" data-sort="sort-name">Name</button></th>
<th><button class="table-sort" data-sort="sort-city">ID</button></th>
<th><button class="table-sort" data-sort="sort-type">Tag</button></th>
<th><button class="table-sort" data-sort="sort-score">Status</button></th>
<th><button class="table-sort" data-sort="sort-date">Created</button></th>
<th><button class="table-sort" data-sort="sort-quantity">Size</button></th>
<th><button class="table-sort" data-sort="sort-progress">Action</button></th>
<th><label class="table-sort" data-sort="sort-name">Name</label></th>
<th><label class="table-sort" data-sort="sort-city">ID</label></th>
<th><label class="table-sort" data-sort="sort-type">Tag</label></th>
<th><label class="table-sort" data-sort="sort-score">Status</label></th>
<th><label class="table-sort" data-sort="sort-date">Created</label></th>
<th><label class="table-sort" data-sort="sort-quantity">Size</label></th>
<th><label class="table-sort" data-sort="sort-progress">Action</label></th>
</tr>
</thead>
<tbody class="table-tbody">`

View file

@ -9,14 +9,14 @@ export const Networks = async function(req, res) {
<thead>
<tr>
<th class="w-1"><input class="form-check-input m-0 align-middle" name="select" type="checkbox" aria-label="Select all" onclick="selectAll()"></th>
<th><button class="table-sort" data-sort="sort-name">Name</button></th>
<th><button class="table-sort" data-sort="sort-city">ID</button></th>
<th><button class="table-sort" data-sort="sort-score">Status</button></th>
<th><button class="table-sort" data-sort="sort-date">Created</button></th>
<th><button class="table-sort" data-sort="sort-progress">Action</button></th>
<th><label class="table-sort" data-sort="sort-name">Name</label></th>
<th><label class="table-sort" data-sort="sort-city">ID</label></th>
<th><label class="table-sort" data-sort="sort-score">Status</label></th>
<th><label class="table-sort" data-sort="sort-date">Created</label></th>
<th><label class="table-sort" data-sort="sort-progress">Action</label></th>
</tr>
</thead>
<tbody class="table-tbody">`
<tbody class="table-tbody">`
for (let i = 0; i < networks.length; i++) {

View file

@ -10,12 +10,12 @@ export const Volumes = async function(req, res) {
<thead>
<tr>
<th class="w-1"><input class="form-check-input m-0 align-middle" name="select" type="checkbox" aria-label="Select all" onclick="selectAll()"></th>
<th><button class="table-sort" data-sort="sort-name">Name</button></th>
<th><button class="table-sort" data-sort="sort-city">Mount point</button></th>
<th><button class="table-sort" data-sort="sort-score">Status</button></th>
<th><button class="table-sort" data-sort="sort-date">Created</button></th>
<th><button class="table-sort" data-sort="sort-quantity">Size</button></th>
<th><button class="table-sort" data-sort="sort-progress">Action</button></th>
<th><label class="table-sort" data-sort="sort-name">Name</label></th>
<th><label class="table-sort" data-sort="sort-city">Mount point</label></th>
<th><label class="table-sort" data-sort="sort-score">Status</label></th>
<th><label class="table-sort" data-sort="sort-date">Created</label></th>
<th><label class="table-sort" data-sort="sort-quantity">Size</label></th>
<th><label class="table-sort" data-sort="sort-progress">Action</label></th>
</tr>
</thead>
<tbody class="table-tbody">`

View file

@ -4,7 +4,7 @@ export const router = express.Router();
// Controllers
import { Login, submitLogin, Logout } from "../controllers/login.js";
import { Register, submitRegister } from "../controllers/register.js";
import { Dashboard, searchDashboard, Start, Stop, Pause, Restart, Logs, Modal, Stats, Hide, Reset, Chart } from "../controllers/dashboard.js";
import { Dashboard, searchDashboard, Start, Stop, Pause, Restart, Logs, Modal, Stats, Hide, Reset, Chart, Installing } from "../controllers/dashboard.js";
import { Apps, appSearch } from "../controllers/apps.js";
import { Users } from "../controllers/users.js";
import { Images, removeImage } from "../controllers/images.js";
@ -44,13 +44,14 @@ router.get("/stats", auth, Stats);
router.post("/hide", auth, Hide);
router.post("/reset", auth, Reset);
router.get("/chart", auth, Chart);
router.get("/installing", auth, Installing);
router.get("/images", auth, Images);
router.post("/removeImage", removeImage);
router.get("/volumes", auth, Volumes);
router.post("/removeVolume", removeVolume);
router.post("/removeVolume", auth, removeVolume);
router.get("/networks", auth, Networks);
router.post("/removeNetwork", removeNetwork);

View file

@ -174,19 +174,3 @@ router.get('/sse_event', (req, res) => {
});
router.get('/installing', async (req, res) => {
let install_info = {
name: 'App Name',
service: '',
id: '',
state: 'Installing',
image: '',
external_port: 0,
internal_port: 0,
ports: '',
link: 'localhost',
}
let card = containerCard(install_info);
res.send(card);
});