Ejemplo n.º 1
0
 def _show_history(self, history_json, image_id):
     history = history_json
     histories = [(d.get("Id", "")[:12], d.get("CreatedBy", "")) for d in history]
     dialog = TableDialog(
         "History for %s" % image_id[:12],
         histories,
         [
             {"value": "image id", "weight": 1, "align": "center"},
             {"value": "command", "weight": 4, "align": "center"},
         ],
     )
     dialog.width = ("relative", 90)
     self.show_dialog(dialog)
Ejemplo n.º 2
0
 def _show_top(self, top_json, container_id):
     processes = top_json.get('Processes', '')
     titles = top_json.get('Titles', '')
     dialog = TableDialog("Running Processes in %s" % container_id[:12],
                          processes, [
                              {
                                  'value': titles[0],
                                  'weight': 3,
                                  'align': 'center'
                              },
                              {
                                  'value': titles[1],
                                  'weight': 3,
                                  'align': 'center'
                              },
                              {
                                  'value': titles[2],
                                  'weight': 3,
                                  'align': 'center'
                              },
                              {
                                  'value': titles[3],
                                  'weight': 1,
                                  'align': 'center'
                              },
                              {
                                  'value': titles[4],
                                  'weight': 3,
                                  'align': 'center'
                              },
                              {
                                  'value': titles[5],
                                  'weight': 3,
                                  'align': 'center'
                              },
                              {
                                  'value': titles[6],
                                  'weight': 3,
                                  'align': 'center'
                              },
                              {
                                  'value': titles[7],
                                  'weight': 10,
                                  'align': 'center'
                              },
                          ])
     dialog.width = ('relative', 90)
     self.show_dialog(dialog, )
Ejemplo n.º 3
0
 def _show_history(self, history_json, image_id):
     history = history_json
     histories = [(d.get('Id', '')[:12], d.get('CreatedBy', ''))
                  for d in history]
     dialog = TableDialog("History for %s" % image_id[:12], histories,
                          [{
                              'value': "image id",
                              'weight': 1,
                              'align': 'center'
                          }, {
                              'value': "command",
                              'weight': 4,
                              'align': 'center'
                          }])
     dialog.width = ('relative', 90)
     self.show_dialog(dialog, )
Ejemplo n.º 4
0
 def _show_top(self, top_json, container_id):
     processes = top_json.get('Processes','')
     titles = top_json.get('Titles','')
     dialog = TableDialog(
         "Running Processes in %s" % container_id[:12],
         processes,
         [
             {'value':titles[0], 'weight':3, 'align':'center'},
             {'value':titles[1], 'weight':3, 'align':'center'},
             {'value':titles[2], 'weight':3, 'align':'center'},
             {'value':titles[3], 'weight':1, 'align':'center'},
             {'value':titles[4], 'weight':3, 'align':'center'},
             {'value':titles[5], 'weight':3, 'align':'center'},
             {'value':titles[6], 'weight':3, 'align':'center'},
             {'value':titles[7], 'weight':10, 'align':'center'},
         ]
     )
     dialog.width = ('relative', 90)
     self.show_dialog(dialog, )
Ejemplo n.º 5
0
 def _show_diff(self, diff_json, container_id):
     for d in diff_json:
         if d['Kind'] == 0:
             d['Kind'] = 'Change'
         elif d['Kind'] == 1:
             d['Kind'] = 'Add'
         elif d['Kind'] == 2:
             d['Kind'] = 'Delete'
     diffs = [(d.get('Kind',''), d.get('Path','')) for d in diff_json]
     dialog = TableDialog(
         "Changes in %s" % container_id[:12],
         diffs,
         [
             {'value':"kind", 'weight':1, 'align':'center'},
             {'value':"path", 'weight':4, 'align':'center'}
         ]
     )
     dialog.width = ('relative', 90)
     self.show_dialog(dialog, )
Ejemplo n.º 6
0
 def _show_diff(self, diff_json, container_id):
     for d in diff_json:
         if d['Kind'] == 0:
             d['Kind'] = 'Change'
         elif d['Kind'] == 1:
             d['Kind'] = 'Add'
         elif d['Kind'] == 2:
             d['Kind'] = 'Delete'
     diffs = [(d.get('Kind', ''), d.get('Path', '')) for d in diff_json]
     dialog = TableDialog("Changes in %s" % container_id[:12], diffs,
                          [{
                              'value': "kind",
                              'weight': 1,
                              'align': 'center'
                          }, {
                              'value': "path",
                              'weight': 4,
                              'align': 'center'
                          }])
     dialog.width = ('relative', 90)
     self.show_dialog(dialog, )