Skip to content

Commit

Permalink
feat: PHP 运行环境增加扩展列表提示 (#1500)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 authored Jun 30, 2023
1 parent 5f750e6 commit 4662f47
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion backend/app/service/runtime_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func handleParams(image, runtimeType, runtimeDir string, params map[string]inter
if extendsArray, ok := extends.([]interface{}); ok {
strArray := make([]string, len(extendsArray))
for i, v := range extendsArray {
strArray[i] = fmt.Sprintf("%v", v)
strArray[i] = strings.ToLower(fmt.Sprintf("%v", v))
}
params["PHP_EXTENSIONS"] = strings.Join(strArray, ",")
}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1558,9 +1558,11 @@ const message = {
toupgrade: 'To Upgrade',
edit: 'Edit runtime',
extendHelper:
'Extensions that do not exist in the list can be selected after manual input, for example: input sockets, and then select the first one in the drop-down list',
'Extensions that do not exist in the list can be selected after manual input, for example: input sockets, and then select the first one in the drop-down list,',
rebuildHelper:
'After editing the extension, you need to go to the [App Store-Installed] page to rebuild the PHP application to take effect',
phpPluginHelper:
'<a target="_blank" href="https://1panel.cn/docs/user_manual/websites/php/#php_1">View PHP extension list</a> ',
},
process: {
pid: 'Process ID',
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1478,8 +1478,10 @@ const message = {
openrestryWarn: 'PHP 需要升级 OpenResty 1.21.4.1 版本以上才能使用',
toupgrade: '去升级',
edit: '编辑运行环境',
extendHelper: '列表中不存在的扩展可以手动输入之后选择:输入 sockets然后在下拉列表中选择第一个',
extendHelper: '列表中不存在的扩展可以手动输入之后选择:输入 sockets然后在下拉列表中选择第一个',
rebuildHelper: '编辑扩展后需要去应用商店-已安装页面重建PHP 应用之后才能生效',
phpPluginHelper:
"<a target=_blankhref='https://1panel.cn/docs/user_manual/websites/php/#php_1'>查看 PHP 扩展列表</a> ",
},
process: {
pid: '进程ID',
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/styles/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,7 @@
background: none;
border: none;
}

.common-prompt {
margin-bottom: 20px !important;
}
7 changes: 1 addition & 6 deletions frontend/src/views/app-store/detail/install/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
</template>
<el-row v-loading="loading">
<el-col :span="22" :offset="1">
<el-alert
:title="$t('app.appInstallWarn')"
style="margin-bottom: 20px"
:closable="false"
type="error"
/>
<el-alert :title="$t('app.appInstallWarn')" class="common-prompt" :closable="false" type="error" />
<el-form
@submit.prevent
ref="paramForm"
Expand Down
7 changes: 1 addition & 6 deletions frontend/src/views/app-store/installed/detail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@
</el-row>
<el-row v-else v-loading="loading">
<el-col :span="22" :offset="1">
<el-alert
:title="$t('app.updateHelper')"
type="warning"
:closable="false"
style="margin-bottom: 20px"
/>
<el-alert :title="$t('app.updateHelper')" type="warning" :closable="false" class="common-prompt" />
<el-form @submit.prevent ref="paramForm" :model="paramModel" label-position="top" :rules="rules">
<div v-for="(p, index) in params" :key="index">
<el-form-item :prop="p.key" :label="getLabel(p)">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/container/container/upgrade/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<el-alert
v-if="form.fromApp"
:title="$t('container.appHelper')"
style="margin-bottom: 20px"
class="common-prompt"
:closable="false"
type="error"
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/container/setting/log/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<template #header>
<DrawerHeader :header="$t('container.cutLog')" :back="handleClose" />
</template>
<el-alert style="margin-bottom: 20px" :closable="false" type="warning">
<el-alert class="common-prompt" :closable="false" type="warning">
<template #default>
<ul style="margin-left: -20px">
<li>{{ $t('container.cutLogHelper1') }}</li>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/host/file-management/chown/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</template>
<el-row>
<el-col :span="22" :offset="1">
<el-alert :title="$t('file.ownerHelper')" type="info" :closable="false" style="margin-bottom: 20px" />
<el-alert :title="$t('file.ownerHelper')" type="info" :closable="false" class="common-prompt" />
<el-form
ref="fileForm"
label-position="top"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/host/terminal/terminal/host-create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<el-col :span="22">
<el-alert
v-if="isLocal"
style="margin-bottom: 20px"
class="common-prompt"
center
:title="$t('terminal.connLocalErr')"
:closable="false"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/setting/panel/timezone/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<el-alert
v-if="canChangeZone()"
:title="$t('setting.timeZoneHelper')"
style="margin-bottom: 20px"
class="common-prompt"
:closable="false"
type="warning"
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/setting/safe/mfa/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<template #header>
<DrawerHeader :header="$t('setting.mfa')" :back="handleClose" />
</template>
<el-alert style="margin-bottom: 20px" :closable="false" type="warning">
<el-alert class="common-prompt" :closable="false" type="warning">
<template #default>
<span>
<span>{{ $t('setting.mfaAlert') }}</span>
Expand Down
13 changes: 6 additions & 7 deletions frontend/src/views/website/runtime/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,12 @@
v-model:rules="rules"
></EditParams>
<el-form-item v-if="runtime.type === 'php'">
<el-alert :title="$t('runtime.extendHelper')" type="info" :closable="false" />
<el-alert
v-if="mode == 'edit'"
:title="$t('runtime.rebuildHelper')"
type="info"
:closable="false"
/>
<el-alert type="info" :closable="false">
<span>{{ $t('runtime.extendHelper') }}</span>
<span v-html="$t('runtime.phpPluginHelper')"></span>
<br />
<span v-if="mode == 'edit'">{{ $t('runtime.rebuildHelper') }}</span>
</el-alert>
</el-form-item>
</div>
</div>
Expand Down

0 comments on commit 4662f47

Please sign in to comment.