-/*global Proxmox*/
Ext.define('PBS.Application', {
extend: 'Ext.app.Application',
appProperty: 'app',
stores: [
- 'NavigationStore'
+ 'NavigationStore',
],
layout: 'fit',
PBS.view = view;
me.view = view;
- if (me.currentView != undefined) {
+ if (me.currentView !== undefined) {
me.currentView.destroy();
}
} else {
me.changeView('mainview', true);
}
- }
+ },
});
Ext.application('PBS.Application');
{
name: 'backup-time',
type: 'date',
- dateFormat: 'timestamp'
+ dateFormat: 'timestamp',
},
- ]
+ ],
});
Ext.define('PBS.DataStorePruneInputPanel', {
method: "POST",
params: params,
callback: function() {
- return; // for easy breakpoint setting
+ // for easy breakpoint setting
},
- failure: function (response, opts) {
+ failure: function(response, opts) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
},
success: function(response, options) {
var data = response.result.data;
view.prune_store.setData(data);
- }
+ },
});
},
control: {
- field: { change: 'reload' }
- }
+ field: { change: 'reload' },
+ },
},
column1: [
allowBlank: true,
fieldLabel: gettext('keep-yearly'),
minValue: 1,
- }
+ },
],
- initComponent : function() {
+ initComponent: function() {
var me = this;
me.prune_store = Ext.create('Ext.data.Store', {
model: 'pbs-prune-list',
- sorters: { property: 'backup-time', direction: 'DESC' }
+ sorters: { property: 'backup-time', direction: 'DESC' },
});
me.column2 = [
},
{
text: "keep",
- dataIndex: 'keep'
- }
- ]
- }
+ dataIndex: 'keep',
+ },
+ ],
+ },
];
me.callParent();
- }
+ },
});
Ext.define('PBS.DataStorePrune', {
isCreate: true,
- initComponent : function() {
+ initComponent: function() {
var me = this;
if (!me.datastore) {
xtype: 'pbsDataStorePruneInputPanel',
url: '/api2/extjs/admin/datastore/' + me.datastore + "/prune",
backup_type: me.backup_type,
- backup_id: me.backup_id
- }]
+ backup_id: me.backup_id,
+ }],
});
me.callParent();
- }
+ },
});
return 0;
}
return (data.io_ticks*1000.0)/ios;
- }
+ },
},
- { type: 'date', dateFormat: 'timestamp', name: 'time' }
- ]
+ { type: 'date', dateFormat: 'timestamp', name: 'time' },
+ ],
});
Ext.define('PBS.DataStoreStatistic', {
throw "no datastore specified";
}
- me.tbar = [ '->', { xtype: 'proxmoxRRDTypeSelector' } ];
+ me.tbar = ['->', { xtype: 'proxmoxRRDTypeSelector' }];
var rrdstore = Ext.create('Proxmox.data.RRDStore', {
rrdurl: "/api2/json/admin/datastore/" + me.datastore + "/rrd",
- model: 'pve-rrd-datastore'
+ model: 'pve-rrd-datastore',
});
me.items = {
defaults: {
minHeight: 320,
padding: 5,
- columnWidth: 1
+ columnWidth: 1,
},
items: [
{
xtype: 'proxmoxRRDChart',
title: gettext('Storage usage (bytes)'),
- fields: ['total','used'],
+ fields: ['total', 'used'],
fieldTitles: [gettext('Total'), gettext('Storage usage')],
- store: rrdstore
+ store: rrdstore,
},
{
xtype: 'proxmoxRRDChart',
title: gettext('Transfer Rate (bytes/second)'),
- fields: ['read_bytes','write_bytes'],
+ fields: ['read_bytes', 'write_bytes'],
fieldTitles: [gettext('Read'), gettext('Write')],
- store: rrdstore
+ store: rrdstore,
},
{
xtype: 'proxmoxRRDChart',
title: gettext('Input/Output Operations per Second (IOPS)'),
- fields: ['read_ios','write_ios'],
+ fields: ['read_ios', 'write_ios'],
fieldTitles: [gettext('Read'), gettext('Write')],
- store: rrdstore
+ store: rrdstore,
},
{
xtype: 'proxmoxRRDChart',
title: gettext('IO Delay (ms)'),
fields: ['io_delay'],
fieldTitles: [gettext('IO Delay')],
- store: rrdstore
+ store: rrdstore,
},
- ]
+ ],
};
me.listeners = {
};
me.callParent();
- }
+ },
});
text: gettext('Dashboard'),
iconCls: 'fa fa-tachometer',
path: 'pbsDashboard',
- leaf: true
+ leaf: true,
},
{
text: gettext('Configuration'),
text: gettext('User Management'),
iconCls: 'fa fa-user',
path: 'pbsUserView',
- leaf: true
+ leaf: true,
},
{
text: gettext('Permissions'),
iconCls: 'fa fa-unlock',
path: 'pbsACLView',
- leaf: true
+ leaf: true,
},
{
text: gettext('Remotes'),
text: gettext('Subscription'),
iconCls: 'fa fa-support',
path: 'pbsSubscription',
- leaf: true
- }
- ]
+ leaf: true,
+ },
+ ],
},
{
text: gettext('Administration'),
path: 'pbsZFSList',
leaf: true,
},
- ]
- }
- ]
+ ],
+ },
+ ],
},
{
text: gettext('Datastore'),
iconCls: 'fa fa-archive',
path: 'pbsDataStoreConfig',
expanded: true,
- leaf: false
+ leaf: false,
},
- ]
- }
+ ],
+ },
});
Ext.define('PBS.view.main.NavigationTree', {
xclass: 'Ext.app.ViewController',
init: function(view) {
-
view.rstore = Ext.create('Proxmox.data.UpdateStore', {
autoStart: true,
interval: 15 * 1000,
storeId: 'pbs-datastore-list',
storeid: 'pbs-datastore-list',
- model: 'pbs-datastore-list'
+ model: 'pbs-datastore-list',
});
view.rstore.on('load', this.onLoad, this);
// FIXME: newly added always get appended to the end..
records.sort((a, b) => {
- if (a.id > b.id) return 1;
+ if (a.id > b.id) return 1;
if (a.id < b.id) return -1;
return 0;
});
var length = records.length;
var lookup_hash = {};
for (var i = 0; i < length; i++) {
- var name = records[i].id;
+ let name = records[i].id;
lookup_hash[name] = true;
if (!list.findChild('text', name, false)) {
list.appendChild({
text: name,
path: `DataStore-${name}`,
iconCls: 'fa fa-database',
- leaf: true
+ leaf: true,
});
}
}
var erase_list = [];
list.eachChild(function(node) {
- var name = node.data.text;
+ let name = node.data.text;
if (!lookup_hash[name]) {
erase_list.push(node);
}
});
Ext.Array.forEach(erase_list, function(node) { node.erase(); });
-
- }
+ },
},
select: function(path) {
expanderOnly: true,
expanderFirst: false,
store: 'NavigationStore',
- ui: 'nav'
+ ui: 'nav',
});