This is an automated email from the ASF dual-hosted git repository.

nicholasjiang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-paimon-webui.git


The following commit(s) were added to refs/heads/main by this push:
     new d9caecf  [Feature] Support management of datafile metadata fetch data 
(#122)
d9caecf is described below

commit d9caecfe113273f8487abdd3594421e9293d04c7
Author: xiaomo <[email protected]>
AuthorDate: Fri Dec 15 18:07:06 2023 +0800

    [Feature] Support management of datafile metadata fetch data (#122)
---
 paimon-web-ui-new/src/api/models/catalog/index.ts  |  4 +-
 .../views/metadata/components/datafile/index.tsx   | 47 +++-------------------
 2 files changed, 7 insertions(+), 44 deletions(-)

diff --git a/paimon-web-ui-new/src/api/models/catalog/index.ts 
b/paimon-web-ui-new/src/api/models/catalog/index.ts
index bb284c4..ad3f077 100644
--- a/paimon-web-ui-new/src/api/models/catalog/index.ts
+++ b/paimon-web-ui-new/src/api/models/catalog/index.ts
@@ -16,7 +16,7 @@ specific language governing permissions and limitations
 under the License. */
 
 import httpRequest from '@/api/request'
-import type { Catalog, Database, Table, Schema, Manifest, Snapshot, TableQuery 
} from './types'
+import type { Catalog, Database, Table, Schema, Manifest, Snapshot, Datafile, 
TableQuery } from './types'
 import type { ResponseOptions } from '@/api/types'
 
 export * from './types'
@@ -68,7 +68,7 @@ export const getManifest = () => {
  * # Get data file
  */
 export const getDataFile = () => {
-  return httpRequest.createHooks!<Table, any[]>({
+  return httpRequest.createHooks!<ResponseOptions<Datafile[]>, Datafile[]>({
     url: '/metadata/query/dataFile',
     method: 'post',
   })
diff --git a/paimon-web-ui-new/src/views/metadata/components/datafile/index.tsx 
b/paimon-web-ui-new/src/views/metadata/components/datafile/index.tsx
index 14792c3..ef32e76 100644
--- a/paimon-web-ui-new/src/views/metadata/components/datafile/index.tsx
+++ b/paimon-web-ui-new/src/views/metadata/components/datafile/index.tsx
@@ -17,50 +17,14 @@ under the License. */
 
 import { type DataTableColumns } from 'naive-ui'
 
-import { getDataFile } from '@/api/models/catalog'
-
-type RowData = {
-  partition: string
-  bucket: number
-  filePath: string
-  fileFormat: string
-}
-
+import { getDataFile, type Datafile } from '@/api/models/catalog'
 
 export default defineComponent({
   name: 'MetadataDataFile',
   setup() {
-    const { t } = useLocaleHooks()
-    const [, useDataFile, { loading }] = getDataFile()
-
-    const data: RowData[] = [
-      {
-        partition: '[1]',
-        bucket: 0,
-        filePath: 'opt/paimon/warehouse/ods.db/t_role',
-        fileFormat: 'ORC'
-      },
-      {
-        partition: '[2]',
-        bucket: 0,
-        filePath: 'opt/paimon/warehouse/ods.db/t_role',
-        fileFormat: 'PARQUET'
-      },
-      {
-        partition: '[3]',
-        bucket: 1,
-        filePath: 'opt/paimon/warehouse/ods.db/t_role',
-        fileFormat: 'ORC'
-      },
-      {
-        partition: '[4]',
-        bucket: 1,
-        filePath: 'opt/paimon/warehouse/ods.db/t_role',
-        fileFormat: 'PARQUET'
-      },
-    ]
+    const [datafiles, useDataFile, { loading }] = getDataFile()
 
-    const columns: DataTableColumns<RowData> = [
+    const columns: DataTableColumns<Datafile> = [
       {
         title: 'Partition',
         key: 'partition'
@@ -92,9 +56,8 @@ export default defineComponent({
 
     return {
       columns,
-      data,
+      datafiles,
       loading,
-      t,
     }
   },
   render() {
@@ -103,7 +66,7 @@ export default defineComponent({
         <n-spin show={this.loading}>
           <n-data-table
             columns={this.columns}
-            data={this.data}
+            data={this.datafiles?.data || []}
           />
         </n-spin>
       </n-card>

Reply via email to