diff --git a/src-tauri/src/handlers/queries.rs b/src-tauri/src/handlers/queries.rs index fd54af6..058ab9b 100644 --- a/src-tauri/src/handlers/queries.rs +++ b/src-tauri/src/handlers/queries.rs @@ -7,11 +7,8 @@ use serde_json::Value; use tauri::{command, AppHandle}; #[command] -pub async fn execute_query(app_handle: AppHandle, conn_id: String, mut query: String) -> CommandResult { +pub async fn execute_query(app_handle: AppHandle, conn_id: String, query: String) -> CommandResult { let connection = app_handle.acquire_connection(conn_id); - if !query.to_lowercase().ends_with("limit 1000") { - query.push_str(" limit 1000"); - } let result = connection.execute_query(query).await?; Ok(result) } diff --git a/src/App.tsx b/src/App.tsx index 9ec16c9..bfb07ec 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,64 +1,94 @@ -import 'utils/i18n'; -import { useAppSelector } from 'services/Context'; -import { Alerts } from 'components/UI'; -import { For, Match, Show, Switch } from 'solid-js'; -import { CloseIcon } from 'components/UI/Icons'; -import { ThemeSwitch } from 'components/UI/ThemeSwitch'; -import { Console } from 'components/Screens/Console/Console'; -import { Home } from 'components/Screens/Home/Home'; +import "utils/i18n"; +import { useAppSelector } from "services/Context"; +import { Alerts } from "components/UI"; +import { For, Match, Show, Switch } from "solid-js"; +import { CloseIcon } from "components/UI/Icons"; +import { ThemeSwitch } from "components/UI/ThemeSwitch"; +import { Console } from "components/Screens/Console/Console"; +import { Home } from "components/Screens/Home/Home"; import "tabulator-tables/dist/css/tabulator_midnight.min.css"; +import { Root, CommandPalette } from 'solid-command-palette'; +import { actions } from './actions'; +import 'solid-command-palette/pkg-dist/style.css'; function App() { - const { connectionsService: { removeTab, clearStore, connectionStore, setConnectionStore } } = useAppSelector() + const { + connectionsService: { + removeTab, + // clearStore, + connectionStore, + setConnectionStore, + }, + } = useAppSelector(); const closeTab = async (id: string) => { - await removeTab(id) - } + await removeTab(id); + }; + + const actionsContext = { + increment() { + console.log("increment count state by 1"); + }, + }; return ( -
-
-
+ + +
+
-
{ setConnectionStore('idx', 0) }} - class="tab tab-md" - classList={{ 'tab-active': connectionStore.idx === 0, }} > - Home +
+
{ + setConnectionStore("idx", 0); + }} + class="tab tab-md" + classList={{ "tab-active": connectionStore.idx === 0 }} + > + Home +
+ + {(tab, idx) => ( +
+
{ + setConnectionStore("idx", idx() + 1); + }} + class="tab tab-md" + classList={{ + "tab-active": connectionStore.idx === idx() + 1, + }} + > + {tab.label} +
+ + + +
+ )} +
+
+
+ {/* */} +
- - {(tab, idx) => -
-
{ setConnectionStore('idx', idx() + 1) }} - class="tab tab-md" - classList={{ 'tab-active': connectionStore.idx === idx() + 1, }} - >{tab.label}
- - - -
- } -
-
- - +
+ + + + + + + +
+
-
- - - - - - - - -
- -
+ ); } diff --git a/src/actions.ts b/src/actions.ts new file mode 100644 index 0000000..9ccef2b --- /dev/null +++ b/src/actions.ts @@ -0,0 +1,25 @@ +import { defineAction } from 'solid-command-palette'; + +const minimalAction = defineAction({ + id: 'minimal', + title: 'Minimal Action', + run: () => { + console.log('ran minimal action'); + }, +}); + +const incrementCounterAction = defineAction({ + id: 'increment-counter', + title: 'Increment Counter by 1', + subtitle: 'Press CMD + E to trigger this.', + shortcut: '$mod+e', // $mod = Command on Mac & Control on Windows. + run: ({ rootContext }) => { + rootContext.increment(); + }, +}); + +export const actions = { + [minimalAction.id]: minimalAction, + [incrementCounterAction.id]: incrementCounterAction, +}; + diff --git a/src/components/Screens/Console/Content/QueryTab/QueryTab.tsx b/src/components/Screens/Console/Content/QueryTab/QueryTab.tsx index c3f3dd2..7aa8472 100644 --- a/src/components/Screens/Console/Content/QueryTab/QueryTab.tsx +++ b/src/components/Screens/Console/Content/QueryTab/QueryTab.tsx @@ -35,7 +35,7 @@ export const QueryTab = () => {
-
+
diff --git a/src/components/Screens/Home/Connections/AddConnectionForm.tsx b/src/components/Screens/Home/Connections/AddConnectionForm.tsx index 213f7c8..a119e78 100644 --- a/src/components/Screens/Home/Connections/AddConnectionForm.tsx +++ b/src/components/Screens/Home/Connections/AddConnectionForm.tsx @@ -96,7 +96,7 @@ const AddConnectionForm = (props: { addConnection: ({ name, scheme, color }: { n }; return ( -
+

{t('components.add_connection_form.title')}

diff --git a/src/components/Screens/Home/Home.tsx b/src/components/Screens/Home/Home.tsx index 519cf9d..c2af8c9 100644 --- a/src/components/Screens/Home/Home.tsx +++ b/src/components/Screens/Home/Home.tsx @@ -20,7 +20,7 @@ export const Home = () => { }); return ( -
+
diff --git a/src/components/UI/Table.tsx b/src/components/UI/Table.tsx index 4522dc6..d7df9ac 100644 --- a/src/components/UI/Table.tsx +++ b/src/components/UI/Table.tsx @@ -15,6 +15,7 @@ export const Table = (props: { data: Record[] }) => { layout: "fitColumns", autoResize: true, pagination: true, + paginationSize: 30, height: "100%", paginationCounter:"rows", }); diff --git a/src/index.css b/src/index.css index 0f41076..4d42bdf 100644 --- a/src/index.css +++ b/src/index.css @@ -100,7 +100,44 @@ dialog { color: inherit; } -.gutter:hover{ - @apply bg-base-100; +.gutter-vertical:hover{ + @apply bg-base-200; cursor: row-resize; } + +.gutter-horizontal:hover{ + @apply bg-base-200; + cursor: col-resize; +} + +.tabulator-page { + @apply text-base-content !important; +} + +.tabulator-row-odd { + @apply bg-base-100 !important; +} + +.tabulator-row-even { + @apply bg-base-200 !important; +} + +.tabulator .tabulator-header .tabulator-col { + @apply bg-base-300 text-base-content !important; +} + +.tabulator-footer { + @apply bg-base-300 text-base-content !important; +} + +.tabulator-tableholder .tabulator-table, .tabulator-footer { + @apply border-neutral-focus !important; +} + +.tabulator-page-counter { + @apply text-base-content !important; +} + +.tabulator .tabulator-tableholder .tabulator-table { + @apply text-base-content !important; +}