mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Make admin-start-backup template extendable (#18904)
We need to change the content of this modal in different plugins based on context, so move some parts of it into the JS file.
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
import Controller, { inject as controller } from "@ember/controller";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||
|
||||
export default Controller.extend(ModalFunctionality, {
|
||||
adminBackupsLogs: controller(),
|
||||
|
||||
@discourseComputed
|
||||
warningMessage() {
|
||||
// this is never shown here, but we may want to show different
|
||||
// messages in plugins
|
||||
return "";
|
||||
},
|
||||
|
||||
@discourseComputed
|
||||
yesLabel() {
|
||||
return "yes_value";
|
||||
},
|
||||
|
||||
actions: {
|
||||
startBackupWithUploads() {
|
||||
this.send("closeModal");
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<DModalBody @title="admin.backups.operations.backup.confirm">
|
||||
<DButton @class="btn-primary backup-with-uploads" @action={{action "startBackupWithUploads"}} @label="yes_value" />
|
||||
{{#if this.warningMessage}}
|
||||
<div class="alert alert-warning">{{html-safe this.warningMessage}}</div>
|
||||
{{/if}}
|
||||
<DButton @class="btn-primary backup-with-uploads" @action={{action "startBackupWithUploads"}} @label={{this.yesLabel}} />
|
||||
<DButton @class="backup-no-uploads" @action={{action "startBackupWithoutUploads"}} @label="admin.backups.operations.backup.without_uploads" />
|
||||
<DButton @class="btn-default" @action={{action "cancel"}} @label="no_value" />
|
||||
</DModalBody>
|
||||
|
||||
Reference in New Issue
Block a user