2023-08-01 21:40:25 +08:00
|
|
|
import Component from "@glimmer/component";
|
2023-08-31 12:51:07 +08:00
|
|
|
import { tracked } from "@glimmer/tracking";
|
2023-10-11 02:38:59 +08:00
|
|
|
import { action } from "@ember/object";
|
2024-03-07 01:05:11 +08:00
|
|
|
import { service } from "@ember/service";
|
2024-11-20 04:45:18 +08:00
|
|
|
import { i18n } from "discourse-i18n";
|
2023-08-01 21:40:25 +08:00
|
|
|
|
|
|
|
export default class StartBackup extends Component {
|
2023-08-31 12:51:07 +08:00
|
|
|
@service siteSettings;
|
|
|
|
@tracked includeUploads = true;
|
|
|
|
|
|
|
|
get canManageUploadsInBackup() {
|
|
|
|
return (
|
|
|
|
!this.siteSettings.enable_s3_uploads ||
|
|
|
|
this.siteSettings.include_s3_uploads_in_backups
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
get warningCssClasses() {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
get warningMessage() {
|
|
|
|
if (
|
|
|
|
this.siteSettings.enable_s3_uploads &&
|
|
|
|
!this.siteSettings.include_s3_uploads_in_backups
|
|
|
|
) {
|
2024-11-20 04:45:18 +08:00
|
|
|
return i18n("admin.backups.operations.backup.s3_upload_warning");
|
2023-08-31 12:51:07 +08:00
|
|
|
}
|
|
|
|
return "";
|
2023-08-01 21:40:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
2023-08-31 12:51:07 +08:00
|
|
|
startBackup() {
|
|
|
|
this.args.model.startBackup(this.includeUploads);
|
2023-08-01 21:40:25 +08:00
|
|
|
this.args.closeModal();
|
|
|
|
}
|
|
|
|
}
|