mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-27 17:26:03 +08:00
fix: fix issue with run cronjob failed (#8082)
This commit is contained in:
parent
e4c096295f
commit
9c238ce7aa
9 changed files with 10 additions and 23 deletions
|
|
@ -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, SitesDir), secret); err != nil {
|
||||
if err = fileOp.TarGzExtractPro(fmt.Sprintf("%s/%s.web.tar.gz", tmpPath, website.Alias), GetOpenrestyDir(SitesRootDir), secret); err != nil {
|
||||
t.LogFailedWithErr(taskName, err)
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -342,11 +342,7 @@ func handleBackupLogs(targetDir, fileName string, secret string) error {
|
|||
return err
|
||||
}
|
||||
if len(websites) != 0 {
|
||||
nginxInstall, err := getAppInstallByKey(constant.AppOpenresty)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
webItem := path.Join(nginxInstall.GetPath(), "www/sites")
|
||||
webItem := GetOpenrestyDir(SitesRootDir)
|
||||
for _, website := range websites {
|
||||
dirItem := path.Join(targetDir, "website", website.Alias)
|
||||
if _, err := os.Stat(dirItem); err != nil && os.IsNotExist(err) {
|
||||
|
|
|
|||
|
|
@ -181,12 +181,8 @@ func (u *CronjobService) handleCutWebsiteLog(cronjob *model.Cronjob, startTime t
|
|||
msgs []string
|
||||
)
|
||||
websites := loadWebsForJob(*cronjob)
|
||||
nginx, err := getAppInstallByKey(constant.AppOpenresty)
|
||||
if err != nil {
|
||||
return msgs, "", nil
|
||||
}
|
||||
baseDir := pathUtils.Join(nginx.GetPath(), "www", "sites")
|
||||
fileOp := files.NewFileOp()
|
||||
baseDir := GetOpenrestyDir(SitesRootDir)
|
||||
for _, website := range websites {
|
||||
websiteLogDir := pathUtils.Join(baseDir, website.Alias, "log")
|
||||
srcAccessLogPath := pathUtils.Join(websiteLogDir, "access.log")
|
||||
|
|
|
|||
|
|
@ -1161,7 +1161,6 @@ const (
|
|||
SiteErrorLog = "error.log"
|
||||
WebsiteRootDir = "WebsiteRootDir"
|
||||
SiteDir = "SiteDir"
|
||||
SitesDir = "SitesDir"
|
||||
SiteIndexDir = "SiteIndexDir"
|
||||
SiteProxyDir = "SiteProxyDir"
|
||||
SiteSSLDir = "SiteSSLDir"
|
||||
|
|
@ -1186,8 +1185,6 @@ 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:
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
package qqwry
|
||||
|
||||
import _ "embed"
|
||||
|
||||
//go:embed qqwry.dat
|
||||
var QQwryByte []byte
|
||||
Binary file not shown.
|
|
@ -93,7 +93,7 @@
|
|||
<el-form-item
|
||||
:label="getLabel(formFields['CONTAINER_PACKAGE_URL'])"
|
||||
:rules="rules.params.CONTAINER_PACKAGE_URL"
|
||||
v-if="formFields['CONTAINER_PACKAGE_URL']"
|
||||
v-if="runtime.params['PHP_VERSION'] != '5.6.40' && formFields['CONTAINER_PACKAGE_URL']"
|
||||
>
|
||||
<el-select v-model="runtime.source" filterable default-first-option>
|
||||
<el-option
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import { Rules } from '@/global/form-rules';
|
|||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
import { getAgentGroupList } from '@/api/modules/group';
|
||||
import { Group } from '@/api/interface/group';
|
||||
|
||||
|
|
@ -75,6 +75,10 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
if (form.remark && form.remark.length > 128) {
|
||||
MsgError(i18n.global.t('commons.rule.length128Err'));
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
updateWebsite(form)
|
||||
.then(() => {
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@
|
|||
<template #default="{ row }">
|
||||
<fu-read-write-switch>
|
||||
<template #read>
|
||||
<MsgInfo :info="row.remark" width="180px" />
|
||||
<MsgInfo :info="row.remark" :width="'280'" />
|
||||
</template>
|
||||
<template #default="{ read }">
|
||||
<el-input v-model="row.remark" @blur="updateRemark(row, read)" />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue