2 Ext
.ns('Proxmox.Setup');
4 if (!Ext
.isDefined(Proxmox
.Setup
.auth_cookie_name
)) {
5 throw "Proxmox library not initialized";
8 // avoid errors when running without development tools
9 if (!Ext
.isDefined(Ext
.global
.console
)) {
21 Ext
.global
.console
= console
;
24 Ext
.Ajax
.defaultHeaders
= {
25 'Accept': 'application/json',
28 Ext
.Ajax
.on('beforerequest', function(conn
, options
) {
29 if (Proxmox
.CSRFPreventionToken
) {
30 if (!options
.headers
) {
33 options
.headers
.CSRFPreventionToken
= Proxmox
.CSRFPreventionToken
;
35 let storedAuth
= Proxmox
.Utils
.getStoredAuth();
36 if (storedAuth
.token
) {
37 options
.headers
.Authorization
= storedAuth
.token
;
41 Ext
.define('Proxmox.Utils', { // a singleton
44 yesText
: gettext('Yes'),
45 noText
: gettext('No'),
46 enabledText
: gettext('Enabled'),
47 disabledText
: gettext('Disabled'),
48 noneText
: gettext('none'),
49 NoneText
: gettext('None'),
50 errorText
: gettext('Error'),
51 warningsText
: gettext('Warnings'),
52 unknownText
: gettext('Unknown'),
53 defaultText
: gettext('Default'),
54 daysText
: gettext('days'),
55 dayText
: gettext('day'),
56 runningText
: gettext('running'),
57 stoppedText
: gettext('stopped'),
58 neverText
: gettext('never'),
59 totalText
: gettext('Total'),
60 usedText
: gettext('Used'),
61 directoryText
: gettext('Directory'),
62 stateText
: gettext('State'),
63 groupText
: gettext('Group'),
65 language_map
: { //language map is sorted alphabetically by iso 639-1
66 ar
: `العربية - ${gettext("Arabic")}`,
67 ca
: `Català - ${gettext("Catalan")}`,
68 da
: `Dansk - ${gettext("Danish")}`,
69 de
: `Deutsch - ${gettext("German")}`,
70 en
: `English - ${gettext("English")}`,
71 es
: `Español - ${gettext("Spanish")}`,
72 eu
: `Euskera (Basque) - ${gettext("Euskera (Basque)")}`,
73 fa
: `فارسی - ${gettext("Persian (Farsi)")}`,
74 fr
: `Français - ${gettext("French")}`,
75 hr
: `Hrvatski - ${gettext("Croatian")}`,
76 he
: `עברית - ${gettext("Hebrew")}`,
77 it
: `Italiano - ${gettext("Italian")}`,
78 ja
: `日本語 - ${gettext("Japanese")}`,
79 ka
: `ქართული - ${gettext("Georgian")}`,
80 ko
: `한국어 - ${gettext("Korean")}`,
81 nb
: `Bokmål - ${gettext("Norwegian (Bokmal)")}`,
82 nl
: `Nederlands - ${gettext("Dutch")}`,
83 nn
: `Nynorsk - ${gettext("Norwegian (Nynorsk)")}`,
84 pl
: `Polski - ${gettext("Polish")}`,
85 pt_BR
: `Português Brasileiro - ${gettext("Portuguese (Brazil)")}`,
86 ru
: `Русский - ${gettext("Russian")}`,
87 sl
: `Slovenščina - ${gettext("Slovenian")}`,
88 sv
: `Svenska - ${gettext("Swedish")}`,
89 tr
: `Türkçe - ${gettext("Turkish")}`,
90 ukr
: `Українська - ${gettext("Ukrainian")}`,
91 zh_CN
: `中文(简体)- ${gettext("Chinese (Simplified)")}`,
92 zh_TW
: `中文(繁體)- ${gettext("Chinese (Traditional)")}`,
95 render_language: function(value
) {
96 if (!value
|| value
=== '__default__') {
97 return Proxmox
.Utils
.defaultText
+ ' (English)';
100 value
= 'ko'; // fix-up wrongly used Korean code. FIXME: remove with trixie releases
102 let text
= Proxmox
.Utils
.language_map
[value
];
104 return text
+ ' (' + value
+ ')';
109 renderEnabledIcon
: enabled
=> `<i class="fa fa-${enabled ? 'check' : 'minus'}"></i>`,
111 language_array: function() {
112 let data
= [['__default__', Proxmox
.Utils
.render_language('')]];
113 Ext
.Object
.each(Proxmox
.Utils
.language_map
, function(key
, value
) {
114 data
.push([key
, Proxmox
.Utils
.render_language(value
)]);
121 crisp
: 'Light theme',
122 "proxmox-dark": 'Proxmox Dark',
125 render_theme: function(value
) {
126 if (!value
|| value
=== '__default__') {
127 return Proxmox
.Utils
.defaultText
+ ' (auto)';
129 let text
= Proxmox
.Utils
.theme_map
[value
];
136 theme_array: function() {
137 let data
= [['__default__', Proxmox
.Utils
.render_theme('')]];
138 Ext
.Object
.each(Proxmox
.Utils
.theme_map
, function(key
, value
) {
139 data
.push([key
, Proxmox
.Utils
.render_theme(value
)]);
145 bond_mode_gettext_map
: {
146 '802.3ad': 'LACP (802.3ad)',
147 'lacp-balance-slb': 'LACP (balance-slb)',
148 'lacp-balance-tcp': 'LACP (balance-tcp)',
151 render_bond_mode
: value
=> Proxmox
.Utils
.bond_mode_gettext_map
[value
] || value
|| '',
153 bond_mode_array: function(modes
) {
154 return modes
.map(mode
=> [mode
, Proxmox
.Utils
.render_bond_mode(mode
)]);
157 getNoSubKeyHtml: function(url
) {
158 let html_url
= Ext
.String
.format('<a target="_blank" href="{0}">www.proxmox.com</a>', url
|| 'https://www.proxmox.com');
159 return Ext
.String
.format(
160 gettext('You do not have a valid subscription for this server. Please visit {0} to get a list of available options.'),
165 format_boolean_with_default: function(value
) {
166 if (Ext
.isDefined(value
) && value
!== '__default__') {
167 return value
? Proxmox
.Utils
.yesText
: Proxmox
.Utils
.noText
;
169 return Proxmox
.Utils
.defaultText
;
172 format_boolean: function(value
) {
173 return value
? Proxmox
.Utils
.yesText
: Proxmox
.Utils
.noText
;
176 format_neg_boolean: function(value
) {
177 return !value
? Proxmox
.Utils
.yesText
: Proxmox
.Utils
.noText
;
180 format_enabled_toggle: function(value
) {
181 return value
? Proxmox
.Utils
.enabledText
: Proxmox
.Utils
.disabledText
;
184 format_expire: function(date
) {
186 return Proxmox
.Utils
.neverText
;
188 return Ext
.Date
.format(date
, "Y-m-d");
191 // somewhat like a human would tell durations, omit zero values and do not
192 // give seconds precision if we talk days already
193 format_duration_human: function(ut
) {
194 let seconds
= 0, minutes
= 0, hours
= 0, days
= 0, years
= 0;
201 seconds
= Number((remaining
% 60).toFixed(1));
202 remaining
= Math
.trunc(remaining
/ 60);
204 minutes
= remaining
% 60;
205 remaining
= Math
.trunc(remaining
/ 60);
207 hours
= remaining
% 24;
208 remaining
= Math
.trunc(remaining
/ 24);
210 days
= remaining
% 365;
211 remaining
= Math
.trunc(remaining
/ 365); // yea, just lets ignore leap years...
220 let add
= (t
, unit
) => {
221 if (t
> 0) res
.push(t
+ unit
);
225 let addMinutes
= !add(years
, 'y');
226 let addSeconds
= !add(days
, 'd');
234 return res
.join(' ');
237 format_duration_long: function(ut
) {
238 let days
= Math
.floor(ut
/ 86400);
240 let hours
= Math
.floor(ut
/ 3600);
242 let mins
= Math
.floor(ut
/ 60);
245 let hours_str
= '00' + hours
.toString();
246 hours_str
= hours_str
.substr(hours_str
.length
- 2);
247 let mins_str
= "00" + mins
.toString();
248 mins_str
= mins_str
.substr(mins_str
.length
- 2);
249 let ut_str
= "00" + ut
.toString();
250 ut_str
= ut_str
.substr(ut_str
.length
- 2);
253 let ds
= days
> 1 ? Proxmox
.Utils
.daysText
: Proxmox
.Utils
.dayText
;
254 return days
.toString() + ' ' + ds
+ ' ' +
255 hours_str
+ ':' + mins_str
+ ':' + ut_str
;
257 return hours_str
+ ':' + mins_str
+ ':' + ut_str
;
261 format_subscription_level: function(level
) {
264 } else if (level
=== 'b') {
266 } else if (level
=== 's') {
268 } else if (level
=== 'p') {
271 return Proxmox
.Utils
.noneText
;
275 compute_min_label_width: function(text
, width
) {
276 if (width
=== undefined) { width
= 100; }
278 let tm
= new Ext
.util
.TextMetrics();
279 let min
= tm
.getWidth(text
+ ':');
281 return min
< width
? width
: min
;
284 // returns username + realm
285 parse_userid: function(userid
) {
286 if (!Ext
.isString(userid
)) {
287 return [undefined, undefined];
290 let match
= userid
.match(/^(.+)@([^@]+)$/);
291 if (match
!== null) {
292 return [match
[1], match
[2]];
295 return [undefined, undefined];
298 render_username: function(userid
) {
299 let username
= Proxmox
.Utils
.parse_userid(userid
)[0] || "";
300 return Ext
.htmlEncode(username
);
303 render_realm: function(userid
) {
304 let username
= Proxmox
.Utils
.parse_userid(userid
)[1] || "";
305 return Ext
.htmlEncode(username
);
308 getStoredAuth: function() {
309 let storedAuth
= JSON
.parse(window
.localStorage
.getItem('ProxmoxUser'));
310 return storedAuth
|| {};
313 setAuthData: function(data
) {
314 Proxmox
.UserName
= data
.username
;
315 Proxmox
.LoggedOut
= data
.LoggedOut
;
316 // creates a session cookie (expire = null)
317 // that way the cookie gets deleted after the browser window is closed
319 Proxmox
.CSRFPreventionToken
= data
.CSRFPreventionToken
;
320 Ext
.util
.Cookies
.set(Proxmox
.Setup
.auth_cookie_name
, data
.ticket
, null, '/', null, true, "strict");
324 window
.localStorage
.setItem('ProxmoxUser', JSON
.stringify(data
));
329 if (Proxmox
.LoggedOut
) {
332 let storedAuth
= Proxmox
.Utils
.getStoredAuth();
333 let cookie
= Ext
.util
.Cookies
.get(Proxmox
.Setup
.auth_cookie_name
);
334 if ((Proxmox
.UserName
!== '' && cookie
&& !cookie
.startsWith("PVE:tfa!")) || storedAuth
.token
) {
335 return cookie
|| storedAuth
.token
;
341 authClear: function() {
342 if (Proxmox
.LoggedOut
) {
345 // ExtJS clear is basically the same, but browser may complain if any cookie isn't "secure"
346 Ext
.util
.Cookies
.set(Proxmox
.Setup
.auth_cookie_name
, "", new Date(0), null, null, true, "strict");
347 window
.localStorage
.removeItem("ProxmoxUser");
350 // The End-User gets redirected back here after login on the OpenID auth. portal, and in the
351 // redirection URL the state and auth.code are passed as URL GET params, this helper parses those
352 getOpenIDRedirectionAuthorization: function() {
353 const auth
= Ext
.Object
.fromQueryString(window
.location
.search
);
354 if (auth
.state
!== undefined && auth
.code
!== undefined) {
360 // comp.setLoading() is buggy in ExtJS 4.0.7, so we
361 // use el.mask() instead
362 setErrorMask: function(comp
, msg
) {
369 } else if (msg
=== true) {
370 el
.mask(gettext("Loading..."));
376 getResponseErrorMessage
: (err
) => {
377 if (!err
.statusText
) {
378 return gettext('Connection error');
380 let msg
= [`${err.statusText} (${err.status})`];
381 if (err
.response
&& err
.response
.responseText
) {
382 let txt
= err
.response
.responseText
;
384 let res
= JSON
.parse(txt
);
385 if (res
.errors
&& typeof res
.errors
=== 'object') {
386 for (let [key
, value
] of Object
.entries(res
.errors
)) {
387 msg
.push(Ext
.String
.htmlEncode(`${key}: ${value}`));
391 // fallback to string
392 msg
.push(Ext
.String
.htmlEncode(txt
));
395 return msg
.join('<br>');
398 monStoreErrors: function(component
, store
, clearMaskBeforeLoad
, errorCallback
) {
399 if (clearMaskBeforeLoad
) {
400 component
.mon(store
, 'beforeload', function(s
, operation
, eOpts
) {
401 Proxmox
.Utils
.setErrorMask(component
, false);
404 component
.mon(store
, 'beforeload', function(s
, operation
, eOpts
) {
405 if (!component
.loadCount
) {
406 component
.loadCount
= 0; // make sure it is nucomponent.ic
407 Proxmox
.Utils
.setErrorMask(component
, true);
412 // only works with 'proxmox' proxy
413 component
.mon(store
.proxy
, 'afterload', function(proxy
, request
, success
) {
414 component
.loadCount
++;
417 Proxmox
.Utils
.setErrorMask(component
, false);
421 let error
= request
._operation
.getError();
422 let msg
= Proxmox
.Utils
.getResponseErrorMessage(error
);
423 if (!errorCallback
|| !errorCallback(error
, msg
)) {
424 Proxmox
.Utils
.setErrorMask(component
, msg
);
429 extractRequestError: function(result
, verbose
) {
430 let msg
= gettext('Successful');
432 if (!result
.success
) {
433 msg
= gettext("Unknown error");
434 if (result
.message
) {
435 msg
= Ext
.htmlEncode(result
.message
);
437 msg
+= ` (${result.status})`;
440 if (verbose
&& Ext
.isObject(result
.errors
)) {
442 Ext
.Object
.each(result
.errors
, (prop
, desc
) => {
443 msg
+= `<br><b>${Ext.htmlEncode(prop)}</b>: ${Ext.htmlEncode(desc)}`;
452 API2Request: function(reqOpts
) {
453 let newopts
= Ext
.apply({
454 waitMsg
: gettext('Please wait...'),
457 // default to enable if user isn't handling the failure already explicitly
458 let autoErrorAlert
= reqOpts
.autoErrorAlert
??
459 (typeof reqOpts
.failure
!== 'function' && typeof reqOpts
.callback
!== 'function');
461 if (!newopts
.url
.match(/^\/api2/)) {
462 newopts
.url
= '/api2/extjs' + newopts
.url
;
464 delete newopts
.callback
;
465 let unmask
= (target
) => {
466 if (target
.waitMsgTargetCount
=== undefined || --target
.waitMsgTargetCount
<= 0) {
467 target
.setLoading(false);
468 delete target
.waitMsgTargetCount
;
472 let createWrapper = function(successFn
, callbackFn
, failureFn
) {
474 success: function(response
, options
) {
475 if (options
.waitMsgTarget
) {
476 if (Proxmox
.Utils
.toolkit
=== 'touch') {
477 options
.waitMsgTarget
.setMasked(false);
479 unmask(options
.waitMsgTarget
);
482 let result
= Ext
.decode(response
.responseText
);
483 response
.result
= result
;
484 if (!result
.success
) {
485 response
.htmlStatus
= Proxmox
.Utils
.extractRequestError(result
, true);
486 Ext
.callback(callbackFn
, options
.scope
, [options
, false, response
]);
487 Ext
.callback(failureFn
, options
.scope
, [response
, options
]);
488 if (autoErrorAlert
) {
489 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);
493 Ext
.callback(callbackFn
, options
.scope
, [options
, true, response
]);
494 Ext
.callback(successFn
, options
.scope
, [response
, options
]);
496 failure: function(response
, options
) {
497 if (options
.waitMsgTarget
) {
498 if (Proxmox
.Utils
.toolkit
=== 'touch') {
499 options
.waitMsgTarget
.setMasked(false);
501 unmask(options
.waitMsgTarget
);
504 response
.result
= {};
506 response
.result
= Ext
.decode(response
.responseText
);
510 let msg
= gettext('Connection error') + ' - server offline?';
511 if (response
.aborted
) {
512 msg
= gettext('Connection error') + ' - aborted.';
513 } else if (response
.timedout
) {
514 msg
= gettext('Connection error') + ' - Timeout.';
515 } else if (response
.status
&& response
.statusText
) {
516 msg
= gettext('Connection error') + ' ' + response
.status
+ ': ' + response
.statusText
;
518 response
.htmlStatus
= msg
;
519 Ext
.callback(callbackFn
, options
.scope
, [options
, false, response
]);
520 Ext
.callback(failureFn
, options
.scope
, [response
, options
]);
525 createWrapper(reqOpts
.success
, reqOpts
.callback
, reqOpts
.failure
);
527 let target
= newopts
.waitMsgTarget
;
529 if (Proxmox
.Utils
.toolkit
=== 'touch') {
530 target
.setMasked({ xtype
: 'loadmask', message
: newopts
.waitMsg
});
531 } else if (target
.rendered
) {
532 target
.waitMsgTargetCount
= (target
.waitMsgTargetCount
?? 0) + 1;
533 target
.setLoading(newopts
.waitMsg
);
535 target
.waitMsgTargetCount
= (target
.waitMsgTargetCount
?? 0) + 1;
536 target
.on('afterlayout', function() {
537 if ((target
.waitMsgTargetCount
?? 0) > 0) {
538 target
.setLoading(newopts
.waitMsg
);
540 }, target
, { single
: true });
543 Ext
.Ajax
.request(newopts
);
546 // can be useful for catching displaying errors from the API, e.g.:
547 // Proxmox.Async.api2({
549 // }).catch(Proxmox.Utils.alertResponseFailure);
550 alertResponseFailure
: res
=> Ext
.Msg
.alert(gettext('Error'), res
.htmlStatus
|| res
.result
.message
),
552 checked_command: function(orig_cmd
) {
553 Proxmox
.Utils
.API2Request(
555 url
: '/nodes/localhost/subscription',
557 failure: function(response
, opts
) {
558 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);
560 success: function(response
, opts
) {
561 let res
= response
.result
;
562 if (res
=== null || res
=== undefined || !res
|| res
563 .data
.status
.toLowerCase() !== 'active') {
565 title
: gettext('No valid subscription'),
566 icon
: Ext
.Msg
.WARNING
,
567 message
: Proxmox
.Utils
.getNoSubKeyHtml(res
.data
.url
),
569 callback: function(btn
) {
584 assemble_field_data: function(values
, data
) {
585 if (!Ext
.isObject(data
)) {
588 Ext
.Object
.each(data
, function(name
, val
) {
589 if (Object
.prototype.hasOwnProperty
.call(values
, name
)) {
590 let bucket
= values
[name
];
591 if (!Ext
.isArray(bucket
)) {
592 bucket
= values
[name
] = [bucket
];
594 if (Ext
.isArray(val
)) {
595 values
[name
] = bucket
.concat(val
);
605 updateColumnWidth: function(container
, thresholdWidth
) {
606 let mode
= Ext
.state
.Manager
.get('summarycolumns') || 'auto';
608 if (mode
!== 'auto') {
609 factor
= parseInt(mode
, 10);
610 if (Number
.isNaN(factor
)) {
614 thresholdWidth
= (thresholdWidth
|| 1400) + 1;
615 factor
= Math
.ceil(container
.getSize().width
/ thresholdWidth
);
618 if (container
.oldFactor
=== factor
) {
622 let items
= container
.query('>'); // direct children
623 factor
= Math
.min(factor
, items
.length
);
624 container
.oldFactor
= factor
;
626 items
.forEach((item
) => {
627 item
.columnWidth
= 1 / factor
;
630 // we have to update the layout twice, since the first layout change
631 // can trigger the scrollbar which reduces the amount of space left
632 container
.updateLayout();
633 container
.updateLayout();
636 // NOTE: depreacated, use updateColumnWidth
637 updateColumns
: container
=> Proxmox
.Utils
.updateColumnWidth(container
),
639 dialog_title: function(subject
, create
, isAdd
) {
642 return gettext('Add') + ': ' + subject
;
644 return gettext('Create') + ': ' + subject
;
647 return gettext('Edit') + ': ' + subject
;
651 network_iface_types
: {
652 eth
: gettext("Network Device"),
653 bridge
: 'Linux Bridge',
656 OVSBridge
: 'OVS Bridge',
659 OVSIntPort
: 'OVS IntPort',
662 render_network_iface_type: function(value
) {
663 return Proxmox
.Utils
.network_iface_types
[value
] ||
664 Proxmox
.Utils
.unknownText
;
667 // Only add product-agnostic fields here!
668 notificationFieldName
: {
669 'type': gettext('Notification type'),
670 'hostname': gettext('Hostname'),
673 formatNotificationFieldName
: (value
) =>
674 Proxmox
.Utils
.notificationFieldName
[value
] || value
,
676 // to add or change existing for product specific ones
677 overrideNotificationFieldName: function(extra
) {
678 for (const [key
, value
] of Object
.entries(extra
)) {
679 Proxmox
.Utils
.notificationFieldName
[key
] = value
;
683 // Only add product-agnostic fields here!
684 notificationFieldValue
: {
685 'system-mail': gettext('Forwarded mails to the local root user'),
688 formatNotificationFieldValue
: (value
) =>
689 Proxmox
.Utils
.notificationFieldValue
[value
] || value
,
691 // to add or change existing for product specific ones
692 overrideNotificationFieldValue: function(extra
) {
693 for (const [key
, value
] of Object
.entries(extra
)) {
694 Proxmox
.Utils
.notificationFieldValue
[key
] = value
;
698 // NOTE: only add general, product agnostic, ones here! Else use override helper in product repos
700 aptupdate
: ['', gettext('Update package database')],
701 diskinit
: ['Disk', gettext('Initialize Disk with GPT')],
702 spiceshell
: ['', gettext('Shell') + ' (Spice)'],
703 srvreload
: ['SRV', gettext('Reload')],
704 srvrestart
: ['SRV', gettext('Restart')],
705 srvstart
: ['SRV', gettext('Start')],
706 srvstop
: ['SRV', gettext('Stop')],
707 termproxy
: ['', gettext('Console') + ' (xterm.js)'],
708 vncshell
: ['', gettext('Shell')],
711 // to add or change existing for product specific ones
712 override_task_descriptions: function(extra
) {
713 for (const [key
, value
] of Object
.entries(extra
)) {
714 Proxmox
.Utils
.task_desc_table
[key
] = value
;
718 format_task_description: function(type
, id
) {
719 let farray
= Proxmox
.Utils
.task_desc_table
[type
];
727 } else if (Ext
.isFunction(farray
)) {
728 return farray(type
, id
);
730 let prefix
= farray
[0];
732 if (prefix
&& id
!== undefined) {
733 return prefix
+ ' ' + id
+ ' - ' + text
;
738 format_size: function(size
, useSI
) {
739 let unitsSI
= [gettext('B'), gettext('KB'), gettext('MB'), gettext('GB'),
740 gettext('TB'), gettext('PB'), gettext('EB'), gettext('ZB'), gettext('YB')];
741 let unitsIEC
= [gettext('B'), gettext('KiB'), gettext('MiB'), gettext('GiB'),
742 gettext('TiB'), gettext('PiB'), gettext('EiB'), gettext('ZiB'), gettext('YiB')];
745 const baseValue
= useSI
? 1000 : 1024;
746 while (size
>= baseValue
&& order
< unitsSI
.length
) {
747 size
= size
/ baseValue
;
751 let unit
= useSI
? unitsSI
[order
] : unitsIEC
[order
];
755 return `${size.toFixed(commaDigits)} ${unit}`;
763 'GiB': 1024*1024*1024,
764 'TiB': 1024*1024*1024*1024,
765 'PiB': 1024*1024*1024*1024*1024,
769 'GB': 1000*1000*1000,
770 'TB': 1000*1000*1000*1000,
771 'PB': 1000*1000*1000*1000*1000,
774 parse_size_unit: function(val
) {
775 //let m = val.match(/([.\d])+\s?([KMGTP]?)(i?)B?\s*$/i);
776 let m
= val
.match(/(\d+(?:\.\d+)?)\s?([KMGTP]?)(i?)B?\s*$/i);
777 let size
= parseFloat(m
[1]);
778 let scale
= m
[2].toUpperCase();
779 let binary
= m
[3].toLowerCase();
781 let unit
= `${scale}${binary}B`;
782 let factor
= Proxmox
.Utils
.SizeUnits
[unit
];
784 return { size
, factor
, unit
, binary
}; // for convenience return all we got
787 size_unit_to_bytes: function(val
) {
788 let { size
, factor
} = Proxmox
.Utils
.parse_size_unit(val
);
789 return size
* factor
;
792 autoscale_size_unit: function(val
) {
793 let { size
, factor
, binary
} = Proxmox
.Utils
.parse_size_unit(val
);
794 return Proxmox
.Utils
.format_size(size
* factor
, binary
!== "i");
797 size_unit_ratios: function(a
, b
) {
798 a
= typeof a
!== "undefined" ? a
: 0;
799 b
= typeof b
!== "undefined" ? b
: Infinity
;
800 let aBytes
= typeof a
=== "number" ? a
: Proxmox
.Utils
.size_unit_to_bytes(a
);
801 let bBytes
= typeof b
=== "number" ? b
: Proxmox
.Utils
.size_unit_to_bytes(b
);
802 return aBytes
/ (bBytes
|| Infinity
); // avoid division by zero
805 render_upid: function(value
, metaData
, record
) {
806 let task
= record
.data
;
807 let type
= task
.type
|| task
.worker_type
;
808 let id
= task
.id
|| task
.worker_id
;
810 return Proxmox
.Utils
.format_task_description(type
, id
);
813 render_uptime: function(value
) {
816 if (uptime
=== undefined) {
824 return Proxmox
.Utils
.format_duration_long(uptime
);
827 systemd_unescape: function(string_value
) {
828 const charcode_0
= '0'.charCodeAt(0);
829 const charcode_9
= '9'.charCodeAt(0);
830 const charcode_A
= 'A'.charCodeAt(0);
831 const charcode_F
= 'F'.charCodeAt(0);
832 const charcode_a
= 'a'.charCodeAt(0);
833 const charcode_f
= 'f'.charCodeAt(0);
834 const charcode_x
= 'x'.charCodeAt(0);
835 const charcode_minus
= '-'.charCodeAt(0);
836 const charcode_slash
= '/'.charCodeAt(0);
837 const charcode_backslash
= '\\'.charCodeAt(0);
839 let parse_hex_digit = function(d
) {
840 if (d
>= charcode_0
&& d
<= charcode_9
) {
841 return d
- charcode_0
;
843 if (d
>= charcode_A
&& d
<= charcode_F
) {
844 return d
- charcode_A
+ 10;
846 if (d
>= charcode_a
&& d
<= charcode_f
) {
847 return d
- charcode_a
+ 10;
849 throw "got invalid hex digit";
852 let value
= new TextEncoder().encode(string_value
);
853 let result
= new Uint8Array(value
.length
);
858 while (i
< value
.length
) {
860 if (c0
=== charcode_minus
) {
861 result
.set([charcode_slash
], result_len
);
866 if ((i
+ 4) < value
.length
) {
868 if (c0
=== charcode_backslash
&& c1
=== charcode_x
) {
869 let h1
= parse_hex_digit(value
[i
+2]);
870 let h0
= parse_hex_digit(value
[i
+3]);
872 result
.set([ord
], result_len
);
878 result
.set([c0
], result_len
);
883 return new TextDecoder().decode(result
.slice(0, result
.len
));
886 parse_task_upid: function(upid
) {
889 let res
= upid
.match(/^UPID:([^\s:]+):([0-9A-Fa-f]{8}):([0-9A-Fa-f]{8,9}):(([0-9A-Fa-f]{8,16}):)?([0-9A-Fa-f]{8}):([^:\s]+):([^:\s]*):([^:\s]+):$/);
891 throw "unable to parse upid '" + upid
+ "'";
894 task
.pid
= parseInt(res
[2], 16);
895 task
.pstart
= parseInt(res
[3], 16);
896 if (res
[5] !== undefined) {
897 task
.task_id
= parseInt(res
[5], 16);
899 task
.starttime
= parseInt(res
[6], 16);
901 task
.id
= Proxmox
.Utils
.systemd_unescape(res
[8]);
904 task
.desc
= Proxmox
.Utils
.format_task_description(task
.type
, task
.id
);
909 parse_task_status: function(status
) {
910 if (status
=== 'OK') {
914 if (status
=== 'unknown') {
918 let match
= status
.match(/^WARNINGS: (.*)$/);
926 format_task_status: function(status
) {
927 let parsed
= Proxmox
.Utils
.parse_task_status(status
);
929 case 'unknown': return Proxmox
.Utils
.unknownText
;
930 case 'error': return Proxmox
.Utils
.errorText
+ ': ' + status
;
931 case 'warning': return status
.replace('WARNINGS', Proxmox
.Utils
.warningsText
);
932 case 'ok': // fall-through
933 default: return status
;
937 render_duration: function(value
) {
938 if (value
=== undefined) {
941 return Proxmox
.Utils
.format_duration_human(value
);
944 render_timestamp: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
945 let servertime
= new Date(value
* 1000);
946 return Ext
.Date
.format(servertime
, 'Y-m-d H:i:s');
949 render_zfs_health: function(value
) {
950 if (typeof value
=== 'undefined') {
953 var iconCls
= 'question-circle';
957 iconCls
= 'check-circle good';
961 iconCls
= 'exclamation-circle warning';
966 iconCls
= 'times-circle critical';
971 return '<i class="fa fa-' + iconCls
+ '"></i> ' + value
;
974 get_help_info: function(section
) {
976 if (typeof proxmoxOnlineHelpInfo
!== 'undefined') {
977 helpMap
= proxmoxOnlineHelpInfo
; // eslint-disable-line no-undef
978 } else if (typeof pveOnlineHelpInfo
!== 'undefined') {
979 // be backward compatible with older pve-doc-generators
980 helpMap
= pveOnlineHelpInfo
; // eslint-disable-line no-undef
982 throw "no global OnlineHelpInfo map declared";
985 if (helpMap
[section
]) {
986 return helpMap
[section
];
988 // try to normalize - and _ separators, to support asciidoc and sphinx
989 // references at the same time.
990 let section_minus_normalized
= section
.replace(/_
/g
, '-');
991 if (helpMap
[section_minus_normalized
]) {
992 return helpMap
[section_minus_normalized
];
994 let section_underscore_normalized
= section
.replace(/-/g
, '_');
995 return helpMap
[section_underscore_normalized
];
998 get_help_link: function(section
) {
999 let info
= Proxmox
.Utils
.get_help_info(section
);
1003 return window
.location
.origin
+ info
.link
;
1006 openXtermJsViewer: function(vmtype
, vmid
, nodename
, vmname
, cmd
) {
1007 let url
= Ext
.Object
.toQueryString({
1008 console
: vmtype
, // kvm, lxc, upgrade or shell
1016 let nw
= window
.open("?" + url
, '_blank', 'toolbar=no,location=no,status=no,menubar=no,resizable=yes,width=800,height=420');
1022 render_optional_url: function(value
) {
1023 if (value
&& value
.match(/^https?:\/\//) !== null) {
1024 return '<a target="_blank" href="' + value
+ '">' + value
+ '</a>';
1029 render_san: function(value
) {
1031 if (Ext
.isArray(value
)) {
1032 value
.forEach(function(val
) {
1033 if (!Ext
.isNumber(val
)) {
1037 return names
.join('<br>');
1042 render_usage
: val
=> (val
* 100).toFixed(2) + '%',
1044 render_cpu_usage: function(val
, max
) {
1045 return Ext
.String
.format(
1046 `${gettext('{0}% of {1}')} ${gettext('CPU(s)')}`,
1047 (val
*100).toFixed(2),
1052 render_size_usage: function(val
, max
, useSI
) {
1054 return gettext('N/A');
1056 let fmt
= v
=> Proxmox
.Utils
.format_size(v
, useSI
);
1057 let ratio
= (val
* 100 / max
).toFixed(2);
1058 return ratio
+ '% (' + Ext
.String
.format(gettext('{0} of {1}'), fmt(val
), fmt(max
)) + ')';
1061 render_cpu: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1062 if (!(record
.data
.uptime
&& Ext
.isNumeric(value
))) {
1066 let maxcpu
= record
.data
.maxcpu
|| 1;
1067 if (!Ext
.isNumeric(maxcpu
) || maxcpu
< 1) {
1070 let cpuText
= maxcpu
> 1 ? 'CPUs' : 'CPU';
1071 let ratio
= (value
* 100).toFixed(1);
1072 return `${ratio}% of ${maxcpu.toString()} ${cpuText}`;
1075 render_size: function(value
, metaData
, record
, rowIndex
, colIndex
, store
) {
1076 if (!Ext
.isNumeric(value
)) {
1079 return Proxmox
.Utils
.format_size(value
);
1082 render_cpu_model: function(cpu
) {
1083 let socketText
= cpu
.sockets
> 1 ? gettext('Sockets') : gettext('Socket');
1084 return `${cpu.cpus} x ${cpu.model} (${cpu.sockets.toString()} ${socketText})`;
1087 /* this is different for nodes */
1088 render_node_cpu_usage: function(value
, record
) {
1089 return Proxmox
.Utils
.render_cpu_usage(value
, record
.cpus
);
1092 render_node_size_usage: function(record
) {
1093 return Proxmox
.Utils
.render_size_usage(record
.used
, record
.total
);
1096 loadTextFromFile: function(file
, callback
, maxBytes
) {
1097 let maxSize
= maxBytes
|| 8192;
1098 if (file
.size
> maxSize
) {
1099 Ext
.Msg
.alert(gettext('Error'), gettext("Invalid file size: ") + file
.size
);
1102 let reader
= new FileReader();
1103 reader
.onload
= evt
=> callback(evt
.target
.result
);
1104 reader
.readAsText(file
);
1107 parsePropertyString: function(value
, defaultKey
) {
1111 if (typeof value
!== 'string' || value
=== '') {
1115 Ext
.Array
.each(value
.split(','), function(p
) {
1116 var kv
= p
.split('=', 2);
1117 if (Ext
.isDefined(kv
[1])) {
1119 } else if (Ext
.isDefined(defaultKey
)) {
1120 if (Ext
.isDefined(res
[defaultKey
])) {
1121 error
= 'defaultKey may be only defined once in propertyString';
1122 return false; // break
1124 res
[defaultKey
] = kv
[0];
1126 error
= 'invalid propertyString, not a key=value pair and no defaultKey defined';
1127 return false; // break
1132 if (error
!== undefined) {
1133 console
.error(error
);
1140 printPropertyString: function(data
, defaultKey
) {
1141 var stringparts
= [],
1142 gotDefaultKeyVal
= false,
1145 Ext
.Object
.each(data
, function(key
, value
) {
1146 if (defaultKey
!== undefined && key
=== defaultKey
) {
1147 gotDefaultKeyVal
= true;
1148 defaultKeyVal
= value
;
1149 } else if (Ext
.isArray(value
)) {
1150 stringparts
.push(key
+ '=' + value
.join(';'));
1151 } else if (value
!== '') {
1152 stringparts
.push(key
+ '=' + value
);
1156 stringparts
= stringparts
.sort();
1157 if (gotDefaultKeyVal
) {
1158 stringparts
.unshift(defaultKeyVal
);
1161 return stringparts
.join(',');
1164 acmedomain_count
: 5,
1166 parseACMEPluginData: function(data
) {
1169 data
.split('\n').forEach((line
) => {
1170 // capture everything after the first = as value
1171 let [key
, value
] = line
.split('=');
1172 if (value
!== undefined) {
1175 extradata
.push(line
);
1178 return [res
, extradata
];
1181 delete_if_default: function(values
, fieldname
, default_val
, create
) {
1182 if (values
[fieldname
] === '' || values
[fieldname
] === default_val
) {
1184 if (values
.delete) {
1185 if (Ext
.isArray(values
.delete)) {
1186 values
.delete.push(fieldname
);
1188 values
.delete += ',' + fieldname
;
1191 values
.delete = fieldname
;
1195 delete values
[fieldname
];
1199 printACME: function(value
) {
1200 if (Ext
.isArray(value
.domains
)) {
1201 value
.domains
= value
.domains
.join(';');
1203 return Proxmox
.Utils
.printPropertyString(value
);
1206 parseACME: function(value
) {
1214 Ext
.Array
.each(value
.split(','), function(p
) {
1215 var kv
= p
.split('=', 2);
1216 if (Ext
.isDefined(kv
[1])) {
1219 error
= 'Failed to parse key-value pair: '+p
;
1225 if (error
!== undefined) {
1226 console
.error(error
);
1230 if (res
.domains
!== undefined) {
1231 res
.domains
= res
.domains
.split(/;/);
1237 add_domain_to_acme: function(acme
, domain
) {
1238 if (acme
.domains
=== undefined) {
1239 acme
.domains
= [domain
];
1241 acme
.domains
.push(domain
);
1242 acme
.domains
= acme
.domains
.filter((value
, index
, self
) => self
.indexOf(value
) === index
);
1247 remove_domain_from_acme: function(acme
, domain
) {
1248 if (acme
.domains
!== undefined) {
1249 acme
.domains
= acme
.domains
.filter(
1250 (value
, index
, self
) => self
.indexOf(value
) === index
&& value
!== domain
,
1256 get_health_icon: function(state
, circle
) {
1257 if (circle
=== undefined) {
1261 if (state
=== undefined) {
1265 var icon
= 'faded fa-question';
1268 icon
= 'good fa-check';
1271 icon
= 'warning fa-upload';
1274 icon
= 'warning fa-refresh';
1277 icon
= 'warning fa-exclamation';
1280 icon
= 'critical fa-times';
1292 formatNodeRepoStatus: function(status
, product
) {
1293 let fmt
= (txt
, cls
) => `<i class="fa fa-fw fa-lg fa-${cls}"></i>${txt}`;
1295 let getUpdates
= Ext
.String
.format(gettext('{0} updates'), product
);
1296 let noRepo
= Ext
.String
.format(gettext('No {0} repository enabled!'), product
);
1298 if (status
=== 'ok') {
1299 return fmt(getUpdates
, 'check-circle good') + ' ' +
1300 fmt(gettext('Production-ready Enterprise repository enabled'), 'check-circle good');
1301 } else if (status
=== 'no-sub') {
1302 return fmt(gettext('Production-ready Enterprise repository enabled'), 'check-circle good') + ' ' +
1303 fmt(gettext('Enterprise repository needs valid subscription'), 'exclamation-circle warning');
1304 } else if (status
=== 'non-production') {
1305 return fmt(getUpdates
, 'check-circle good') + ' ' +
1306 fmt(gettext('Non production-ready repository enabled!'), 'exclamation-circle warning');
1307 } else if (status
=== 'no-repo') {
1308 return fmt(noRepo
, 'exclamation-circle critical');
1311 return Proxmox
.Utils
.unknownText
;
1314 render_u2f_error: function(error
) {
1316 '1': gettext('Other Error'),
1317 '2': gettext('Bad Request'),
1318 '3': gettext('Configuration Unsupported'),
1319 '4': gettext('Device Ineligible'),
1320 '5': gettext('Timeout'),
1322 return "U2F Error: " + ErrorNames
[error
] || Proxmox
.Utils
.unknownText
;
1325 // Convert an ArrayBuffer to a base64url encoded string.
1326 // A `null` value will be preserved for convenience.
1327 bytes_to_base64url: function(bytes
) {
1328 if (bytes
=== null) {
1333 .from(new Uint8Array(bytes
))
1334 .map(val
=> String
.fromCharCode(val
))
1337 .replace(/\+/g, '-')
1338 .replace(/\//g, '_')
1339 .replace(/[=]/g, '');
1342 // Convert an a base64url string to an ArrayBuffer.
1343 // A `null` value will be preserved for convenience.
1344 base64url_to_bytes: function(b64u
) {
1345 if (b64u
=== null) {
1349 return new Uint8Array(
1352 .replace(/_/g, '/'),
1355 .map(val => val.charCodeAt(0)),
1359 stringToRGB: function(string) {
1364 string += 'prox
'; // give short strings more variance
1365 for (let i = 0; i < string.length; i++) {
1366 hash = string.charCodeAt(i) + ((hash << 5) - hash);
1367 hash = hash & hash; // to int
1370 let alpha = 0.7; // make the color a bit brighter
1371 let bg = 255; // assume white background
1374 (hash & 255) * alpha + bg * (1 - alpha),
1375 ((hash >> 8) & 255) * alpha + bg * (1 - alpha),
1376 ((hash >> 16) & 255) * alpha + bg * (1 - alpha),
1380 rgbToCss: function(rgb) {
1381 return `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`;
1384 rgbToHex: function(rgb) {
1385 let r = Math.round(rgb[0]).toString(16);
1386 let g = Math.round(rgb[1]).toString(16);
1387 let b = Math.round(rgb[2]).toString(16);
1388 return `${r}${g}${b}`;
1391 hexToRGB: function(hex) {
1395 if (hex.length === 7) {
1398 let r = parseInt(hex.slice(0, 2), 16);
1399 let g = parseInt(hex.slice(2, 4), 16);
1400 let b = parseInt(hex.slice(4, 6), 16);
1404 // optimized & simplified SAPC function
1405 // https://github.com/Myndex/SAPC-APCA
1406 getTextContrastClass: function(rgb) {
1407 const blkThrs = 0.022;
1408 const blkClmp = 1.414;
1410 // linearize & gamma correction
1411 let r = (rgb[0] / 255) ** 2.4;
1412 let g = (rgb[1] / 255) ** 2.4;
1413 let b = (rgb[2] / 255) ** 2.4;
1415 // relative luminance sRGB
1416 let bg = r * 0.2126729 + g * 0.7151522 + b * 0.0721750;
1419 bg = bg > blkThrs ? bg : bg + (blkThrs - bg) ** blkClmp;
1421 // SAPC with white text
1422 let contrastLight = bg ** 0.65 - 1;
1423 // SAPC with black text
1424 let contrastDark = bg ** 0.56 - 0.046134502;
1426 if (Math.abs(contrastLight) >= Math.abs(contrastDark)) {
1433 getTagElement: function(string, color_overrides) {
1434 let rgb = color_overrides?.[string] || Proxmox.Utils.stringToRGB(string);
1435 let style = `background-color: ${Proxmox.Utils.rgbToCss(rgb)};`;
1437 if (rgb.length > 3) {
1438 style += `color: ${Proxmox.Utils.rgbToCss([rgb[3], rgb[4], rgb[5]])}`;
1439 cls = "proxmox-tag-dark";
1441 let txtCls = Proxmox.Utils.getTextContrastClass(rgb);
1442 cls = `proxmox-tag-${txtCls}`;
1444 return `<span class="${cls}" style="${style}">${string}</span>`;
1447 // Setting filename here when downloading from a remote url sometimes fails in chromium browsers
1448 // because of a bug when using attribute download in conjunction with a self signed certificate.
1449 // For more info see https://bugs.chromium.org/p/chromium/issues/detail?id=993362
1450 downloadAsFile: function(source, fileName) {
1451 let hiddenElement = document.createElement('a
');
1452 hiddenElement.href = source;
1453 hiddenElement.target = '_blank
';
1455 hiddenElement.download = fileName;
1457 hiddenElement.click();
1462 constructor: function() {
1464 Ext.apply(me, me.utilities);
1466 let IPV4_OCTET = "(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])";
1467 let IPV4_REGEXP = "(?:(?:" + IPV4_OCTET + "\\.){3}" + IPV4_OCTET + ")";
1468 let IPV6_H16 = "(?:[0-9a-fA-F]{1,4})";
1469 let IPV6_LS32 = "(?:(?:" + IPV6_H16 + ":" + IPV6_H16 + ")|" + IPV4_REGEXP + ")";
1470 let IPV4_CIDR_MASK = "([0-9]{1,2})";
1471 let IPV6_CIDR_MASK = "([0-9]{1,3})";
1474 me.IP4_match = new RegExp("^(?:" + IPV4_REGEXP + ")$");
1475 me.IP4_cidr_match = new RegExp("^(?:" + IPV4_REGEXP + ")/" + IPV4_CIDR_MASK + "$");
1477 /* eslint-disable no-useless-concat,no-multi-spaces */
1478 let IPV6_REGEXP = "(?:" +
1479 "(?:(?:" + "(?:" + IPV6_H16 + ":){6})" + IPV6_LS32 + ")|" +
1480 "(?:(?:" + "::" + "(?:" + IPV6_H16 + ":){5})" + IPV6_LS32 + ")|" +
1481 "(?:(?:(?:" + IPV6_H16 + ")?::" + "(?:" + IPV6_H16 + ":){4})" + IPV6_LS32 + ")|" +
1482 "(?:(?:(?:(?:" + IPV6_H16 + ":){0,1}" + IPV6_H16 + ")?::" + "(?:" + IPV6_H16 + ":){3})" + IPV6_LS32 + ")|" +
1483 "(?:(?:(?:(?:" + IPV6_H16 + ":){0,2}" + IPV6_H16 + ")?::" + "(?:" + IPV6_H16 + ":){2})" + IPV6_LS32 + ")|" +
1484 "(?:(?:(?:(?:" + IPV6_H16 + ":){0,3}" + IPV6_H16 + ")?::" + "(?:" + IPV6_H16 + ":){1})" + IPV6_LS32 + ")|" +
1485 "(?:(?:(?:(?:" + IPV6_H16 + ":){0,4}" + IPV6_H16 + ")?::" + ")" + IPV6_LS32 + ")|" +
1486 "(?:(?:(?:(?:" + IPV6_H16 + ":){0,5}" + IPV6_H16 + ")?::" + ")" + IPV6_H16 + ")|" +
1487 "(?:(?:(?:(?:" + IPV6_H16 + ":){0,7}" + IPV6_H16 + ")?::" + ")" + ")" +
1489 /* eslint-enable no-useless-concat,no-multi-spaces */
1491 me.IP6_match = new RegExp("^(?:" + IPV6_REGEXP + ")$");
1492 me.IP6_cidr_match = new RegExp("^(?:" + IPV6_REGEXP + ")/" + IPV6_CIDR_MASK + "$");
1493 me.IP6_bracket_match = new RegExp("^\\[(" + IPV6_REGEXP + ")\\]");
1495 me.IP64_match = new RegExp("^(?:" + IPV6_REGEXP + "|" + IPV4_REGEXP + ")$");
1496 me.IP64_cidr_match = new RegExp("^(?:" + IPV6_REGEXP + "/" + IPV6_CIDR_MASK + ")|(?:" + IPV4_REGEXP + "/" + IPV4_CIDR_MASK + ")$");
1498 let DnsName_REGEXP = "(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]*[a-zA-Z0-9])?)\\.)*(?:[A-Za-z0-9](?:[A-Za-z0-9\\-]*[A-Za-z0-9])?))";
1499 me.DnsName_match = new RegExp("^" + DnsName_REGEXP + "$");
1500 me.DnsName_or_Wildcard_match = new RegExp("^(?:\\*\\.)?" + DnsName_REGEXP + "$");
1502 me.CpuSet_match = /^[0-9]+(?:-[0-9]+)?(?:,[0-9]+(?:-[0-9]+)?)*$/;
1504 me.HostPort_match = new RegExp("^(" + IPV4_REGEXP + "|" + DnsName_REGEXP + ")(?::(\\d+))?$");
1505 me.HostPortBrackets_match = new RegExp("^\\[(" + IPV6_REGEXP + "|" + IPV4_REGEXP + "|" + DnsName_REGEXP + ")\\](?::(\\d+))?$");
1506 me.IP6_dotnotation_match = new RegExp("^(" + IPV6_REGEXP + ")(?:\\.(\\d+))?$");
1507 me.Vlan_match = /^vlan(\d+)/;
1508 me.VlanInterface_match = /(\w+)\.(\d+)/;
1512 Ext.define('Proxmox
.Async
', {
1515 // Returns a Promise resolving to the result of an `API2Request` or rejecting to the error
1516 // response on failure
1517 api2: function(reqOpts) {
1518 return new Promise((resolve, reject) => {
1519 delete reqOpts.callback; // not allowed in this api
1520 reqOpts.success = response => resolve(response);
1521 reqOpts.failure = response => reject(response);
1522 Proxmox.Utils.API2Request(reqOpts);
1526 // Delay for a number of milliseconds.
1527 sleep: function(millis) {
1528 return new Promise((resolve, _reject) => setTimeout(resolve, millis));
1532 Ext.override(Ext.data.Store, {
1533 // If the store's proxy is changed
while it is waiting
for an AJAX
1534 // response, `onProxyLoad` will still be called for the outdated response.
1535 // To avoid displaying inconsistent information, only process responses
1536 // belonging to the current proxy. However, do not apply this workaround
1537 // to the mobile UI, as Sencha Touch has an incompatible internal API.
1538 onProxyLoad: function(operation
) {
1540 if (Proxmox
.Utils
.toolkit
=== 'touch' || operation
.getProxy() === me
.getProxy()) {
1541 me
.callParent(arguments
);
1543 console
.log(`ignored outdated response: ${operation.getRequest().getUrl()}`);