UX: Fix restore info link on admin backups page (#28452)

Followup 1446596089

The link to inform admins that restore is disabled
was not correct. This fixes it and also changes it
to go to /admin/backups/settings
This commit is contained in:
Martin Brennan 2024-08-21 13:23:24 +10:00 committed by GitHub
parent 8632ea5a63
commit 9dd47ca755
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 8 deletions

View File

@ -5,6 +5,7 @@ import { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax"; import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error"; import { popupAjaxError } from "discourse/lib/ajax-error";
import { i18n, setting } from "discourse/lib/computed"; import { i18n, setting } from "discourse/lib/computed";
import getURL from "discourse-common/lib/get-url";
import discourseComputed from "discourse-common/utils/decorators"; import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n"; import I18n from "discourse-i18n";
@ -17,6 +18,10 @@ export default class AdminBackupsIndexController extends Controller {
@setting("backup_location") backupLocation; @setting("backup_location") backupLocation;
@equal("backupLocation", "local") localBackupStorage; @equal("backupLocation", "local") localBackupStorage;
get restoreSettingsUrl() {
return getURL("/admin/backups/settings?filter=allow_restore");
}
@discourseComputed("status.allowRestore", "status.isOperationRunning") @discourseComputed("status.allowRestore", "status.isOperationRunning")
restoreTitle(allowRestore, isOperationRunning) { restoreTitle(allowRestore, isOperationRunning) {
if (!allowRestore) { if (!allowRestore) {

View File

@ -13,10 +13,13 @@
{{#if this.status.restoreDisabled}} {{#if this.status.restoreDisabled}}
<div class="backup-message alert alert-info"> <div class="backup-message alert alert-info">
<a href="site_settings/category/all_results?filter=allow_restore">{{d-icon {{dIcon "info-circle"}}
"info-circle" {{html-safe
}} (i18n
{{i18n "admin.backups.operations.restore.is_disabled"}}</a> "admin.backups.operations.restore.is_disabled"
url=this.restoreSettingsUrl
)
}}
</div> </div>
{{/if}} {{/if}}

View File

@ -5686,7 +5686,7 @@ en:
backups: "Backups" backups: "Backups"
backup_files: "Backup files" backup_files: "Backup files"
logs: "Logs" logs: "Logs"
none: "No backup available." none: "No backup available"
read_only: read_only:
enable: enable:
title: "Enable read-only mode" title: "Enable read-only mode"
@ -5724,12 +5724,12 @@ en:
download: download:
label: "Download" label: "Download"
title: "Send email with download link" title: "Send email with download link"
alert: "A link to download this backup has been emailed to you." alert: "A link to download this backup has been emailed to you"
destroy: destroy:
title: "Remove the backup" title: "Remove the backup"
confirm: "Are you sure you want to destroy this backup?" confirm: "Are you sure you want to destroy this backup?"
restore: restore:
is_disabled: "Restore is disabled in the site settings." is_disabled: "Restore is currently disabled. To enable it, visit the <a href='%{url}'>site settings</a>."
label: "Restore" label: "Restore"
title: "Restore the backup" title: "Restore the backup"
confirm: "Are you sure you want to restore this backup?" confirm: "Are you sure you want to restore this backup?"
@ -5738,7 +5738,7 @@ en:
title: "Rollback the database to previous working state" title: "Rollback the database to previous working state"
confirm: "Are you sure you want to rollback the database to the previous working state?" confirm: "Are you sure you want to rollback the database to the previous working state?"
location: location:
local: "Local Storage" local: "Local storage"
s3: "S3" s3: "S3"
backup_storage_error: "Failed to access backup storage: %{error_message}" backup_storage_error: "Failed to access backup storage: %{error_message}"