zhangmo8 commented on code in PR #238:
URL: https://github.com/apache/paimon-webui/pull/238#discussion_r1609729303


##########
paimon-web-ui/src/form-lib/cdc/use-paimon.ts:
##########
@@ -15,109 +15,110 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License. */
 
-import { getAllCatalogs } from "@/api/models/catalog"
-import type { IJsonItem } from "@/components/dynamic-form/types"
-import { useCatalogStore } from "@/store/catalog"
+import { getAllCatalogs } from '@/api/models/catalog'
+import type { IJsonItem } from '@/components/dynamic-form/types'
+import { useCatalogStore } from '@/store/catalog'
 
 export function usePaimon(item: any) {
-       const { t } = useLocaleHooks()
-       const tabType = item.data.tabType
-       let catalogOptions: any = ref([{value:1}])
-       const catalogStore = useCatalogStore()
-       catalogStore.getAllCatalogs().then(()=>{
-               catalogOptions.value = catalogStore.catalogs
-       })
-       const model = reactive({
-               warehouse: '',
-               metastore: '',
-               url: '',
-               other_configs: '',
-               database: '',
-               table_name: '',
-               primary_key: '',
-               partition_column: '',
-               other_configs2: '',
-       })
+  const { t } = useLocaleHooks()
+  const tabType = item.data.tabType
+  let catalogOptions: any = ref([{ value: 1 }])
+  const catalogStore = useCatalogStore()
+  catalogStore.getAllCatalogs().then(() => {
+    catalogOptions.value = catalogStore.catalogs?.map((e) => {
+      return { label: e.label, value: e.key }
+    })
+  })
+  const data = item.data
+  const model = reactive({
+    catalog: data.catalog || '',
+    other_configs: data.other_configs || '',
+    database: data.database || '',
+    table_name: data.table_name || '',
+    primary_key: data.primary_key || '',
+    partition_column: data.partition_column || '',
+    other_configs2: data.other_configs2 || ''
+  })

Review Comment:
   You can assign values using extenders, but pay attention to the type
   ```suggestion
     const model = reactive({ ...data })
   ```



##########
paimon-web-ui/src/views/cdc/components/list/index.tsx:
##########
@@ -20,10 +20,11 @@ import { useTable } from './use-table'
 
 export default defineComponent({
   name: 'ListPage',
-  setup() {
+  emits:['cdcJobSubmit'],
+  setup(props,ctx) {

Review Comment:
   If you do not use this props, please use an '_' as the parameter name. 
   ```suggestion
     setup(_, ctx) {
   ```



##########
paimon-web-ui/src/locales/zh/modules/cdc.ts:
##########
@@ -49,4 +49,5 @@ export default {
   synchronization_configuration: '同步配置',
   primary_key: '主键',
   partition_column: '分区列',
+  submit_cdc_job:'提交CDC作业'

Review Comment:
   ```suggestion
     submit_cdc_job:'提交 CDC 作业'
   ```



##########
paimon-web-ui/src/views/cdc/components/list/use-table.ts:
##########
@@ -15,106 +15,113 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License. */
 
-import { useCDCStore } from '@/store/cdc';
-import type { Router } from 'vue-router';
-import TableAction from '@/components/table-action';
-import { deleteCdcJobDefinition, getCdcJobDefinition, listAllCdcJob } from 
'@/api/models/cdc';
-import { get } from 'lodash';
-export const useTable = () => {
-    const router: Router = useRouter()
-    const { t } = useLocaleHooks()
-    const tableVariables = reactive({
-        columns: [
-            {
-                title: t('cdc.job_name'),
-                key: 'name',
-                resizable: true
-            },
-            {
-                title: t('cdc.synchronization_type'),
-                key: 'cdcType',
-                resizable: true,
-                render: (row:any)=>{
-                    if(row.cdcType == 0){
-                        return t('cdc.single_table_synchronization')
-                    }else if(row.cdcType ==1){
-                        return  t('cdc.whole_database_synchronization')
-                    }
-                }
-            },
-            {
-                title: t('cdc.job_description'),
-                key: 'description',
-                resizable: true
-            },
-            {
-                title: t('cdc.create_user'),
-                key: 'createUser',
-                resizable: true
-            },
-            {
-                title: t('cdc.create_time'),
-                key: 'createTime',
-                resizable: true
+import { useCDCStore } from '@/store/cdc'
+import type { Router } from 'vue-router'
+import TableAction from '@/components/table-action'
+import { deleteCdcJobDefinition, getCdcJobDefinition, listAllCdcJob } from 
'@/api/models/cdc'
+export const useTable = (ctx: any) => {
+  const router: Router = useRouter()
+  const { t } = useLocaleHooks()
+  const tableVariables = reactive({
+    columns: [
+      {
+        title: t('cdc.job_name'),
+        key: 'name',
+        resizable: true
+      },
+      {
+        title: t('cdc.synchronization_type'),
+        key: 'cdcType',
+        resizable: true,
+        render: (row: any) => {
+          if (row.cdcType == 0) {
+            return t('cdc.single_table_synchronization')
+          } else if (row.cdcType == 1) {
+            return t('cdc.whole_database_synchronization')
+          }

Review Comment:
   The number type can be judged as a Boolean
   
   ```suggestion
       const message = row.cdcType ? 'cdc.whole_database_synchronization' : 
'cdc.single_table_synchronization'
       return t(message)
   ```



##########
paimon-web-ui/src/views/cdc/components/list/use-table.ts:
##########
@@ -15,106 +15,113 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License. */
 
-import { useCDCStore } from '@/store/cdc';
-import type { Router } from 'vue-router';
-import TableAction from '@/components/table-action';
-import { deleteCdcJobDefinition, getCdcJobDefinition, listAllCdcJob } from 
'@/api/models/cdc';
-import { get } from 'lodash';
-export const useTable = () => {
-    const router: Router = useRouter()
-    const { t } = useLocaleHooks()
-    const tableVariables = reactive({
-        columns: [
-            {
-                title: t('cdc.job_name'),
-                key: 'name',
-                resizable: true
-            },
-            {
-                title: t('cdc.synchronization_type'),
-                key: 'cdcType',
-                resizable: true,
-                render: (row:any)=>{
-                    if(row.cdcType == 0){
-                        return t('cdc.single_table_synchronization')
-                    }else if(row.cdcType ==1){
-                        return  t('cdc.whole_database_synchronization')
-                    }
-                }
-            },
-            {
-                title: t('cdc.job_description'),
-                key: 'description',
-                resizable: true
-            },
-            {
-                title: t('cdc.create_user'),
-                key: 'createUser',
-                resizable: true
-            },
-            {
-                title: t('cdc.create_time'),
-                key: 'createTime',
-                resizable: true
+import { useCDCStore } from '@/store/cdc'
+import type { Router } from 'vue-router'

Review Comment:
   sort the import. Of course, we will fix it later in the process of eslint 
improvement. This is just a reminder.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to