mirror of
https://github.com/discourse/discourse.git
synced 2024-12-17 00:53:42 +08:00
41 lines
1.0 KiB
Plaintext
41 lines
1.0 KiB
Plaintext
|
import { setting } from "discourse/lib/computed";
|
||
|
import computed from "ember-addons/ember-computed-decorators";
|
||
|
|
||
|
export default Ember.Component.extend({
|
||
|
classNames: ["admin-report-storage-stats"],
|
||
|
|
||
|
backupLocation: setting("backup_location"),
|
||
|
backupStats: Ember.computed.alias("model.data.backups"),
|
||
|
uploadStats: Ember.computed.alias("model.data.uploads"),
|
||
|
|
||
|
@computed("backupStats")
|
||
|
showBackupStats(stats) {
|
||
|
return stats && this.currentUser.admin;
|
||
|
},
|
||
|
|
||
|
@computed("backupLocation")
|
||
|
backupLocationName(backupLocation) {
|
||
|
return I18n.t(`admin.backups.location.${backupLocation}`);
|
||
|
},
|
||
|
|
||
|
@computed("backupStats.used_bytes")
|
||
|
usedBackupSpace(bytes) {
|
||
|
return I18n.toHumanSize(bytes);
|
||
|
},
|
||
|
|
||
|
@computed("backupStats.free_bytes")
|
||
|
freeBackupSpace(bytes) {
|
||
|
return I18n.toHumanSize(bytes);
|
||
|
},
|
||
|
|
||
|
@computed("uploadStats.used_bytes")
|
||
|
usedUploadSpace(bytes) {
|
||
|
return I18n.toHumanSize(bytes);
|
||
|
},
|
||
|
|
||
|
@computed("uploadStats.free_bytes")
|
||
|
freeUploadSpace(bytes) {
|
||
|
return I18n.toHumanSize(bytes);
|
||
|
}
|
||
|
});
|