whats-up-dug 0.2.5 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -51821,7 +51821,7 @@ function formatCell(value, column) {
|
|
|
51821
51821
|
}
|
|
51822
51822
|
if (typeof value === "object")
|
|
51823
51823
|
return JSON.stringify(value);
|
|
51824
|
-
return String(value);
|
|
51824
|
+
return String(value).replace(/[\r\n]+/g, " ");
|
|
51825
51825
|
}
|
|
51826
51826
|
function DataTable({
|
|
51827
51827
|
data,
|
|
@@ -51945,6 +51945,7 @@ function DataTable({
|
|
|
51945
51945
|
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
|
|
51946
51946
|
dimColor: true,
|
|
51947
51947
|
bold: true,
|
|
51948
|
+
wrap: "truncate",
|
|
51948
51949
|
children: [
|
|
51949
51950
|
" ",
|
|
51950
51951
|
headerStr
|
|
@@ -51954,6 +51955,7 @@ function DataTable({
|
|
|
51954
51955
|
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
|
|
51955
51956
|
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
|
|
51956
51957
|
dimColor: true,
|
|
51958
|
+
wrap: "truncate",
|
|
51957
51959
|
children: [
|
|
51958
51960
|
" ",
|
|
51959
51961
|
separatorStr
|
|
@@ -51976,6 +51978,7 @@ function DataTable({
|
|
|
51976
51978
|
const rowStr = buildRowStr(columns.map((col, i2) => pad(formatCell(row[col], col), colWidths[i2])));
|
|
51977
51979
|
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
|
|
51978
51980
|
children: isSelected ? /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
|
|
51981
|
+
wrap: "truncate",
|
|
51979
51982
|
children: [
|
|
51980
51983
|
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
|
|
51981
51984
|
color: "cyan",
|
|
@@ -51988,6 +51991,7 @@ function DataTable({
|
|
|
51988
51991
|
}, undefined, false, undefined, this)
|
|
51989
51992
|
]
|
|
51990
51993
|
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
|
|
51994
|
+
wrap: "truncate",
|
|
51991
51995
|
children: [
|
|
51992
51996
|
" ",
|
|
51993
51997
|
rowStr
|
|
@@ -53761,10 +53765,6 @@ function App2({
|
|
|
53761
53765
|
return () => clearTimeout(t2);
|
|
53762
53766
|
}, []);
|
|
53763
53767
|
const overlayActive = import_react36.useRef(false);
|
|
53764
|
-
const { stdout } = use_stdout_default();
|
|
53765
|
-
const clearScreen2 = import_react36.useCallback(() => {
|
|
53766
|
-
stdout.write("\x1B[2J\x1B[H");
|
|
53767
|
-
}, [stdout]);
|
|
53768
53768
|
const hasTextInput = current.screen === "connect";
|
|
53769
53769
|
use_input_default((input, key) => {
|
|
53770
53770
|
if (quitting)
|
|
@@ -53786,7 +53786,6 @@ function App2({
|
|
|
53786
53786
|
}
|
|
53787
53787
|
if (key.escape && !overlayActive.current) {
|
|
53788
53788
|
if (stack.length > 1) {
|
|
53789
|
-
clearScreen2();
|
|
53790
53789
|
pop();
|
|
53791
53790
|
} else {
|
|
53792
53791
|
setQuitting(true);
|
|
@@ -53799,37 +53798,31 @@ function App2({
|
|
|
53799
53798
|
nav.info("Connected, navigating to dashboard");
|
|
53800
53799
|
client.clearCache();
|
|
53801
53800
|
setConnectedUrl(url);
|
|
53802
|
-
clearScreen2();
|
|
53803
53801
|
push("dashboard", { url });
|
|
53804
|
-
}, [push, client
|
|
53802
|
+
}, [push, client]);
|
|
53805
53803
|
const handleSelectDatabase = import_react36.useCallback((db) => {
|
|
53806
53804
|
nav.info("Selected database: %s", db);
|
|
53807
|
-
clearScreen2();
|
|
53808
53805
|
push("database", { database: db });
|
|
53809
|
-
}, [push
|
|
53806
|
+
}, [push]);
|
|
53810
53807
|
const handleSelectTable = import_react36.useCallback((table) => {
|
|
53811
53808
|
const db = current.params.database;
|
|
53812
53809
|
nav.info("Selected table: %s.%s", db, table);
|
|
53813
|
-
clearScreen2();
|
|
53814
53810
|
push("table", { database: db, table });
|
|
53815
|
-
}, [push, current
|
|
53811
|
+
}, [push, current]);
|
|
53816
53812
|
const handleSelectRecord = import_react36.useCallback((record, primaryKey) => {
|
|
53817
53813
|
const { database, table } = current.params;
|
|
53818
53814
|
const pk = primaryKey ?? "id";
|
|
53819
53815
|
nav.info("Selected record: %s.%s[%s]", database, table, record[pk]);
|
|
53820
|
-
clearScreen2();
|
|
53821
53816
|
push("record", { database, table, record, primaryKey: pk });
|
|
53822
|
-
}, [push, current
|
|
53817
|
+
}, [push, current]);
|
|
53823
53818
|
const handleNavigateToRecord = import_react36.useCallback((database, table, record, primaryKey) => {
|
|
53824
53819
|
nav.info("FK navigate: %s.%s[%s]", database, table, record[primaryKey] ?? "?");
|
|
53825
|
-
clearScreen2();
|
|
53826
53820
|
push("record", { database, table, record, primaryKey });
|
|
53827
|
-
}, [push
|
|
53821
|
+
}, [push]);
|
|
53828
53822
|
const handleSystemInfo = import_react36.useCallback(() => {
|
|
53829
53823
|
nav.info("Viewing system info");
|
|
53830
|
-
clearScreen2();
|
|
53831
53824
|
push("system", {});
|
|
53832
|
-
}, [push
|
|
53825
|
+
}, [push]);
|
|
53833
53826
|
const breadcrumbItems = import_react36.useMemo(() => {
|
|
53834
53827
|
const items = [version ? `dug ${version} \uD83D\uDC15` : "dug \uD83D\uDC15"];
|
|
53835
53828
|
if (connectedUrl) {
|