0
Færdig

Remove widgets from dashboard not only on dashboard tab

Paulo Jorge Rodrigues Figueire 10 år siden opdateret af Eugene Pankov (Project coordinator) 10 år siden 2

I'v added a widget on dashboard that's causing a error while i try to access the dashboard tab.

I would be nice to disable widgets also on another tab - where they wouldn't be 'loaded' and then not crash/return a error.


Sorry for my rusty english!

Svar

Svar
Færdig

Fix committed, due for the next build :)

Dashboard will now just display crash notice if there's a problem with a widget (this lets us handle not only "bad configuration" crashes, but all others as well).

Could you please include bug report? Normally no widgets should case dashboard-blocking errors.

Sure!

For example, added lm-sensors...

I got the "Crashed" lightbox... I guess that there's no way to cancel the widget...

I hit continue... the widget isn't added on the widget tab BUT in widgets entry on /etc/ajenti/config.json its there... witch causes the Dashboard tab to crash... need to remove it editing the file... an option on other tab like with checkboxes or something would be nice!


Tnks for your time Eugeny!


'lm-sensors'
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/ajenti/plugins/main/main.py", line 104, in on_message
    self.ui.dispatch_event(update['uid'], update['event'], update['params'])
  File "/usr/lib/pymodules/python2.7/ajenti/ui/__init__.py", line 52, in dispatch_event
    self.root.dispatch_event(uid, event, params)
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 313, in dispatch_event
    if child.dispatch_event(uid, event, params):
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 313, in dispatch_event
    if child.dispatch_event(uid, event, params):
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 313, in dispatch_event
    if child.dispatch_event(uid, event, params):
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 313, in dispatch_event
    if child.dispatch_event(uid, event, params):
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 313, in dispatch_event
    if child.dispatch_event(uid, event, params):
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 313, in dispatch_event
    if child.dispatch_event(uid, event, params):
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 313, in dispatch_event
    if child.dispatch_event(uid, event, params):
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 313, in dispatch_event
    if child.dispatch_event(uid, event, params):
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 313, in dispatch_event
    if child.dispatch_event(uid, event, params):
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 313, in dispatch_event
    if child.dispatch_event(uid, event, params):
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 309, in dispatch_event
    self.event(event, params)
  File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 330, in event
    self.events[event](*self.event_args[event], **(params or {}))
  File "/usr/lib/pymodules/python2.7/ajenti/plugins/dashboard/dash.py", line 56, in on_add_widget_click
    self.add_widget(cls, config)
  File "/usr/lib/pymodules/python2.7/ajenti/plugins/dashboard/dash.py", line 67, in add_widget
    self.refresh()
  File "/usr/lib/pymodules/python2.7/ajenti/plugins/dashboard/dash.py", line 85, in refresh
    config=widget['config'],
  File "/usr/lib/pymodules/python2.7/ajenti/api/__init__.py", line 88, in new
    return context.instantiate(cls, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/ajenti/plugins/__init__.py", line 177, in instantiate
    init(instance)
  File "/usr/lib/pymodules/python2.7/ajenti/plugins/dashboard/api.py", line 31, in init
    self.on_prepare()
  File "/usr/lib/pymodules/python2.7/ajenti/plugins/lm_sensors/main.py", line 53, in on_prepare
    self.append(self.ui.inflate('lm-sensors:widget'))
  File "/usr/lib/pymodules/python2.7/ajenti/ui/__init__.py", line 28, in inflate
    return self.inflater.inflate(self, layout)
  File "/usr/lib/pymodules/python2.7/ajenti/ui/inflater.py", line 64, in inflate
    file = open(os.path.join(manager.resolve_path(plugin), 'layout', path + '.xml'), 'r')
  File "/usr/lib/pymodules/python2.7/ajenti/plugins/__init__.py", line 235, in resolve_path
    return self.__plugins[name].path
KeyError: 'lm-sensors'





Svar
Færdig

Fix committed, due for the next build :)

Dashboard will now just display crash notice if there's a problem with a widget (this lets us handle not only "bad configuration" crashes, but all others as well).

Kundesupport af UserEcho