mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
FIX: improves durability display check
This commit is contained in:
parent
95d99de7b4
commit
50d11fd582
@ -15,8 +15,12 @@ export default Ember.Controller.extend({
|
||||
exceptionController: Ember.inject.controller("exception"),
|
||||
showVersionChecks: setting("version_checks"),
|
||||
diskSpace: Ember.computed.alias("model.attributes.disk_space"),
|
||||
lastBackupTakenAt: Ember.computed.alias(
|
||||
"model.attributes.last_backup_taken_at"
|
||||
),
|
||||
logSearchQueriesEnabled: setting("log_search_queries"),
|
||||
availablePeriods: ["yearly", "quarterly", "monthly", "weekly"],
|
||||
shouldDisplayDurability: Ember.computed.and("lastBackupTakenAt", "diskSpace"),
|
||||
|
||||
@computed("problems.length")
|
||||
foundProblems(problemsLength) {
|
||||
@ -137,7 +141,7 @@ export default Ember.Controller.extend({
|
||||
return moment(updatedAt).format("LLL");
|
||||
},
|
||||
|
||||
@computed("model.attributes.last_backup_taken_at")
|
||||
@computed("lastBackupTakenAt")
|
||||
backupTimestamp(lastBackupTakenAt) {
|
||||
return moment(lastBackupTakenAt).format("LLL");
|
||||
},
|
||||
|
@ -90,7 +90,7 @@
|
||||
</div>
|
||||
{{#conditional-loading-section isLoading=isLoading title=(i18n "admin.dashboard.backups")}}
|
||||
<div class="misc">
|
||||
{{#if diskSpace}}
|
||||
{{#if shouldDisplayDurability}}
|
||||
<div class="durability">
|
||||
{{#if currentUser.admin}}
|
||||
<div class="backups">
|
||||
|
@ -23,11 +23,20 @@ class AdminDashboardNextData
|
||||
end
|
||||
|
||||
def as_json(_options = nil)
|
||||
@json ||= {
|
||||
@json ||= get_json
|
||||
end
|
||||
|
||||
def get_json
|
||||
json = {
|
||||
reports: AdminDashboardNextData.reports(REPORTS),
|
||||
last_backup_taken_at: last_backup_taken_at,
|
||||
updated_at: Time.zone.now.as_json
|
||||
}
|
||||
|
||||
if SiteSetting.enable_backups
|
||||
json[:last_backup_taken_at] = last_backup_taken_at
|
||||
end
|
||||
|
||||
json
|
||||
end
|
||||
|
||||
def last_backup_taken_at
|
||||
|
Loading…
Reference in New Issue
Block a user