dataStorePrefix: 'DataStore-',
+ cryptmap: [
+ 'none',
+ 'mixed',
+ 'sign-only',
+ 'encrypt',
+ ],
+
+ cryptText: [
+ Proxmox.Utils.noText,
+ gettext('Mixed'),
+ gettext('Signed'),
+ gettext('Encrypted'),
+ ],
+
+ cryptIconCls: [
+ '',
+ '',
+ 'lock faded',
+ 'lock good',
+ ],
+
+ calculateCryptMode: function(data) {
+ let mixed = data.mixed;
+ let encrypted = data.encrypt;
+ let signed = data['sign-only'];
+ let files = data.count;
+ if (mixed > 0) {
+ return PBS.Utils.cryptmap.indexOf('mixed');
+ } else if (files === encrypted && encrypted > 0) {
+ return PBS.Utils.cryptmap.indexOf('encrypt');
+ } else if (files === signed && signed > 0) {
+ return PBS.Utils.cryptmap.indexOf('sign-only');
+ } else if ((signed+encrypted) === 0) {
+ return PBS.Utils.cryptmap.indexOf('none');
+ } else {
+ return PBS.Utils.cryptmap.indexOf('mixed');
+ }
+ },
+
getDataStoreFromPath: function(path) {
return path.slice(PBS.Utils.dataStorePrefix.length);
},