mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 22:42:13 +08:00
eab560fe2a
Co-authored-by: Mark VanLandingham <markvanlan@gmail.com> Co-authored-by: Robin Ward <robin.ward@gmail.com> Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
import I18n from "I18n";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
import { alias } from "@ember/object/computed";
|
|
import Component from "@ember/component";
|
|
import { setting } from "discourse/lib/computed";
|
|
|
|
export default Component.extend({
|
|
classNames: ["admin-report-storage-stats"],
|
|
|
|
backupLocation: setting("backup_location"),
|
|
backupStats: alias("model.data.backups"),
|
|
uploadStats: alias("model.data.uploads"),
|
|
|
|
@discourseComputed("backupStats")
|
|
showBackupStats(stats) {
|
|
return stats && this.currentUser.admin;
|
|
},
|
|
|
|
@discourseComputed("backupLocation")
|
|
backupLocationName(backupLocation) {
|
|
return I18n.t(`admin.backups.location.${backupLocation}`);
|
|
},
|
|
|
|
@discourseComputed("backupStats.used_bytes")
|
|
usedBackupSpace(bytes) {
|
|
return I18n.toHumanSize(bytes);
|
|
},
|
|
|
|
@discourseComputed("backupStats.free_bytes")
|
|
freeBackupSpace(bytes) {
|
|
return I18n.toHumanSize(bytes);
|
|
},
|
|
|
|
@discourseComputed("uploadStats.used_bytes")
|
|
usedUploadSpace(bytes) {
|
|
return I18n.toHumanSize(bytes);
|
|
},
|
|
|
|
@discourseComputed("uploadStats.free_bytes")
|
|
freeUploadSpace(bytes) {
|
|
return I18n.toHumanSize(bytes);
|
|
}
|
|
});
|