示例#1
0
 def render(self):
     if self._batch_id is None:
         return vd.div('No batch id')
     if self._list_mode:
         refresh_button = vd.button('Refresh', onclick=self._on_refresh)
         back_button = vd.button('Back to batches', onclick=self._on_back)
         label = self._batch.get('label', 'nolabel')
         return vd.div(vd.div(self._batch_id + ' ' + label),
                       vd.div(refresh_button, back_button), self._job_table)
     else:
         # back_button=vd.button('Back to job list',onclick=self._on_back_to_list)
         return vd.div(self._job_view, style=dict(padding='15px'))
示例#2
0
 def render(self):
     button_style = {'margin': '3px'}
     buttons = [
         vd.button(item[0], onclick=item[1], style=button_style)
         for item in self._data
     ]
     return vd.div(buttons, style={'padding-bottom': '20px'})
示例#3
0
 def render(self):
     if self._job is None:
         return vd.div('No job')
     back_button = vd.button('Back to job list', onclick=self._on_back)
     console_out = None
     if 'result' in self._job:
         console_out = mt.loadText(
             path=self._job['result'].get('console_out', None))
     return vd.div(vd.div(back_button), vd.div(vd.pre(console_out or '')),
                   vd.div(vd.pre(json.dumps(self._job, indent=4))))
示例#4
0
 def render(self):
     if self._list_mode:
         refresh_list_button = vd.button('Refresh',
                                         onclick=self._on_refresh_list)
         return vd.div(vd.table(vd.tr(vd.td(refresh_list_button))),
                       vd.components.ScrollArea(self._batchlist_table,
                                                height=500),
                       style=dict(padding='15px'))
     else:
         # back_button=vd.button('Back to list',onclick=self._on_back_to_list)
         return vd.div(self._batch_view, style=dict(padding='15px'))
示例#5
0
    def createSession(self):
        status = Status()
        status.setStatus('test1')

        def on_click():
            print('clicked')
            status.setStatus('clicked...')
            return 'return_string'

        root = vd.div(vd.h3('testing'), vd.h2('testing2'),
                      vd.button('push me', onclick=on_click), status)
        return root
示例#6
0
 def __init__(self):
     vd.Component.__init__(self)
     self._job = None
     self._show_console_output_button = vd.button(
         'Show console output', onclick=self._on_show_console_output)
示例#7
0
 def render(self):
     button = vd.button(self._label, onclick=self._on_click, **self._kwargs)
     return button