mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-27 00:02:35 +00:00
fix: parquet renderer display number of rows" (#4389)
* all * all * all * nocheck
This commit is contained in:
@@ -1 +1 @@
|
||||
3d8ce9f1f15de94a40a0c349c7769598041a0d8a
|
||||
636634202618e4b6a7fd20117d811f15cfbf9311
|
||||
@@ -8347,6 +8347,38 @@ paths:
|
||||
application/json:
|
||||
schema: {}
|
||||
|
||||
/w/{workspace}/job_helpers/load_table_count/{path}:
|
||||
get:
|
||||
summary: Load the table row count
|
||||
operationId: loadTableRowCount
|
||||
tags:
|
||||
- helpers
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/WorkspaceId"
|
||||
- $ref: "#/components/parameters/Path"
|
||||
- name: search_col
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: search_term
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: storage
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: Table count
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
count:
|
||||
type: number
|
||||
|
||||
/w/{workspace}/job_helpers/load_csv_preview/{path}:
|
||||
get:
|
||||
summary: Load a preview of a csv file
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
Error parsing /git/windmill/backend/windmill-api/openapi.yaml: duplicated mapping key (8350:3)
|
||||
|
||||
8347 | application/json:
|
||||
8348 | schema: {}
|
||||
8349 |
|
||||
8350 | /w/{workspace}/job_helpers/loa ...
|
||||
----------^
|
||||
8351 | get:
|
||||
8352 | summary: Load a preview of ...
|
||||
ParserError: Error parsing /git/windmill/backend/windmill-api/openapi.yaml: duplicated mapping key (8350:3)
|
||||
|
||||
8347 | application/json:
|
||||
8348 | schema: {}
|
||||
8349 |
|
||||
8350 | /w/{workspace}/job_helpers/loa ...
|
||||
----------^
|
||||
8351 | get:
|
||||
8352 | summary: Load a preview of ...
|
||||
at Object.parse (/git/windmill/frontend/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/yaml.js:44:23)
|
||||
at getResult (/git/windmill/frontend/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/plugins.js:116:22)
|
||||
at runNextPlugin (/git/windmill/frontend/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/plugins.js:64:32)
|
||||
at /git/windmill/frontend/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/plugins.js:55:9
|
||||
at new Promise (<anonymous>)
|
||||
at Object.run (/git/windmill/frontend/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/plugins.js:54:12)
|
||||
at parseFile (/git/windmill/frontend/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parse.js:130:38)
|
||||
at parse (/git/windmill/frontend/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parse.js:56:30)
|
||||
at async $RefParser.parse (/git/windmill/frontend/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/index.js:115:28)
|
||||
at async $RefParser.resolve (/git/windmill/frontend/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/index.js:145:13)
|
||||
@@ -9,6 +9,7 @@
|
||||
import { base } from '$lib/base'
|
||||
import { enterpriseLicense, workspaceStore } from '$lib/stores'
|
||||
import { Download } from 'lucide-svelte'
|
||||
import { Loader2 } from 'lucide-svelte'
|
||||
|
||||
// import 'ag-grid-community/dist/styles/ag-theme-alpine-dark.css'
|
||||
|
||||
@@ -18,13 +19,30 @@
|
||||
export let workspaceId: string | undefined
|
||||
export let disable_download: boolean = false
|
||||
|
||||
let lastSearch: string | undefined = undefined
|
||||
|
||||
let nbRows: number | undefined = undefined
|
||||
let csvSeparatorChar: string = ','
|
||||
let datasource: IDatasource = {
|
||||
rowCount: 0,
|
||||
getRows: async function (params) {
|
||||
try {
|
||||
const searchCol = params.filterModel ? Object.keys(params.filterModel)?.[0] : undefined
|
||||
const searchTerm = searchCol ? params.filterModel?.[searchCol]?.filter : undefined
|
||||
const csv = s3resource.endsWith('.csv')
|
||||
const newSearch = searchCol ? searchCol + searchTerm : undefined
|
||||
if (!nbRows || lastSearch != newSearch) {
|
||||
nbRows = undefined
|
||||
const res = await HelpersService.loadTableRowCount({
|
||||
workspace: workspaceId ?? $workspaceStore!,
|
||||
path: s3resource,
|
||||
searchCol: searchCol,
|
||||
storage,
|
||||
searchTerm
|
||||
})
|
||||
nbRows = res.count
|
||||
lastSearch = newSearch
|
||||
}
|
||||
|
||||
const requestBody = {
|
||||
workspace: workspaceId ?? $workspaceStore!,
|
||||
@@ -33,8 +51,8 @@
|
||||
limit: params.endRow - params.startRow,
|
||||
sortCol: params.sortModel?.[0]?.colId,
|
||||
sortDesc: params.sortModel?.[0]?.sort == 'desc',
|
||||
searchCol: searchCol,
|
||||
searchTerm: searchCol ? params.filterModel?.[searchCol]?.filter : undefined,
|
||||
searchCol,
|
||||
searchTerm,
|
||||
storage: storage,
|
||||
csvSeparator: csv ? csvSeparatorChar : undefined
|
||||
}
|
||||
@@ -54,7 +72,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
params.successCallback(res.rows)
|
||||
params.successCallback(res.rows, nbRows)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
params.failCallback()
|
||||
@@ -185,6 +203,11 @@
|
||||
>
|
||||
{/if}
|
||||
|
||||
{#if nbRows != undefined}
|
||||
<div class="text-secondary ml-0.5 text-2xs">{nbRows} rows</div>
|
||||
{:else}
|
||||
<Loader2 class="animate-spin ml-0.5" size={12} />
|
||||
{/if}
|
||||
<div
|
||||
class="ag-theme-alpine shadow-sm h-full"
|
||||
class:ag-theme-alpine-dark={darkMode}
|
||||
|
||||
@@ -843,7 +843,7 @@
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: transparent;
|
||||
background: transparent !important;
|
||||
font-size: var(--font-size, 16px);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user