feat(hbase): improve desktop connections and table operations

This commit is contained in:
zipg authored and GitHub committed 2026-07-28 21:11:59 +08:00
1 parent 8bd92e4f2c
commit a0d4a31467
17 files changed
+514 -50

No files matched your search

@@ -299,6 +299,7 @@ interface DataGridProps {
totalRowCount?: number;
totalRowCountIsExact?: boolean;
paginationTotalRowCount?: number;
paginationEnabled?: boolean;
totalRowCountLoading?: boolean;
loading?: boolean;
cacheKey?: string;
@@ -319,6 +320,7 @@ const props = withDefaults(defineProps<DataGridProps>(), {
// Vue casts absent Boolean props to false unless a default is explicit.
// Regular grids have exact totals; document stores opt into lower-bound totals.
totalRowCountIsExact: true,
paginationEnabled: true,
// Omitted row-action limits must keep normal table-data editing.
allowInsertRows: undefined,
allowDeleteRows: undefined,
@@ -461,7 +463,7 @@ const compactColumnHeaderActions = computed(() => settingsStore.editorSettings.c
const dataGridRenderMode = computed(() => settingsStore.editorSettings.dataGridRenderMode);
const dataGridSearchMode = computed(() => settingsStore.editorSettings.dataGridSearchMode);
const compactDataGridToolbar = computed(() => dataGridTopbarWidth.value > 0 && dataGridTopbarWidth.value < DATA_GRID_COMPACT_TOPBAR_WIDTH);
const infiniteScrollEnabled = computed(() => settingsStore.editorSettings.infiniteScroll);
const infiniteScrollEnabled = computed(() => props.paginationEnabled && settingsStore.editorSettings.infiniteScroll);
const infiniteScrollMaxRows = computed(() => settingsStore.editorSettings.infiniteScrollMaxRows);
const expandedCellEditor = ref<{ rowId: number; col: number } | null>(null);
@@ -9178,6 +9180,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
<DataGridPagination
v-model:custom-page-size-input="customPageSizeInput"
:pagination-enabled="paginationEnabled"
:selection-summary="selectionSummary"
:selection-summary-sum-text="selectionSummarySumText"
:loading="loading"
@@ -10,19 +10,23 @@ import DataGridExportMenu from "@/components/grid/DataGridExportMenu.vue";
const { t } = useI18n();
defineProps<{
selectionSummary: { cellCount: number; rowCount: number } | null;
selectionSummarySumText: string;
loading: boolean;
infiniteScrollEnabled: boolean;
infiniteScrollAllLoaded: boolean;
pageSize: number;
pageSizeMenuItems: LightDropdownItem[];
exportMenuItems: LightDropdownItem[];
currentPage: number;
canGoNextPage: boolean;
canJumpLastPage: boolean;
}>();
withDefaults(
defineProps<{
paginationEnabled?: boolean;
selectionSummary: { cellCount: number; rowCount: number } | null;
selectionSummarySumText: string;
loading: boolean;
infiniteScrollEnabled: boolean;
infiniteScrollAllLoaded: boolean;
pageSize: number;
pageSizeMenuItems: LightDropdownItem[];
exportMenuItems: LightDropdownItem[];
currentPage: number;
canGoNextPage: boolean;
canJumpLastPage: boolean;
}>(),
{ paginationEnabled: true },
);
const customPageSizeInput = defineModel<string>("customPageSizeInput", { default: "" });
@@ -47,10 +51,10 @@ const emit = defineEmits<{
</div>
</div>
<Loader2 v-if="loading" class="w-3 h-3 animate-spin text-muted-foreground" />
<template v-if="infiniteScrollEnabled">
<template v-if="paginationEnabled && infiniteScrollEnabled">
<span v-if="infiniteScrollAllLoaded" class="text-xs text-muted-foreground shrink-0">{{ t("grid.allLoaded") }}</span>
</template>
<template v-if="!infiniteScrollEnabled">
<template v-if="paginationEnabled && !infiniteScrollEnabled">
<LightDropdown
:model-value="String(pageSize)"
:items="pageSizeMenuItems"
@@ -213,6 +213,26 @@ describe("DataGridPagination", () => {
expect(nextPage).toHaveBeenCalledOnce();
expect(lastPage).toHaveBeenCalledOnce();
});
it("hides pagination controls when the data source does not support paging", () => {
const mounted = mountComponent(DataGridPagination, {
paginationEnabled: false,
selectionSummary: null,
selectionSummarySumText: "",
loading: false,
infiniteScrollEnabled: false,
infiniteScrollAllLoaded: false,
pageSize: 100,
customPageSizeInput: "",
pageSizeMenuItems: [],
exportMenuItems: [],
currentPage: 1,
canGoNextPage: false,
canJumpLastPage: false,
});
expect(findAll(mounted.root, (node) => node.props["data-stub"] === "Button" && node.props.class === "h-5 w-5 shrink-0")).toHaveLength(0);
});
});
describe("DataGridColumnHeader", () => {