app: Refactor all apps to use the Info component

- Remove the need to pass all the individual information elements to the AppView
  separately. This eliminates many issues with elements that were mistakenly not
  sent to AppView. Also reduces a lot of code duplication.

- Create App classes for power and sso for consistency.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2020-02-16 18:22:01 -05:00
1 parent 67a216ba18
commit b576a77c3d
112 files changed
+862 -1041

No files matched your search

+9 -5
View File
@@ -40,9 +40,7 @@ managed_services = ['ssh']
managed_packages = ['openssh-server']
name = _('Secure Shell (SSH) Server')
description = [
_description = [
_('A Secure Shell server uses the secure shell protocol to accept '
'connections from remote computers. An authorized remote computer '
'can perform administration tasks, copy files or run other services '
@@ -62,11 +60,17 @@ class SSHApp(app_module.App):
def __init__(self):
"""Create components for the app."""
super().__init__()
menu_item = menu.Menu('menu-ssh', name, None, 'fa-terminal',
info = app_module.Info(app_id=self.app_id, version=version,
is_essential=is_essential,
name=_('Secure Shell (SSH) Server'),
icon='fa-terminal', description=_description)
self.add(info)
menu_item = menu.Menu('menu-ssh', info.name, None, info.icon,
'ssh:index', parent_url_name='system')
self.add(menu_item)
firewall = Firewall('firewall-ssh', name, ports=['ssh'],
firewall = Firewall('firewall-ssh', info.name, ports=['ssh'],
is_external=True)
self.add(firewall)
-3
View File
@@ -30,9 +30,6 @@ from .forms import SSHServerForm
class SshAppView(AppView):
app_id = 'ssh'
name = ssh.name
description = ssh.description
port_forwarding_info = ssh.port_forwarding_info
template_name = 'ssh.html'
form_class = SSHServerForm