Dashboard graph Y-axis width should increase with label. #5929

This commit is contained in:
Aditya Toshniwal 2023-03-14 11:04:08 +05:30 committed by GitHub
parent e32019882e
commit f72f4aa359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -80,7 +80,7 @@ export function getNodeView(nodeType, treeNodeInfo, actionType, itemNodeData, fo
resolve(res.data);
onSave && onSave(res.data);
}).catch((err)=>{
Notify.pgNotifier('error', err, '', function(msg) {
Notify.pgNotifier('error-noalert', err, '', function(msg) {
if (msg == 'CRYPTKEY_SET') {
return Promise.resolve(onSaveClick(isNew, data));
} else if (msg == 'CRYPTKEY_NOT_SET') {

View File

@ -92,6 +92,16 @@ export default function StreamingChart({xRange=75, data, options}) {
{
show: false,
},
{
size: function(_obj, values) {
let size = 40;
if(values?.length > 0) {
size = values[values.length-1].length*12;
if(size < 40) size = 40;
}
return size;
}
}
],
plugins: options.showTooltip ? [tooltipPlugin(data.refreshRate)] : [],
}), [data.refreshRate, data?.datasets?.length, width, height, options]);

View File

@ -192,6 +192,9 @@ let Notifier = {
return;
}
}
if(type == 'error-noalert' && onJSONResult && typeof(onJSONResult) == 'function') {
return onJSONResult();
}
this.alert(promptmsg, msg.replace(new RegExp(/\r?\n/, 'g'), '<br />'));
},
alert: (title, text, onOkClick, okLabel=gettext('OK'))=>{