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 57eb2b2 [Feature] Support management of manifest metadata fetch data
(#120)
57eb2b2 is described below
commit 57eb2b242e6eb230f81b573a4c33ebdb941e0e20
Author: xiaomo <[email protected]>
AuthorDate: Fri Dec 15 18:00:25 2023 +0800
[Feature] Support management of manifest metadata fetch data (#120)
---
paimon-web-ui-new/src/api/models/catalog/index.ts | 4 +-
.../views/metadata/components/manifest/index.tsx | 43 +++-------------------
2 files changed, 8 insertions(+), 39 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 52ae2b8..e4bfe4a 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, TableQuery } from './types'
+import type { Catalog, Database, Table, Schema, Manifest, TableQuery } from
'./types'
import type { ResponseOptions } from '@/api/types'
export * from './types'
@@ -58,7 +58,7 @@ export const getSchema = () => {
* # Get manifest
*/
export const getManifest = () => {
- return httpRequest.createHooks!<Table, any[]>({
+ return httpRequest.createHooks!<ResponseOptions<Manifest[]>, Manifest[]>({
url: '/metadata/query/manifest',
method: 'post',
})
diff --git a/paimon-web-ui-new/src/views/metadata/components/manifest/index.tsx
b/paimon-web-ui-new/src/views/metadata/components/manifest/index.tsx
index a2f6178..7b97427 100644
--- a/paimon-web-ui-new/src/views/metadata/components/manifest/index.tsx
+++ b/paimon-web-ui-new/src/views/metadata/components/manifest/index.tsx
@@ -17,46 +17,15 @@ under the License. */
import { type DataTableColumns } from 'naive-ui'
-import { getManifest } from '@/api/models/catalog'
-
-type RowData = {
- fileName: string
- fileSize: number
- numAddFiles: number
-}
-
+import { getManifest, type Manifest } from '@/api/models/catalog'
export default defineComponent({
name: 'MetadataManifest',
setup() {
const { t } = useLocaleHooks()
- const [, useManifest, { loading }] = getManifest()
-
-
- const data: RowData[] = [
- {
- fileName: 'manifest-wekfj',
- fileSize: 29838,
- numAddFiles: 19,
- },
- {
- fileName: 'manifest-akagerjgerg38746',
- fileSize: 827387,
- numAddFiles: 27,
- },
- {
- fileName: 'manifest-aka38reophkrpoth746',
- fileSize: 36423,
- numAddFiles: 37,
- },
- {
- fileName: 'manifest-gerjgoiejrog',
- fileSize: 387423,
- numAddFiles: 34,
- },
- ]
+ const [manifest, useManifest, { loading }] = getManifest()
- const columns: DataTableColumns<RowData> = [
+ const columns: DataTableColumns<Manifest> = [
{
title: 'File Name',
key: 'fileName'
@@ -67,7 +36,7 @@ export default defineComponent({
},
{
title: 'Number of Add Files',
- key: 'numAddFiles'
+ key: 'numAddedFiles'
},
]
@@ -84,7 +53,7 @@ export default defineComponent({
return {
columns,
- data,
+ manifest,
loading,
t,
}
@@ -95,7 +64,7 @@ export default defineComponent({
<n-spin show={this.loading}>
<n-data-table
columns={this.columns}
- data={this.data}
+ data={this.manifest?.data || []}
/>
</n-spin>
</n-card>