mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Add basic front page with shortcuts to web apps
This commit is contained in:
1 parent
b69720e0d4
commit
3eb7dd914a
11 files changed
+229
-7
No files matched your search
@@ -24,6 +24,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from plinth import actions
|
||||
from plinth import action_utils
|
||||
from plinth import cfg
|
||||
from plinth import frontpage
|
||||
from plinth import service as service_module
|
||||
|
||||
|
||||
@@ -59,12 +60,20 @@ def init():
|
||||
managed_services[0], title, ports=['http', 'https'], is_external=True,
|
||||
is_enabled=is_enabled, enable=enable, disable=disable)
|
||||
|
||||
if is_enabled():
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
helper.install(managed_packages)
|
||||
helper.call('post', actions.superuser_run, 'deluge', ['enable'])
|
||||
helper.call('post', service.notify_enabled, None, True)
|
||||
helper.call('post', add_shortcut)
|
||||
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('deluge', title, '/deluge', 'glyphicon-magnet')
|
||||
|
||||
|
||||
def is_enabled():
|
||||
@@ -76,11 +85,13 @@ def is_enabled():
|
||||
def enable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('deluge', ['enable'])
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def disable():
|
||||
"""Disable the module."""
|
||||
actions.superuser_run('deluge', ['disable'])
|
||||
frontpage.remove_shortcut('deluge')
|
||||
|
||||
|
||||
def diagnose():
|
||||
|
||||
@@ -24,6 +24,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from plinth import actions
|
||||
from plinth import action_utils
|
||||
from plinth import cfg
|
||||
from plinth import frontpage
|
||||
from plinth import service as service_module
|
||||
|
||||
|
||||
@@ -58,12 +59,20 @@ def init():
|
||||
'ikiwiki', title, ports=['http', 'https'], is_external=True,
|
||||
is_enabled=is_enabled, enable=enable, disable=disable)
|
||||
|
||||
if is_enabled():
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
helper.install(managed_packages)
|
||||
helper.call('post', actions.superuser_run, 'ikiwiki', ['setup'])
|
||||
helper.call('post', service.notify_enabled, None, True)
|
||||
helper.call('post', add_shortcut)
|
||||
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('ikiwiki', title, '/ikiwiki', 'glyphicon-edit')
|
||||
|
||||
|
||||
def is_enabled():
|
||||
@@ -74,11 +83,13 @@ def is_enabled():
|
||||
def enable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('ikiwiki', ['enable'])
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def disable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('ikiwiki', ['disable'])
|
||||
frontpage.remove_shortcut('ikiwiki')
|
||||
|
||||
|
||||
def diagnose():
|
||||
|
||||
@@ -24,6 +24,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from plinth import actions
|
||||
from plinth import action_utils
|
||||
from plinth import cfg
|
||||
from plinth import frontpage
|
||||
from plinth import service as service_module
|
||||
|
||||
|
||||
@@ -70,12 +71,21 @@ def init():
|
||||
'roundcube', title, ports=['http', 'https'], is_external=True,
|
||||
is_enabled=is_enabled, enable=enable, disable=disable)
|
||||
|
||||
if is_enabled():
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
helper.call('pre', actions.superuser_run, 'roundcube', ['pre-install'])
|
||||
helper.install(managed_packages)
|
||||
helper.call('post', actions.superuser_run, 'roundcube', ['setup'])
|
||||
helper.call('post', add_shortcut)
|
||||
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut(
|
||||
'roundcube', title, '/roundcube', 'glyphicon-envelope')
|
||||
|
||||
|
||||
def is_enabled():
|
||||
@@ -86,11 +96,13 @@ def is_enabled():
|
||||
def enable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('roundcube', ['enable'])
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def disable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('roundcube', ['disable'])
|
||||
frontpage.remove_shortcut('roundcube')
|
||||
|
||||
|
||||
def diagnose():
|
||||
|
||||
@@ -24,6 +24,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from plinth import actions
|
||||
from plinth import action_utils
|
||||
from plinth import cfg
|
||||
from plinth import frontpage
|
||||
from plinth import service as service_module
|
||||
|
||||
|
||||
@@ -57,11 +58,19 @@ def init():
|
||||
'shaarli', title, ports=['http', 'https'], is_external=True,
|
||||
is_enabled=is_enabled, enable=enable, disable=disable)
|
||||
|
||||
if is_enabled():
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
helper.install(managed_packages)
|
||||
helper.call('post', service.notify_enabled, None, True)
|
||||
helper.call('post', add_shortcut)
|
||||
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('shaarli', title, '/shaarli', 'glyphicon-bookmark')
|
||||
|
||||
|
||||
def is_enabled():
|
||||
@@ -72,8 +81,10 @@ def is_enabled():
|
||||
def enable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('shaarli', ['enable'])
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def disable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('shaarli', ['disable'])
|
||||
frontpage.remove_shortcut('shaarli')
|
||||
@@ -25,6 +25,7 @@ import json
|
||||
from plinth import actions
|
||||
from plinth import action_utils
|
||||
from plinth import cfg
|
||||
from plinth import frontpage
|
||||
from plinth import service as service_module
|
||||
|
||||
|
||||
@@ -58,6 +59,9 @@ def init():
|
||||
managed_services[0], title, ports=['http', 'https'], is_external=True,
|
||||
is_enabled=is_enabled, enable=enable, disable=disable)
|
||||
|
||||
if is_enabled():
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
@@ -70,6 +74,12 @@ def setup(helper, old_version=None):
|
||||
|
||||
helper.call('post', actions.superuser_run, 'transmission', ['enable'])
|
||||
helper.call('post', service.notify_enabled, None, True)
|
||||
helper.call('post', add_shortcut)
|
||||
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut(
|
||||
'transmission', title, '/transmission', 'glyphicon-save')
|
||||
|
||||
|
||||
def is_enabled():
|
||||
@@ -81,11 +91,13 @@ def is_enabled():
|
||||
def enable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('transmission', ['enable'])
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def disable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('transmission', ['disable'])
|
||||
frontpage.remove_shortcut('transmission')
|
||||
|
||||
|
||||
def diagnose():
|
||||
|
||||
@@ -24,6 +24,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from plinth import actions
|
||||
from plinth import action_utils
|
||||
from plinth import cfg
|
||||
from plinth import frontpage
|
||||
from plinth import service as service_module
|
||||
|
||||
|
||||
@@ -59,6 +60,9 @@ def init():
|
||||
managed_services[0], title, ports=['http', 'https'], is_external=True,
|
||||
is_enabled=is_enabled, enable=enable, disable=disable)
|
||||
|
||||
if is_enabled():
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
@@ -66,6 +70,11 @@ def setup(helper, old_version=None):
|
||||
helper.install(managed_packages)
|
||||
helper.call('post', actions.superuser_run, 'ttrss', ['setup'])
|
||||
helper.call('post', service.notify_enabled, None, True)
|
||||
helper.call('post', add_shortcut)
|
||||
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('ttrss', title, '/tt-rss', 'glyphicon-envelope')
|
||||
|
||||
|
||||
def is_enabled():
|
||||
@@ -77,11 +86,13 @@ def is_enabled():
|
||||
def enable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('ttrss', ['enable'])
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def disable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('ttrss', ['disable'])
|
||||
frontpage.remove_shortcut('ttrss')
|
||||
|
||||
|
||||
def diagnose():
|
||||
|
||||
@@ -26,6 +26,7 @@ import socket
|
||||
from plinth import actions
|
||||
from plinth import action_utils
|
||||
from plinth import cfg
|
||||
from plinth import frontpage
|
||||
from plinth import service as service_module
|
||||
from plinth.views import ServiceView
|
||||
from plinth.signals import pre_hostname_change, post_hostname_change
|
||||
@@ -72,6 +73,9 @@ def init():
|
||||
post_hostname_change.connect(on_post_hostname_change)
|
||||
domainname_change.connect(on_domainname_change)
|
||||
|
||||
if is_enabled():
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
@@ -83,6 +87,11 @@ def setup(helper, old_version=None):
|
||||
helper.install(managed_packages)
|
||||
helper.call('post', actions.superuser_run, 'xmpp', ['setup'])
|
||||
helper.call('post', service.notify_enabled, None, True)
|
||||
helper.call('post', add_shortcut)
|
||||
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('xmpp', title, '/jwchat', 'glyphicon-comment')
|
||||
|
||||
|
||||
class EjabberdServiceView(ServiceView):
|
||||
@@ -112,11 +121,13 @@ def get_domainname():
|
||||
def enable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('xmpp', ['enable'])
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def disable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('xmpp', ['disable'])
|
||||
frontpage.remove_shortcut('xmpp')
|
||||
|
||||
|
||||
def on_pre_hostname_change(sender, old_hostname, new_hostname, **kwargs):
|
||||
|
||||
Reference in new issue
Block a user