mirror of
https://github.com/discourse/discourse.git
synced 2025-04-03 05:39:41 +08:00
do not show the read-only alert to the admin
This commit is contained in:
parent
aff3463957
commit
38e365ea45
@ -55,7 +55,10 @@ Discourse.AdminBackupsIndexController = Ember.ArrayController.extend({
|
|||||||
I18n.t("no_value"),
|
I18n.t("no_value"),
|
||||||
I18n.t("yes_value"),
|
I18n.t("yes_value"),
|
||||||
function(confirmed) {
|
function(confirmed) {
|
||||||
if (confirmed) { self._toggleReadOnlyMode(true); }
|
if (confirmed) {
|
||||||
|
Discourse.User.currentProp("hideReadOnlyAlert", true);
|
||||||
|
self._toggleReadOnlyMode(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -14,6 +14,7 @@ Discourse.AdminBackupsRoute = Discourse.Route.extend({
|
|||||||
this.controllerFor("adminBackups").set("isOperationRunning", false);
|
this.controllerFor("adminBackups").set("isOperationRunning", false);
|
||||||
bootbox.alert(I18n.t("admin.backups.operations.failed", { operation: log.operation }));
|
bootbox.alert(I18n.t("admin.backups.operations.failed", { operation: log.operation }));
|
||||||
} else if (log.message === "[SUCCESS]") {
|
} else if (log.message === "[SUCCESS]") {
|
||||||
|
Discourse.User.currentProp("hideReadOnlyAlert", false);
|
||||||
this.controllerFor("adminBackups").set("isOperationRunning", false);
|
this.controllerFor("adminBackups").set("isOperationRunning", false);
|
||||||
if (log.operation === "restore") {
|
if (log.operation === "restore") {
|
||||||
// redirect to homepage when the restore is done (session might be lost)
|
// 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"),
|
I18n.t("yes_value"),
|
||||||
function(confirmed) {
|
function(confirmed) {
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
|
Discourse.User.currentProp("hideReadOnlyAlert", true);
|
||||||
Discourse.Backup.start().then(function() {
|
Discourse.Backup.start().then(function() {
|
||||||
self.controllerFor("adminBackupsLogs").clear();
|
self.controllerFor("adminBackupsLogs").clear();
|
||||||
self.controllerFor("adminBackups").set("isOperationRunning", true);
|
self.controllerFor("adminBackups").set("isOperationRunning", true);
|
||||||
@ -99,6 +101,7 @@ Discourse.AdminBackupsRoute = Discourse.Route.extend({
|
|||||||
I18n.t("yes_value"),
|
I18n.t("yes_value"),
|
||||||
function(confirmed) {
|
function(confirmed) {
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
|
Discourse.User.currentProp("hideReadOnlyAlert", true);
|
||||||
backup.restore().then(function() {
|
backup.restore().then(function() {
|
||||||
self.controllerFor("adminBackupsLogs").clear();
|
self.controllerFor("adminBackupsLogs").clear();
|
||||||
self.controllerFor("adminBackups").set("isOperationRunning", true);
|
self.controllerFor("adminBackups").set("isOperationRunning", true);
|
||||||
|
@ -30,7 +30,7 @@ Discourse.addInitializer(function() {
|
|||||||
|
|
||||||
Discourse.MessageBus.subscribe("/global/read-only", function (enabled) {
|
Discourse.MessageBus.subscribe("/global/read-only", function (enabled) {
|
||||||
Discourse.set("isReadOnly", enabled);
|
Discourse.set("isReadOnly", enabled);
|
||||||
if (enabled) {
|
if (enabled && !Discourse.User.currentProp("hideReadOnlyAlert")) {
|
||||||
bootbox.alert(I18n.t("read_only_mode_enabled"));
|
bootbox.alert(I18n.t("read_only_mode_enabled"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user