mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 04:01:29 -05:00
do not show the read-only alert to the admin
This commit is contained in:
parent
aff3463957
commit
38e365ea45
3 changed files with 8 additions and 2 deletions
|
@ -55,7 +55,10 @@ Discourse.AdminBackupsIndexController = Ember.ArrayController.extend({
|
|||
I18n.t("no_value"),
|
||||
I18n.t("yes_value"),
|
||||
function(confirmed) {
|
||||
if (confirmed) { self._toggleReadOnlyMode(true); }
|
||||
if (confirmed) {
|
||||
Discourse.User.currentProp("hideReadOnlyAlert", true);
|
||||
self._toggleReadOnlyMode(true);
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
|
|
|
@ -14,6 +14,7 @@ Discourse.AdminBackupsRoute = Discourse.Route.extend({
|
|||
this.controllerFor("adminBackups").set("isOperationRunning", false);
|
||||
bootbox.alert(I18n.t("admin.backups.operations.failed", { operation: log.operation }));
|
||||
} else if (log.message === "[SUCCESS]") {
|
||||
Discourse.User.currentProp("hideReadOnlyAlert", false);
|
||||
this.controllerFor("adminBackups").set("isOperationRunning", false);
|
||||
if (log.operation === "restore") {
|
||||
// redirect to homepage when the restore is done (session might be lost)
|
||||
|
@ -53,6 +54,7 @@ Discourse.AdminBackupsRoute = Discourse.Route.extend({
|
|||
I18n.t("yes_value"),
|
||||
function(confirmed) {
|
||||
if (confirmed) {
|
||||
Discourse.User.currentProp("hideReadOnlyAlert", true);
|
||||
Discourse.Backup.start().then(function() {
|
||||
self.controllerFor("adminBackupsLogs").clear();
|
||||
self.controllerFor("adminBackups").set("isOperationRunning", true);
|
||||
|
@ -99,6 +101,7 @@ Discourse.AdminBackupsRoute = Discourse.Route.extend({
|
|||
I18n.t("yes_value"),
|
||||
function(confirmed) {
|
||||
if (confirmed) {
|
||||
Discourse.User.currentProp("hideReadOnlyAlert", true);
|
||||
backup.restore().then(function() {
|
||||
self.controllerFor("adminBackupsLogs").clear();
|
||||
self.controllerFor("adminBackups").set("isOperationRunning", true);
|
||||
|
|
|
@ -30,7 +30,7 @@ Discourse.addInitializer(function() {
|
|||
|
||||
Discourse.MessageBus.subscribe("/global/read-only", function (enabled) {
|
||||
Discourse.set("isReadOnly", enabled);
|
||||
if (enabled) {
|
||||
if (enabled && !Discourse.User.currentProp("hideReadOnlyAlert")) {
|
||||
bootbox.alert(I18n.t("read_only_mode_enabled"));
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue