ui: fix crypt mode caluclation

also include 'mixed' in the calculation of the overall mode of a
snapshot and group

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2020-07-09 16:50:24 +02:00
committed by Thomas Lamprecht
parent 7ba2c1c386
commit 106603c58f
2 changed files with 14 additions and 7 deletions

View File

@ -34,8 +34,14 @@ Ext.define('PBS.Utils', {
'lock',
],
calculateCryptMode: function(signed, encrypted, files) {
if (files === encrypted) {
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) {
return PBS.Utils.cryptmap.indexOf('encrypt');
} else if (files === signed) {
return PBS.Utils.cryptmap.indexOf('sign-only');