--- /dev/null
+Ext.define('PBS.admin.Directorylist', {
+ extend: 'Ext.grid.Panel',
+ xtype: 'pbsDirectoryList',
+
+ stateful: true,
+ stateId: 'grid-node-directory',
+
+ emptyText: gettext('No Mount-Units found'),
+
+ controller: {
+ xclass: 'Ext.app.ViewController',
+
+ createDirectory: function() {
+ let me = this;
+ Ext.create('PBS.window.CreateDirectory', {
+ listeners: {
+ destroy: function() {
+ me.reload();
+ },
+ },
+ }).show();
+ },
+
+ reload: function() {
+ let me = this;
+ let store = me.getView().getStore();
+ store.load();
+ store.sort();
+ },
+
+ init: function(view) {
+ let me = this;
+ Proxmox.Utils.monStoreErrors(view, view.getStore(), true);
+ me.reload();
+ },
+ },
+
+
+ rootVisible: false,
+ useArrows: true,
+
+ tbar: [
+ {
+ text: gettext('Reload'),
+ iconCls: 'fa fa-refresh',
+ handler: 'reload',
+ },
+ {
+ text: gettext('Create') + ': Directory',
+ handler: 'createDirectory',
+ },
+ ],
+
+ columns: [
+ {
+ text: gettext('Path'),
+ dataIndex: 'path',
+ flex: 1,
+ },
+ {
+ header: gettext('Device'),
+ flex: 1,
+ dataIndex: 'device',
+ },
+ {
+ header: gettext('Filesystem'),
+ width: 100,
+ dataIndex: 'filesystem',
+ },
+ {
+ header: gettext('Options'),
+ width: 100,
+ dataIndex: 'options',
+ },
+ {
+ header: gettext('Unit File'),
+ hidden: true,
+ dataIndex: 'unitfile',
+ },
+ ],
+
+ store: {
+ fields: ['path', 'device', 'filesystem', 'options', 'unitfile'],
+ proxy: {
+ type: 'proxmox',
+ url: '/api2/json/nodes/localhost/disks/directory',
+ },
+ sorters: 'path',
+ },
+});
window/SyncJobEdit.js \
window/ACLEdit.js \
window/DataStoreEdit.js \
+ window/CreateDirectory.js \
dashboard/DataStoreStatistics.js \
dashboard/LongestTasks.js \
dashboard/RunningTasks.js \
dashboard/TaskSummary.js \
Utils.js \
+ DirectoryList.js \
LoginView.js \
VersionInfo.js \
SystemConfiguration.js \
text: gettext('Administration'),
iconCls: 'fa fa-wrench',
path: 'pbsServerAdministration',
- leaf: true
+ expanded: true,
+ leaf: false,
+ children: [
+ {
+ text: gettext('Disks'),
+ iconCls: 'fa fa-hdd-o',
+ path: 'pmxDiskList',
+ leaf: false,
+ children: [
+ {
+ text: Proxmox.Utils.directoryText,
+ iconCls: 'fa fa-folder',
+ path: 'pbsDirectoryList',
+ leaf: true,
+ },
+ ]
+ }
+ ]
},
{
text: gettext('Data Store'),
--- /dev/null
+Ext.define('PBS.window.CreateDirectory', {
+ extend: 'Proxmox.window.Edit',
+ xtype: 'pbsCreateDirectory',
+
+ subject: Proxmox.Utils.directoryText,
+ showProgress: true,
+ isCreate: true,
+ url: '/nodes/localhost/disks/directory',
+ method: 'POST',
+
+ items: [
+ {
+ xtype: 'pmxDiskSelector',
+ name: 'disk',
+ valueField: 'name',
+ typeProperty: 'usage-type',
+ nodename: 'localhost',
+ diskType: 'unused',
+ fieldLabel: gettext('Disk'),
+ allowBlank: false,
+ },
+ {
+ xtype: 'proxmoxKVComboBox',
+ comboItems: [
+ ['ext4', 'ext4'],
+ ['xfs', 'xfs'],
+ ],
+ fieldLabel: gettext('Filesystem'),
+ name: 'filesystem',
+ value: '',
+ allowBlank: false,
+ },
+ {
+ xtype: 'proxmoxtextfield',
+ name: 'name',
+ fieldLabel: gettext('Name'),
+ allowBlank: false,
+ },
+ {
+ xtype: 'proxmoxcheckbox',
+ name: 'add-datastore',
+ fieldLabel: gettext('Add Data Store'),
+ value: '1',
+ },
+ ],
+});
+