Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "harperdb-studio",
"version": "4.5.8",
"version": "4.5.9",
"description": "A UI for HarperDB",
"deploymentUrl": "studio.harperdb.io",
"private": true,
Expand Down
16 changes: 12 additions & 4 deletions src/components/instance/browse/BrowseDatatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import DataTableHeader from './BrowseDatatableHeader';
import DataTable from '../../shared/DataTable';
import getTableData from '../../../functions/instance/getTableData';
import getTablePagination from '../../../functions/instance/getTablePagination';
import usePersistedUser from '../../../functions/state/persistedUser';

let controller;
let controller2;
Expand All @@ -26,6 +27,7 @@ function BrowseDatatable({ tableState, setTableState, activeTable }) {
const [loading, setLoading] = useState(false);
const [loadingFilter, setLoadingFilter] = useState(false);
const [lastUpdate, setLastUpdate] = useState(true);
const [persistedUser, setPersistedUser] = usePersistedUser({});

useEffect(() => {
controller?.abort();
Expand Down Expand Up @@ -69,7 +71,7 @@ function BrowseDatatable({ tableState, setTableState, activeTable }) {
filtered: tableState.filtered,
pageSize: tableState.pageSize,
sorted: tableState.sorted,
onlyCached: tableState.onlyCached,
onlyCached: persistedUser?.onlyCached?.[activeTable],
page: tableState.page,
auth,
url,
Expand Down Expand Up @@ -116,7 +118,13 @@ function BrowseDatatable({ tableState, setTableState, activeTable }) {
isMounted = false;
};
// eslint-disable-next-line
}, [tableState.sorted, tableState.page, tableState.filtered, tableState.pageSize, tableState.onlyCached, lastUpdate, activeTable]);
}, [tableState.sorted, tableState.page, tableState.filtered, tableState.pageSize, persistedUser.onlyCached, lastUpdate, activeTable]);

const toggleOnlyCached = () => {
const onlyCached = typeof persistedUser.onlyCached === 'object' ? { ...persistedUser.onlyCached } : {};
onlyCached[activeTable] = !persistedUser?.onlyCached?.[activeTable];
setPersistedUser({ ...persistedUser, onlyCached });
};

useInterval(() => tableState.autoRefresh && setLastUpdate(Date.now()), config.refresh_content_interval);

