Skip to content

Commit

Permalink
ensure pbsutils declaration on top
Browse files Browse the repository at this point in the history
  • Loading branch information
Son Roy Almerol committed Feb 7, 2025
1 parent 83c0a06 commit f81b90f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 45 deletions.
46 changes: 46 additions & 0 deletions internal/proxy/js_compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,52 @@ function encodePathValue(path) {
.replace(/=+$/, '');
return encoded;
}
Ext.define('PBS.PlusUtils', {
singleton: true,
render_task_status: function(value, metadata, record, rowIndex, colIndex, store) {
var lastPlusError = record.data['last-plus-error'] || store.getById('last-plus-error')?.data.value
if (lastPlusError) {
return ` + "`<i class=\"fa fa-times critical\"></i> ${lastPlusError}`" + `;
}
if (
!record.data['last-run-upid'] &&
!store.getById('last-run-upid')?.data.value &&
!record.data.upid &&
!store.getById('upid')?.data.value
) {
return '-';
}
if (!record.data['last-run-endtime'] && !store.getById('last-run-endtime')?.data.value) {
metadata.tdCls = 'x-grid-row-loading';
return '';
}
let parsed = Proxmox.Utils.parse_task_status(value);
let text = value;
let icon = '';
switch (parsed) {
case 'unknown':
icon = 'question faded';
text = Proxmox.Utils.unknownText;
break;
case 'error':
icon = 'times critical';
text = Proxmox.Utils.errorText + ': ' + value;
break;
case 'warning':
icon = 'exclamation warning';
break;
case 'ok':
icon = 'check good';
text = gettext("OK");
}
return ` + "`<i class=\"fa fa-${icon}\"></i> ${text}`" + `;
},
});
`)

err := fs.WalkDir(customJsFS, ".", func(path string, d fs.DirEntry, err error) error {
Expand Down
45 changes: 0 additions & 45 deletions internal/proxy/views/utils.js

This file was deleted.

0 comments on commit f81b90f

Please sign in to comment.