コード例 #1
0
ファイル: gui.py プロジェクト: kavinsivak/openstack-installer
    def _build_node_waiting(self):
        """ creates a loading screen if nodes do not exist yet """
        text = [Padding.line_break(""), Text(self.message, align="center"), Padding.line_break("")]

        load_box = [
            Color.pending_icon_on(Text("\u2581", align="center")),
            Color.pending_icon_on(Text("\u2582", align="center")),
            Color.pending_icon_on(Text("\u2583", align="center")),
            Color.pending_icon_on(Text("\u2584", align="center")),
            Color.pending_icon_on(Text("\u2585", align="center")),
            Color.pending_icon_on(Text("\u2586", align="center")),
            Color.pending_icon_on(Text("\u2587", align="center")),
            Color.pending_icon_on(Text("\u2588", align="center")),
        ]

        # Add loading boxes
        random.shuffle(load_box)
        loading_boxes = []
        loading_boxes.append(("weight", 1, Text("")))
        for i in load_box:
            loading_boxes.append(("pack", load_box[random.randrange(len(load_box))]))
        loading_boxes.append(("weight", 1, Text("")))
        loading_boxes = Columns(loading_boxes)

        return Filler(Pile(text + [loading_boxes]), valign="middle")
コード例 #2
0
 def _build_widget(self, **kwargs):
     total_items = [
         Padding.center_60(Text(self.title, align="center")),
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1))
     ]
     if self.input_items:
         for item in self.input_items:
             key = item[0]
             caption = item[1]
             try:
                 mask = item[2]
             except:
                 mask = None
             self.input_selection[key] = EditInput(caption="",
                                                   mask=mask)
             col = Columns(
                 [
                     ("weight", 0.4, Text(caption, align="right")),
                     Color.string_input(self.input_selection[key],
                                        focus_map="string_input focus")
                 ]
             )
             total_items.append(Padding.center_60(col))
     total_items.append(
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)))
     total_items.append(Padding.center_20(self._build_buttons()))
     return Filler(Pile(total_items), valign='middle')
コード例 #3
0
    def _build_node_waiting(self):
        """ creates a loading screen if nodes do not exist yet """
        text = [
            Padding.line_break(""),
            Text(self.message, align="center"),
            Padding.line_break("")
        ]

        load_box = [
            Color.pending_icon_on(Text("\u2581", align="center")),
            Color.pending_icon_on(Text("\u2582", align="center")),
            Color.pending_icon_on(Text("\u2583", align="center")),
            Color.pending_icon_on(Text("\u2584", align="center")),
            Color.pending_icon_on(Text("\u2585", align="center")),
            Color.pending_icon_on(Text("\u2586", align="center")),
            Color.pending_icon_on(Text("\u2587", align="center")),
            Color.pending_icon_on(Text("\u2588", align="center"))
        ]

        # Add loading boxes
        random.shuffle(load_box)
        loading_boxes = []
        loading_boxes.append(('weight', 1, Text('')))
        for i in load_box:
            loading_boxes.append(
                ('pack', load_box[random.randrange(len(load_box))]))
        loading_boxes.append(('weight', 1, Text('')))
        loading_boxes = Columns(loading_boxes)

        return Filler(Pile(text + [loading_boxes]), valign="middle")
コード例 #4
0
 def _build_widget(self, **kwargs):
     total_items = [
         Padding.center_60(Text(self.title, align="center")),
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1))
     ]
     if self.input_items:
         for item in self.input_items:
             key = item[0]
             caption = item[1]
             try:
                 mask = item[2]
             except:
                 mask = None
             self.input_selection[key] = StringEditor(caption="", mask=mask)
             col = Columns([
                 ("weight", 0.4, Text(caption, align="right")),
                 Color.string_input(self.input_selection[key],
                                    focus_map="string_input focus")
             ])
             total_items.append(Padding.center_60(col))
     total_items.append(
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)))
     total_items.append(Padding.center_20(self._build_buttons()))
     return Filler(Pile(total_items), valign='middle')
コード例 #5
0
    def __init__(self):
        help_text = [
            Padding.line_break(""),
            Text("OpenStack Installer - Help \u21C5 Scroll (ESC) Close",
                 align="center"),
            Divider('-', 1, 1),
            Text("""
For full documentation, please refer to http://openstack.astokes.org/guides
            """),
            Color.header_title(Text("Overview")),
            Divider('-'),
            Text("""
- Header

The header shows a few common command keys for quick reference.

- Main Table

The main table has a row for each Juju service in the current environment,
updated every ten seconds. Each row will contain a status icon indicator, agent
state, ip address, machine type, and hardware specifications.

There may also be an additional status field with information in the event of
provisioning errors or additional status notifications.

- Footer

The footer displays a status message, and the URLs for the two web dashboards
installed, one for OpenStack Horizon and the other for the Juju GUI.
            """),
            Color.header_title(Text("Command Reference")),
            Divider('-'),
            Text("""
- (R/F5) refreshes the displayed state immediately

- (A/a/F6) brings up a dialog box for adding additional units. This is how to
  add compute units or a storage service. This dialog takes care of launching
  required dependencies, so for example, launching swift here will add a
  swift-proxy service and enough swift-storage nodes to meet the replica
  criterion (currently 3).

- '(H/h/?)' displays this help screen.

- 'q' quits.
            """),
            Color.header_title(Text("Troubleshooting")),
            Divider('-'),
            Text("""
The juju commands used to deploy the services listed are logged in
~/.cloud-install/commands.log

Note: In a multi-install, MAAS may be unable to find machines that match the
default constraints set for one of the services the installer deploys. This
will be shown in the table under the service's heading, along with detail
about what those constraints were.
            """)]
        w = Padding.center_79(SimpleList(help_text))
        super().__init__(w)
