Browse Source

refactor(gui-v2): code cleanup

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2730/head
Pranav C 2 years ago
parent
commit
7ebdd6b840
  1. 31
      packages/nc-gui-v2/pages/projects/index/create-external.vue

31
packages/nc-gui-v2/pages/projects/index/create-external.vue

@ -126,17 +126,10 @@ watch(
<template> <template>
<a-card class="max-w-[600px] mx-auto !mt-100px" :title="$t('activity.createProject')"> <a-card class="max-w-[600px] mx-auto !mt-100px" :title="$t('activity.createProject')">
<a-form :model="formState" name="validate_other" layout="horizontal" :label-col="{ span: 8 }" :wrapper-col="{ span: 18 }"> <a-form :model="formState" name="validate_other" layout="horizontal" :label-col="{ span: 8 }" :wrapper-col="{ span: 18 }">
<!-- <a-row :gutter="24"> -->
<!-- <a-col span="24"> -->
<!-- Enter Project Name -->
<a-form-item :label="$t('placeholder.projName')" v-bind="validateInfos.title"> <a-form-item :label="$t('placeholder.projName')" v-bind="validateInfos.title">
<a-input v-model:value="formState.title" size="small" /> <a-input v-model:value="formState.title" size="small" />
</a-form-item> </a-form-item>
<!-- </a-col> -->
<!-- <a-col :span="24" class="text-center text-md font-medium mb-3 mt-1"> -->
<!-- {{ $t('title.dbCredentials') }} -->
<!-- </a-col> -->
<!-- <a-col :span="8"> -->
<a-form-item :label="$t('labels.dbType')" v-bind="validateInfos['dataSource.client']"> <a-form-item :label="$t('labels.dbType')" v-bind="validateInfos['dataSource.client']">
<a-select v-model:value="formState.dataSource.client" size="small" @change="onClientChange"> <a-select v-model:value="formState.dataSource.client" size="small" @change="onClientChange">
<a-select-option v-for="client in clientTypes" :key="client.value" :value="client.value" <a-select-option v-for="client in clientTypes" :key="client.value" :value="client.value"
@ -144,28 +137,18 @@ watch(
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<!-- </a-col> -->
<!-- <a-col :span="8"> -->
<a-form-item :label="$t('labels.hostAddress')" v-bind="validateInfos['dataSource.connection.host']"> <a-form-item :label="$t('labels.hostAddress')" v-bind="validateInfos['dataSource.connection.host']">
<a-input v-model:value="formState.dataSource.connection.host" size="small" /> <a-input v-model:value="formState.dataSource.connection.host" size="small" />
</a-form-item> </a-form-item>
<!-- </a-col> -->
<!-- <a-col :span="8"> -->
<a-form-item :label="$t('labels.port')" v-bind="validateInfos['dataSource.connection.port']"> <a-form-item :label="$t('labels.port')" v-bind="validateInfos['dataSource.connection.port']">
<a-input-number v-model:value="formState.dataSource.connection.port" class="!w-full" size="small" /> <a-input-number v-model:value="formState.dataSource.connection.port" class="!w-full" size="small" />
</a-form-item> </a-form-item>
<!-- </a-col> -->
<!-- <a-col :span="8"> -->
<a-form-item :label="$t('labels.username')" v-bind="validateInfos['dataSource.connection.user']"> <a-form-item :label="$t('labels.username')" v-bind="validateInfos['dataSource.connection.user']">
<a-input v-model:value="formState.dataSource.connection.user" size="small" /> <a-input v-model:value="formState.dataSource.connection.user" size="small" />
</a-form-item> </a-form-item>
<!-- </a-col> -->
<!-- <a-col :span="8"> -->
<a-form-item :label="$t('labels.password')"> <a-form-item :label="$t('labels.password')">
<a-input-password v-model:value="formState.dataSource.connection.password" size="small" /> <a-input-password v-model:value="formState.dataSource.connection.password" size="small" />
</a-form-item> </a-form-item>
<!-- </a-col> -->
<!-- <a-col :span="8"> -->
<a-form-item :label="$t('labels.database')" v-bind="validateInfos['dataSource.connection.database']"> <a-form-item :label="$t('labels.database')" v-bind="validateInfos['dataSource.connection.database']">
<a-input <a-input
v-model:value="formState.dataSource.connection.database" v-model:value="formState.dataSource.connection.database"
@ -173,9 +156,6 @@ watch(
size="small" size="small"
/> />
</a-form-item> </a-form-item>
<!-- </a-col> -->
<!-- </a-row> -->
<a-collapse ghost expand-icon-position="right"> <a-collapse ghost expand-icon-position="right">
<a-collapse-panel key="1" header="Advance options"> <a-collapse-panel key="1" header="Advance options">
<a-form-item :label="$t('lables.ssl')" v-bind="validateInfos['dataSource.ssl']"> <a-form-item :label="$t('lables.ssl')" v-bind="validateInfos['dataSource.ssl']">
@ -185,8 +165,6 @@ watch(
</a-form-item> </a-form-item>
<a-form-item :label="$t('labels.dbCredentials')"> <a-form-item :label="$t('labels.dbCredentials')">
<!-- <a-input v-model:value="formState.dataSource.connection.database" size="small" /> -->
<div class="flex gap-2"> <div class="flex gap-2">
<a-tooltip placement="top"> <a-tooltip placement="top">
<template #title> <template #title>
@ -215,8 +193,7 @@ watch(
</div> </div>
</a-form-item> </a-form-item>
<!-- <v-row> -->
<!-- <v-col> -->
<a-form-item :label="$t('labels.inflection.tableName')" v-bind="validateInfos['dataSource.client']"> <a-form-item :label="$t('labels.inflection.tableName')" v-bind="validateInfos['dataSource.client']">
<a-select v-model:value="formState.dataSource.client" size="small" @change="onClientChange"> <a-select v-model:value="formState.dataSource.client" size="small" @change="onClientChange">
<a-select-option v-for="client in clientTypes" :key="client.value" :value="client.value" <a-select-option v-for="client in clientTypes" :key="client.value" :value="client.value"
@ -224,8 +201,6 @@ watch(
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<!-- </v-col> -->
<!-- <v-col> -->
<a-form-item :label="$t('labels.inflection.columnName')" v-bind="validateInfos['dataSource.client']"> <a-form-item :label="$t('labels.inflection.columnName')" v-bind="validateInfos['dataSource.client']">
<a-select v-model:value="formState.dataSource.client" size="small" @change="onClientChange"> <a-select v-model:value="formState.dataSource.client" size="small" @change="onClientChange">
<a-select-option v-for="client in clientTypes" :key="client.value" :value="client.value" <a-select-option v-for="client in clientTypes" :key="client.value" :value="client.value"
@ -233,8 +208,6 @@ watch(
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<!-- </v-col> -->
<!-- </v-row> -->
<div class="flex justify-end"> <div class="flex justify-end">
<a-button size="small" @click="configEditDlg = true"> <a-button size="small" @click="configEditDlg = true">
<!-- Edit connection JSON --> <!-- Edit connection JSON -->

Loading…
Cancel
Save