mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
backups: Use AppView for the main app page
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
d18e92af80
commit
2eca38299f
@ -5,14 +5,14 @@ URLs for the backups module.
|
||||
|
||||
from django.urls import re_path
|
||||
|
||||
from .views import (AddRemoteRepositoryView, AddRepositoryView,
|
||||
from .views import (AddRemoteRepositoryView, AddRepositoryView, BackupsView,
|
||||
CreateArchiveView, DeleteArchiveView, DownloadArchiveView,
|
||||
IndexView, RemoveRepositoryView, RestoreArchiveView,
|
||||
RemoveRepositoryView, RestoreArchiveView,
|
||||
RestoreFromUploadView, ScheduleView, UploadArchiveView,
|
||||
VerifySshHostkeyView, mount_repository, umount_repository)
|
||||
|
||||
urlpatterns = [
|
||||
re_path(r'^sys/backups/$', IndexView.as_view(), name='index'),
|
||||
re_path(r'^sys/backups/$', BackupsView.as_view(), name='index'),
|
||||
re_path(r'^sys/backups/(?P<uuid>[^/]+)/schedule/$', ScheduleView.as_view(),
|
||||
name='schedule'),
|
||||
re_path(r'^sys/backups/create/$', CreateArchiveView.as_view(),
|
||||
|
||||
@ -20,9 +20,9 @@ from django.utils.translation import gettext as _
|
||||
from django.utils.translation import gettext_lazy
|
||||
from django.views.generic import FormView, TemplateView, View
|
||||
|
||||
from plinth import app as app_module
|
||||
from plinth.errors import PlinthError
|
||||
from plinth.modules import backups, storage
|
||||
from plinth.views import AppView
|
||||
|
||||
from . import (SESSION_PATH_VARIABLE, api, forms, get_known_hosts_path,
|
||||
is_ssh_hostkey_verified)
|
||||
@ -34,14 +34,15 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@method_decorator(delete_tmp_backup_file, name='dispatch')
|
||||
class IndexView(TemplateView):
|
||||
class BackupsView(AppView):
|
||||
"""View to show list of archives."""
|
||||
|
||||
app_id = 'backups'
|
||||
template_name = 'backups.html'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
"""Return additional context for rendering the template."""
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['app_info'] = app_module.App.get('backups').info
|
||||
context['repositories'] = [
|
||||
repository.get_view_content() for repository in get_repositories()
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user