diff --git a/app/assets/javascripts/admin/templates/dashboard_next.hbs b/app/assets/javascripts/admin/templates/dashboard_next.hbs index f5470dfd7a8..20b781c2e7c 100644 --- a/app/assets/javascripts/admin/templates/dashboard_next.hbs +++ b/app/assets/javascripts/admin/templates/dashboard_next.hbs @@ -90,27 +90,29 @@ {{#conditional-loading-section isLoading=isLoading title=(i18n "admin.dashboard.backups")}}
-
- {{#if currentUser.admin}} -
-

- {{d-icon "archive"}} {{i18n "admin.dashboard.backups"}} -

+ {{#if diskSpace}} +
+ {{#if currentUser.admin}} +
+

+ {{d-icon "archive"}} {{i18n "admin.dashboard.backups"}} +

+

+ {{diskSpace.backups_used}} ({{i18n "admin.dashboard.space_free" size=diskSpace.backups_free}}) +
+ {{{i18n "admin.dashboard.lastest_backup" date=backupTimestamp}}} +

+
+ {{/if}} + +
+

{{d-icon "upload"}} {{i18n "admin.dashboard.uploads"}}

- {{diskSpace.backups_used}} ({{i18n "admin.dashboard.space_free" size=diskSpace.backups_free}}) -
- {{{i18n "admin.dashboard.lastest_backup" date=backupTimestamp}}} + {{diskSpace.uploads_used}} ({{i18n "admin.dashboard.space_free" size=diskSpace.uploads_free}})

- {{/if}} - -
-

{{d-icon "upload"}} {{i18n "admin.dashboard.uploads"}}

-

- {{diskSpace.uploads_used}} ({{i18n "admin.dashboard.space_free" size=diskSpace.uploads_free}}) -

-
+ {{/if}}
diff --git a/app/controllers/admin/dashboard_next_controller.rb b/app/controllers/admin/dashboard_next_controller.rb index 47eef7b5f4c..a564fd64ee2 100644 --- a/app/controllers/admin/dashboard_next_controller.rb +++ b/app/controllers/admin/dashboard_next_controller.rb @@ -4,7 +4,7 @@ class Admin::DashboardNextController < Admin::AdminController def index dashboard_data = AdminDashboardNextData.fetch_cached_stats dashboard_data.merge!(version_check: DiscourseUpdates.check_version.as_json) if SiteSetting.version_checks? - dashboard_data[:disk_space] = DiskSpace.cached_stats + dashboard_data[:disk_space] = DiskSpace.cached_stats if SiteSetting.enable_backups render json: dashboard_data end end