feat(runtime): fix issue with install php runtime failed (#8230)

This commit is contained in:
zhengkunwang 2025-03-24 18:41:30 +08:00 committed by GitHub
parent a617424786
commit 0bddeef63e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 30 additions and 5 deletions

View file

@ -113,5 +113,6 @@ type Resource struct {
type Database struct { type Database struct {
Name string `json:"name"` Name string `json:"name"`
Type string `json:"type"` Type string `json:"type"`
From string `json:"from"`
ID uint `json:"id"` ID uint `json:"id"`
} }

View file

@ -112,7 +112,7 @@ func (a AppService) PageApp(ctx *gin.Context, req request.AppSearch) (interface{
lang := strings.ToLower(common.GetLang(ctx)) lang := strings.ToLower(common.GetLang(ctx))
for _, ap := range apps { for _, ap := range apps {
if req.Type == "php" { if req.Type == "php" {
if ap.RequiredPanelVersion == 0 || !common.CompareAppVersion(fmt.Sprintf("%f", ap.RequiredPanelVersion), info.SystemVersion) { if ap.RequiredPanelVersion == 0 || !common.CompareAppVersion(fmt.Sprintf("%f", ap.RequiredPanelVersion), common.GetSystemVersion(info.SystemVersion)) {
continue continue
} }
} }

View file

@ -3219,6 +3219,7 @@ func (w WebsiteService) ListDatabases() ([]response.Database, error) {
ID: db.ID, ID: db.ID,
Name: db.Name, Name: db.Name,
Type: database.Type, Type: database.Type,
From: database.From,
}) })
} }
} }
@ -3230,6 +3231,7 @@ func (w WebsiteService) ListDatabases() ([]response.Database, error) {
ID: db.ID, ID: db.ID,
Name: db.Name, Name: db.Name,
Type: database.Type, Type: database.Type,
From: database.From,
}) })
} }
} }

View file

@ -399,3 +399,12 @@ func RestartService(core, agent, reload bool) {
global.LOG.Errorf("restart 1panel service failed, err: %v, std: %s", err, std) global.LOG.Errorf("restart 1panel service failed, err: %v, std: %s", err, std)
} }
} }
func GetSystemVersion(versionString string) string {
re := regexp.MustCompile(`v(\d+\.\d+\.\d+)`)
match := re.FindStringSubmatch(versionString)
if len(match) > 1 {
return match[1]
}
return ""
}

View file

@ -628,6 +628,7 @@ export namespace Website {
type: string; type: string;
databaseID: number; databaseID: number;
websiteID: number; websiteID: number;
from: string;
} }
export interface ChangeDatabase { export interface ChangeDatabase {

View file

@ -45,7 +45,11 @@
> >
<PHP :id="id" v-if="tabIndex == '13'"></PHP> <PHP :id="id" v-if="tabIndex == '13'"></PHP>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('logs.resource')" name="14"> <el-tab-pane
:label="$t('logs.resource')"
name="14"
v-if="website.type === 'runtime' || website.type === 'static'"
>
<Resource :id="id" v-if="tabIndex == '14'"></Resource> <Resource :id="id" v-if="tabIndex == '14'"></Resource>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('website.other')" name="12"> <el-tab-pane :label="$t('website.other')" name="12">

View file

@ -23,7 +23,12 @@
> >
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<div>
<el-tag>{{ item.type }}</el-tag> <el-tag>{{ item.type }}</el-tag>
<el-tag class="ml-1">
{{ item.from === 'local' ? $t('commons.table.local') : $t('database.remote') }}
</el-tag>
</div>
</div> </div>
</el-option> </el-option>
</el-select> </el-select>

View file

@ -272,7 +272,7 @@ const shortcuts = [
{ {
text: useI18n().t('website.ever'), text: useI18n().t('website.ever'),
value: () => { value: () => {
return new Date('9999-12-31'); return new Date('2006-01-02');
}, },
}, },
{ {
@ -438,7 +438,10 @@ const pickerVisibility = (visibility: boolean, row: any) => {
}; };
const updateWebsitConfig = (row: any) => { const updateWebsitConfig = (row: any) => {
const reqDate = dateFormatSimple(row.expireDate); let reqDate = dateFormatSimple(row.expireDate);
if (reqDate == '2006-01-02') {
reqDate = '9999-12-31';
}
const req = { const req = {
id: row.id, id: row.id,
primaryDomain: row.primaryDomain, primaryDomain: row.primaryDomain,