ui: improve task description for loat/unload media

This commit is contained in:
Dietmar Maurer 2021-02-18 09:23:50 +01:00
parent 0514a4308f
commit dea8e2cb54
1 changed files with 13 additions and 0 deletions

View File

@ -172,6 +172,17 @@ Ext.define('PBS.Utils', {
return `${what} ${id}`; return `${what} ${id}`;
}, },
render_drive_load_media_id: function(id, what) {
const res = id.match(/^(\S+?):(\S+?)$/);
if (res) {
let drive = res[1];
let label = res[2];
return gettext('Drive') + ` ${drive} - ${what} '${label}'`;
}
return `${what} ${id}`;
},
// mimics Display trait in backend // mimics Display trait in backend
renderKeyID: function(fingerprint) { renderKeyID: function(fingerprint) {
return fingerprint.substring(0, 23); return fingerprint.substring(0, 23);
@ -312,6 +323,8 @@ Ext.define('PBS.Utils', {
"barcode-label-media": [gettext('Drive'), gettext('Barcode label media')], "barcode-label-media": [gettext('Drive'), gettext('Barcode label media')],
dircreate: [gettext('Directory Storage'), gettext('Create')], dircreate: [gettext('Directory Storage'), gettext('Create')],
dirremove: [gettext('Directory'), gettext('Remove')], dirremove: [gettext('Directory'), gettext('Remove')],
"load-media": (type, id) => PBS.Utils.render_drive_load_media_id(id, gettext('Load media')),
"unload-media": [gettext('Drive'), gettext('Unload media')],
"eject-media": [gettext('Drive'), gettext('Eject media')], "eject-media": [gettext('Drive'), gettext('Eject media')],
"erase-media": [gettext('Drive'), gettext('Erase media')], "erase-media": [gettext('Drive'), gettext('Erase media')],
garbage_collection: ['Datastore', gettext('Garbage collect')], garbage_collection: ['Datastore', gettext('Garbage collect')],