Skip to content

Commit 77f8db7

Browse files
feat: Installed Openresty and added automatic directory creation. (#7768)
1 parent 8283cd7 commit 77f8db7

File tree

6 files changed

+79
-61
lines changed

6 files changed

+79
-61
lines changed

agent/app/service/app.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
351351
return
352352
}
353353
}
354-
if app.Key == "openresty" && app.Resource == "remote" && common.CompareVersion(appDetail.Version, "1.21.4.3-3-3") {
354+
if app.Key == "openresty" && app.Resource == "remote" && common.CompareVersion(appDetail.Version, "1.27") {
355355
if dir, ok := req.Params["WEBSITE_DIR"]; ok {
356356
siteDir := dir.(string)
357357
if siteDir == "" || !strings.HasPrefix(siteDir, "/") {
@@ -365,6 +365,7 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
365365
}
366366
if !fileOp.Stat(siteDir) {
367367
_ = fileOp.CreateDir(siteDir, constant.DirPerm)
368+
_ = fileOp.CreateDir(path.Join(siteDir, "conf.d"), constant.DirPerm)
368369
}
369370
err = settingRepo.UpdateOrCreate("WEBSITE_DIR", siteDir)
370371
if err != nil {
@@ -377,16 +378,16 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
377378
continue
378379
}
379380
var port int
380-
if port, err = checkPort(key, req.Params); err == nil {
381-
if key == "PANEL_APP_PORT_HTTP" {
382-
httpPort = port
383-
}
384-
if key == "PANEL_APP_PORT_HTTPS" {
385-
httpsPort = port
386-
}
387-
} else {
381+
port, err = checkPort(key, req.Params)
382+
if err != nil {
388383
return
389384
}
385+
if key == "PANEL_APP_PORT_HTTP" {
386+
httpPort = port
387+
}
388+
if key == "PANEL_APP_PORT_HTTPS" {
389+
httpsPort = port
390+
}
390391
}
391392

392393
if err = checkRequiredAndLimit(app); err != nil {
@@ -919,11 +920,11 @@ func (a AppService) SyncAppListFromRemote(taskID string) (err error) {
919920
appTags []*model.AppTag
920921
oldAppIds []uint
921922
)
922-
for _, t := range list.Extra.Tags {
923+
for _, tag := range list.Extra.Tags {
923924
tags = append(tags, &model.Tag{
924-
Key: t.Key,
925-
Name: t.Name,
926-
Sort: t.Sort,
925+
Key: tag.Key,
926+
Name: tag.Name,
927+
Sort: tag.Sort,
927928
})
928929
}
929930
deleteCustomApp()

agent/init/migration/migrations/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ var InitDefaultCA = &gormigrate.Migration{
207207
var InitPHPExtensions = &gormigrate.Migration{
208208
ID: "20240722-add-php-extensions",
209209
Migrate: func(tx *gorm.DB) error {
210-
if err := tx.Create(&model.PHPExtensions{Name: "Default", Extensions: "bcmath,gd,gettext,intl,pcntl,shmop,soap,sockets,sysvsem,xmlrpc,zip"}).Error; err != nil {
210+
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 {
211211
return err
212212
}
213213
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 {

core/constant/common.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ var WebUrlMap = map[string]struct{}{
7272
"/hosts/files": {},
7373
"/hosts/monitor/monitor": {},
7474
"/hosts/monitor/setting": {},
75-
"/hosts/terminal": {},
7675
"/hosts/firewall/port": {},
7776
"/hosts/firewall/forward": {},
7877
"/hosts/firewall/ip": {},
@@ -82,6 +81,8 @@ var WebUrlMap = map[string]struct{}{
8281
"/hosts/ssh/log": {},
8382
"/hosts/ssh/session": {},
8483

84+
"/terminal": {},
85+
8586
"/logs": {},
8687
"/logs/operation": {},
8788
"/logs/login": {},

frontend/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
},
2222
"dependencies": {
2323
"@codemirror/lang-json": "^6.0.1",
24-
"@codemirror/lang-html": "^6.4.9",
25-
"@codemirror/lang-php": "^6.0.1",
2624
"@codemirror/language": "^6.10.2",
2725
"@codemirror/legacy-modes": "^6.4.0",
2826
"@codemirror/theme-one-dark": "^6.1.2",

frontend/src/views/website/runtime/php/create/index.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@
9797
>
9898
<el-select v-model="runtime.source" filterable default-first-option>
9999
<el-option
100-
v-for="service in formFields['CONTAINER_PACKAGE_URL'].values"
101-
:key="service.label"
102-
:value="service.value"
103-
:label="service.label"
100+
v-for="source in phpSources"
101+
:key="source.label"
102+
:value="source.value"
103+
:label="source.label + ' [' + source.value + ']'"
104104
></el-option>
105105
</el-select>
106106
</el-form-item>
@@ -216,41 +216,41 @@ const phpSources = globalStore.isIntl
216216
? [
217217
{
218218
label: i18n.global.t('runtime.default'),
219-
value: 'dl-cdn.alpinelinux.org',
219+
value: 'https://dl-cdn.alpinelinux.org',
220220
},
221221
{
222222
label: i18n.global.t('runtime.xtom'),
223-
value: 'mirrors.xtom.com',
223+
value: 'https://mirrors.xtom.com',
224224
},
225225
]
226226
: [
227227
{
228228
label: i18n.global.t('runtime.ustc'),
229-
value: 'mirrors.ustc.edu.cn',
229+
value: 'https://mirrors.ustc.edu.cn',
230230
},
231231
{
232232
label: i18n.global.t('runtime.netease'),
233-
value: 'mirrors.163.com',
233+
value: 'https://mirrors.163.com',
234234
},
235235
{
236236
label: i18n.global.t('runtime.aliyun'),
237-
value: 'mirrors.aliyun.com',
237+
value: 'https://mirrors.aliyun.com',
238238
},
239239
{
240240
label: i18n.global.t('runtime.tsinghua'),
241-
value: 'mirrors.tuna.tsinghua.edu.cn',
241+
value: 'https://mirrors.tuna.tsinghua.edu.cn',
242242
},
243243
{
244244
label: i18n.global.t('runtime.xtomhk'),
245-
value: 'mirrors.xtom.com.hk',
245+
value: 'https://mirrors.xtom.com.hk',
246246
},
247247
{
248248
label: i18n.global.t('runtime.xtom'),
249-
value: 'mirrors.xtom.com',
249+
value: 'https://mirrors.xtom.com',
250250
},
251251
{
252-
label: i18n.global.t('runtime.default'),
253-
value: 'dl-cdn.alpinelinux.org',
252+
label: i18n.global.t('commons.table.default'),
253+
value: 'https://dl-cdn.alpinelinux.org',
254254
},
255255
];
256256
@@ -476,8 +476,8 @@ const acceptParams = async (props: OperateRrops) => {
476476
getRuntime(props.id);
477477
}
478478
extensions.value = '';
479-
listPHPExtensions();
480479
open.value = true;
480+
listPHPExtensions();
481481
};
482482
483483
defineExpose({

frontend/src/views/website/website/nginx/status/index.vue

Lines changed: 47 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,52 @@
11
<template>
22
<div>
3-
<el-row>
4-
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
5-
<el-statistic :title="$t('nginx.connections')" :value="data.active" />
6-
</el-col>
7-
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
8-
<el-statistic :title="$t('nginx.accepts')" :value="data.accepts" />
9-
</el-col>
10-
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
11-
<el-statistic :title="$t('nginx.handled')" :value="data.handled" />
12-
</el-col>
13-
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
14-
<el-statistic :title="$t('nginx.requests')" :value="data.requests" />
15-
</el-col>
16-
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
17-
<el-statistic :title="$t('nginx.reading')" :value="data.reading" />
18-
</el-col>
19-
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
20-
<el-statistic :title="$t('nginx.writing')" :value="data.writing" />
21-
</el-col>
22-
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
23-
<el-statistic :title="$t('nginx.waiting')" :value="data.waiting" />
24-
</el-col>
25-
</el-row>
3+
<el-form label-position="top">
4+
<el-row type="flex" class="ml-5" justify="center">
5+
<el-form-item class="w-1/4">
6+
<template #label>
7+
<span class="status-label">{{ $t('nginx.connections') }}</span>
8+
</template>
9+
<span class="status-count">{{ data.active }}</span>
10+
</el-form-item>
11+
<el-form-item class="w-1/4">
12+
<template #label>
13+
<span class="status-label">{{ $t('nginx.accepts') }}</span>
14+
</template>
15+
<span class="status-count">{{ data.accepts }}</span>
16+
</el-form-item>
17+
<el-form-item class="w-1/4">
18+
<template #label>
19+
<span class="status-label">{{ $t('nginx.handled') }}</span>
20+
</template>
21+
<span class="status-count">{{ data.handled }}</span>
22+
</el-form-item>
23+
<el-form-item class="w-1/4">
24+
<template #label>
25+
<span class="status-label">{{ $t('nginx.requests') }}</span>
26+
</template>
27+
<span class="status-count">{{ data.requests }}</span>
28+
</el-form-item>
29+
<el-form-item class="w-1/4">
30+
<template #label>
31+
<span class="status-label">{{ $t('nginx.reading') }}</span>
32+
</template>
33+
<span class="status-count">{{ data.reading }}</span>
34+
</el-form-item>
35+
<el-form-item class="w-1/4">
36+
<template #label>
37+
<span class="status-label">{{ $t('nginx.writing') }}</span>
38+
</template>
39+
<span class="status-count">{{ data.writing }}</span>
40+
</el-form-item>
41+
<el-form-item class="w-1/4">
42+
<template #label>
43+
<span class="status-label">{{ $t('nginx.waiting') }}</span>
44+
</template>
45+
<span class="status-count">{{ data.waiting }}</span>
46+
</el-form-item>
47+
<el-form-item class="w-1/4" />
48+
</el-row>
49+
</el-form>
2650
</div>
2751
</template>
2852

@@ -60,9 +84,3 @@ onMounted(() => {
6084
get();
6185
});
6286
</script>
63-
64-
<style scoped>
65-
.el-col {
66-
text-align: center;
67-
}
68-
</style>

0 commit comments

Comments
 (0)