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
27 changes: 14 additions & 13 deletions agent/app/service/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
return
}
}
if app.Key == "openresty" && app.Resource == "remote" && common.CompareVersion(appDetail.Version, "1.21.4.3-3-3") {
if app.Key == "openresty" && app.Resource == "remote" && common.CompareVersion(appDetail.Version, "1.27") {
if dir, ok := req.Params["WEBSITE_DIR"]; ok {
siteDir := dir.(string)
if siteDir == "" || !strings.HasPrefix(siteDir, "/") {
Expand All @@ -365,6 +365,7 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
}
if !fileOp.Stat(siteDir) {
_ = fileOp.CreateDir(siteDir, constant.DirPerm)
_ = fileOp.CreateDir(path.Join(siteDir, "conf.d"), constant.DirPerm)
}
err = settingRepo.UpdateOrCreate("WEBSITE_DIR", siteDir)
if err != nil {
Expand All @@ -377,16 +378,16 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
continue
}
var port int
if port, err = checkPort(key, req.Params); err == nil {
if key == "PANEL_APP_PORT_HTTP" {
httpPort = port
}
if key == "PANEL_APP_PORT_HTTPS" {
httpsPort = port
}
} else {
port, err = checkPort(key, req.Params)
if err != nil {
return
}
if key == "PANEL_APP_PORT_HTTP" {
httpPort = port
}
if key == "PANEL_APP_PORT_HTTPS" {
httpsPort = port
}
}

if err = checkRequiredAndLimit(app); err != nil {
Expand Down Expand Up @@ -919,11 +920,11 @@ func (a AppService) SyncAppListFromRemote(taskID string) (err error) {
appTags []*model.AppTag
oldAppIds []uint
)
for _, t := range list.Extra.Tags {
for _, tag := range list.Extra.Tags {
tags = append(tags, &model.Tag{
Key: t.Key,
Name: t.Name,
Sort: t.Sort,
Key: tag.Key,
Name: tag.Name,
Sort: tag.Sort,
})
}
deleteCustomApp()
Copy link
Member

Choose a reason for hiding this comment

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

There don't appear to be any immediate errors or inconsistencies with this code snippet. However, if you have specific issues or requirements in mind that need addressing, please provide more details about what is not operating as intended and I can suggest improvements based on my knowledge of Go programming language conventions and patterns.

Expand Down
2 changes: 1 addition & 1 deletion agent/init/migration/migrations/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ var InitDefaultCA = &gormigrate.Migration{
var InitPHPExtensions = &gormigrate.Migration{
ID: "20240722-add-php-extensions",
Migrate: func(tx *gorm.DB) error {
if err := tx.Create(&model.PHPExtensions{Name: "Default", Extensions: "bcmath,gd,gettext,intl,pcntl,shmop,soap,sockets,sysvsem,xmlrpc,zip"}).Error; err != nil {
if err := tx.Create(&model.PHPExtensions{Name: "Default", Extensions: "bcmath,ftp,gd,gettext,intl,mysqli,pcntl,pdo_mysql,shmop,soap,sockets,sysvsem,xmlrpc,zip"}).Error; err != nil {
return err
}
if err := tx.Create(&model.PHPExtensions{Name: "WordPress", Extensions: "exif,igbinary,imagick,intl,zip,apcu,memcached,opcache,redis,bc,image,shmop,mysqli,pdo_mysql,gd"}).Error; err != nil {
Expand Down
3 changes: 2 additions & 1 deletion core/constant/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ var WebUrlMap = map[string]struct{}{
"/hosts/files": {},
"/hosts/monitor/monitor": {},
"/hosts/monitor/setting": {},
"/hosts/terminal": {},
"/hosts/firewall/port": {},
"/hosts/firewall/forward": {},
"/hosts/firewall/ip": {},
Expand All @@ -82,6 +81,8 @@ var WebUrlMap = map[string]struct{}{
"/hosts/ssh/log": {},
"/hosts/ssh/session": {},

"/terminal": {},

"/logs": {},
"/logs/operation": {},
"/logs/login": {},
Expand Down
2 changes: 0 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
},
"dependencies": {
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-html": "^6.4.9",
"@codemirror/lang-php": "^6.0.1",
"@codemirror/language": "^6.10.2",
"@codemirror/legacy-modes": "^6.4.0",
"@codemirror/theme-one-dark": "^6.1.2",
Expand Down
30 changes: 15 additions & 15 deletions frontend/src/views/website/runtime/php/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@
>
<el-select v-model="runtime.source" filterable default-first-option>
<el-option
v-for="service in formFields['CONTAINER_PACKAGE_URL'].values"
:key="service.label"
:value="service.value"
:label="service.label"
v-for="source in phpSources"
:key="source.label"
:value="source.value"
:label="source.label + ' [' + source.value + ']'"
></el-option>
</el-select>
</el-form-item>
Expand Down Expand Up @@ -216,41 +216,41 @@ const phpSources = globalStore.isIntl
? [
{
label: i18n.global.t('runtime.default'),
value: 'dl-cdn.alpinelinux.org',
value: 'https://dl-cdn.alpinelinux.org',
},
{
label: i18n.global.t('runtime.xtom'),
value: 'mirrors.xtom.com',
value: 'https://mirrors.xtom.com',
},
]
: [
{
label: i18n.global.t('runtime.ustc'),
value: 'mirrors.ustc.edu.cn',
value: 'https://mirrors.ustc.edu.cn',
},
{
label: i18n.global.t('runtime.netease'),
value: 'mirrors.163.com',
value: 'https://mirrors.163.com',
},
{
label: i18n.global.t('runtime.aliyun'),
value: 'mirrors.aliyun.com',
value: 'https://mirrors.aliyun.com',
},
{
label: i18n.global.t('runtime.tsinghua'),
value: 'mirrors.tuna.tsinghua.edu.cn',
value: 'https://mirrors.tuna.tsinghua.edu.cn',
},
{
label: i18n.global.t('runtime.xtomhk'),
value: 'mirrors.xtom.com.hk',
value: 'https://mirrors.xtom.com.hk',
},
{
label: i18n.global.t('runtime.xtom'),
value: 'mirrors.xtom.com',
value: 'https://mirrors.xtom.com',
},
{
label: i18n.global.t('runtime.default'),
value: 'dl-cdn.alpinelinux.org',
label: i18n.global.t('commons.table.default'),
value: 'https://dl-cdn.alpinelinux.org',
},
];

Expand Down Expand Up @@ -476,8 +476,8 @@ const acceptParams = async (props: OperateRrops) => {
getRuntime(props.id);
}
extensions.value = '';
listPHPExtensions();
open.value = true;
listPHPExtensions();
};

defineExpose({
Copy link
Member

Choose a reason for hiding this comment

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

The code you have shared contains some syntax errors and lacks context about what it is intended to accomplish. However, I can observe that there were formatting differences between JavaScript files in different projects. As long as the changes are minor and stylistic rather than substantive and potentially causing bugs or other issues with your app, it would be reasonable to suggest these should not significantly impact performance but could result in slightly cleaner looking output when reviewed within an IDE.

In terms of optimization suggestions:

Asynchronous operations like getRuntime may perform better without blocking user interactions temporarily, which will speed up UI responsiveness.

Similarly, calling functions directly from templates using variables ('i18n', etc.) instead of destructuring them for use elsewhere might also make the code leaner overall.

Lastly, consider splitting CSS imports into separate CSS files and avoiding inline styles altogether if possible since they take extra time due to network requests involved per stylesheet imported in this project.

Remember, while small optimizations often go unnoticed until more thorough testing, the larger scale improvements come through across many components and pages.

Expand Down
76 changes: 47 additions & 29 deletions frontend/src/views/website/website/nginx/status/index.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,52 @@
<template>
<div>
<el-row>
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
<el-statistic :title="$t('nginx.connections')" :value="data.active" />
</el-col>
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
<el-statistic :title="$t('nginx.accepts')" :value="data.accepts" />
</el-col>
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
<el-statistic :title="$t('nginx.handled')" :value="data.handled" />
</el-col>
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
<el-statistic :title="$t('nginx.requests')" :value="data.requests" />
</el-col>
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
<el-statistic :title="$t('nginx.reading')" :value="data.reading" />
</el-col>
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
<el-statistic :title="$t('nginx.writing')" :value="data.writing" />
</el-col>
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
<el-statistic :title="$t('nginx.waiting')" :value="data.waiting" />
</el-col>
</el-row>
<el-form label-position="top">
<el-row type="flex" class="ml-5" justify="center">
<el-form-item class="w-1/4">
<template #label>
<span class="status-label">{{ $t('nginx.connections') }}</span>
</template>
<span class="status-count">{{ data.active }}</span>
</el-form-item>
<el-form-item class="w-1/4">
<template #label>
<span class="status-label">{{ $t('nginx.accepts') }}</span>
</template>
<span class="status-count">{{ data.accepts }}</span>
</el-form-item>
<el-form-item class="w-1/4">
<template #label>
<span class="status-label">{{ $t('nginx.handled') }}</span>
</template>
<span class="status-count">{{ data.handled }}</span>
</el-form-item>
<el-form-item class="w-1/4">
<template #label>
<span class="status-label">{{ $t('nginx.requests') }}</span>
</template>
<span class="status-count">{{ data.requests }}</span>
</el-form-item>
<el-form-item class="w-1/4">
<template #label>
<span class="status-label">{{ $t('nginx.reading') }}</span>
</template>
<span class="status-count">{{ data.reading }}</span>
</el-form-item>
<el-form-item class="w-1/4">
<template #label>
<span class="status-label">{{ $t('nginx.writing') }}</span>
</template>
<span class="status-count">{{ data.writing }}</span>
</el-form-item>
<el-form-item class="w-1/4">
<template #label>
<span class="status-label">{{ $t('nginx.waiting') }}</span>
</template>
<span class="status-count">{{ data.waiting }}</span>
</el-form-item>
<el-form-item class="w-1/4" />
</el-row>
</el-form>
</div>
</template>

Expand Down Expand Up @@ -60,9 +84,3 @@ onMounted(() => {
get();
});
</script>

<style scoped>
.el-col {
text-align: center;
}
</style>
Copy link
Member

Choose a reason for hiding this comment

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

Based on the code provided, there are no known abnormalities or potential issues; it appears to work correctly with minimal adjustments. The style attributes el-row could be simplified since none of them have classes associated which could help maintain conciseness.

Since this is a template component and not intended for execution directly in the browser environment, minor formatting refinements might improve readability without affecting functionality. However, such changes would depend more on personal preferences than actual coding guidelines or best practices:

.el-col {
    text-align: center;
}

</style>

Loading