From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 04CDB76A4E for ; Fri, 16 Jul 2021 16:21:30 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 02AA211BF2 for ; Fri, 16 Jul 2021 16:21:30 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 3E0D711B81 for ; Fri, 16 Jul 2021 16:21:27 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1695E4219E for ; Fri, 16 Jul 2021 16:21:27 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Fri, 16 Jul 2021 16:21:23 +0200 Message-Id: <20210716142126.1216972-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210716142126.1216972-1-d.csapak@proxmox.com> References: <20210716142126.1216972-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.571 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager v3 2/5] ui: move Utils.storageSchema to Schema.storageTypes X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2021 14:21:30 -0000 Signed-off-by: Dominik Csapak --- www/manager6/Schema.js | 99 ++++++++++++++++++++++++++++++++ www/manager6/Utils.js | 102 +-------------------------------- www/manager6/dc/StorageView.js | 4 +- 3 files changed, 102 insertions(+), 103 deletions(-) diff --git a/www/manager6/Schema.js b/www/manager6/Schema.js index 5649241a..73d98889 100644 --- a/www/manager6/Schema.js +++ b/www/manager6/Schema.js @@ -1,4 +1,103 @@ Ext.define('PVE.Schema', { // a singleton singleton: true, + storageTypes: { + dir: { + name: Proxmox.Utils.directoryText, + ipanel: 'DirInputPanel', + faIcon: 'folder', + backups: true, + }, + lvm: { + name: 'LVM', + ipanel: 'LVMInputPanel', + faIcon: 'folder', + backups: false, + }, + lvmthin: { + name: 'LVM-Thin', + ipanel: 'LvmThinInputPanel', + faIcon: 'folder', + backups: false, + }, + btrfs: { + name: 'BTRFS', + ipanel: 'BTRFSInputPanel', + faIcon: 'folder', + backups: true, + }, + nfs: { + name: 'NFS', + ipanel: 'NFSInputPanel', + faIcon: 'building', + backups: true, + }, + cifs: { + name: 'CIFS', + ipanel: 'CIFSInputPanel', + faIcon: 'building', + backups: true, + }, + glusterfs: { + name: 'GlusterFS', + ipanel: 'GlusterFsInputPanel', + faIcon: 'building', + backups: true, + }, + iscsi: { + name: 'iSCSI', + ipanel: 'IScsiInputPanel', + faIcon: 'building', + backups: false, + }, + cephfs: { + name: 'CephFS', + ipanel: 'CephFSInputPanel', + faIcon: 'building', + backups: true, + }, + pvecephfs: { + name: 'CephFS (PVE)', + ipanel: 'CephFSInputPanel', + hideAdd: true, + faIcon: 'building', + backups: true, + }, + rbd: { + name: 'RBD', + ipanel: 'RBDInputPanel', + faIcon: 'building', + backups: false, + }, + pveceph: { + name: 'RBD (PVE)', + ipanel: 'RBDInputPanel', + hideAdd: true, + faIcon: 'building', + backups: false, + }, + zfs: { + name: 'ZFS over iSCSI', + ipanel: 'ZFSInputPanel', + faIcon: 'building', + backups: false, + }, + zfspool: { + name: 'ZFS', + ipanel: 'ZFSPoolInputPanel', + faIcon: 'folder', + backups: false, + }, + pbs: { + name: 'Proxmox Backup Server', + ipanel: 'PBSInputPanel', + faIcon: 'floppy-o', + backups: true, + }, + drbd: { + name: 'DRBD', + hideAdd: true, + backups: false, + }, + }, }); diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index a22eaaa7..e8c9f218 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -760,106 +760,6 @@ Ext.define('PVE.Utils', { }, }, - storageSchema: { - dir: { - name: Proxmox.Utils.directoryText, - ipanel: 'DirInputPanel', - faIcon: 'folder', - backups: true, - }, - lvm: { - name: 'LVM', - ipanel: 'LVMInputPanel', - faIcon: 'folder', - backups: false, - }, - lvmthin: { - name: 'LVM-Thin', - ipanel: 'LvmThinInputPanel', - faIcon: 'folder', - backups: false, - }, - btrfs: { - name: 'BTRFS', - ipanel: 'BTRFSInputPanel', - faIcon: 'folder', - backups: true, - }, - nfs: { - name: 'NFS', - ipanel: 'NFSInputPanel', - faIcon: 'building', - backups: true, - }, - cifs: { - name: 'CIFS', - ipanel: 'CIFSInputPanel', - faIcon: 'building', - backups: true, - }, - glusterfs: { - name: 'GlusterFS', - ipanel: 'GlusterFsInputPanel', - faIcon: 'building', - backups: true, - }, - iscsi: { - name: 'iSCSI', - ipanel: 'IScsiInputPanel', - faIcon: 'building', - backups: false, - }, - cephfs: { - name: 'CephFS', - ipanel: 'CephFSInputPanel', - faIcon: 'building', - backups: true, - }, - pvecephfs: { - name: 'CephFS (PVE)', - ipanel: 'CephFSInputPanel', - hideAdd: true, - faIcon: 'building', - backups: true, - }, - rbd: { - name: 'RBD', - ipanel: 'RBDInputPanel', - faIcon: 'building', - backups: false, - }, - pveceph: { - name: 'RBD (PVE)', - ipanel: 'RBDInputPanel', - hideAdd: true, - faIcon: 'building', - backups: false, - }, - zfs: { - name: 'ZFS over iSCSI', - ipanel: 'ZFSInputPanel', - faIcon: 'building', - backups: false, - }, - zfspool: { - name: 'ZFS', - ipanel: 'ZFSPoolInputPanel', - faIcon: 'folder', - backups: false, - }, - pbs: { - name: 'Proxmox Backup Server', - ipanel: 'PBSInputPanel', - faIcon: 'floppy-o', - backups: true, - }, - drbd: { - name: 'DRBD', - hideAdd: true, - backups: false, - }, - }, - sdnvnetSchema: { vnet: { name: 'vnet', @@ -998,7 +898,7 @@ Ext.define('PVE.Utils', { value = !record || record.get('monhost') ? 'cephfs' : 'pvecephfs'; } - var schema = PVE.Utils.storageSchema[value]; + var schema = PVE.Schema.storageTypes[value]; if (schema) { return schema.name; } diff --git a/www/manager6/dc/StorageView.js b/www/manager6/dc/StorageView.js index c6417ee7..4f44ad05 100644 --- a/www/manager6/dc/StorageView.js +++ b/www/manager6/dc/StorageView.js @@ -9,7 +9,7 @@ Ext.define('PVE.dc.StorageView', { stateId: 'grid-dc-storage', createStorageEditWindow: function(type, sid) { - let schema = PVE.Utils.storageSchema[type]; + let schema = PVE.Schema.storageTypes[type]; if (!schema || !schema.ipanel) { throw "no editor registered for storage type: " + type; } @@ -69,7 +69,7 @@ Ext.define('PVE.dc.StorageView', { return function() { me.createStorageEditWindow(type); }; }; let addMenuItems = []; - for (const [type, storage] of Object.entries(PVE.Utils.storageSchema)) { + for (const [type, storage] of Object.entries(PVE.Schema.storageTypes)) { if (storage.hideAdd) { continue; } -- 2.30.2