mirror of
https://github.com/zadam/trilium.git
synced 2026-02-27 00:53:35 +01:00
feat(sql_console): row numbers
This commit is contained in:
parent
f10373d54f
commit
bc79ff6845
@ -2,7 +2,7 @@ import "./SqlConsole.css";
|
|||||||
|
|
||||||
import { SqlExecuteResults } from "@triliumnext/commons";
|
import { SqlExecuteResults } from "@triliumnext/commons";
|
||||||
import { useState } from "preact/hooks";
|
import { useState } from "preact/hooks";
|
||||||
import { ClipboardModule, EditModule, ExportModule, KeybindingsModule, ResizeColumnsModule, SelectRangeModule, SelectRowModule, SortModule } from "tabulator-tables";
|
import { ClipboardModule, EditModule, ExportModule, FormatModule, FrozenColumnsModule, KeybindingsModule, ResizeColumnsModule, SelectRangeModule, SelectRowModule, SortModule } from "tabulator-tables";
|
||||||
|
|
||||||
import { t } from "../../services/i18n";
|
import { t } from "../../services/i18n";
|
||||||
import Tabulator from "../collections/table/tabulator";
|
import Tabulator from "../collections/table/tabulator";
|
||||||
@ -61,7 +61,7 @@ function SqlResultTable({ rows }: { rows: object[] }) {
|
|||||||
return (
|
return (
|
||||||
<Tabulator
|
<Tabulator
|
||||||
layout="fitDataFill"
|
layout="fitDataFill"
|
||||||
modules={[ ResizeColumnsModule, SortModule, SelectRangeModule, ClipboardModule, KeybindingsModule, EditModule, ExportModule, SelectRowModule ]}
|
modules={[ ResizeColumnsModule, SortModule, SelectRangeModule, ClipboardModule, KeybindingsModule, EditModule, ExportModule, SelectRowModule, FormatModule, FrozenColumnsModule ]}
|
||||||
selectableRange
|
selectableRange
|
||||||
clipboard="copy"
|
clipboard="copy"
|
||||||
clipboardCopyRowRange="range"
|
clipboardCopyRowRange="range"
|
||||||
@ -70,6 +70,13 @@ function SqlResultTable({ rows }: { rows: object[] }) {
|
|||||||
columnHeaders: false
|
columnHeaders: false
|
||||||
}}
|
}}
|
||||||
columns={[
|
columns={[
|
||||||
|
{
|
||||||
|
title: "#",
|
||||||
|
formatter: "rownum",
|
||||||
|
width: 60,
|
||||||
|
hozAlign: "right",
|
||||||
|
frozen: true
|
||||||
|
},
|
||||||
...Object.keys(rows[0]).map(key => ({
|
...Object.keys(rows[0]).map(key => ({
|
||||||
title: key,
|
title: key,
|
||||||
field: key,
|
field: key,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user