def on_click(self, event, params, vars=None): if params[0] == 'restart': backend.restart() if params[0] == 'editshare': self._editing_share = params[1] self._tab = 0 if params[0] == 'delshare': if params[1] in self._cfg.shares.keys(): del self._cfg.shares[params[1]] self._cfg.save() self._tab = 0 if params[0] == 'newshare': self._editing_share = '' self._tab = 0 #if params[0] == 'edituser': # self._editing_user = params[1] # self._tab = 1 if params[0] == 'newuser': self._adding_user = True self._tab = 1 if params[0] == 'deluser': self._cfg.del_user(params[1]) self._cfg.load() self._tab = 1 if params[0] == 'chuser': self._tab = 1 self._editing = params[1]
def on_click(self, event, params, vars=None): if params[0] == 'restart': backend.restart() if params[0] == 'editshare': self._editing_share = params[1] self._tab = 0 if params[0] == 'delshare': self._cfg.shares.pop(params[1]) self._cfg.save() self._tab = 0 if params[0] == 'newshare': self._editing_share = '' self._tab = 0 if params[0] == 'edituser': self._editing_user = params[1] self._tab = 1 if params[0] == 'newuser': self._adding_user = True self._tab = 1 if params[0] == 'deluser': self._cfg.del_user(params[1]) self._cfg.load() self._tab = 1 if params[0] == 'chuser': self._tab = 1 self._editing = params[1]
def on_click(self, event, params, vars=None): if params[0] == 'restart': backend.restart() if params[0] == 'edit_user': self._editing_user = params[1] self._tab = 0 if params[0] == 'del_user': if params[1] in self._cfg.get_userlist(): self._cfg.delete_user(params[1]) self._cfg.save() self.put_message('info', 'User "' + params[1] + '" deleted.') else: self.put_message('err', 'User "' + params[1] + '" not found.') self._tab = 0 if params[0] == 'newuser': self._adding_user = True