mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 16:29:17 +08:00
feat: 新建网站 无数据库情况增加提示
This commit is contained in:
parent
83199c41cb
commit
e9a129ef0f
@ -804,6 +804,7 @@ export default {
|
||||
forceDeleteHelper: '强制删除,会忽略删除过程中产生的错误并最终删除元数据',
|
||||
deleteBackup: '删除备份',
|
||||
deleteBackupHelper: '同时删除应用备份',
|
||||
toInstall: '去安装',
|
||||
},
|
||||
website: {
|
||||
website: '网站',
|
||||
|
@ -34,6 +34,9 @@
|
||||
:label="service.label"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<span v-if="p.type === 'service' && !p.services" style="margin-left: 5px">
|
||||
<el-link type="primary" :underline="false" @click="toPage()">{{ $t('app.toInstall') }}</el-link>
|
||||
</span>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</template>
|
||||
@ -43,6 +46,8 @@ import { getRandomStr } from '@/utils/util';
|
||||
import { GetAppService } from '@/api/modules/app';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { App } from '@/api/interface/app';
|
||||
import { useRouter } from 'vue-router';
|
||||
const router = useRouter();
|
||||
|
||||
interface ParamObj extends App.FromField {
|
||||
services: App.AppService[];
|
||||
@ -133,7 +138,7 @@ const handleParams = () => {
|
||||
const getServices = async (envKey: string, key: string | undefined, pObj: ParamObj) => {
|
||||
await GetAppService(key).then((res) => {
|
||||
pObj.services = res.data;
|
||||
if (res.data.length > 0) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
form[envKey] = res.data[0].value;
|
||||
if (res.data[0].config) {
|
||||
Object.entries(res.data[0].config).forEach(([k, v]) => {
|
||||
@ -162,6 +167,10 @@ const changeService = (value: string, services: App.AppService[]) => {
|
||||
updateParam();
|
||||
};
|
||||
|
||||
const toPage = () => {
|
||||
router.push({ name: 'App' });
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
handleParams();
|
||||
});
|
||||
|
@ -12,7 +12,7 @@
|
||||
ref="websiteForm"
|
||||
label-position="right"
|
||||
:model="website"
|
||||
label-width="68px"
|
||||
label-width="125px"
|
||||
:rules="rules"
|
||||
:validate-on-rule-change="false"
|
||||
>
|
||||
|
Loading…
x
Reference in New Issue
Block a user