mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
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:
1 parent
67a216ba18
commit
b576a77c3d
112 files changed
+862
-1041
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user