ui: eslint: fix various spacing related issues

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-01-19 17:39:15 +01:00
parent 9beb47513e
commit 8b520a2b6f
185 changed files with 639 additions and 760 deletions

View File

@ -1,7 +1,8 @@
// Some configuration values are complex strings -
// so we need parsers/generators for them.
Ext.define('PVE.Parser', { statics: {
Ext.define('PVE.Parser', {
statics: {
// this class only contains static functions
@ -155,7 +156,6 @@ Ext.define('PVE.Parser', { statics: {
},
printQemuNetwork: function(net) {
var netstr = net.model;
if (net.macaddr) {
netstr += "=" + net.macaddr;
@ -239,7 +239,6 @@ Ext.define('PVE.Parser', { statics: {
},
printQemuDrive: function(drive) {
var drivestr = drive.file;
Ext.Object.each(drive, function(key, value) {
@ -333,7 +332,7 @@ Ext.define('PVE.Parser', { statics: {
errors = true;
return false; // break
}
if (match_res[1] === 'bridge'){
if (match_res[1] === 'bridge') {
var bridgevlanf = match_res[2];
var bridge_res = bridgevlanf.match(/^(vmbr(\d+))(v(\d+))?(f)?$/);
if (!bridge_res) {
@ -368,18 +367,17 @@ Ext.define('PVE.Parser', { statics: {
var tmparray = [];
Ext.Array.each(['ifname', 'mac', 'bridge', 'host_ifname', 'host_mac', 'mac_filter', 'tag', 'firewall'], function(key) {
var value = data[key];
if (key === 'bridge'){
if(data.tag){
if (key === 'bridge') {
if (data.tag) {
value = value + 'v' + data.tag;
}
if (data.firewall){
if (data.firewall) {
value = value + 'f';
}
}
if (value) {
tmparray.push(key + '=' + value);
}
});
netarray.push(tmparray.join(','));
});
@ -544,7 +542,7 @@ Ext.define('PVE.Parser', { statics: {
},
parseQemuSmbios1: function(value) {
var res = value.split(',').reduce(function (accumulator, currentValue) {
var res = value.split(',').reduce(function(accumulator, currentValue) {
var splitted = currentValue.split(new RegExp("=(.+)"));
accumulator[splitted[0]] = splitted[1];
return accumulator;
@ -561,7 +559,6 @@ Ext.define('PVE.Parser', { statics: {
},
printQemuSmbios1: function(data) {
var datastr = '';
var base64 = false;
Ext.Object.each(data, function(key, value) {
@ -714,4 +711,5 @@ Ext.define('PVE.Parser', { statics: {
});
return [res, extradata];
},
}});
}
});

View File

@ -59,7 +59,7 @@ Ext.define('PVE.StateProvider', {
'ha-groups': 47,
'ha-resources': 46,
'ceph-log': 45,
'ceph-crushmap':44,
'ceph-crushmap': 44,
'ceph-pools': 43,
'ceph-osdtree': 42,
'ceph-disklist': 41,
@ -173,7 +173,7 @@ Ext.define('PVE.StateProvider', {
return ctoken;
},
constructor: function(config){
constructor: function(config) {
var me = this;
me.callParent([config]);
@ -184,7 +184,7 @@ Ext.define('PVE.StateProvider', {
//console.log("HC " + token);
if (!token) {
var res = window.confirm(gettext('Are you sure you want to navigate away from this page?'));
if (res){
if (res) {
// process text value and close...
Ext.History.back();
} else {
@ -213,7 +213,7 @@ Ext.define('PVE.StateProvider', {
Ext.History.on('change', history_change_cb);
},
get: function(name, defaultValue){
get: function(name, defaultValue) {
var me = this;
var data;
@ -230,7 +230,7 @@ Ext.define('PVE.StateProvider', {
return data;
},
clear: function(name){
clear: function(name) {
var me = this;
if (typeof me.UIState[name] != "undefined") {
@ -240,7 +240,7 @@ Ext.define('PVE.StateProvider', {
me.callParent(arguments);
},
set: function(name, value, fireevent){
set: function(name, value, fireevent) {
var me = this;
//console.log("SET " + name + " " + Ext.encode(value));

View File

@ -19,7 +19,8 @@ Ext.Ajax.defaultHeaders = {
'Accept': 'application/json',
};
Ext.define('PVE.Utils', { utilities: {
Ext.define('PVE.Utils', {
utilities: {
// this singleton contains miscellaneous utilities
@ -61,10 +62,10 @@ Ext.define('PVE.Utils', { utilities: {
{ desc: '2000', val: 'w2k' },
],
'Solaris Kernel': [
{ desc: '-', val: 'solaris'},
{ desc: '-', val: 'solaris' },
],
'Other': [
{ desc: '-', val: 'other'},
{ desc: '-', val: 'other' },
],
},
@ -78,7 +79,7 @@ Ext.define('PVE.Utils', { utilities: {
}
var icon = 'faded fa-question';
switch(state) {
switch (state) {
case 'good':
icon = 'good fa-check';
break;
@ -145,7 +146,7 @@ Ext.define('PVE.Utils', { utilities: {
if (av === undefined && bv === undefined) {
return 0;
} else if (av === undefined) {
} else if (av === undefined) {
return -1;
} else if (bv === undefined) {
return 1;
@ -155,7 +156,6 @@ Ext.define('PVE.Utils', { utilities: {
// else we need to look at the next parts
}
}
},
get_ceph_icon_html: function(health, fw) {
@ -168,11 +168,11 @@ Ext.define('PVE.Utils', { utilities: {
},
map_ceph_health: {
'HEALTH_OK':'good',
'HEALTH_UPGRADE':'upgrade',
'HEALTH_OLD':'old',
'HEALTH_WARN':'warning',
'HEALTH_ERR':'critical',
'HEALTH_OK': 'good',
'HEALTH_UPGRADE': 'upgrade',
'HEALTH_OLD': 'old',
'HEALTH_WARN': 'warning',
'HEALTH_ERR': 'critical',
},
render_ceph_health: function(healthObj) {
@ -194,7 +194,7 @@ Ext.define('PVE.Utils', { utilities: {
},
render_zfs_health: function(value) {
if (typeof value == 'undefined'){
if (typeof value == 'undefined') {
return "";
}
var iconCls = 'question-circle';
@ -216,7 +216,6 @@ Ext.define('PVE.Utils', { utilities: {
}
return '<i class="fa fa-' + iconCls + '"></i> ' + value;
},
render_pbs_fingerprint: fp => fp.substring(0, 23),
@ -239,7 +238,7 @@ Ext.define('PVE.Utils', { utilities: {
if (v === undefined || v === null) {
return i('question-circle-o warning', gettext('None'));
}
let tip = ""
let tip = "";
let txt = gettext('Failed');
let iconCls = 'times critical';
if (v.state === 'ok') {
@ -286,7 +285,7 @@ Ext.define('PVE.Utils', { utilities: {
var dows = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
var selected = [];
var cur = -1;
val.split(',').forEach(function(day){
val.split(',').forEach(function(day) {
cur++;
var dow = (dows.indexOf(day)+6)%7;
if (cur === dow) {
@ -365,7 +364,7 @@ Ext.define('PVE.Utils', { utilities: {
return info;
},
render_kvm_ostype: function (value) {
render_kvm_ostype: function(value) {
var osinfo = PVE.Utils.get_kvm_osinfo(value);
if (osinfo.desc && osinfo.desc !== '-') {
return osinfo.base + ' ' + osinfo.desc;
@ -374,7 +373,7 @@ Ext.define('PVE.Utils', { utilities: {
}
},
render_hotplug_features: function (value) {
render_hotplug_features: function(value) {
var fa = [];
if (!value || (value === '0')) {
@ -413,7 +412,7 @@ Ext.define('PVE.Utils', { utilities: {
render_qga_features: function(value) {
if (!value) {
return Proxmox.Utils.defaultText + ' (' + Proxmox.Utils.disabledText + ')';
return Proxmox.Utils.defaultText + ' (' + Proxmox.Utils.disabledText + ')';
}
var props = PVE.Parser.parsePropertyString(value, 'enabled');
if (!PVE.Parser.parseBoolean(props.enabled)) {
@ -424,7 +423,7 @@ Ext.define('PVE.Utils', { utilities: {
var agentstring = Proxmox.Utils.enabledText;
Ext.Object.each(props, function(key, value) {
var keystring = '' ;
var keystring = '';
agentstring += ', ' + key + ': ';
if (key === 'type') {
@ -562,7 +561,7 @@ Ext.define('PVE.Utils', { utilities: {
none: Proxmox.Utils.noneText,
},
render_kvm_language: function (value) {
render_kvm_language: function(value) {
if (!value || value === '__default__') {
return Proxmox.Utils.defaultText;
}
@ -603,7 +602,7 @@ Ext.define('PVE.Utils', { utilities: {
});
},
render_kvm_vga_driver: function (value) {
render_kvm_vga_driver: function(value) {
if (!value) {
return Proxmox.Utils.defaultText;
}
@ -898,7 +897,7 @@ Ext.define('PVE.Utils', { utilities: {
if (value.managed) {
text = value.state || Proxmox.Utils.noneText;
text += ', ' + Proxmox.Utils.groupText + ': ';
text += ', ' + Proxmox.Utils.groupText + ': ';
text += value.group || Proxmox.Utils.noneText;
}
@ -923,12 +922,11 @@ Ext.define('PVE.Utils', { utilities: {
return data.volid.replace(/^.*?:(.*?\/)?/, '');
},
render_serverity: function (value) {
render_serverity: function(value) {
return PVE.Utils.log_severity_hash[value] || value;
},
render_cpu: function(value, metaData, record, rowIndex, colIndex, store) {
if (!(record.data.uptime && Ext.isNumeric(value))) {
return '';
}
@ -945,7 +943,6 @@ Ext.define('PVE.Utils', { utilities: {
},
render_size: function(value, metaData, record, rowIndex, colIndex, store) {
if (!Ext.isNumeric(value)) {
return '';
}
@ -979,7 +976,7 @@ Ext.define('PVE.Utils', { utilities: {
if (!Ext.isNumeric(value) || value === -1) {
return '';
}
if (value > 1 ) {
if (value > 1) {
// we got no percentage but bytes
var mem = value;
var maxmem = record.data.maxmem;
@ -995,7 +992,6 @@ Ext.define('PVE.Utils', { utilities: {
},
render_mem_usage: function(value, metaData, record, rowIndex, colIndex, store) {
var mem = value;
var maxmem = record.data.maxmem;
@ -1011,7 +1007,6 @@ Ext.define('PVE.Utils', { utilities: {
},
calculate_disk_usage: function(data) {
if (!Ext.isNumeric(data.disk) ||
data.type === 'qemu' ||
(data.type === 'lxc' && data.uptime === 0) ||
@ -1031,7 +1026,6 @@ Ext.define('PVE.Utils', { utilities: {
},
render_disk_usage: function(value, metaData, record, rowIndex, colIndex, store) {
var disk = value;
var maxdisk = record.data.maxdisk;
var type = record.data.type;
@ -1076,10 +1070,9 @@ Ext.define('PVE.Utils', { utilities: {
},
render_resource_type: function(value, metaData, record, rowIndex, colIndex, store) {
var cls = PVE.Utils.get_object_icon_class(value, record.data);
var fa = '<i class="fa-fw x-grid-icon-custom ' + cls + '"></i> ';
var fa = '<i class="fa-fw x-grid-icon-custom ' + cls + '"></i> ';
return fa + value;
},
@ -1159,7 +1152,7 @@ Ext.define('PVE.Utils', { utilities: {
'4': gettext('Device Ineligible'),
'5': gettext('Timeout'),
};
return "U2F Error: " + ErrorNames[error] || Proxmox.Utils.unknownText;
return "U2F Error: " + ErrorNames[error] || Proxmox.Utils.unknownText;
},
windowHostname: function() {
@ -1207,7 +1200,6 @@ Ext.define('PVE.Utils', { utilities: {
},
defaultViewer: function(consoles) {
var allowSpice, allowXtermjs;
if (consoles === true) {
@ -1248,13 +1240,12 @@ Ext.define('PVE.Utils', { utilities: {
}
},
openSpiceViewer: function(url, params){
openSpiceViewer: function(url, params) {
var downloadWithName = function(uri, name) {
var link = Ext.DomHelper.append(document.body, {
tag: 'a',
href: uri,
css : 'display:none;visibility:hidden;height:0px;',
css: 'display:none;visibility:hidden;height:0px;',
});
// Note: we need to tell android the correct file name extension
@ -1278,10 +1269,10 @@ Ext.define('PVE.Utils', { utilities: {
url: url,
params: params,
method: 'POST',
failure: function(response, opts){
failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
},
success: function(response, opts){
success: function(response, opts) {
var raw = "[virt-viewer]\n";
Ext.Object.each(response.result.data, function(k, v) {
raw += k + "=" + v + "\n";
@ -1321,7 +1312,6 @@ Ext.define('PVE.Utils', { utilities: {
// test automation helper
call_menu_handler: function(menu, text) {
var list = menu.query('menuitem');
Ext.Array.each(list, function(item) {
@ -1433,7 +1423,7 @@ Ext.define('PVE.Utils', { utilities: {
if (Ext.isArray(types)) {
busses = types;
} else if (Ext.isDefined(types)) {
busses = [ types ];
busses = [types];
}
// check if we only have valid busses
@ -1479,7 +1469,7 @@ Ext.define('PVE.Utils', { utilities: {
hardware_counts: { net: 32, usb: 5, hostpci: 16, audio: 1, efidisk: 1, serial: 4, rng: 1 },
cleanEmptyObjectKeys: function (obj) {
cleanEmptyObjectKeys: function(obj) {
var propName;
for (propName in obj) {
if (obj.hasOwnProperty(propName)) {
@ -1497,26 +1487,20 @@ Ext.define('PVE.Utils', { utilities: {
acme.domains = [domain];
} else {
acme.domains.push(domain);
acme.domains = acme.domains.filter((value, index, self) => {
return self.indexOf(value) === index;
});
acme.domains = acme.domains.filter((value, index, self) => self.indexOf(value) === index);
}
return acme;
},
remove_domain_from_acme: function(acme, domain) {
if (acme.domains !== undefined) {
acme.domains = acme.domains.filter((value, index, self) => {
return self.indexOf(value) === index && value !== domain;
});
acme.domains = acme.domains.filter((value, index, self) => self.indexOf(value) === index && value !== domain);
}
return acme;
},
handleStoreErrorOrMask: function(me, store, regex, callback) {
me.mon(store, 'load', function (proxy, response, success, operation) {
me.mon(store, 'load', function(proxy, response, success, operation) {
if (success) {
Proxmox.Utils.setErrorMask(me, false);
return;
@ -1537,12 +1521,12 @@ Ext.define('PVE.Utils', { utilities: {
});
},
showCephInstallOrMask: function(container, msg, nodename, callback){
showCephInstallOrMask: function(container, msg, nodename, callback) {
var regex = new RegExp("not (installed|initialized)", "i");
if (msg.match(regex)) {
if (Proxmox.UserName === 'root@pam') {
container.el.mask();
if (!container.down('pveCephInstallWindow')){
if (!container.down('pveCephInstallWindow')) {
var isInstalled = msg.match(/not initialized/i) ? true : false;
var win = Ext.create('PVE.ceph.Install', {
nodename: nodename,

View File

@ -29,7 +29,7 @@ Ext.define('PVE.noVncConsole', {
// always use same iframe, to avoid running several noVnc clients
// at same time (to avoid performance problems)
var box = Ext.create('Ext.ux.IFrame', { itemid : "vncconsole" });
var box = Ext.create('Ext.ux.IFrame', { itemid: "vncconsole" });
var type = me.xtermjs ? 'xtermjs' : 'novnc';
Ext.apply(me, {

View File

@ -55,7 +55,7 @@ Ext.define('PVE.Workspace', {
me.login.show();
},
initComponent : function() {
initComponent: function() {
var me = this;
Ext.tip.QuickTipManager.init();
@ -104,7 +104,6 @@ Ext.define('PVE.Workspace', {
},
interval: 15*60*1000,
});
},
});
@ -129,13 +128,12 @@ Ext.define('PVE.StdWorkspace', {
cont.add(comp);
if (cur !== null && lay.getNext()) {
lay.next();
var task = Ext.create('Ext.util.DelayedTask', function(){
var task = Ext.create('Ext.util.DelayedTask', function() {
cont.remove(cur);
});
task.delay(10);
}
}
else {
} else {
// helper for cleaning the content when logging out
cont.removeAll();
}
@ -202,7 +200,7 @@ Ext.define('PVE.StdWorkspace', {
ui.updateLayout();
},
initComponent : function() {
initComponent: function() {
var me = this;
Ext.History.init();
@ -432,7 +430,7 @@ Ext.define('PVE.StdWorkspace', {
margin: '0 0 0 5',
split: true,
width: 200,
items: [ selview, rtree ],
items: [selview, rtree],
listeners: {
resize: function(panel, width, height) {
var viewWidth = me.getSize().width;
@ -448,12 +446,12 @@ Ext.define('PVE.StdWorkspace', {
stateId: 'pvesouth',
itemId: 'south',
region: 'south',
margin:'0 5 5 5',
margin: '0 5 5 5',
title: gettext('Logs'),
collapsible: true,
header: false,
height: 200,
split:true,
split: true,
listeners: {
resize: function(panel, width, height) {
var viewHeight = me.getSize().height;
@ -471,10 +469,10 @@ Ext.define('PVE.StdWorkspace', {
me.updateUserInfo();
// on resize, center all modal windows
Ext.on('resize', function(){
Ext.on('resize', function() {
var wins = Ext.ComponentQuery.query('window[modal]');
if (wins.length > 0) {
wins.forEach(function(win){
wins.forEach(function(win) {
win.alignTo(me, 'c-c');
});
}

View File

@ -19,14 +19,14 @@ Ext.define('PVE.button.ConsoleButton', {
text: gettext('Console'),
setEnableSpice: function(enable){
setEnableSpice: function(enable) {
var me = this;
me.enableSpice = enable;
me.down('#spicemenu').setDisabled(!enable);
},
setEnableXtermJS: function(enable){
setEnableXtermJS: function(enable) {
var me = this;
me.enableXtermjs = enable;
@ -45,7 +45,7 @@ Ext.define('PVE.button.ConsoleButton', {
menu: [
{
xtype:'menuitem',
xtype: 'menuitem',
text: 'noVNC',
iconCls: 'pve-itype-icon-novnc',
type: 'html5',

View File

@ -20,7 +20,7 @@ Ext.define('PVE.button.PendingRevert', {
if (!rec) return;
let rowdef = view.rows[rec.data.key] || {};
let keys = rowdef.multiKey || [ rec.data.key ];
let keys = rowdef.multiKey || [rec.data.key];
Proxmox.Utils.API2Request({
url: this.apiurl || view.editorConfig.url,

View File

@ -55,7 +55,6 @@ Ext.define('PVE.button.Split', {
},
initComponent: function() {
var me = this;
if (me.handler) {
@ -73,7 +72,7 @@ Ext.define('PVE.button.Split', {
if (item.selModel) {
me.mon(item.selModel, "selectionchange", function() {
var rec = item.selModel.getSelection()[0];
if (!rec || (item.enableFn(rec) === false )) {
if (!rec || (item.enableFn(rec) === false)) {
item.setDisabled(true);
} else {
item.setDisabled(false);
@ -86,7 +85,6 @@ Ext.define('PVE.button.Split', {
me.callParent();
if (me.selModel) {
me.mon(me.selModel, "selectionchange", function() {
var rec = me.selModel.getSelection()[0];
if (!rec || (me.enableFn(rec) === false)) {

View File

@ -49,8 +49,8 @@ Ext.define('PVE.ceph.CephVersionSelector', {
},
},
data: [
{release: "nautilus", version: "14.2"},
{release: "octopus", version: "15.2"},
{ release: "nautilus", version: "14.2" },
{ release: "octopus", version: "15.2" },
//{release: "pacific", version: "16.1"},
],
},
@ -163,7 +163,7 @@ Ext.define('PVE.ceph.CephInstallWizard', {
tp.setActiveTab(ntab);
}
},
setInitialTab: function (index) {
setInitialTab: function(index) {
var tp = this.down('#wizcontent');
var initialTab = tp.items.getAt(index);
initialTab.enable();
@ -203,7 +203,7 @@ Ext.define('PVE.ceph.CephInstallWizard', {
{
xtype: 'pveCephHighestVersionDisplay',
labelWidth: 180,
cbind:{
cbind: {
nodename: '{nodename}',
},
gotNewestVersion: function(release, maxversiontext, maxversion) {
@ -256,7 +256,7 @@ Ext.define('PVE.ceph.CephInstallWizard', {
title: gettext('Installation'),
xtype: 'panel',
layout: 'fit',
cbind:{
cbind: {
nodename: '{nodename}',
},
viewModel: {}, // needed to inherit parent viewModel data
@ -281,7 +281,6 @@ Ext.define('PVE.ceph.CephInstallWizard', {
},
listeners: {
load: function(rec, response, success, operation) {
if (success) {
me.updateStore.stopUpdate();
me.down('textfield').setValue('success');
@ -485,7 +484,6 @@ Ext.define('PVE.ceph.CephInstallWizard', {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
},
});
} else {
me.up('pveCephInstallWizard').navigateNext();
}
@ -513,7 +511,7 @@ Ext.define('PVE.ceph.CephInstallWizard', {
var tp = this.up('#wizcontent');
var idx = tp.items.indexOf(this)-1;
for(;idx >= 0;idx--) {
for (;idx >= 0; idx--) {
var nc = tp.items.getAt(idx);
if (nc) {
nc.disable();

View File

@ -79,13 +79,12 @@ Ext.define('PVE.node.CephConfig', {
me.update(gettext('Error') + " " + response.htmlStatus);
var msg = response.htmlStatus;
PVE.Utils.showCephInstallOrMask(me.ownerCt, msg, me.pveSelNode.data.node,
function(win){
me.mon(win, 'cephInstallWindowClosed', function(){
function(win) {
me.mon(win, 'cephInstallWindowClosed', function() {
me.load();
});
},
);
},
success: function(response, opts) {
var data = response.result.data;

View File

@ -17,8 +17,8 @@ Ext.define('PVE.node.CephCrushMap', {
me.update(gettext('Error') + " " + response.htmlStatus);
var msg = response.htmlStatus;
PVE.Utils.showCephInstallOrMask(me.ownerCt, msg, me.pveSelNode.data.node,
function(win){
me.mon(win, 'cephInstallWindowClosed', function(){
function(win) {
me.mon(win, 'cephInstallWindowClosed', function() {
me.load();
});
},

View File

@ -55,7 +55,7 @@ Ext.define('PVE.CephCreateFS', {
},
],
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.nodename) {
@ -124,11 +124,11 @@ Ext.define('PVE.NodeCephFSPanel', {
},
}));
var regex = new RegExp("not (installed|initialized)", "i");
PVE.Utils.handleStoreErrorOrMask(view, view.rstore, regex, function(me, error){
PVE.Utils.handleStoreErrorOrMask(view, view.rstore, regex, function(me, error) {
me.rstore.stopUpdate();
PVE.Utils.showCephInstallOrMask(me.ownerCt, error.statusText, view.nodename,
function(win){
me.mon(win, 'cephInstallWindowClosed', function(){
function(win) {
me.mon(win, 'cephInstallWindowClosed', function() {
me.rstore.startUpdate();
});
},
@ -214,7 +214,7 @@ Ext.define('PVE.NodeCephFSPanel', {
}, function() {
Ext.define('pve-ceph-fs', {
extend: 'Ext.data.Model',
fields: [ 'name', 'data_pool', 'metadata_pool' ],
fields: ['name', 'data_pool', 'metadata_pool'],
proxy: {
type: 'proxmox',
url: "/api2/json/nodes/localhost/ceph/fs",

View File

@ -8,8 +8,8 @@ Ext.define('PVE.ceph.Log', {
var me = this;
var msg = response.htmlStatus;
var windowShow = PVE.Utils.showCephInstallOrMask(me, msg, me.nodename,
function(win){
me.mon(win, 'cephInstallWindowClosed', function(){
function(win) {
me.mon(win, 'cephInstallWindowClosed', function() {
me.loadTask.delay(200);
});
},

View File

@ -2,7 +2,7 @@ Ext.define('PVE.node.CephMonMgrList', {
extend: 'Ext.container.Container',
xtype: 'pveNodeCephMonMgr',
mixins: ['Proxmox.Mixin.CBind' ],
mixins: ['Proxmox.Mixin.CBind'],
onlineHelp: 'chapter_pveceph',

View File

@ -73,7 +73,7 @@ Ext.define('PVE.CephCreatePool', {
},
},
],
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.nodename) {
@ -101,7 +101,7 @@ Ext.define('PVE.node.CephPoolList', {
stateId: 'grid-ceph-pools',
bufferedRenderer: false,
features: [ { ftype: 'summary'} ],
features: [{ ftype: 'summary' }],
columns: [
{
@ -201,11 +201,11 @@ Ext.define('PVE.node.CephPoolList', {
var store = Ext.create('Proxmox.data.DiffStore', { rstore: rstore });
var regex = new RegExp("not (installed|initialized)", "i");
PVE.Utils.handleStoreErrorOrMask(me, rstore, regex, function(me, error){
PVE.Utils.handleStoreErrorOrMask(me, rstore, regex, function(me, error) {
me.store.rstore.stopUpdate();
PVE.Utils.showCephInstallOrMask(me, error.statusText, nodename,
function(win){
me.mon(win, 'cephInstallWindowClosed', function(){
function(win) {
me.mon(win, 'cephInstallWindowClosed', function() {
me.store.rstore.startUpdate();
});
},
@ -255,7 +255,7 @@ Ext.define('PVE.node.CephPoolList', {
Ext.apply(me, {
store: store,
selModel: sm,
tbar: [ create_btn, destroy_btn ],
tbar: [create_btn, destroy_btn],
listeners: {
activate: () => rstore.startUpdate(),
destroy: () => rstore.stopUpdate(),
@ -265,18 +265,17 @@ Ext.define('PVE.node.CephPoolList', {
me.callParent();
},
}, function() {
Ext.define('ceph-pool-list', {
extend: 'Ext.data.Model',
fields: [ 'pool_name',
{ name: 'pool', type: 'integer'},
{ name: 'size', type: 'integer'},
{ name: 'min_size', type: 'integer'},
{ name: 'pg_num', type: 'integer'},
{ name: 'bytes_used', type: 'integer'},
{ name: 'percent_used', type: 'number'},
{ name: 'crush_rule', type: 'integer'},
{ name: 'crush_rule_name', type: 'string'},
fields: ['pool_name',
{ name: 'pool', type: 'integer' },
{ name: 'size', type: 'integer' },
{ name: 'min_size', type: 'integer' },
{ name: 'pg_num', type: 'integer' },
{ name: 'bytes_used', type: 'integer' },
{ name: 'percent_used', type: 'number' },
{ name: 'crush_rule', type: 'integer' },
{ name: 'crush_rule_name', type: 'string' },
],
idProperty: 'pool_name',
});
@ -315,7 +314,7 @@ Ext.define('PVE.form.CephRuleSelector', {
me.callParent();
store.load({
callback: function(rec, op, success){
callback: function(rec, op, success) {
if (success && rec.length > 0) {
me.select(rec[0]);
}

View File

@ -30,7 +30,7 @@ Ext.define('PVE.CephCreateService', {
},
],
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.nodename) {
@ -159,8 +159,8 @@ Ext.define('PVE.node.CephServiceList', {
PVE.Utils.handleStoreErrorOrMask(view, view.rstore, regex, function(me, error) {
view.rstore.stopUpdate();
PVE.Utils.showCephInstallOrMask(view.ownerCt, error.statusText, view.nodename,
function(win){
me.mon(win, 'cephInstallWindowClosed', function(){
function(win) {
me.mon(win, 'cephInstallWindowClosed', function() {
view.rstore.startUpdate();
});
},
@ -206,7 +206,7 @@ Ext.define('PVE.node.CephServiceList', {
var view = this.getView();
var rec = view.getSelection()[0];
var servicename = 'ceph-' + view.type + '@' + rec.data.name;
var url = "/api2/extjs/nodes/" + rec.data.host + "/syslog?service=" + encodeURIComponent(servicename);
var url = "/api2/extjs/nodes/" + rec.data.host + "/syslog?service=" + encodeURIComponent(servicename);
var win = Ext.create('Ext.window.Window', {
title: gettext('Syslog') + ': ' + servicename,
modal: true,
@ -367,14 +367,15 @@ Ext.define('PVE.node.CephServiceList', {
},
}, function() {
Ext.define('ceph-service-list', {
extend: 'Ext.data.Model',
fields: [ 'addr', 'name', 'rank', 'host', 'quorum', 'state',
fields: ['addr', 'name', 'rank', 'host', 'quorum', 'state',
'ceph_version', 'ceph_version_short',
{ type: 'string', name: 'version', calculate: function(data) {
{
type: 'string', name: 'version', calculate: function(data) {
return PVE.Utils.parse_ceph_version(data);
} },
}
},
],
idProperty: 'name',
});

View File

@ -11,7 +11,7 @@ Ext.define('PVE.ceph.Services', {
defaults: {
xtype: 'box',
style: {
'text-align':'center',
'text-align': 'center',
},
},
@ -242,12 +242,12 @@ Ext.define('PVE.ceph.ServiceList', {
xtype: 'pveCephServiceList',
style: {
'text-align':'center',
'text-align': 'center',
},
defaults: {
xtype: 'box',
style: {
'text-align':'center',
'text-align': 'center',
},
},

View File

@ -390,11 +390,11 @@ Ext.define('PVE.node.CephStatus', {
me.writes = me.down('#writes');
var regex = new RegExp("not (installed|initialized)", "i");
PVE.Utils.handleStoreErrorOrMask(me, me.store, regex, function(me, error){
PVE.Utils.handleStoreErrorOrMask(me, me.store, regex, function(me, error) {
me.store.stopUpdate();
PVE.Utils.showCephInstallOrMask(me, error.statusText, (nodename || 'localhost'),
function(win){
me.mon(win, 'cephInstallWindowClosed', function(){
function(win) {
me.mon(win, 'cephInstallWindowClosed', function() {
me.store.startUpdate();
});
},

View File

@ -11,7 +11,7 @@ Ext.define('PVE.ceph.StatusDetail', {
defaults: {
xtype: 'box',
style: {
'text-align':'center',
'text-align': 'center',
},
},
@ -215,7 +215,7 @@ Ext.define('PVE.ceph.StatusDetail', {
// update PGs sorted
var pgmap = status.pgmap || {};
var pgs_by_state = pgmap.pgs_by_state || [];
pgs_by_state.sort(function(a, b){
pgs_by_state.sort(function(a, b) {
return (a.state_name < b.state_name)?-1:(a.state_name === b.state_name)?0:1;
});
@ -241,7 +241,7 @@ Ext.define('PVE.ceph.StatusDetail', {
});
me.getComponent('pgchart').getStore().setData(me.statecategories);
me.getComponent('pgs').update({states: pgs_by_state});
me.getComponent('pgs').update({ states: pgs_by_state });
var downinregex = /(\d+) osds down/;
var downin_osds = 0;

View File

@ -15,7 +15,7 @@ Ext.define('PVE.data.ResourceStore', {
var nodes = [];
me.each(function(record) {
if (record.get('type') == "node") {
nodes.push( record.getData() );
nodes.push(record.getData());
}
});
@ -282,7 +282,7 @@ Ext.define('PVE.data.ResourceStore', {
var fields = [];
var fieldNames = [];
Ext.Object.each(field_defaults, function(key, value) {
var field = {name: key, type: value.type};
var field = { name: key, type: value.type };
if (Ext.isDefined(value.convert)) {
field.convert = value.convert;
}

View File

@ -2,14 +2,14 @@ Ext.define('pve-rrd-node', {
extend: 'Ext.data.Model',
fields: [
{
name:'cpu',
name: 'cpu',
// percentage
convert: function(value) {
return value*100;
},
},
{
name:'iowait',
name: 'iowait',
// percentage
convert: function(value) {
return value*100;
@ -33,7 +33,7 @@ Ext.define('pve-rrd-guest', {
extend: 'Ext.data.Model',
fields: [
{
name:'cpu',
name: 'cpu',
// percentage
convert: function(value) {
return value*100;

View File

@ -4,8 +4,7 @@ Ext.define('PVE.dc.ACLAdd', {
url: '/access/acl',
method: 'PUT',
isAdd: true,
initComponent : function() {
initComponent: function() {
var me = this;
me.isCreate = true;
@ -68,7 +67,7 @@ Ext.define('PVE.dc.ACLAdd', {
});
Ext.apply(me, {
items: [ ipanel ],
items: [ipanel],
});
me.callParent();
@ -88,7 +87,7 @@ Ext.define('PVE.dc.ACLView', {
// use fixed path
path: undefined,
initComponent : function() {
initComponent: function() {
var me = this;
var store = Ext.create('Ext.data.Store', {
@ -187,7 +186,7 @@ Ext.define('PVE.dc.ACLView', {
callback: function() {
reload();
},
failure: function (response, opts) {
failure: function(response, opts) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
},
});
@ -258,7 +257,6 @@ Ext.define('PVE.dc.ACLView', {
me.callParent();
},
}, function() {
Ext.define('pve-acl', {
extend: 'Ext.data.Model',
fields: [
@ -269,5 +267,4 @@ Ext.define('PVE.dc.ACLView', {
},
],
});
});

View File

@ -4,7 +4,7 @@ Ext.define('PVE.dc.BackupEdit', {
defaultFocus: undefined,
initComponent : function() {
initComponent: function() {
var me = this;
me.isCreate = !me.jobid;
@ -25,7 +25,7 @@ Ext.define('PVE.dc.BackupEdit', {
});
// 'value' can be assigned a string or an array
var selModeField = Ext.create('Proxmox.form.KVComboBox', {
var selModeField = Ext.create('Proxmox.form.KVComboBox', {
xtype: 'proxmoxKVComboBox',
comboItems: [
['include', gettext('Include selected VMs')],
@ -146,7 +146,7 @@ Ext.define('PVE.dc.BackupEdit', {
allowBlank: true,
name: 'pool',
listeners: {
change: function( selpool, newValue, oldValue) {
change: function(selpool, newValue, oldValue) {
selectPoolMembers(newValue);
},
},
@ -242,7 +242,7 @@ Ext.define('PVE.dc.BackupEdit', {
var ipanel = Ext.create('Proxmox.panel.InputPanel', {
onlineHelp: 'chapter_vzdump',
column1: column1,
column2: column2,
column2: column2,
onGetValues: function(values) {
if (!values.node) {
if (!me.isCreate) {
@ -315,7 +315,6 @@ Ext.define('PVE.dc.BackupEdit', {
selPool.setVisible(true);
selPool.allowBlank = false;
selectPoolMembers(selPool.value);
} else {
selPool.setVisible(false);
selPool.allowBlank = true;
@ -337,7 +336,7 @@ Ext.define('PVE.dc.BackupEdit', {
var mode = selModeField.getValue();
if (mode === 'all') {
sm.selectAll(true);
} else if (mode === 'pool'){
} else if (mode === 'pool') {
selectPoolMembers(selPool.value);
} else {
update_vmid_selection(list, mode);
@ -350,7 +349,7 @@ Ext.define('PVE.dc.BackupEdit', {
subject: gettext("Backup Job"),
url: url,
method: method,
items: [ ipanel, vmgrid ],
items: [ipanel, vmgrid],
});
me.callParent();
@ -550,7 +549,8 @@ Ext.define('PVE.dc.BackupDiskTree', {
},
},
},
]},
]
},
});
me.callParent();
@ -570,7 +570,7 @@ Ext.define('PVE.dc.BackupInfo', {
name: 'node',
fieldLabel: gettext('Node'),
xtype: 'displayfield',
renderer: function (value) {
renderer: function(value) {
if (!value) {
return '-- ' + gettext('All') + ' --';
} else {
@ -615,7 +615,7 @@ Ext.define('PVE.dc.BackupInfo', {
name: 'mailnotification',
fieldLabel: gettext('Email notification'),
xtype: 'displayfield',
renderer: function (value) {
renderer: function(value) {
let msg;
switch (value) {
case 'always':
@ -637,7 +637,7 @@ Ext.define('PVE.dc.BackupInfo', {
name: 'mode',
fieldLabel: gettext('Mode'),
xtype: 'displayfield',
renderer: function (value) {
renderer: function(value) {
let msg;
switch (value) {
case 'snapshot':
@ -657,7 +657,7 @@ Ext.define('PVE.dc.BackupInfo', {
name: 'enabled',
fieldLabel: gettext('Enabled'),
xtype: 'displayfield',
renderer: function (value) {
renderer: function(value) {
if (PVE.Parser.parseBoolean(value.toString())) {
return gettext('Yes');
} else {
@ -805,7 +805,7 @@ Ext.define('PVE.dc.BackupView', {
allText: '-- ' + gettext('All') + ' --',
initComponent : function() {
initComponent: function() {
var me = this;
var store = new Ext.data.Store({
@ -818,7 +818,7 @@ Ext.define('PVE.dc.BackupView', {
var not_backed_store = new Ext.data.Store({
sorters: 'vmid',
proxy:{
proxy: {
type: 'proxmox',
url: 'api2/json/cluster/backupinfo/not_backed_up',
},
@ -856,7 +856,7 @@ Ext.define('PVE.dc.BackupView', {
var run_detail = function() {
let me = this;
let record = sm.getSelection()[0]
let record = sm.getSelection()[0];
if (!record) {
return;
}
@ -881,7 +881,7 @@ Ext.define('PVE.dc.BackupView', {
layout: 'fit',
title: gettext('Backup Details'),
items:[{
items: [{
xtype: 'panel',
region: 'center',
layout: {
@ -914,7 +914,7 @@ Ext.define('PVE.dc.BackupView', {
Ext.Msg.alert('Error', "Node '"+ jobNode +"' from backup job isn't online!");
return;
}
nodes = [ jobNode ];
nodes = [jobNode];
} else {
let unkownNodes = allNodes.filter(node => node.status !== 'online');
if (unkownNodes.length > 0)
@ -929,7 +929,7 @@ Ext.define('PVE.dc.BackupView', {
progressText: '0/' + jobTotalCount,
});
let postRequest = function () {
let postRequest = function() {
jobsStarted++;
Ext.Msg.updateProgress(jobsStarted / jobTotalCount, jobsStarted + '/' + jobTotalCount);
@ -945,7 +945,7 @@ Ext.define('PVE.dc.BackupView', {
url: '/nodes/' + node + '/vzdump',
method: 'POST',
params: job,
failure: function (response, opts) {
failure: function(response, opts) {
errors.push(node + ': ' + response.htmlStatus);
postRequest();
},
@ -969,7 +969,7 @@ Ext.define('PVE.dc.BackupView', {
layout: 'fit',
title: gettext('Guests without backup job'),
items:[{
items: [{
xtype: 'panel',
region: 'center',
layout: {
@ -1128,7 +1128,6 @@ Ext.define('PVE.dc.BackupView', {
me.callParent();
},
}, function() {
Ext.define('pve-cluster-backup', {
extend: 'Ext.data.Model',
fields: [

View File

@ -80,7 +80,7 @@ Ext.define('PVE.ClusterAdministration', {
vm.set('isInCluster', !!data.totem.cluster_name);
vm.set('nodelist', data.nodelist);
var nodeinfo = Ext.Array.findBy(data.nodelist, function (el) {
var nodeinfo = Ext.Array.findBy(data.nodelist, function(el) {
return el.name === data.preferred_node;
});

View File

@ -243,7 +243,6 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
linkEditor.setInfoText();
if (links.length == 1 && joinInfo.ring_addr !== undefined &&
joinInfo.ring_addr[0] === joinInfo.ipAddress) {
links[0].allowBlank = true;
links[0].emptyText = gettext("IP resolved by node's hostname");
}

View File

@ -77,7 +77,7 @@ Ext.define('PVE.form.CorosyncLinkEditorController', {
let deleteButtons = view.query('button[cls=removeLinkBtn]');
Ext.Array.each(deleteButtons, btn => {
btn.setDisabled(disabled);
})
});
},
getNextFreeNetwork: function() {
@ -122,7 +122,7 @@ Ext.define('PVE.form.CorosyncLinkSelector', {
extend: 'Ext.panel.Panel',
xtype: 'pveCorosyncLinkSelector',
mixins: ['Proxmox.Mixin.CBind' ],
mixins: ['Proxmox.Mixin.CBind'],
cbindData: [],
// config
@ -312,7 +312,7 @@ Ext.define('PVE.form.CorosyncLinkEditor', {
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
defaultButtonUI : 'default',
defaultButtonUI: 'default',
border: false,
padding: '6 0 6 0',
bind: {

View File

@ -2,7 +2,7 @@ Ext.define('PVE.dc.GroupEdit', {
extend: 'Proxmox.window.Edit',
alias: ['widget.pveDcGroupEdit'],
initComponent : function() {
initComponent: function() {
var me = this;
me.isCreate = !me.groupid;

View File

@ -8,7 +8,7 @@ Ext.define('PVE.dc.GroupView', {
stateful: true,
stateId: 'grid-groups',
initComponent : function() {
initComponent: function() {
var me = this;
var store = new Ext.data.Store({

View File

@ -20,8 +20,8 @@ Ext.define('PVE.dc.Guests', {
xtype: 'box',
padding: '0 50 0 50',
style: {
'text-align':'center',
'line-height':'1.2',
'text-align': 'center',
'line-height': '1.2',
},
},
items: [{
@ -117,6 +117,6 @@ Ext.define('PVE.dc.Guests', {
var me = this;
me.getComponent('qemu').update(qemu);
me.getComponent('lxc').update(lxc);
me.getComponent('error').update({num: error});
me.getComponent('error').update({ num: error });
},
});

View File

@ -15,7 +15,7 @@ Ext.define('PVE.dc.Health', {
flex: 1,
xtype: 'box',
style: {
'text-align':'center',
'text-align': 'center',
},
},
@ -46,7 +46,7 @@ Ext.define('PVE.dc.Health', {
var item = records[i];
if (item.data.type === 'node') {
nodes[item.data.online === 1 ? 'online':'offline']++;
} else if(item.data.type === 'cluster') {
} else if (item.data.type === 'cluster') {
cluster.text = gettext("Cluster") + ": ";
cluster.text += item.data.name + ", ";
cluster.text += gettext("Quorate") + ": ";
@ -71,7 +71,6 @@ Ext.define('PVE.dc.Health', {
var me = this;
var cephstatus = me.getComponent('ceph');
if (!success || records.length < 1) {
// if ceph status is already visible
// don't stop to update
if (cephstatus.isVisible()) {
@ -142,7 +141,7 @@ Ext.define('PVE.dc.Health', {
element: 'el',
click: function() {
var sp = Ext.state.Manager.getProvider();
sp.set('dctab', {value:'ceph'}, true);
sp.set('dctab', { value: 'ceph' }, true);
},
},
},

View File

@ -7,7 +7,7 @@ Ext.define('PVE.dc.Log', {
alias: ['widget.pveClusterLog'],
initComponent : function() {
initComponent: function() {
var me = this;
var logstore = Ext.create('Proxmox.data.UpdateStore', {

View File

@ -26,7 +26,7 @@ Ext.define('PVE.dc.NodeView', {
dataIndex: 'online',
renderer: function(value) {
var cls = (value)?'good':'critical';
return '<i class="fa ' + PVE.Utils.get_health_icon(cls) + '"><i/>';
return '<i class="fa ' + PVE.Utils.get_health_icon(cls) + '"><i/>';
},
},
{
@ -78,7 +78,7 @@ Ext.define('PVE.dc.NodeView', {
tools: [
{
type: 'up',
handler: function(){
handler: function() {
var me = this.up('grid');
var height = Math.max(me.getHeight()-50, 250);
me.setHeight(height);
@ -86,7 +86,7 @@ Ext.define('PVE.dc.NodeView', {
},
{
type: 'down',
handler: function(){
handler: function() {
var me = this.up('grid');
var height = me.getHeight()+50;
me.setHeight(height);
@ -94,13 +94,11 @@ Ext.define('PVE.dc.NodeView', {
},
],
}, function() {
Ext.define('pve-dc-nodes', {
extend: 'Ext.data.Model',
fields: [ 'id', 'type', 'name', 'nodeid', 'ip', 'level', 'local', 'online'],
fields: ['id', 'type', 'name', 'nodeid', 'ip', 'level', 'local', 'online'],
idProperty: 'id',
});
});
Ext.define('PVE.widget.ProgressBar', {
@ -112,7 +110,7 @@ Ext.define('PVE.widget.ProgressBar', {
'{percent}%',
],
setValue: function(value){
setValue: function(value) {
var me = this;
me.callParent([value]);

View File

@ -65,7 +65,7 @@ Ext.define('PVE.dc.OptionView', {
.join(',');
},
initComponent : function() {
initComponent: function() {
var me = this;
var caps = Ext.state.Manager.get('GuiCap');
@ -130,7 +130,7 @@ Ext.define('PVE.dc.OptionView', {
deleteEmpty: false,
value: '__default__',
comboItems: [
['__default__', Proxmox.Utils.defaultText + ' (conditional)' ],
['__default__', Proxmox.Utils.defaultText + ' (conditional)'],
['freeze', 'freeze'],
['failover', 'failover'],
['migrate', 'migrate'],

View File

@ -8,7 +8,7 @@ Ext.define('PVE.dc.PoolView', {
stateful: true,
stateId: 'grid-pools',
initComponent : function() {
initComponent: function() {
var me = this;
var store = new Ext.data.Store({
@ -28,7 +28,7 @@ Ext.define('PVE.dc.PoolView', {
var remove_btn = Ext.create('Proxmox.button.StdRemoveButton', {
selModel: sm,
baseurl: '/pools/',
callback: function () {
callback: function() {
reload();
},
});

View File

@ -4,7 +4,7 @@ Ext.define('PVE.dc.RoleEdit', {
width: 400,
initComponent : function() {
initComponent: function() {
var me = this;
me.isCreate = !me.roleid;

View File

@ -8,7 +8,7 @@ Ext.define('PVE.dc.RoleView', {
stateful: true,
stateId: 'grid-roles',
initComponent : function() {
initComponent: function() {
var me = this;
var store = new Ext.data.Store({
@ -20,7 +20,6 @@ Ext.define('PVE.dc.RoleView', {
});
var render_privs = function(value, metaData) {
if (!value) {
return '-';
}

View File

@ -1,7 +1,7 @@
Ext.define('pve-security-groups', {
extend: 'Ext.data.Model',
fields: [ 'group', 'comment', 'digest' ],
fields: ['group', 'comment', 'digest'],
idProperty: 'group',
});
@ -12,7 +12,7 @@ Ext.define('PVE.SecurityGroupEdit', {
allow_iface: false,
initComponent : function() {
initComponent: function() {
var me = this;
me.isCreate = (me.group_name === undefined);
@ -58,7 +58,7 @@ Ext.define('PVE.SecurityGroupEdit', {
Ext.apply(me, {
subject: subject,
items: [ ipanel ],
items: [ipanel],
});
me.callParent();
@ -161,7 +161,7 @@ Ext.define('PVE.SecurityGroupList', {
Ext.apply(me, {
store: store,
tbar: [ '<b>' + gettext('Group') + ':</b>', me.addBtn, me.removeBtn, me.editBtn ],
tbar: ['<b>' + gettext('Group') + ':</b>', me.addBtn, me.removeBtn, me.editBtn],
selModel: sm,
columns: [
{ header: gettext('Group'), dataIndex: 'group', width: '100' },
@ -214,7 +214,7 @@ Ext.define('PVE.SecurityGroups', {
Ext.apply(me, {
layout: 'border',
items: [ sglist, rule_panel ],
items: [sglist, rule_panel],
listeners: {
show: function() {
sglist.fireEvent('show', sglist);

View File

@ -26,7 +26,7 @@ Ext.define('PVE.dc.StorageView', {
});
},
initComponent : function() {
initComponent: function() {
var me = this;
var store = new Ext.data.Store({
@ -82,7 +82,7 @@ Ext.define('PVE.dc.StorageView', {
continue;
}
addMenuItems.push({
text: PVE.Utils.format_storage_type(type),
text: PVE.Utils.format_storage_type(type),
iconCls: 'fa fa-fw fa-' + storage.faIcon,
handler: addHandleGenerator(type),
});
@ -168,15 +168,13 @@ Ext.define('PVE.dc.StorageView', {
me.callParent();
},
}, function() {
Ext.define('pve-storage', {
extend: 'Ext.data.Model',
fields: [
'path', 'type', 'content', 'server', 'portal', 'target', 'export', 'storage',
{ name: 'shared', type: 'boolean'},
{ name: 'disable', type: 'boolean'},
{ name: 'shared', type: 'boolean' },
{ name: 'disable', type: 'boolean' },
],
idProperty: 'storage',
});
});

View File

@ -32,7 +32,7 @@ Ext.define('PVE.dc.Summary', {
xtype: 'proxmoxGauge',
flex: 1,
},
items:[
items: [
{
title: gettext('CPU'),
itemId: 'cpu',
@ -131,7 +131,7 @@ Ext.define('PVE.dc.Summary', {
var total = 0;
var usableStorages = {};
var storages = sp.get('dash-storages') || '';
storages.split(',').forEach(function(storage){
storages.split(',').forEach(function(storage) {
if (storage !== '') {
usableStorages[storage] = true;
}
@ -155,7 +155,7 @@ Ext.define('PVE.dc.Summary', {
for (i = 0; i < results.length; i++) {
var item = results[i];
switch(item.data.type) {
switch (item.data.type) {
case 'node':
cpu += (item.data.cpu * item.data.maxcpu);
maxcpu += item.data.maxcpu || 0;
@ -283,7 +283,7 @@ Ext.define('PVE.dc.Summary', {
subs.setData(data);
});
me.on('destroy', function(){
me.on('destroy', function() {
rstore.stopUpdate();
});

View File

@ -7,7 +7,7 @@ Ext.define('PVE.dc.Tasks', {
alias: ['widget.pveClusterTasks'],
initComponent : function() {
initComponent: function() {
var me = this;
var taskstore = Ext.create('Proxmox.data.UpdateStore', {
@ -25,11 +25,11 @@ Ext.define('PVE.dc.Tasks', {
appendAtStart: true,
sorters: [
{
property : 'pid',
property: 'pid',
direction: 'DESC',
},
{
property : 'starttime',
property: 'starttime',
direction: 'DESC',
},
],
@ -85,9 +85,9 @@ Ext.define('PVE.dc.Tasks', {
if (record.data.type == "vncproxy" ||
record.data.type == "vncshell" ||
record.data.type == "spiceproxy") {
metaData.tdCls = "x-grid-row-console";
metaData.tdCls = "x-grid-row-console";
} else {
metaData.tdCls = "x-grid-row-loading";
metaData.tdCls = "x-grid-row-loading";
}
return "";
}
@ -118,7 +118,7 @@ Ext.define('PVE.dc.Tasks', {
renderer: function(value, metaData, record) {
if (record.data.pid) {
if (record.data.type != "vncproxy") {
metaData.tdCls = "x-grid-row-loading";
metaData.tdCls = "x-grid-row-loading";
}
return "";
}

View File

@ -4,7 +4,7 @@ Ext.define('PVE.dc.UserEdit', {
isAdd: true,
initComponent : function() {
initComponent: function() {
var me = this;
me.isCreate = !me.userid;
@ -63,7 +63,6 @@ Ext.define('PVE.dc.UserEdit', {
verifypw.setVisible(false);
verifypw.setDisabled(true);
}
};
var column1 = [
@ -126,7 +125,7 @@ Ext.define('PVE.dc.UserEdit', {
matchFieldWidth: false,
listConfig: { width: 300 },
listeners: {
change: function(combo, newValue){
change: function(combo, newValue) {
realm = newValue;
update_passwd_field(realm);
},
@ -172,7 +171,7 @@ Ext.define('PVE.dc.UserEdit', {
fieldDefaults: {
labelWidth: 110, // for spanish translation
},
items: [ ipanel ],
items: [ipanel],
});
me.callParent();
@ -183,7 +182,7 @@ Ext.define('PVE.dc.UserEdit', {
var data = response.result.data;
me.setValues(data);
if (data.keys) {
if ( data.keys === 'x!oath' || data.keys === 'x!u2f' ) {
if (data.keys === 'x!oath' || data.keys === 'x!u2f') {
me.down('[name="keys"]').setDisabled(1);
}
}

View File

@ -8,7 +8,7 @@ Ext.define('PVE.dc.UserView', {
stateful: true,
stateId: 'grid-users',
initComponent : function() {
initComponent: function() {
var me = this;
var caps = Ext.state.Manager.get('GuiCap');

View File

@ -2,7 +2,7 @@ Ext.define('PVE.form.BandwidthField', {
extend: 'Ext.form.FieldContainer',
alias: 'widget.pveBandwidthField',
mixins: ['Proxmox.Mixin.CBind' ],
mixins: ['Proxmox.Mixin.CBind'],
viewModel: {
data: {
@ -67,7 +67,7 @@ Ext.define('PVE.form.BandwidthField', {
},
getSubmitValue: function() {
let v = this.processRawValue(this.getRawValue());
v = v.replace(this.decimalSeparator, '.')
v = v.replace(this.decimalSeparator, '.');
if (v === undefined) return null;
// FIXME: make it configurable, as this only works if 0 === default
@ -85,7 +85,7 @@ Ext.define('PVE.form.BandwidthField', {
listeners: {
// our setValue gets only called if we have a value, avoid
// transformation of the first user-entered value
keydown: function () { this._transformed = true; },
keydown: function() { this._transformed = true; },
},
},
{

View File

@ -5,11 +5,11 @@ Ext.define('PVE.form.BridgeSelector', {
bridgeType: 'any_bridge', // bridge, OVSBridge or any_bridge
store: {
fields: [ 'iface', 'active', 'type' ],
fields: ['iface', 'active', 'type'],
filterOnLoad: true,
sorters: [
{
property : 'iface',
property: 'iface',
direction: 'ASC',
},
],

View File

@ -1,10 +1,10 @@
Ext.define('PVE.data.CPUModel', {
extend: 'Ext.data.Model',
fields: [
{name: 'name'},
{name: 'vendor'},
{name: 'custom'},
{name: 'displayname'},
{ name: 'name' },
{ name: 'vendor' },
{ name: 'custom' },
{ name: 'displayname' },
],
});

View File

@ -9,14 +9,14 @@ Ext.define('PVE.form.CalendarEvent', {
queryMode: 'local',
store: {
field: [ 'value', 'text'],
field: ['value', 'text'],
data: [
{ value: '*/30', text: Ext.String.format(gettext("Every {0} minutes"), 30) },
{ value: '*/2:00', text: gettext("Every two hours")},
{ value: '2,22:30', text: gettext("Every day") + " 02:30, 22:30"},
{ value: 'mon..fri', text: gettext("Monday to Friday") + " 00:00"},
{ value: 'mon..fri */1:00', text: gettext("Monday to Friday") + ': ' + gettext("hourly")},
{ value: 'sun 01:00', text: gettext("Sunday") + " 01:00"},
{ value: '*/2:00', text: gettext("Every two hours") },
{ value: '2,22:30', text: gettext("Every day") + " 02:30, 22:30" },
{ value: 'mon..fri', text: gettext("Monday to Friday") + " 00:00" },
{ value: 'mon..fri */1:00', text: gettext("Monday to Friday") + ': ' + gettext("hourly") },
{ value: 'sun 01:00', text: gettext("Sunday") + " 01:00" },
],
},

View File

@ -31,7 +31,7 @@ Ext.define('PVE.form.CephPoolSelector', {
me.callParent();
store.load({
callback: function(rec, op, success){
callback: function(rec, op, success) {
if (success && rec.length > 0) {
me.select(rec[0]);
}

View File

@ -48,7 +48,7 @@ Ext.define('PVE.form.ControllerSelector', {
return;
}
clist = ['ide', 'scsi', 'sata'];
} else {
} else {
// in most cases we want to add a disk to the same controller
// we previously used
clist = me.sortByPreviousUsage(me.vmconfig, clist);

View File

@ -1,8 +1,8 @@
Ext.define('PVE.form.DayOfWeekSelector', {
extend: 'Proxmox.form.KVComboBox',
alias: ['widget.pveDayOfWeekSelector'],
comboItems:[],
initComponent: function(){
comboItems: [],
initComponent: function() {
var me = this;
me.comboItems = [
['mon', Ext.util.Format.htmlDecode(Ext.Date.dayNames[1])],

View File

@ -1,7 +1,7 @@
Ext.define('PVE.form.DiskFormatSelector', {
extend: 'Proxmox.form.KVComboBox',
alias: 'widget.pveDiskFormatSelector',
comboItems: [
comboItems: [
['raw', gettext('Raw disk image') + ' (raw)'],
['qcow2', gettext('QEMU image format') + ' (qcow2)'],
['vmdk', gettext('VMware image format') + ' (vmdk)'],

View File

@ -4,6 +4,6 @@ Ext.define('PVE.form.FirewallPolicySelector', {
comboItems: [
['ACCEPT', 'ACCEPT'],
['REJECT', 'REJECT'],
[ 'DROP', 'DROP'],
['DROP', 'DROP'],
],
});

View File

@ -28,11 +28,11 @@ Ext.define('PVE.form.GlobalSearchField', {
scrollable: {
xtype: 'scroller',
y: true,
x:false,
x: false,
},
store: {
model: 'PVEResources',
proxy:{
proxy: {
type: 'proxmox',
url: '/api2/extjs/cluster/resources',
},
@ -125,14 +125,14 @@ Ext.define('PVE.form.GlobalSearchField', {
//
// results gets sorted by points (descending)
fields = me.filterVal.split(/\s+/);
for(i = 0; i < fieldArr.length; i++) {
for (i = 0; i < fieldArr.length; i++) {
var v = item.data[fieldArr[i]];
if (v !== undefined) {
v = v.toString().toLowerCase();
for(j = 0; j < fields.length; j++) {
for (j = 0; j < fields.length; j++) {
if (v.indexOf(fields[j]) !== -1) {
match++;
if(v === fields[j]) {
if (v === fields[j]) {
match++;
}
}
@ -166,7 +166,7 @@ Ext.define('PVE.form.GlobalSearchField', {
var me = this;
var key = e.getKey();
switch(key) {
switch (key) {
case Ext.event.Event.ENTER:
// go to first entry if there is one
if (me.grid.store.getCount() > 0) {
@ -244,13 +244,13 @@ Ext.define('PVE.form.GlobalSearchField', {
me.keymap = new Ext.KeyMap({
target: Ext.get(document),
binding: [{
key:'F',
key: 'F',
ctrl: true,
shift: true,
fn: me.toggleFocus,
scope: me,
}, {
key:' ',
key: ' ',
ctrl: true,
fn: me.toggleFocus,
scope: me,

View File

@ -1,6 +1,6 @@
Ext.define('pve-groups', {
extend: 'Ext.data.Model',
fields: [ 'groupid', 'comment', 'users' ],
fields: ['groupid', 'comment', 'users'],
proxy: {
type: 'proxmox',
url: "/api2/json/access/groups",

View File

@ -52,7 +52,7 @@ Ext.define('PVE.form.HotplugFeatureSelector', {
var me = this,
boxes = me.getBoxes(),
data = [];
Ext.Array.forEach(boxes, function(box){
Ext.Array.forEach(boxes, function(box) {
if (box.getValue()) {
data.push(box.inputValue);
}
@ -60,7 +60,7 @@ Ext.define('PVE.form.HotplugFeatureSelector', {
/* because above is hotplug an array */
if (data.length === 0) {
return { 'hotplug':'0' };
return { 'hotplug': '0' };
} else {
return { 'hotplug': data.join(',') };
}

View File

@ -29,12 +29,12 @@ Ext.define('PVE.form.IPProtocolSelector', {
],
},
store: {
fields: [ 'p', 'd', 'n'],
fields: ['p', 'd', 'n'],
data: [
{ p: 'tcp', n: 6, d: 'Transmission Control Protocol' },
{ p: 'udp', n: 17, d: 'User Datagram Protocol' },
{ p: 'icmp', n: 1, d: 'Internet Control Message Protocol' },
{ p: 'igmp', n: 2, d: 'Internet Group Management' },
{ p: 'igmp', n: 2, d: 'Internet Group Management' },
{ p: 'ggp', n: 3, d: 'gateway-gateway protocol' },
{ p: 'ipencap', n: 4, d: 'IP encapsulated in IP' },
{ p: 'st', n: 5, d: 'ST datagram mode' },

View File

@ -26,7 +26,7 @@ Ext.define('PVE.form.IPRefSelector', {
var store = Ext.create('Ext.data.Store', {
autoLoad: true,
fields: [ 'type', 'name', 'ref', 'comment' ],
fields: ['type', 'name', 'ref', 'comment'],
idProperty: 'ref',
proxy: {
type: 'proxmox',

View File

@ -3,11 +3,11 @@ Ext.define('PVE.form.MDevSelector', {
xtype: 'pveMDevSelector',
store: {
fields: [ 'type', 'available', 'description' ],
fields: ['type', 'available', 'description'],
filterOnLoad: true,
sorters: [
{
property : 'type',
property: 'type',
direction: 'ASC',
},
],

View File

@ -19,18 +19,18 @@ Ext.define('PVE.form.NodeSelector', {
valueField: 'node',
displayField: 'node',
store: {
fields: [ 'node', 'cpu', 'maxcpu', 'mem', 'maxmem', 'uptime' ],
fields: ['node', 'cpu', 'maxcpu', 'mem', 'maxmem', 'uptime'],
proxy: {
type: 'proxmox',
url: '/api2/json/nodes',
},
sorters: [
{
property : 'node',
property: 'node',
direction: 'ASC',
},
{
property : 'mem',
property: 'mem',
direction: 'DESC',
},
],
@ -111,7 +111,7 @@ Ext.define('PVE.form.NodeSelector', {
},
}));
me.mon(me.getStore(), 'load', function(){
me.mon(me.getStore(), 'load', function() {
me.isValid();
});
},

View File

@ -3,11 +3,11 @@ Ext.define('PVE.form.PCISelector', {
xtype: 'pvePCISelector',
store: {
fields: [ 'id', 'vendor_name', 'device_name', 'vendor', 'device', 'iommugroup', 'mdev' ],
fields: ['id', 'vendor_name', 'device_name', 'vendor', 'device', 'iommugroup', 'mdev'],
filterOnLoad: true,
sorters: [
{
property : 'id',
property: 'id',
direction: 'ASC',
},
],

View File

@ -42,15 +42,13 @@ Ext.define('PVE.form.PoolSelector', {
},
}, function() {
Ext.define('pve-pools', {
extend: 'Ext.data.Model',
fields: [ 'poolid', 'comment' ],
fields: ['poolid', 'comment'],
proxy: {
type: 'proxmox',
url: "/api2/json/pools",
},
idProperty: 'poolid',
});
});

View File

@ -27,7 +27,7 @@ Ext.define('PVE.form.PrivilegesSelector', {
});
},
failure: function (response, opts) {
failure: function(response, opts) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
},
});

View File

@ -38,15 +38,13 @@ Ext.define('PVE.form.SDNControllerSelector', {
},
}, function() {
Ext.define('pve-sdn-controller', {
extend: 'Ext.data.Model',
fields: [ 'controller' ],
fields: ['controller'],
proxy: {
type: 'proxmox',
url: "/api2/json/cluster/sdn/controllers",
},
idProperty: 'controller',
});
});

View File

@ -38,15 +38,13 @@ Ext.define('PVE.form.SDNZoneSelector', {
},
}, function() {
Ext.define('pve-sdn-zone', {
extend: 'Ext.data.Model',
fields: [ 'zone' ],
fields: ['zone'],
proxy: {
type: 'proxmox',
url: "/api2/json/cluster/sdn/zones",
},
idProperty: 'zone',
});
});

View File

@ -9,7 +9,7 @@ Ext.define('PVE.form.SecurityGroupsSelector', {
var store = Ext.create('Ext.data.Store', {
autoLoad: true,
fields: [ 'group', 'comment' ],
fields: ['group', 'comment'],
idProperty: 'group',
proxy: {
type: 'proxmox',

View File

@ -44,7 +44,7 @@ Ext.define('PVE.form.SnapshotSelector', {
}
var store = Ext.create('Ext.data.Store', {
fields: [ 'name'],
fields: ['name'],
filterOnLoad: true,
});

View File

@ -58,7 +58,6 @@ Ext.define('PVE.form.StorageSelector', {
});
me.store.load();
},
setTargetNode: function(targetNode) {
@ -110,11 +109,9 @@ Ext.define('PVE.form.StorageSelector', {
}
},
}, function() {
Ext.define('pve-storage-status', {
extend: 'Ext.data.Model',
fields: [ 'storage', 'active', 'type', 'avail', 'total' ],
fields: ['storage', 'active', 'type', 'avail', 'total'],
idProperty: 'storage',
});
});

View File

@ -43,7 +43,7 @@ Ext.define('PVE.form.USBSelector', {
url: `/api2/json/nodes/${nodename}/hardware/usb`,
},
filters: [
function (item) {
function(item) {
return !!item.data.usbpath && !!item.data.prodid && item.data['class'] != 9;
},
],
@ -86,10 +86,10 @@ Ext.define('PVE.form.USBSelector', {
dataIndex: 'speed',
renderer: function(value) {
let speed_map = {
"10000" : "USB 3.1",
"5000" : "USB 3.0",
"480" : "USB 2.0",
"12" : "USB 1.x",
"10000": "USB 3.1",
"5000": "USB 3.0",
"480": "USB 2.0",
"12": "USB 1.x",
"1.5": "USB 1.x",
};
return speed_map[value] || value + " Mbps";
@ -105,7 +105,6 @@ Ext.define('PVE.form.USBSelector', {
},
}, function() {
Ext.define('pve-usb-device', {
extend: 'Ext.data.Model',
fields: [

View File

@ -52,11 +52,10 @@ Ext.define('PVE.form.UserSelector', {
me.callParent();
store.load({ params: { enabled: 1 }});
store.load({ params: { enabled: 1 } });
},
}, function() {
Ext.define('pve-users', {
extend: 'Ext.data.Model',
fields: [
@ -70,7 +69,6 @@ Ext.define('PVE.form.UserSelector', {
},
idProperty: 'userid',
});
});

View File

@ -98,7 +98,7 @@ Ext.define('PVE.form.VMCPUFlagSelector', {
{
dataIndex: 'state',
renderer: function(v) {
switch(v) {
switch (v) {
case '=': return 'Default';
case '-': return 'Off';
case '+': return 'On';
@ -111,7 +111,7 @@ Ext.define('PVE.form.VMCPUFlagSelector', {
xtype: 'widgetcolumn',
dataIndex: 'state',
width: 95,
onWidgetAttach: function (column, widget, record) {
onWidgetAttach: function(column, widget, record) {
var val = record.get('state') || '=';
widget.down('[inputValue=' + val + ']').setValue(true);
// TODO: disable if selected CPU model and flag are incompatible

View File

@ -74,14 +74,14 @@ Ext.define('PVE.form.VMSelector', {
type: 'list',
store: {
data: [
{id: 'qemu', text: gettext('Virtual Machine')},
{id: 'lxc', text: gettext('LXC Container')},
{ id: 'qemu', text: gettext('Virtual Machine') },
{ id: 'lxc', text: gettext('LXC Container') },
],
// due to EXTJS-18711
// we have to do a static list via a store
// but to avoid creating an object,
// we have to have a pseudo un function
un: function(){},
un: function() {},
},
},
},
@ -154,7 +154,7 @@ Ext.define('PVE.form.VMSelector', {
getErrors: function(value) {
var me = this;
if (me.allowBlank === false &&
if (me.allowBlank === false &&
me.getSelectionModel().getCount() === 0) {
me.addBodyCls(['x-form-trigger-wrap-default', 'x-form-trigger-wrap-invalid']);
return [gettext('No VM selected')];
@ -205,7 +205,7 @@ Ext.define('PVE.form.VMSelector', {
var sm = me.getSelectionModel();
if (me.selectAll) {
me.mon(store, 'load', function(){
me.mon(store, 'load', function() {
me.getSelectionModel().selectAll(false);
});
}
@ -291,10 +291,10 @@ Ext.define('PVE.form.VMComboSelector', {
type: 'list',
store: {
data: [
{id: 'qemu', text: gettext('Virtual Machine')},
{id: 'lxc', text: gettext('LXC Container')},
{ id: 'qemu', text: gettext('Virtual Machine') },
{ id: 'lxc', text: gettext('LXC Container') },
],
un: function(){}, // due to EXTJS-18711
un: function() {}, // due to EXTJS-18711
},
},
},

View File

@ -71,7 +71,7 @@ Ext.define('PVE.form.ViewSelector', {
return { value: me.getValue() };
},
applyState : function(state, doSelect) {
applyState: function(state, doSelect) {
var view = me.getValue();
if (state && state.value && (view != state.value)) {
var record = store.findRecord('key', state.value, 0, false, true, true);
@ -83,7 +83,7 @@ Ext.define('PVE.form.ViewSelector', {
}
}
},
stateEvents: [ 'select' ],
stateEvents: ['select'],
stateful: true,
stateId: 'pveview',
id: 'view',

View File

@ -3,8 +3,8 @@ Ext.define('PVE.form.iScsiProviderSelector', {
alias: ['widget.pveiScsiProviderSelector'],
comboItems: [
['comstar', 'Comstar'],
[ 'istgt', 'istgt'],
[ 'iet', 'IET'],
[ 'LIO', 'LIO'],
['istgt', 'istgt'],
['iet', 'IET'],
['LIO', 'LIO'],
],
});

View File

@ -8,7 +8,7 @@ Ext.define('PVE.grid.BackupView', {
stateful: true,
stateId: 'grid-guest-backup',
initComponent : function() {
initComponent: function() {
var me = this;
var nodename = me.pveSelNode.data.node;
@ -152,7 +152,7 @@ Ext.define('PVE.grid.BackupView', {
vmid: vmid,
vmtype: vmtype,
storage: storagesel.getValue(),
listeners : {
listeners: {
close: function() {
reload();
},

View File

@ -7,8 +7,7 @@ Ext.define('PVE.FirewallAliasEdit', {
width: 400,
initComponent : function() {
initComponent: function() {
var me = this;
me.isCreate = (me.alias_name === undefined);
@ -21,7 +20,7 @@ Ext.define('PVE.FirewallAliasEdit', {
me.method = 'PUT';
}
var items = [
var items = [
{
xtype: 'textfield',
name: me.isCreate ? 'name' : 'rename',
@ -49,7 +48,7 @@ Ext.define('PVE.FirewallAliasEdit', {
Ext.apply(me, {
subject: gettext('Alias'),
isAdd: true,
items: [ ipanel ],
items: [ipanel],
});
me.callParent();
@ -69,7 +68,7 @@ Ext.define('PVE.FirewallAliasEdit', {
Ext.define('pve-fw-aliases', {
extend: 'Ext.data.Model',
fields: [ 'name', 'cidr', 'comment', 'digest' ],
fields: ['name', 'cidr', 'comment', 'digest'],
idProperty: 'name',
});
@ -86,8 +85,7 @@ Ext.define('PVE.FirewallAliases', {
title: gettext('Alias'),
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.base_url) {
@ -143,7 +141,7 @@ Ext.define('PVE.FirewallAliases', {
handler: run_editor,
});
me.addBtn = Ext.create('Ext.Button', {
me.addBtn = Ext.create('Ext.Button', {
text: gettext('Add'),
handler: function() {
var win = Ext.create('PVE.FirewallAliasEdit', {
@ -163,7 +161,7 @@ Ext.define('PVE.FirewallAliases', {
Ext.apply(me, {
store: store,
tbar: [ me.addBtn, me.removeBtn, me.editBtn ],
tbar: [me.addBtn, me.removeBtn, me.editBtn],
selModel: sm,
columns: [
{
@ -172,7 +170,7 @@ Ext.define('PVE.FirewallAliases', {
flex: 1,
},
{
header: gettext('IP/CIDR'),
header: gettext('IP/CIDR'),
dataIndex: 'cidr',
flex: 1,
},

View File

@ -6,8 +6,7 @@ Ext.define('PVE.FirewallOptions', {
base_url: undefined,
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.base_url) {
@ -167,7 +166,7 @@ Ext.define('PVE.FirewallOptions', {
Ext.apply(me, {
url: "/api2/json" + me.base_url,
tbar: [ edit_btn ],
tbar: [edit_btn],
editorConfig: {
url: '/api2/extjs/' + me.base_url,
},

View File

@ -26,7 +26,7 @@ Ext.define('PVE.form.FWMacroSelector', {
var store = Ext.create('Ext.data.Store', {
autoLoad: true,
fields: [ 'macro', 'descr' ],
fields: ['macro', 'descr'],
idProperty: 'macro',
proxy: {
type: 'proxmox',
@ -70,7 +70,7 @@ Ext.define('PVE.FirewallRulePanel', {
return values;
},
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.list_refs_url) {
@ -235,8 +235,7 @@ Ext.define('PVE.FirewallRuleEdit', {
allow_iface: false,
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.base_url) {
@ -266,7 +265,7 @@ Ext.define('PVE.FirewallRuleEdit', {
Ext.apply(me, {
subject: gettext('Rule'),
isAdd: true,
items: [ ipanel ],
items: [ipanel],
});
me.callParent();
@ -299,8 +298,7 @@ Ext.define('PVE.FirewallGroupRuleEdit', {
allow_iface: false,
initComponent : function() {
initComponent: function() {
var me = this;
me.isCreate = (me.rule_pos === undefined);
@ -363,14 +361,14 @@ Ext.define('PVE.FirewallGroupRuleEdit', {
Ext.apply(me, {
subject: gettext('Rule'),
isAdd: true,
items: [ ipanel ],
items: [ipanel],
});
me.callParent();
if (!me.isCreate) {
me.load({
success: function(response, options) {
success: function(response, options) {
var values = response.result.data;
ipanel.setValues(values);
},
@ -528,7 +526,7 @@ Ext.define('PVE.FirewallRules', {
handler: run_editor,
});
me.addBtn = Ext.create('Ext.Button', {
me.addBtn = Ext.create('Ext.Button', {
text: gettext('Add'),
disabled: true,
handler: function() {
@ -577,7 +575,7 @@ Ext.define('PVE.FirewallRules', {
});
if (me.allow_groups) {
me.groupBtn = Ext.create('Ext.Button', {
me.groupBtn = Ext.create('Ext.Button', {
text: gettext('Insert') + ': ' +
gettext('Security Group'),
disabled: true,
@ -606,7 +604,7 @@ Ext.define('PVE.FirewallRules', {
},
});
var tbar = me.tbar_prefix ? [ me.tbar_prefix ] : [];
var tbar = me.tbar_prefix ? [me.tbar_prefix] : [];
tbar.push(me.addBtn, me.copyBtn);
if (me.groupBtn) {
tbar.push(me.groupBtn);
@ -617,7 +615,7 @@ Ext.define('PVE.FirewallRules', {
var errors = record.data.errors;
if (errors && errors[name]) {
metaData.tdCls = 'proxmox-invalid-row';
var html = '<p>' + Ext.htmlEncode(errors[name]) + '</p>';
var html = '<p>' + Ext.htmlEncode(errors[name]) + '</p>';
metaData.tdAttr = 'data-qwidth=600 data-qtitle="ERROR" data-qtip="' +
html.replace(/\"/g, '&quot;') + '"';
}
@ -797,13 +795,11 @@ Ext.define('PVE.FirewallRules', {
}
},
}, function() {
Ext.define('pve-fw-rule', {
extend: 'Ext.data.Model',
fields: [ { name: 'enable', type: 'boolean' },
fields: [{ name: 'enable', type: 'boolean' },
'type', 'action', 'macro', 'source', 'dest', 'proto', 'iface',
'dport', 'sport', 'comment', 'pos', 'digest', 'errors' ],
'dport', 'sport', 'comment', 'pos', 'digest', 'errors'],
idProperty: 'pos',
});
});

View File

@ -4,8 +4,7 @@ Ext.define('PVE.pool.AddVM', {
height: 400,
isAdd: true,
isCreate: true,
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.pool) {
@ -88,7 +87,7 @@ Ext.define('PVE.pool.AddVM', {
});
Ext.apply(me, {
subject: gettext('Virtual Machine'),
items: [ vmsField, vmGrid ],
items: [vmsField, vmGrid],
});
me.callParent();
@ -99,8 +98,7 @@ Ext.define('PVE.pool.AddVM', {
Ext.define('PVE.pool.AddStorage', {
extend: 'Proxmox.window.Edit',
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.pool) {
@ -121,7 +119,7 @@ Ext.define('PVE.pool.AddStorage', {
name: 'storage',
nodename: 'localhost',
autoSelect: false,
value: '',
value: '',
fieldLabel: gettext("Storage"),
},
],
@ -140,7 +138,7 @@ Ext.define('PVE.grid.PoolMembers', {
stateful: true,
stateId: 'grid-pool-members',
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.pool) {
@ -151,7 +149,7 @@ Ext.define('PVE.grid.PoolMembers', {
model: 'PVEResources',
sorters: [
{
property : 'type',
property: 'type',
direction: 'ASC',
},
],
@ -174,7 +172,7 @@ Ext.define('PVE.grid.PoolMembers', {
text: gettext('Remove'),
disabled: true,
selModel: sm,
confirmMsg: function (rec) {
confirmMsg: function(rec) {
return Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
"'" + rec.data.id + "'");
},
@ -196,7 +194,7 @@ Ext.define('PVE.grid.PoolMembers', {
callback: function() {
reload();
},
failure: function (response, opts) {
failure: function(response, opts) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
},
});

View File

@ -116,7 +116,6 @@ Ext.define('PVE.window.ReplicaEdit', {
me.highestids = highestids;
},
});
} else {
me.load({
success: function(response, options) {
@ -176,7 +175,7 @@ Ext.define('PVE.grid.ReplicaView', {
method: 'POST',
waitMsgTarget: me,
callback: function() { controller.reload(); },
failure: function (response, opts) {
failure: function(response, opts) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
},
});
@ -190,7 +189,7 @@ Ext.define('PVE.grid.ReplicaView', {
url: "/api2/extjs/nodes/" + me.nodename + "/replication/" + rec.data.id + "/log",
});
var win = Ext.create('Ext.window.Window', {
items: [ logView ],
items: [logView],
layout: 'fit',
width: 800,
height: 400,
@ -332,7 +331,6 @@ Ext.define('PVE.grid.ReplicaView', {
minWidth: 160,
flex: 1,
renderer: function(value, metadata, record) {
if (record.data.pid) {
metadata.tdCls = 'x-grid-row-loading';
return '';
@ -474,7 +472,6 @@ Ext.define('PVE.grid.ReplicaView', {
me.rstore.startUpdate();
},
}, function() {
Ext.define('pve-replication', {
extend: 'Ext.data.Model',
fields: [
@ -494,5 +491,4 @@ Ext.define('PVE.grid.ReplicaView', {
'fail_count', 'remove_job', 'pid',
],
});
});

View File

@ -7,7 +7,7 @@ Ext.define('PVE.grid.ResourceGrid', {
property: 'type',
direction: 'ASC',
},
initComponent : function() {
initComponent: function() {
var me = this;
var rstore = PVE.data.ResourceStore;
@ -39,7 +39,6 @@ Ext.define('PVE.grid.ResourceGrid', {
};
var updateGrid = function() {
var filterfn = me.viewFilter ? me.viewFilter.filterfn : null;
//console.log("START GRID UPDATE " + me.viewFilter);
@ -137,7 +136,7 @@ Ext.define('PVE.grid.ResourceGrid', {
//console.log("END GRID UPDATE");
};
var filter_task = new Ext.util.DelayedTask(function(){
var filter_task = new Ext.util.DelayedTask(function() {
updateGrid();
});

View File

@ -4,7 +4,7 @@ Ext.define('PVE.ha.FencingView', {
onlineHelp: 'ha_manager_fencing',
initComponent : function() {
initComponent: function() {
var me = this;
var store = new Ext.data.Store({
@ -38,12 +38,10 @@ Ext.define('PVE.ha.FencingView', {
me.callParent();
},
}, function() {
Ext.define('pve-ha-fencing', {
extend: 'Ext.data.Model',
fields: [
'node', 'command', 'digest',
],
});
});

View File

@ -14,7 +14,7 @@ Ext.define('PVE.ha.GroupInputPanel', {
return values;
},
initComponent : function() {
initComponent: function() {
var me = this;
var update_nodefield, update_node_selection;
@ -32,15 +32,15 @@ Ext.define('PVE.ha.GroupInputPanel', {
var data = PVE.data.ResourceStore.getNodes();
var store = Ext.create('Ext.data.Store', {
fields: [ 'node', 'mem', 'cpu', 'priority' ],
fields: ['node', 'mem', 'cpu', 'priority'],
data: data,
proxy: {
type: 'memory',
reader: {type: 'json'},
reader: { type: 'json' },
},
sorters: [
{
property : 'node',
property: 'node',
direction: 'ASC',
},
],
@ -98,11 +98,11 @@ Ext.define('PVE.ha.GroupInputPanel', {
name: 'nodes',
value: '',
listeners: {
change: function (nodefield, value) {
change: function(nodefield, value) {
update_node_selection(value);
},
},
isValid: function () {
isValid: function() {
var value = nodefield.getValue();
return (value && 0 !== value.length);
},
@ -111,7 +111,7 @@ Ext.define('PVE.ha.GroupInputPanel', {
update_node_selection = function(string) {
sm.deselectAll(true);
string.split(',').forEach(function (e, idx, array) {
string.split(',').forEach(function(e, idx, array) {
var res = e.split(':');
store.each(function(record) {
@ -125,7 +125,6 @@ Ext.define('PVE.ha.GroupInputPanel', {
});
});
nodegrid.reconfigure(store);
};
update_nodefield = function(selected) {
@ -195,7 +194,7 @@ Ext.define('PVE.ha.GroupEdit', {
groupId: undefined,
initComponent : function() {
initComponent: function() {
var me = this;
me.isCreate = !me.groupId;
@ -215,14 +214,14 @@ Ext.define('PVE.ha.GroupEdit', {
Ext.apply(me, {
subject: gettext('HA Group'),
items: [ ipanel ],
items: [ipanel],
});
me.callParent();
if (!me.isCreate) {
me.load({
success: function(response, options) {
success: function(response, options) {
var values = response.result.data;
ipanel.setValues(values);

View File

@ -43,17 +43,16 @@ Ext.define('PVE.ha.GroupSelector', {
},
}, function() {
Ext.define('pve-ha-groups', {
extend: 'Ext.data.Model',
fields: [
'group', 'type', 'digest', 'nodes', 'comment',
{
name : 'restricted',
name: 'restricted',
type: 'boolean',
},
{
name : 'nofailback',
name: 'nofailback',
type: 'boolean',
},
],

View File

@ -7,7 +7,7 @@ Ext.define('PVE.ha.GroupsView', {
stateful: true,
stateId: 'grid-ha-groups',
initComponent : function() {
initComponent: function() {
var me = this;
var caps = Ext.state.Manager.get('GuiCap');

View File

@ -18,7 +18,7 @@ Ext.define('PVE.ha.VMResourceInputPanel', {
return values;
},
initComponent : function() {
initComponent: function() {
var me = this;
var MIN_QUORUM_VOTES = 3;
@ -126,8 +126,7 @@ Ext.define('PVE.ha.VMResourceInputPanel', {
'change': function(field, newValue) {
if (newValue === 'disabled') {
disabledHint.setVisible(true);
}
else {
} else {
if (disabledHint.isVisible()) {
disabledHint.setVisible(false);
}
@ -158,7 +157,7 @@ Ext.define('PVE.ha.VMResourceEdit', {
guestType: undefined,
isCreate: undefined,
initComponent : function() {
initComponent: function() {
var me = this;
if (me.isCreate === undefined) {
@ -183,17 +182,17 @@ Ext.define('PVE.ha.VMResourceEdit', {
subject: gettext('Resource') + ': ' + gettext('Container') +
'/' + gettext('Virtual Machine'),
isAdd: true,
items: [ ipanel ],
items: [ipanel],
});
me.callParent();
if (!me.isCreate) {
me.load({
success: function(response, options) {
success: function(response, options) {
var values = response.result.data;
var regex = /^(\S+):(\S+)$/;
var regex = /^(\S+):(\S+)$/;
var res = regex.exec(values.sid);
if (res[1] !== 'vm' && res[1] !== 'ct') {

View File

@ -7,7 +7,7 @@ Ext.define('PVE.ha.ResourcesView', {
stateful: true,
stateId: 'grid-ha-resources',
initComponent : function() {
initComponent: function() {
var me = this;
var caps = Ext.state.Manager.get('GuiCap');
@ -36,7 +36,7 @@ Ext.define('PVE.ha.ResourcesView', {
var msg = errors[dataIndex];
if (msg) {
metaData.tdCls = 'proxmox-invalid-row';
var html = '<p>' + Ext.htmlEncode(msg) + '</p>';
var html = '<p>' + Ext.htmlEncode(msg) + '</p>';
metaData.tdAttr = 'data-qwidth=600 data-qtitle="ERROR" data-qtip="' +
html.replace(/\"/g, '&quot;') + '"';
}
@ -50,7 +50,7 @@ Ext.define('PVE.ha.ResourcesView', {
var rec = sm.getSelection()[0];
var sid = rec.data.sid;
var regex = /^(\S+):(\S+)$/;
var regex = /^(\S+):(\S+)$/;
var res = regex.exec(sid);
if (res[1] !== 'vm' && res[1] !== 'ct') {

View File

@ -11,7 +11,7 @@ Ext.define('PVE.ha.StatusView', {
service: 4,
},
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.rstore) {
@ -62,10 +62,8 @@ Ext.define('PVE.ha.StatusView', {
me.on('activate', me.rstore.startUpdate);
me.on('destroy', me.rstore.stopUpdate);
},
}, function() {
Ext.define('pve-ha-status', {
extend: 'Ext.data.Model',
fields: [
@ -90,5 +88,4 @@ Ext.define('PVE.ha.StatusView', {
],
idProperty: 'id',
});
});

View File

@ -62,7 +62,7 @@ Ext.define('PVE.lxc.Config', {
vm_command('shutdown');
},
menu: {
items:[{
items: [{
text: gettext('Reboot'),
disabled: !caps.vms['VM.PowerMgmt'],
confirmMsg: Proxmox.Utils.format_task_description('vzreboot', vmid),
@ -104,7 +104,8 @@ Ext.define('PVE.lxc.Config', {
var moreBtn = Ext.create('Proxmox.button.Button', {
text: gettext('More'),
menu: { items: [
menu: {
items: [
{
text: gettext('Clone'),
iconCls: 'fa fa-fw fa-clone',
@ -156,7 +157,8 @@ Ext.define('PVE.lxc.Config', {
},
iconCls: 'fa fa-trash-o',
},
]},
]
},
});
var consoleBtn = Ext.create('PVE.button.ConsoleButton', {
@ -184,7 +186,7 @@ Ext.define('PVE.lxc.Config', {
title: Ext.String.format(gettext("Container {0} on node '{1}'"), vm.text, nodename),
hstateid: 'lxctab',
tbarSpacing: false,
tbar: [ statusTxt, '->', startBtn, shutdownBtn, migrateBtn, consoleBtn, moreBtn ],
tbar: [statusTxt, '->', startBtn, shutdownBtn, migrateBtn, consoleBtn, moreBtn],
defaults: { statusStore: me.statusStore },
items: [
{

View File

@ -238,13 +238,13 @@ Ext.define('PVE.lxc.CreateWizard', {
store: {
model: 'KeyValue',
sorters: [{
property : 'key',
property: 'key',
direction: 'ASC',
}],
},
columns: [
{header: 'Key', width: 150, dataIndex: 'key'},
{header: 'Value', flex: 1, dataIndex: 'value'},
{ header: 'Key', width: 150, dataIndex: 'key' },
{ header: 'Value', flex: 1, dataIndex: 'value' },
],
},
],
@ -304,7 +304,7 @@ Ext.define('PVE.lxc.CreateWizard', {
waitMsgTarget: wizard,
method: 'POST',
params: kv,
success: function(response, opts){
success: function(response, opts) {
var upid = response.result.data;
var win = Ext.create('Proxmox.window.TaskViewer', {
@ -323,4 +323,3 @@ Ext.define('PVE.lxc.CreateWizard', {
});

View File

@ -15,7 +15,7 @@ Ext.define('PVE.lxc.DNSInputPanel', {
if (values.nameserver) {
var list = values.nameserver.split(/[\ \,\;]+/);
values.nameserver = list.join(' ');
} else if(!me.insideWizard) {
} else if (!me.insideWizard) {
deletes.push('nameserver');
}
@ -26,7 +26,7 @@ Ext.define('PVE.lxc.DNSInputPanel', {
return values;
},
initComponent : function() {
initComponent: function() {
var me = this;
var items = [
@ -62,14 +62,14 @@ Ext.define('PVE.lxc.DNSInputPanel', {
Ext.define('PVE.lxc.DNSEdit', {
extend: 'Proxmox.window.Edit',
initComponent : function() {
initComponent: function() {
var me = this;
var ipanel = Ext.create('PVE.lxc.DNSInputPanel');
Ext.apply(me, {
subject: gettext('Resources'),
items: [ ipanel ],
items: [ipanel],
});
me.callParent();
@ -97,7 +97,7 @@ Ext.define('PVE.lxc.DNS', {
onlineHelp: 'pct_container_network',
initComponent : function() {
initComponent: function() {
var me = this;
var i;
@ -123,7 +123,7 @@ Ext.define('PVE.lxc.DNS', {
subject: gettext('Hostname'),
items: {
xtype: 'inputpanel',
items:{
items: {
fieldLabel: gettext('Hostname'),
xtype: 'textfield',
name: 'hostname',
@ -136,7 +136,7 @@ Ext.define('PVE.lxc.DNS', {
if (values.hostname === undefined ||
values.hostname === null ||
values.hostname === '') {
params = { hostname: 'CT'+vmid.toString()};
params = { hostname: 'CT'+vmid.toString() };
}
return params;
},
@ -237,7 +237,7 @@ Ext.define('PVE.lxc.DNS', {
cwidth1: 150,
interval: 5000,
run_editor: run_editor,
tbar: [ edit_btn, revert_btn ],
tbar: [edit_btn, revert_btn],
rows: rows,
editorConfig: {
url: "/api2/extjs/" + baseurl,

View File

@ -97,7 +97,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
me.down('#diskstorage').setNodename(nodename);
},
controller: {
controller: {
xclass: 'Ext.app.ViewController',
control: {
@ -231,7 +231,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
xtype: 'textfield',
name: 'mp',
value: '',
emptyText: gettext('/some/path'),
emptyText: gettext('/some/path'),
allowBlank: false,
disabled: true,
fieldLabel: gettext('Path'),
@ -329,7 +329,7 @@ Ext.define('PVE.lxc.MountPointEdit', {
unprivileged: false,
initComponent : function() {
initComponent: function() {
var me = this;
var nodename = me.pveSelNode.data.node;

View File

@ -5,7 +5,7 @@ Ext.define('PVE.window.MPResize', {
resize_disk: function(disk, size) {
var me = this;
var params = { disk: disk, size: '+' + size + 'G' };
var params = { disk: disk, size: '+' + size + 'G' };
Proxmox.Utils.API2Request({
params: params,
@ -24,7 +24,7 @@ Ext.define('PVE.window.MPResize', {
});
},
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.nodename) {
@ -87,8 +87,8 @@ Ext.define('PVE.window.MPResize', {
modal: true,
border: false,
layout: 'fit',
buttons: [ submitBtn ],
items: [ me.formPanel ],
buttons: [submitBtn],
items: [me.formPanel],
});
@ -97,6 +97,5 @@ Ext.define('PVE.window.MPResize', {
if (!me.disk) {
return;
}
},
});

View File

@ -46,7 +46,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
return newdata;
},
initComponent : function() {
initComponent: function() {
var me = this;
var cdata = {};
@ -56,7 +56,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
cdata.name = 'eth0';
me.dataCache = {};
}
cdata.firewall = (me.insideWizard || me.isCreate);
cdata.firewall = (me.insideWizard || me.isCreate);
if (!me.dataCache) {
throw "no dataCache specified";
@ -306,7 +306,7 @@ Ext.define('PVE.lxc.NetworkEdit', {
isAdd: true,
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.dataCache) {
@ -327,7 +327,7 @@ Ext.define('PVE.lxc.NetworkEdit', {
Ext.apply(me, {
subject: gettext('Network Device') + ' (veth)',
digest: me.dataCache.digest,
items: [ ipanel ],
items: [ipanel],
});
me.callParent();
@ -375,7 +375,7 @@ Ext.define('PVE.lxc.NetworkView', {
});
},
initComponent : function() {
initComponent: function() {
var me = this;
var nodename = me.pveSelNode.data.node;
@ -396,7 +396,7 @@ Ext.define('PVE.lxc.NetworkView', {
model: 'pve-lxc-network',
sorters: [
{
property : 'id',
property: 'id',
direction: 'ASC',
},
],
@ -411,7 +411,7 @@ Ext.define('PVE.lxc.NetworkView', {
enableFn: function(rec) {
return !!caps.vms['VM.Config.Network'];
},
confirmMsg: function (rec) {
confirmMsg: function(rec) {
return Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
"'" + rec.data.id + "'");
},
@ -420,11 +420,11 @@ Ext.define('PVE.lxc.NetworkView', {
url: me.url,
waitMsgTarget: me,
method: 'PUT',
params: { 'delete': rec.data.id, digest: me.dataCache.digest },
params: { 'delete': rec.data.id, digest: me.dataCache.digest },
callback: function() {
me.load();
},
failure: function (response, opts) {
failure: function(response, opts) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
},
});
@ -556,13 +556,11 @@ Ext.define('PVE.lxc.NetworkView', {
me.callParent();
},
}, function() {
Ext.define('pve-lxc-network', {
extend: "Ext.data.Model",
proxy: { type: 'memory' },
fields: [ 'id', 'name', 'hwaddr', 'bridge',
'ip', 'gw', 'ip6', 'gw6', 'tag', 'firewall' ],
fields: ['id', 'name', 'hwaddr', 'bridge',
'ip', 'gw', 'ip6', 'gw6', 'tag', 'firewall'],
});
});

View File

@ -4,7 +4,7 @@ Ext.define('PVE.lxc.Options', {
onlineHelp: 'pct_options',
initComponent : function() {
initComponent: function() {
var me = this;
var i;
@ -41,8 +41,8 @@ Ext.define('PVE.lxc.Options', {
header: gettext('Start/Shutdown order'),
defaultValue: '',
renderer: PVE.Utils.render_kvm_startup,
editor: caps.vms['VM.Config.Options'] && caps.nodes['Sys.Modify'] ?
{
editor: caps.vms['VM.Config.Options'] && caps.nodes['Sys.Modify']
? {
xtype: 'pveWindowStartupEdit',
onlineHelp: 'pct_startup_and_shutdown',
} : undefined,
@ -137,8 +137,8 @@ Ext.define('PVE.lxc.Options', {
features: {
header: gettext('Features'),
defaultValue: Proxmox.Utils.noneText,
editor: Proxmox.UserName === 'root@pam' ?
'PVE.lxc.FeaturesEdit' : undefined,
editor: Proxmox.UserName === 'root@pam'
? 'PVE.lxc.FeaturesEdit' : undefined,
},
hookscript: {
header: gettext('Hookscript'),
@ -184,7 +184,7 @@ Ext.define('PVE.lxc.Options', {
url: "/api2/json/nodes/" + nodename + "/lxc/" + vmid + "/pending",
selModel: sm,
interval: 5000,
tbar: [ edit_btn, revert_btn ],
tbar: [edit_btn, revert_btn],
rows: rows,
editorConfig: {
url: '/api2/extjs/' + baseurl,
@ -204,7 +204,6 @@ Ext.define('PVE.lxc.Options', {
me.mon(me.getStore(), 'datachanged', function() {
set_button_status();
});
},
});

View File

@ -3,7 +3,7 @@ var labelWidth = 120;
Ext.define('PVE.lxc.MemoryEdit', {
extend: 'Proxmox.window.Edit',
initComponent : function() {
initComponent: function() {
var me = this;
Ext.apply(me, {
@ -21,7 +21,7 @@ Ext.define('PVE.lxc.MemoryEdit', {
Ext.define('PVE.lxc.CPUEdit', {
extend: 'Proxmox.window.Edit',
initComponent : function() {
initComponent: function() {
var me = this;
Ext.apply(me, {
@ -109,7 +109,7 @@ Ext.define('PVE.lxc.MemoryInputPanel', {
insideWizard: false,
initComponent : function() {
initComponent: function() {
var me = this;
var items = [

View File

@ -15,7 +15,7 @@ Ext.define('PVE.lxc.RessourceView', {
return rowdef.header || key;
},
initComponent : function() {
initComponent: function() {
var me = this;
var i, confid;
@ -145,7 +145,7 @@ Ext.define('PVE.lxc.RessourceView', {
params: {
'delete': rec.data.key,
},
failure: function (response, opts) {
failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
},
});
@ -247,7 +247,6 @@ Ext.define('PVE.lxc.RessourceView', {
resize_btn.setDisabled(!isDisk || !diskCap || isUnusedDisk);
move_btn.setDisabled(!isDisk || !diskCap);
revert_btn.setDisabled(!pending);
};
var sorterFn = function(rec1, rec2) {

View File

@ -4,7 +4,7 @@ Ext.define('PVE.node.CertificateView', {
onlineHelp: 'sysadmin_certificate_management',
mixins: ['Proxmox.Mixin.CBind' ],
mixins: ['Proxmox.Mixin.CBind'],
items: [
{
@ -230,7 +230,7 @@ Ext.define('PVE.node.CertUpload', {
Ext.define('pve-certificate', {
extend: 'Ext.data.Model',
fields: [ 'filename', 'fingerprint', 'issuer', 'notafter', 'notbefore', 'subject', 'san', 'public-key-bits', 'public-key-type' ],
fields: ['filename', 'fingerprint', 'issuer', 'notafter', 'notbefore', 'subject', 'san', 'public-key-bits', 'public-key-type'],
idProperty: 'filename',
});
@ -365,7 +365,7 @@ Ext.define('PVE.node.Certificates', {
}
var win = Ext.create('PVE.node.CertificateViewer', {
cert: selection[0].data.filename,
nodename : me.nodename,
nodename: me.nodename,
});
win.show();
},

View File

@ -8,7 +8,7 @@ Ext.define('PVE.node.CreateDirectory', {
onlineHelp: 'chapter_storage',
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.nodename) {
@ -140,7 +140,7 @@ Ext.define('PVE.node.Directorylist', {
Ext.apply(me, {
store: {
fields: ['path', 'device', 'type', 'options', 'unitfile' ],
fields: ['path', 'device', 'type', 'options', 'unitfile'],
proxy: {
type: 'proxmox',
url: "/api2/json/nodes/" + me.nodename + '/disks/directory',

View File

@ -8,7 +8,7 @@ Ext.define('PVE.node.CreateLVM', {
onlineHelp: 'chapter_lvm',
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.nodename) {

View File

@ -8,7 +8,7 @@ Ext.define('PVE.node.CreateLVMThin', {
onlineHelp: 'chapter_lvm',
initComponent : function() {
initComponent: function() {
var me = this;
if (!me.nodename) {

View File

@ -97,9 +97,9 @@ Ext.define('PVE.node.StatusView', {
renderer: function(cpuinfo) {
return cpuinfo.cpus + " x " + cpuinfo.model + " (" +
cpuinfo.sockets.toString() + " " +
(cpuinfo.sockets > 1 ?
gettext('Sockets') :
gettext('Socket')
(cpuinfo.sockets > 1
? gettext('Sockets')
: gettext('Socket')
) + ")";
},
value: '',

Some files were not shown because too many files have changed in this diff Show More