Closed hseffler closed 4 years ago
I got the same problem, even with 6.7.1
Yep, exactly the same Problem. After Upgrading to 6.7.1 its broken. After Downgrad to 6.6.2 it's working again
Me too
Seems that the problem is in src/status_ctrl.js:L171
:
setTextMaxWidth() {
let tail = ' …';
let panelWidth = this.$panelContainer.innerWidth();
if (isNaN(panelWidth))
panelWidth = parseInt(panelWidth.slice(0, -2), 10) / 12;
panelWidth = panelWidth - 20;
this.maxWidth = panelWidth;
}
I know it is not a satisfying thing to say, but this project looks dead and given that there are backwards-incompatibility issues with panels in Grafana at least once a year, using built-in panels is a much safer bet. Grafana has a new Stat
panel, which is less powerful than multistat since it cannot set colors, thresholds and units for time series separately, but might be sufficient in most use cases.
Most likely, one of our internal customers got also some sort of JS errors:
Panel rendering error, panelWidth is undefined
The panel-container class is not accessible like it is here: https://github.com/Vonage/Grafana_Status_panel/blob/master/src/status_ctrl.js#L637
But if you change it to: elem.closest('.panel-container');
the panel should start working again. But the way this panel works by accessing core classes outside it's scope (panel-container & panel-header) is very fragile and will break again as these are classes Grafana will change in the future.
I updated Grafana 6.5 to 6.7 , from that on status panel not working . I tried to do some changes in the status panel config and it says “Panel rendering error Cannot read property ‘slice’ of undefined”
I see already some actions taken here, just posting
It seems I've found the solution.
Change this line:
https://github.com/Vonage/Grafana_Status_panel/blob/master/src/status_ctrl.js#L637
like this:
this.$panelContainer = elem;
The elem
parameter of method link
receives the following DOM subtree:
<grafana-panel ctrl="ctrl" class="panel-height-helper ng-isolate-scope">
<ng-transclude class="panel-height-helper"><div class="status-panel ng-scope">
<div ng-show="ctrl.duplicates">...
If I not mistakes, this is a container of the plugin which previously was retrieved by calling elem.find()
method.
Anyway, this subtree does not contains object of class 'panel-container'.
Yes, it works! I'm not sure but there is a small graphic difference, after your suggestion only the internal rectangle color is changing and not the full rectangle containing the status.
Thank you, Fabrizio
Yes, it works! I'm not sure but there is a small graphic difference, after your suggestion only the internal rectangle color is changing and not the full rectangle containing the status.
Thank you, Fabrizio
Probably, It was a quick fix. In our case it was OK.
Yes, It's OK also for me simply adding the trasparency to the panel,
Dear @sgolubevCY , Thanks for share your solution.
Sory, but i'm a JS newbie. After fix the source file, what other command o task need I execute?
I've made the change you suggested on src/status_ctrl.js
, and restart Grafana, but my pannels keep blank with no info.
Thanks in advance!
Hello, You must change also the file in "dist" directory, not only in "src".
Bye
Hi @MefhigosetH,
As @ftasso suggested, you have to change this line in the same file into "dist" folder.
@ftasso @sgolubevCY Oh, thanks! This 'detail' was the solution.
Now, I can see my pannels :-D
Hey everyone. Unfortunately, we currently don't have the resources to work on this panel. I think issue is specifically important for continued use. If someone can create a PR to fix this, we'll try to validate and push this in soon. Thanks and apologies for the inconvenience.
Hey,
your fix solved first issue. But If I try to use two metrics, I have this error :
@ktibi This might be related to the issue where if you click on the "Duplicate Query" icon instead of the "Add Query" button. Duplicate Query will break the panel. It seems to copy some internal ID that Status panel references. It is not documented other than in an issue, but that is the way to add more than one metric! Hope this helps. The status plugin works for me with the fix and displays multiple metrics. Would be great to have a group officially take over this plugin or that the functionality be folded into the official single-stat plugin.
@xkilian Thx your explanation. Add new query instead of duplicate resolve the issue.
Yes, yes. With the patch sugested by @sgolubevCY , the panel on my dashboards, worked fine again:
I hope, the project can merge my PR.
my grafana version is 6.7.2 i have the same problem
Grafana 6.7.2
Cannot read property 'slice' of undefined
angular.js:14800 TypeError: Cannot read property 'slice' of undefined
at StatusPluginCtrl.setTextMaxWidth (status_ctrl.js:175)
at StatusPluginCtrl.onRender (status_ctrl.js:216)
at u.emit (index.js:150)
at e.value (emitter.ts:27)
at StatusPluginCtrl.value (panel_ctrl.ts:102)
at panel_directive.ts:64
at angular.js:20566
at p (angular.js:6428)
at angular.js:6707 "Possibly unhandled rejection: {}"
Dear @freedomwarrior , @luciferYu
The issue was fixed with the @sgolubevCY change, on prev messages here.
Or you can review muy PullRequest 161 for known where to apply the neccesary changes.
Cheers
Dear @freedomwarrior , @luciferYu
The issue was fixed with the @sgolubevCY change, on prev messages here.
Or you can review muy PullRequest 161 for known where to apply the neccesary changes.
Cheers
Worked!
i see the issue is fixed but the panel display is not elegant as it used to be as @MefhigosetH mentioned. This needs to fixed too along with the other things.
When could is fixed this issue ? I see workaround applied by @vkalladath in a fork repo , bug the original repo have not a merge with the fix yet.
I would like this to be fixed in the main repository too
Yes, yes. With the patch sugested by @sgolubevCY , the panel on my dashboards, worked fine again:
I hope, the project can merge my PR.
hi can you share the JSON format of the dashboard?
Works up to 6.6.2, breaks in 6.7.0 released yesterday.