mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-28 01:36:56 +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")
|
taskName := i18n.GetMsgByKey("TaskRecover") + i18n.GetMsgByKey("websiteDir")
|
||||||
t.Log(taskName)
|
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)
|
t.LogFailedWithErr(taskName, err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -342,11 +342,7 @@ func handleBackupLogs(targetDir, fileName string, secret string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if len(websites) != 0 {
|
if len(websites) != 0 {
|
||||||
nginxInstall, err := getAppInstallByKey(constant.AppOpenresty)
|
webItem := GetOpenrestyDir(SitesRootDir)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
webItem := path.Join(nginxInstall.GetPath(), "www/sites")
|
|
||||||
for _, website := range websites {
|
for _, website := range websites {
|
||||||
dirItem := path.Join(targetDir, "website", website.Alias)
|
dirItem := path.Join(targetDir, "website", website.Alias)
|
||||||
if _, err := os.Stat(dirItem); err != nil && os.IsNotExist(err) {
|
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
|
msgs []string
|
||||||
)
|
)
|
||||||
websites := loadWebsForJob(*cronjob)
|
websites := loadWebsForJob(*cronjob)
|
||||||
nginx, err := getAppInstallByKey(constant.AppOpenresty)
|
|
||||||
if err != nil {
|
|
||||||
return msgs, "", nil
|
|
||||||
}
|
|
||||||
baseDir := pathUtils.Join(nginx.GetPath(), "www", "sites")
|
|
||||||
fileOp := files.NewFileOp()
|
fileOp := files.NewFileOp()
|
||||||
|
baseDir := GetOpenrestyDir(SitesRootDir)
|
||||||
for _, website := range websites {
|
for _, website := range websites {
|
||||||
websiteLogDir := pathUtils.Join(baseDir, website.Alias, "log")
|
websiteLogDir := pathUtils.Join(baseDir, website.Alias, "log")
|
||||||
srcAccessLogPath := pathUtils.Join(websiteLogDir, "access.log")
|
srcAccessLogPath := pathUtils.Join(websiteLogDir, "access.log")
|
||||||
|
|
|
||||||
|
|
@ -1161,7 +1161,6 @@ const (
|
||||||
SiteErrorLog = "error.log"
|
SiteErrorLog = "error.log"
|
||||||
WebsiteRootDir = "WebsiteRootDir"
|
WebsiteRootDir = "WebsiteRootDir"
|
||||||
SiteDir = "SiteDir"
|
SiteDir = "SiteDir"
|
||||||
SitesDir = "SitesDir"
|
|
||||||
SiteIndexDir = "SiteIndexDir"
|
SiteIndexDir = "SiteIndexDir"
|
||||||
SiteProxyDir = "SiteProxyDir"
|
SiteProxyDir = "SiteProxyDir"
|
||||||
SiteSSLDir = "SiteSSLDir"
|
SiteSSLDir = "SiteSSLDir"
|
||||||
|
|
@ -1186,8 +1185,6 @@ func GetSitePath(website model.Website, confType string) string {
|
||||||
return path.Join(GteSiteDir(website.Alias), "log", "error.log")
|
return path.Join(GteSiteDir(website.Alias), "log", "error.log")
|
||||||
case SiteDir:
|
case SiteDir:
|
||||||
return GteSiteDir(website.Alias)
|
return GteSiteDir(website.Alias)
|
||||||
case SitesDir:
|
|
||||||
return path.Join(GetWebSiteRootDir(), "sites")
|
|
||||||
case SiteIndexDir:
|
case SiteIndexDir:
|
||||||
return path.Join(GteSiteDir(website.Alias), "index")
|
return path.Join(GteSiteDir(website.Alias), "index")
|
||||||
case SiteCacheDir:
|
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
|
<el-form-item
|
||||||
:label="getLabel(formFields['CONTAINER_PACKAGE_URL'])"
|
:label="getLabel(formFields['CONTAINER_PACKAGE_URL'])"
|
||||||
:rules="rules.params.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-select v-model="runtime.source" filterable default-first-option>
|
||||||
<el-option
|
<el-option
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ import { Rules } from '@/global/form-rules';
|
||||||
import { computed, onMounted, reactive, ref } from 'vue';
|
import { computed, onMounted, reactive, ref } from 'vue';
|
||||||
import { FormInstance } from 'element-plus';
|
import { FormInstance } from 'element-plus';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||||
import { getAgentGroupList } from '@/api/modules/group';
|
import { getAgentGroupList } from '@/api/modules/group';
|
||||||
import { Group } from '@/api/interface/group';
|
import { Group } from '@/api/interface/group';
|
||||||
|
|
||||||
|
|
@ -75,6 +75,10 @@ const submit = async (formEl: FormInstance | undefined) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (form.remark && form.remark.length > 128) {
|
||||||
|
MsgError(i18n.global.t('commons.rule.length128Err'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
updateWebsite(form)
|
updateWebsite(form)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<fu-read-write-switch>
|
<fu-read-write-switch>
|
||||||
<template #read>
|
<template #read>
|
||||||
<MsgInfo :info="row.remark" width="180px" />
|
<MsgInfo :info="row.remark" :width="'280'" />
|
||||||
</template>
|
</template>
|
||||||
<template #default="{ read }">
|
<template #default="{ read }">
|
||||||
<el-input v-model="row.remark" @blur="updateRemark(row, read)" />
|
<el-input v-model="row.remark" @blur="updateRemark(row, read)" />
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue