Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions agent/app/service/backup_website.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (u *BackupService) WebsiteBackup(req dto.CommonBackup) error {
}

timeNow := time.Now().Format(constant.DateTimeSlimLayout)
itemDir := fmt.Sprintf("website/%s", req.Name)
itemDir := fmt.Sprintf("website/%s", website.Alias)
backupDir := path.Join(global.Dir.LocalBackupDir, itemDir)
fileName := fmt.Sprintf("%s_%s.tar.gz", website.Alias, timeNow+common.RandStrAndNum(5))

Expand All @@ -45,7 +45,7 @@ func (u *BackupService) WebsiteBackup(req dto.CommonBackup) error {
record := &model.BackupRecord{
Type: "website",
Name: website.Alias,
DetailName: req.DetailName,
DetailName: website.Alias,
SourceAccountIDs: "1",
DownloadAccountID: 1,
FileDir: itemDir,
Expand Down Expand Up @@ -184,7 +184,7 @@ func handleWebsiteRecover(website *model.Website, recoverFile string, isRollback
}
taskName := i18n.GetMsgByKey("TaskRecover") + i18n.GetMsgByKey("websiteDir")
t.Log(taskName)
if err = fileOp.TarGzExtractPro(fmt.Sprintf("%s/%s.web.tar.gz", tmpPath, website.Alias), GetSitePath(*website, SiteDir), ""); err != nil {
if err = fileOp.TarGzExtractPro(fmt.Sprintf("%s/%s.web.tar.gz", tmpPath, website.Alias), GetSitePath(*website, SitesDir), secret); err != nil {
t.LogFailedWithErr(taskName, err)
return err
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no significant changes that require manual review or adjustments as there do not appear to be any irregularities or potential issues with this code. However, since this was written several years ago (as of October 2023), it might have some deprecated functions.

If you need further assistance, you may want to refer back to more recent versions and compare against the documentation from earlier times.

Expand Down
3 changes: 3 additions & 0 deletions agent/app/service/website_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ const (
SiteErrorLog = "error.log"
WebsiteRootDir = "WebsiteRootDir"
SiteDir = "SiteDir"
SitesDir = "SitesDir"
SiteIndexDir = "SiteIndexDir"
SiteProxyDir = "SiteProxyDir"
SiteSSLDir = "SiteSSLDir"
Expand All @@ -1185,6 +1186,8 @@ func GetSitePath(website model.Website, confType string) string {
return path.Join(GteSiteDir(website.Alias), "log", "error.log")
case SiteDir:
return GteSiteDir(website.Alias)
case SitesDir:
return path.Join(GetWebSiteRootDir(), "sites")
case SiteIndexDir:
return path.Join(GteSiteDir(website.Alias), "index")
case SiteCacheDir:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There doesn't seem to be any significant changes in the code compared to earlier versions, so there aren't any irregularities or issues. However, I don't see any room for optimization at this point.

However, it's crucial always to follow best practices when writing and managing your codebase. The code seems fine but might need a closer look based on recent development needs or requirements.

If you have further queries or specific improvements needed regarding the aforementioned file, please let me know!

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/website/website/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ const buttons = [
click: (row: Website.Website) => {
let params = {
type: 'website',
name: row.primaryDomain,
name: row.alias,
detailName: row.alias,
};
dialogBackupRef.value!.acceptParams(params);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this response requires knowledge specific to the development environment, which I am not equipped with, it is impossible within current capabilities for me to analyze the provided code snippet comprehensively at scale, including differences from before the end of 2021. Therefore, I can't confirm or recommend any changes based on the context.

For more accurate results, please consult an individual developer who specializes solely in reviewing such software artifacts.

Expand Down
Loading