Expand All @@ -127,10 +135,10 @@ function BrowseDatatable({ tableState, setTableState, activeTable }) {
loading={loading}
loadingFilter={loadingFilter}
autoRefresh={tableState.autoRefresh}
onlyCached={tableState.onlyCached}
onlyCached={persistedUser?.onlyCached?.[activeTable]}
refresh={() => setLastUpdate(Date.now())}
toggleAutoRefresh={() => setTableState({ ...tableState, autoRefresh: !tableState.autoRefresh })}
toggleOnlyCached={() => setTableState({ ...tableState, onlyCached: !tableState.onlyCached })}
toggleOnlyCached={toggleOnlyCached}
toggleFilter={() => setTableState({ ...tableState, showFilter: !tableState.showFilter })}
/>
<Card className="my-3">
Expand Down
3 changes: 1 addition & 2 deletions src/components/instance/browse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const defaultTableState = {
page: 0,
pageSize: 20,
autoRefresh: false,
onlyCached: false,
showFilter: false,
newEntityAttributes: false,
hashAttribute: false,
Expand Down Expand Up @@ -56,7 +55,7 @@ function BrowseIndex() {
const location = useLocation();
const { schema, table, action, customer_id, compute_stack_id } = useParams();
const [instanceAuths] = useInstanceAuth({});
const auth = instanceAuths && instanceAuths[compute_stack_id];
const auth = instanceAuths?.[compute_stack_id];
const url = useStoreState(instanceState, (s) => s.url);
const registration = useStoreState(instanceState, (s) => s.registration);
const version = registration?.version;
Expand Down
72 changes: 36 additions & 36 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2285,9 +2285,9 @@
"@types/node" "*"

"@types/node@*":
version "22.7.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.4.tgz#e35d6f48dca3255ce44256ddc05dee1c23353fcc"
integrity sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==
version "22.7.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.5.tgz#cfde981727a7ab3611a481510b473ae54442b92b"
integrity sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==
dependencies:
undici-types "~6.19.2"

Expand Down Expand Up @@ -3006,9 +3006,9 @@ at-least-node@^1.0.0:
integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==

attr-accept@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b"
integrity sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg==
version "2.2.4"
resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.4.tgz#e28749d5975732586aea03c8912e2d0f1d1d77e7"
integrity sha512-2pA6xFIbdTUDCAwjN8nQwI+842VwzbDUXO2IYlpPXQIORgKnavorcr4Ce3rwh+zsNg9zK7QPsdvDj3Lum4WX4w==

autoprefixer@^10.4.13:
version "10.4.20"
Expand Down Expand Up @@ -3620,10 +3620,10 @@ cookie-signature@1.0.6:
resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==

cookie@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051"
integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==
cookie@0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9"
integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==

core-js-compat@^3.38.0, core-js-compat@^3.38.1:
version "3.38.1"
Expand Down Expand Up @@ -3706,9 +3706,9 @@ css-declaration-sorter@^6.3.1:
integrity sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g==

css-functions-list@^3.2.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/css-functions-list/-/css-functions-list-3.2.2.tgz#9a54c6dd8416ed25c1079cd88234e927526c1922"
integrity sha512-c+N0v6wbKVxTu5gOBBFkr9BEdBWaqqjQeiJ8QvSRIJOf+UxlJh930m8e6/WNeODIK0mYLFkoONrnj16i2EcvfQ==
version "3.2.3"
resolved "https://registry.yarnpkg.com/css-functions-list/-/css-functions-list-3.2.3.tgz#95652b0c24f0f59b291a9fc386041a19d4f40dbe"
integrity sha512-IQOkD3hbR5KrN93MtcYuad6YPuTSUhntLHDuLEbFWE+ff2/XSZNdZG+LcbbIW5AXKg/WFIfYItIzVoHngHXZzA==

css-has-pseudo@^3.0.4:
version "3.0.4"
Expand Down Expand Up @@ -4232,9 +4232,9 @@ ejs@^3.1.6:
jake "^10.8.5"

electron-to-chromium@^1.5.28:
version "1.5.33"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.33.tgz#8f64698661240e70fdbc4b032e6085e391f05e09"
integrity sha512-+cYTcFB1QqD4j4LegwLfpCNxifb6dDFUAwk6RsLusCwIaZI6or2f+q8rs5tTB2YC53HhOlIbEaqHMAAC8IOIwA==
version "1.5.34"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.34.tgz#59f6eef987d2301d96d46b1bc4da913fe784baeb"
integrity sha512-/TZAiChbAflBNjCg+VvstbcwAtIL/VdMFO3NgRFIzBjpvPzWOTIbbO8kNb6RwU4bt9TP7K+3KqBKw/lOU+Y+GA==

emittery@^0.10.2:
version "0.10.2"
Expand Down Expand Up @@ -4388,9 +4388,9 @@ es-get-iterator@^1.1.3:
stop-iteration-iterator "^1.0.0"

es-iterator-helpers@^1.0.19:
version "1.0.19"
resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz#117003d0e5fec237b4b5c08aded722e0c6d50ca8"
integrity sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==
version "1.1.0"
resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.1.0.tgz#f6d745d342aea214fe09497e7152170dc333a7a6"
integrity sha512-/SurEfycdyssORP/E+bj4sEu1CWw4EmLDsHynHwSXQ7utgbrMRWW195pTrCjFgFCddf/UkYm3oqKPRq5i8bJbw==
dependencies:
call-bind "^1.0.7"
define-properties "^1.2.1"
Expand All @@ -4399,12 +4399,12 @@ es-iterator-helpers@^1.0.19:
es-set-tostringtag "^2.0.3"
function-bind "^1.1.2"
get-intrinsic "^1.2.4"
globalthis "^1.0.3"
globalthis "^1.0.4"
has-property-descriptors "^1.0.2"
has-proto "^1.0.3"
has-symbols "^1.0.3"
internal-slot "^1.0.7"
iterator.prototype "^1.1.2"
iterator.prototype "^1.1.3"
safe-array-concat "^1.1.2"

es-module-lexer@^1.2.1:
Expand Down Expand Up @@ -4901,16 +4901,16 @@ expect@^27.5.1:
jest-message-util "^27.5.1"

express@^4.17.3:
version "4.21.0"
resolved "https://registry.yarnpkg.com/express/-/express-4.21.0.tgz#d57cb706d49623d4ac27833f1cbc466b668eb915"
integrity sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==
version "4.21.1"
resolved "https://registry.yarnpkg.com/express/-/express-4.21.1.tgz#9dae5dda832f16b4eec941a4e44aa89ec481b281"
integrity sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==
dependencies:
accepts "~1.3.8"
array-flatten "1.1.1"
body-parser "1.20.3"
content-disposition "0.5.4"
content-type "~1.0.4"
cookie "0.6.0"
cookie "0.7.1"
cookie-signature "1.0.6"
debug "2.6.9"
depd "2.0.0"
Expand Down Expand Up @@ -5377,7 +5377,7 @@ globals@^14.0.0:
resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e"
integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==

globalthis@^1.0.3:
globalthis@^1.0.3, globalthis@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236"
integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==
Expand Down Expand Up @@ -6061,10 +6061,10 @@ istanbul-reports@^3.1.3:
html-escaper "^2.0.0"
istanbul-lib-report "^3.0.0"

iterator.prototype@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/iterator.prototype/-/iterator.prototype-1.1.2.tgz#5e29c8924f01916cb9335f1ff80619dcff22b0c0"
integrity sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==
iterator.prototype@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/iterator.prototype/-/iterator.prototype-1.1.3.tgz#016c2abe0be3bbdb8319852884f60908ac62bf9c"
integrity sha512-FW5iMbeQ6rBGm/oKgzq2aW4KvAGpxPzYES8N4g4xNXUKpL1mclMvOe+76AcLDTvD+Ze+sOpVhgdAQEKF4L9iGQ==
dependencies:
define-properties "^1.2.1"
get-intrinsic "^1.2.1"
Expand Down Expand Up @@ -8238,9 +8238,9 @@ qs@6.13.0:
side-channel "^1.0.6"

query-string@^9.0.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-9.1.0.tgz#5f12a4653a4ba56021e113b5cf58e56581823e7a"
integrity sha512-t6dqMECpCkqfyv2FfwVS1xcB6lgXW/0XZSaKdsCNGYkqMO76AFiJEg4vINzoDKcZa6MS7JX+OHIjwh06K5vczw==
version "9.1.1"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-9.1.1.tgz#dbfebb4196aeb2919915f2b2b81b91b965cf03a0"
integrity sha512-MWkCOVIcJP9QSKU52Ngow6bsAWAPlPK2MludXvcrS2bGZSl+T1qX9MZvRIkqUIkGLJquMJHWfsT6eRqUpp4aWg==
dependencies:
decode-uri-component "^0.4.1"
filter-obj "^5.1.0"
Expand Down Expand Up @@ -10004,9 +10004,9 @@ typedarray-to-buffer@^3.1.5:
is-typedarray "^1.0.0"

typescript@^5.6.2:
version "5.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.2.tgz#d1de67b6bef77c41823f822df8f0b3bcff60a5a0"
integrity sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==
version "5.6.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b"
integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==

unbox-primitive@^1.0.2:
version "1.0.2"
Expand Down