mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-01-07 23:55:15 +08:00
feat: 运行环境应用和版本增加联动 (#545)
This commit is contained in:
parent
5c524f0d23
commit
49ab26200d
1 changed files with 20 additions and 6 deletions
|
|
@ -34,7 +34,11 @@
|
|||
<el-form-item :label="$t('runtime.app')" prop="appId">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-select v-model="runtime.appId" :disabled="mode === 'edit'">
|
||||
<el-select
|
||||
v-model="runtime.appId"
|
||||
:disabled="mode === 'edit'"
|
||||
@change="changeApp(runtime.appId)"
|
||||
>
|
||||
<el-option
|
||||
v-for="(app, index) in apps"
|
||||
:key="index"
|
||||
|
|
@ -120,10 +124,10 @@ const runtimeForm = ref<FormInstance>();
|
|||
const loading = ref(false);
|
||||
const initParam = ref(false);
|
||||
const mode = ref('create');
|
||||
let appParams = ref<App.AppParams>();
|
||||
let editParams = ref<App.InstallParams[]>();
|
||||
let appVersions = ref<string[]>([]);
|
||||
let appReq = reactive({
|
||||
const appParams = ref<App.AppParams>();
|
||||
const editParams = ref<App.InstallParams[]>();
|
||||
const appVersions = ref<string[]>([]);
|
||||
const appReq = reactive({
|
||||
type: 'php',
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
|
|
@ -136,7 +140,7 @@ const runtime = ref<Runtime.RuntimeCreate>({
|
|||
type: 'php',
|
||||
resource: 'appstore',
|
||||
});
|
||||
let rules = ref<any>({
|
||||
const rules = ref<any>({
|
||||
name: [Rules.appName],
|
||||
resource: [Rules.requiredInput],
|
||||
appId: [Rules.requiredSelect],
|
||||
|
|
@ -180,6 +184,16 @@ const searchApp = (appId: number) => {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
const changeApp = (appId: number) => {
|
||||
for (const app of apps.value) {
|
||||
if (app.id === appId) {
|
||||
getApp(app.key, mode.value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getApp = (appkey: string, mode: string) => {
|
||||
GetApp(appkey).then((res) => {
|
||||
appVersions.value = res.data.versions || [];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue