mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
FIX: missing tooltip on backup screen
This commit is contained in:
@ -1,49 +1,24 @@
|
||||
export default Ember.ArrayController.extend({
|
||||
needs: ["adminBackups"],
|
||||
status: Em.computed.alias("controllers.adminBackups"),
|
||||
|
||||
uploadText: function() { return I18n.t("admin.backups.upload.text"); }.property(),
|
||||
|
||||
readOnlyModeDisabled: Em.computed.alias("status.isOperationRunning"),
|
||||
|
||||
isOperationRunning: Em.computed.alias("status.isOperationRunning"),
|
||||
restoreDisabled: Em.computed.alias("status.restoreDisabled"),
|
||||
|
||||
uploadLabel: function() { return I18n.t("admin.backups.upload.label"); }.property(),
|
||||
|
||||
restoreTitle: function() {
|
||||
if (!this.get('status.allowRestore')) {
|
||||
return I18n.t("admin.backups.operations.restore.is_disabled");
|
||||
return "admin.backups.operations.restore.is_disabled";
|
||||
} else if (this.get("status.isOperationRunning")) {
|
||||
return I18n.t("admin.backups.operation_already_running");
|
||||
return "admin.backups.operations.is_running";
|
||||
} else {
|
||||
return I18n.t("admin.backups.operations.restore.title");
|
||||
return "admin.backups.operations.restore.title";
|
||||
}
|
||||
}.property("status.isOperationRunning"),
|
||||
|
||||
destroyDisabled: Em.computed.alias("status.isOperationRunning"),
|
||||
|
||||
destroyTitle: function() {
|
||||
if (this.get("status.isOperationRunning")) {
|
||||
return I18n.t("admin.backups.operation_already_running");
|
||||
} else {
|
||||
return I18n.t("admin.backups.operations.destroy.title");
|
||||
}
|
||||
}.property("status.isOperationRunning"),
|
||||
|
||||
readOnlyModeTitle: function() { return this._readOnlyModeI18n("title"); }.property("site.isReadOnly"),
|
||||
readOnlyModeText: function() { return this._readOnlyModeI18n("text"); }.property("site.isReadOnly"),
|
||||
|
||||
_readOnlyModeI18n: function(value) {
|
||||
var action = this.site.get("isReadOnly") ? "disable" : "enable";
|
||||
return I18n.t("admin.backups.read_only." + action + "." + value);
|
||||
},
|
||||
}.property("status.{allowRestore,isOperationRunning}"),
|
||||
|
||||
actions: {
|
||||
|
||||
/**
|
||||
Toggle read-only mode
|
||||
|
||||
@method toggleReadOnlyMode
|
||||
**/
|
||||
toggleReadOnlyMode: function() {
|
||||
toggleReadOnlyMode() {
|
||||
var self = this;
|
||||
if (!this.site.get("isReadOnly")) {
|
||||
bootbox.confirm(
|
||||
@ -64,7 +39,7 @@ export default Ember.ArrayController.extend({
|
||||
|
||||
},
|
||||
|
||||
_toggleReadOnlyMode: function(enable) {
|
||||
_toggleReadOnlyMode(enable) {
|
||||
var site = this.site;
|
||||
Discourse.ajax("/admin/backups/readonly", {
|
||||
type: "PUT",
|
||||
|
Reference in New Issue
Block a user