def get_ui_about(self): ui = UI.Centerer( UI.VContainer( UI.Image(file='/dl/core/ui/logo_big.png'), UI.Spacer(height=6), UI.Label(text='Ajenti ' + version, size=4), UI.Label(text='Your personal server affairs agent'), UI.Spacer(height=10), UI.HContainer( UI.OutLinkLabel( url ='http://www.assembla.com/spaces/ajenti/wiki?id=aLa8XiGfWr36nLeJe5cbLA', text='Wiki'), UI.OutLinkLabel( url= 'http://www.assembla.com/spaces/ajenti/wiki?id=ajenti&wiki_id=Developers', text='Credits'), UI.OutLinkLabel( text='License', url='http://www.gnu.org/licenses/lgpl.html'), UI.OutLinkLabel( text='Bugs', url= 'http://www.assembla.com/spaces/ajenti/support/tickets' ), spacing=6), UI.Spacer(height=10), UI.Button(text='Close', id='closeabout'))) return UI.DialogBox(ui, hideok=True, hidecancel=True)
def get_ui_hosts(self): tbl = UI.DataTable( UI.DataTableRow(UI.Label(), UI.Label(text='Name'), UI.Label(), header=True)) hosts = self._backend.get_hosts() for x in sorted(hosts.keys()): tbl.append( UI.DataTableRow( UI.Image(file='/dl/core/ui/stock/status-%sabled.png' % ('en' if hosts[x].enabled else 'dis')), UI.Label(text=x), UI.DataTableCell(UI.HContainer( UI.MiniButton(id='edithost/' + x, text='Edit'), UI.MiniButton(id='togglehost/' + x, text='Disable' if hosts[x].enabled else 'Enable'), UI.WarningMiniButton(id='deletehost/' + x, text='Delete', msg='Delete host %s' % x), spacing=0), hidden=True))) ui = UI.VContainer(tbl, UI.Button(text='Add host', id='addhost')) if self._creating_host: ui.append( UI.InputBox(text='Host config name:', id='dlgCreateHost')) if self._editing_host is not None: ui.append( UI.AreaInputBox(text='Host config:', value=self._backend.get_hosts()[ self._editing_host].config, id='dlgEditHost')) return ui