Allow restoring from backups in development mode even if the setting is
off.
This commit is contained in:
parent
464a922910
commit
9e2c72e277
|
@ -9,7 +9,7 @@ export default Ember.ArrayController.extend({
|
|||
restoreDisabled: Em.computed.alias("status.restoreDisabled"),
|
||||
|
||||
restoreTitle: function() {
|
||||
if (!Discourse.SiteSettings.allow_restore) {
|
||||
if (!this.get('status.allowRestore')) {
|
||||
return I18n.t("admin.backups.operations.restore.is_disabled");
|
||||
} else if (this.get("status.isOperationRunning")) {
|
||||
return I18n.t("admin.backups.operation_already_running");
|
||||
|
|
|
@ -1,16 +1,9 @@
|
|||
/**
|
||||
Data model for representing the status of backup/restore
|
||||
|
||||
@class BackupStatus
|
||||
@extends Discourse.Model
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.BackupStatus = Discourse.Model.extend({
|
||||
|
||||
restoreDisabled: Em.computed.not("restoreEnabled"),
|
||||
|
||||
restoreEnabled: function() {
|
||||
return Discourse.SiteSettings.allow_restore && !this.get("isOperationRunning");
|
||||
}.property("isOperationRunning")
|
||||
return this.get('allowRestore') && !this.get("isOperationRunning");
|
||||
}.property("isOperationRunning", "allowRestore")
|
||||
|
||||
});
|
||||
|
|
|
@ -31,7 +31,8 @@ Discourse.AdminBackupsRoute = Discourse.Route.extend({
|
|||
}).then(function (status) {
|
||||
return Discourse.BackupStatus.create({
|
||||
isOperationRunning: status.is_operation_running,
|
||||
canRollback: status.can_rollback
|
||||
canRollback: status.can_rollback,
|
||||
allowRestore: status.allow_restore
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
|
@ -628,7 +628,7 @@ legal:
|
|||
|
||||
backups:
|
||||
allow_restore:
|
||||
client: true
|
||||
client: false
|
||||
default: false
|
||||
maximum_backups:
|
||||
client: true
|
||||
|
|
|
@ -56,6 +56,7 @@ module BackupRestore
|
|||
{
|
||||
is_operation_running: is_operation_running?,
|
||||
can_rollback: can_rollback?,
|
||||
allow_restore: Rails.env.development? || SiteSetting.allow_restore
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue