mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-08-08 10:09:56 +00:00
collect and show errors on dashboard
if a cluster member is not reachable, collect the errors and show them once to the user Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
91c74e81a8
commit
bb7ab2baa6
@ -113,6 +113,7 @@ Ext.define('PMG.Dashboard', {
|
|||||||
var mem = 0;
|
var mem = 0;
|
||||||
var hd = 0;
|
var hd = 0;
|
||||||
var count = records.length;
|
var count = records.length;
|
||||||
|
var errors = [];
|
||||||
|
|
||||||
records.forEach(function(item) {
|
records.forEach(function(item) {
|
||||||
// subscription level check
|
// subscription level check
|
||||||
@ -135,6 +136,13 @@ Ext.define('PMG.Dashboard', {
|
|||||||
var rootfs = item.data.rootfs || { used: 0, total: 1 };
|
var rootfs = item.data.rootfs || { used: 0, total: 1 };
|
||||||
hd += (rootfs.used/rootfs.total);
|
hd += (rootfs.used/rootfs.total);
|
||||||
|
|
||||||
|
if (item.data.conn_error && count > 1) {
|
||||||
|
count--;
|
||||||
|
errors.push({
|
||||||
|
name: item.data.name,
|
||||||
|
msg: item.data.conn_error
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var subscriptionPanel = me.lookup('subscription');
|
var subscriptionPanel = me.lookup('subscription');
|
||||||
@ -152,6 +160,15 @@ Ext.define('PMG.Dashboard', {
|
|||||||
|
|
||||||
var hdPanel = me.lookup('hd');
|
var hdPanel = me.lookup('hd');
|
||||||
hdPanel.updateValue(hd);
|
hdPanel.updateValue(hd);
|
||||||
|
|
||||||
|
if (errors.length && !viewmodel.get('error_shown')) {
|
||||||
|
var text = "";
|
||||||
|
errors.forEach(function(error) {
|
||||||
|
text += error.name + ':<br>' + error.msg + '<br>';
|
||||||
|
});
|
||||||
|
Ext.Msg.alert(gettext('Error'), text);
|
||||||
|
viewmodel.set('error_shown', true);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
init: function(view) {
|
init: function(view) {
|
||||||
@ -166,6 +183,7 @@ Ext.define('PMG.Dashboard', {
|
|||||||
data: {
|
data: {
|
||||||
timespan: 300, // in seconds
|
timespan: 300, // in seconds
|
||||||
hours: 12, // in hours
|
hours: 12, // in hours
|
||||||
|
error_shown: false,
|
||||||
'bytes_in': 0,
|
'bytes_in': 0,
|
||||||
'bytes_out': 0,
|
'bytes_out': 0,
|
||||||
'avg_ptime': 0.0
|
'avg_ptime': 0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user