コード例 #6
0
ファイル: gui.py プロジェクト: kavinsivak/openstack-installer
 def __init__(self, msg=None):
     if not msg:
         msg = "Processing."
     items = [
         Padding.center_60(Text("Information", align="center")),
         Padding.center_60(Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)),
         Padding.center_60(Text(msg)),
     ]
     super().__init__(Filler(Pile(items), valign="middle"))
コード例 #7
0
    def __init__(self):
        help_text = [
            Padding.line_break(""),
            Text("OpenStack Installer - Help \u21C5 Scroll (ESC) Close",
                 align="center"),
            Divider('-', 1, 1),
            Text("For full documentation, please refer to "
                 "https://help.ubuntu.com/lts/clouddocs/installer/"),
            Color.header_title(Text("Overview")),
            Divider('-'),
            Text("""
- Header

The header shows a few common command keys for quick reference.

- Main Table

The main table has a row for each Juju service in the current environment,
updated every ten seconds. Each row will contain a status icon indicator, agent
state, ip address, machine type, and hardware specifications.

There may also be an additional status field with information in the event of
provisioning errors or additional status notifications.

- Footer

The footer displays a status message, and the URLs for the two web dashboards
installed, one for OpenStack Horizon and the other for the Juju GUI.
            """),
            Color.header_title(Text("Command Reference")),
            Divider('-'),
            Text("""
- (R/F5) refreshes the displayed state immediately

- (A/a/F6) brings up a dialog box for adding additional units. This is how to
  add compute units or a storage service. This dialog takes care of launching
  required dependencies, so for example, launching swift here will add a
  swift-proxy service and enough swift-storage nodes to meet the replica
  criterion (currently 3).

- '(H/h/?)' displays this help screen.

- 'q' quits.
            """),
            Color.header_title(Text("Troubleshooting")),
            Divider('-'),
            Text("""
The juju commands used to deploy the services listed are logged in
~/.cloud-install/commands.log

Note: In a multi-install, MAAS may be unable to find machines that match the
default constraints set for one of the services the installer deploys. This
will be shown in the table under the service's heading, along with detail
about what those constraints were.
            """)]
        w = Padding.center_79(SimpleList(help_text))
        super().__init__(w)
コード例 #8
0
 def __init__(self, msg=None):
     if not msg:
         msg = "Processing."
     items = [
         Padding.center_60(Text("Information", align="center")),
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)),
         Padding.center_60(Text(msg))
     ]
     super().__init__(Filler(Pile(items), valign='middle'))
コード例 #9
0
    def _build_node_waiting(self):
        """ creates a loading screen if nodes do not exist yet """
        text = [Padding.line_break(""), self.message, Padding.line_break("")]

        _boxes = []
        _boxes.append(('weight', 1, Text('')))
        for i in self.loading_boxes:
            _boxes.append(('pack', i))
        _boxes.append(('weight', 1, Text('')))
        _boxes = Columns(_boxes)

        return Filler(Pile(text + [_boxes]), valign="middle")
    def _build_node_waiting(self):
        """ creates a loading screen if nodes do not exist yet """
        text = [Padding.line_break(""),
                self.message,
                Padding.line_break("")]

        _boxes = []
        _boxes.append(('weight', 1, Text('')))
        for i in self.loading_boxes:
            _boxes.append(('pack', i))
        _boxes.append(('weight', 1, Text('')))
        _boxes = Columns(_boxes)

        return Filler(Pile(text + [_boxes]),
                      valign="middle")
コード例 #11
0
 def _build_widget(self):
     total_items = [
         Padding.center_60(Text(self.title, align="center")),
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1))
     ]
     for item in self.radio_items.keys():
         opt, desc = self.radio_items[item]
         col = Columns([("weight", 0.4, opt), Text(desc)], dividechars=1)
         total_items.append(Padding.center_60(col))
     total_items.append(
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)))
     total_items.append(Padding.center_20(self._build_buttons()))
     return Filler(Pile(total_items), valign='middle')
コード例 #12
0
 def _build_buttons(self):
     buttons = [
         Padding.line_break(""),
         Color.button_secondary(Button("Quit", self.cancel),
                                focus_map='button_secondary focus'),
     ]
     return Pile(buttons)
