File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
library/Graphite/Web/Widget Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 44
55use Icinga \Application \Config ;
66use Icinga \Application \Icinga ;
7+ use Icinga \Authentication \Auth ;
8+ use Icinga \Exception \ConfigurationError ;
79use Icinga \Module \Graphite \Forms \TimeRangePicker \TimeRangePickerTrait ;
810use Icinga \Module \Graphite \Graphing \GraphingTrait ;
911use Icinga \Module \Graphite \Graphing \Template ;
@@ -317,7 +319,22 @@ protected function getGraphsList()
317319
318320 public function render ()
319321 {
320- $ result = $ this ->getGraphsList ();
322+ try {
323+ $ result = $ this ->getGraphsList ();
324+ } catch (ConfigurationError $ e ) {
325+ $ view = $ this ->view ();
326+
327+ return "<p> {$ view ->escape ($ e ->getMessage ())}</p> "
328+ . '<p> ' . vsprintf (
329+ $ view ->escape ($ view ->translate ('Please %scorrect%s the configuration of the Graphite module. ' )),
330+ Auth::getInstance ()->hasPermission ('config/modules ' )
331+ ? explode (
332+ '$LINK_TEXT$ ' ,
333+ $ view ->qlink ('$LINK_TEXT$ ' , 'graphite/config/backend ' , null , ['class ' => 'action-link ' ])
334+ )
335+ : ['' , '' ]
336+ ) . '</p> ' ;
337+ }
321338
322339 if ($ result === '' && $ this ->getShowNoGraphsFound ()) {
323340 $ view = $ this ->view ();
You can’t perform that action at this time.
0 commit comments