Web: cleanup, add some trailing commas and remove unused code

No functional changes.
This commit is contained in:
Sybren A. Stüvel 2022-05-16 15:32:49 +02:00
parent 8f27ea9714
commit 32737ef17b

View File

@ -41,11 +41,11 @@ export default {
// { title: "ID", field: "id", headerSort: false, formatter: (cell) => cell.getData().id.substr(0, 8), }, // { title: "ID", field: "id", headerSort: false, formatter: (cell) => cell.getData().id.substr(0, 8), },
{ {
title: 'Status', field: 'status', sorter: 'string', title: 'Status', field: 'status', sorter: 'string',
formatter(cell, formatterParams) { // eslint-disable-line no-unused-vars formatter(cell) {
const cellValue = cell.getData(); const cellValue = cell.getData();
const label = toTitleCase(cellValue.status); const label = toTitleCase(cellValue.status);
return `<span title="${label}" class="indicator status-${cellValue.status}"></span>`; return `<span title="${label}" class="indicator status-${cellValue.status}"></span>`;
} },
}, },
{ title: 'Name', field: 'name', sorter: 'string' }, { title: 'Name', field: 'name', sorter: 'string' },
{ title: 'Type', field: 'type', sorter: 'string' }, { title: 'Type', field: 'type', sorter: 'string' },
@ -53,13 +53,13 @@ export default {
{ {
title: 'Updated', field: 'updated', title: 'Updated', field: 'updated',
sorter: 'alphanum', sorterParams: { alignEmptyValues: "top" }, sorter: 'alphanum', sorterParams: { alignEmptyValues: "top" },
formatter(cell, formatterParams) { // eslint-disable-line no-unused-vars formatter(cell) {
const cellValue = cell.getData().updated; const cellValue = cell.getData().updated;
// TODO: if any "{amount} {units} ago" shown, the table should be // TODO: if any "{amount} {units} ago" shown, the table should be
// refreshed every few {units}, so that it doesn't show any stale "4 // refreshed every few {units}, so that it doesn't show any stale "4
// seconds ago" for days. // seconds ago" for days.
return datetime.relativeTime(cellValue); return datetime.relativeTime(cellValue);
} },
}, },
], ],
rowFormatter(row) { rowFormatter(row) {
@ -163,6 +163,6 @@ export default {
if (row.reformat) row.reformat(); if (row.reformat) row.reformat();
else if (row.reinitialize) row.reinitialize(true); else if (row.reinitialize) row.reinitialize(true);
}, },
} },
}; };
</script> </script>