コード例 #13
0
ファイル: gui.py プロジェクト: kavinsivak/openstack-installer
    def _build_widget(self, nodes, **kwargs):
        unit_info = []
        for node in nodes:
            node_pile = []
            node_cols = []
            charm_class, service = node
            if len(service.units) > 0:
                for u in sorted(service.units, key=attrgetter("unit_name")):
                    node_cols = self._build_node_columns(u, charm_class)
                    node_pile.append(node_cols)

                unit_info.append(
                    Padding.center_96(
                        LineBox(
                            Pile(node_pile),
                            title=charm_class.display_name,
                            lline=" ",
                            blcorner=" ",
                            rline=" ",
                            bline=" ",
                            brcorner=" ",
                        )
                    )
                )

        return ScrollableListBox(unit_info)
コード例 #14
0
ファイル: gui.py プロジェクト: terminiter/openstack-installer
 def _build_buttons(self):
     buttons = [
         Padding.line_break(""),
         Color.button_secondary(
             Button("Quit", self.cancel),
             focus_map='button_secondary focus'),
     ]
     return Pile(buttons)
コード例 #15
0
 def _build_buttons(self):
     buttons = [
         Padding.line_break(""),
         Color.button_primary(Button("Confirm", self.submit),
                              focus_map='button_primary focus'),
         Color.button_secondary(Button("Cancel", self.cancel),
                                focus_map='button_secondary focus'),
     ]
     return Pile(buttons)
 def _build_widget(self):
     total_items = [
         Padding.center_60(Text(self.title, align="center")),
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1))
     ]
     for item in self.radio_items.keys():
         opt, desc = self.radio_items[item]
         col = Columns(
             [
                 ("weight", 0.4, opt),
                 Text(desc)
             ], dividechars=1)
         total_items.append(Padding.center_60(col))
     total_items.append(
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)))
     total_items.append(Padding.center_20(self._build_buttons()))
     return Filler(Pile(total_items), valign='middle')
コード例 #17
0
 def _build_buttons(self):
     buttons = [
         Padding.line_break(""),
         Color.button_primary(
             Button("Confirm", self.submit),
             focus_map='button_primary focus'),
         Color.button_secondary(
             Button("Cancel", self.cancel),
             focus_map='button_secondary focus'),
     ]
     return Pile(buttons)
コード例 #18
0
 def __init__(self, error):
     log.debug("showing error view for: {}".format(error))
     bug_url = ("https://github.com/Ubuntu-Solutions-Engineering"
                "/openstack-installer/issues/new")
     body = [
         Padding.center_60(
             Text("Oops, there was a problem with your install:",
                  align="center")),
         Padding.center_95(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)),
         Padding.center_85(Text("Reason:")),
         Padding.center_80(Color.error_major(Text(error))),
         Padding.line_break(""),
         Padding.center_85(
             Text("Please file a bug with the above output and of "
                  "~/.cloud-install/*.log at {}".format(bug_url))),
         Padding.line_break(""),
         Padding.center_95(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)),
         Padding.center_20(self._build_buttons())
     ]
     super().__init__(Filler(Pile(body), valign="middle"))
コード例 #19
0
 def __init__(self, error):
     log.debug("showing error view for: {}".format(error))
     bug_url = ("https://github.com/Ubuntu-Solutions-Engineering"
                "/openstack-installer/issues/new")
     body = [
         Padding.center_60(
             Text("Oops, there was a problem with your install:",
                  align="center")),
         Padding.center_95(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)),
         Padding.center_85(Text("Reason:")),
         Padding.center_80(Color.error_major(Text(error))),
         Padding.line_break(""),
         Padding.center_85(
             Text("Please file a bug with the above output and of "
                  "~/.cloud-install/*.log at {}".format(bug_url))),
         Padding.line_break(""),
         Padding.center_95(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)),
         Padding.center_20(self._build_buttons())
     ]
     super().__init__(Filler(Pile(body), valign="middle"))
コード例 #20
0
    def _build_widget(self, nodes, **kwargs):
        unit_info = []
        for node in nodes:
            node_pile = []
            node_cols = []
            charm_class, service = node
            if len(service.units) > 0:
                for u in sorted(service.units, key=attrgetter('unit_name')):
                    node_cols = self._build_node_columns(u, charm_class)
                    node_pile.append(node_cols)

                unit_info.append(
                    Padding.center_96(
                        LineBox(Pile(node_pile),
                                title=charm_class.display_name,
                                lline=' ',
                                blcorner=' ',
                                rline=' ',
                                bline=' ',
                                brcorner=' ')))

        return ScrollableListBox(unit_info)
コード例 #21
0
ファイル: gui.py プロジェクト: terminiter/openstack-installer
 def __init__(self):
     self.title_widget = Color.frame_header(
         Padding.center_96(Text(TITLE_TEXT)))
     self.pile = Pile([self.title_widget, Text("")])
     self.set_show_add_units_hotkey(False)
     super().__init__(self.pile)