mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-26 01:23:18 +08:00
chore: sidebar table / token tweak
This commit is contained in:
@ -192,9 +192,9 @@ const ConnectionSidebar = () => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{databaseList.length > 0 && (
|
{databaseList.length > 0 && (
|
||||||
<div className="w-full sticky top-0 z-1 my-4">
|
<div className="w-full sticky top-0 z-1 mt-4">
|
||||||
<Select
|
<Select
|
||||||
className="w-full px-4 py-3 !text-base mb-2"
|
className="w-full px-4 py-3 !text-base"
|
||||||
value={currentConnectionCtx?.database?.name}
|
value={currentConnectionCtx?.database?.name}
|
||||||
itemList={databaseList.map((database) => {
|
itemList={databaseList.map((database) => {
|
||||||
return {
|
return {
|
||||||
@ -209,7 +209,7 @@ const ConnectionSidebar = () => {
|
|||||||
)}
|
)}
|
||||||
{hasSchemaProperty && schemaList.length > 0 && (
|
{hasSchemaProperty && schemaList.length > 0 && (
|
||||||
<Select
|
<Select
|
||||||
className="w-full px-4 py-3 !text-base mb-2"
|
className="w-full px-4 py-3 !text-base mt-2"
|
||||||
value={selectedSchemaName}
|
value={selectedSchemaName}
|
||||||
itemList={schemaList.map((schema) => {
|
itemList={schemaList.map((schema) => {
|
||||||
return {
|
return {
|
||||||
@ -221,9 +221,19 @@ const ConnectionSidebar = () => {
|
|||||||
placeholder={t("connection.select-schema") || ""}
|
placeholder={t("connection.select-schema") || ""}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{currentConnectionCtx && !tableSchemaLoadingState.isLoading && (
|
||||||
|
<div className="flex justify-between text-sm text-gray-700 dark:text-gray-300 mt-3 mb-2 px-1">
|
||||||
|
<div>{t("connection.total-token")}</div>
|
||||||
|
<div>
|
||||||
|
{totalToken}/{maxToken}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{currentConnectionCtx &&
|
{currentConnectionCtx &&
|
||||||
(tableSchemaLoadingState.isLoading ? (
|
(tableSchemaLoadingState.isLoading ? (
|
||||||
<div className="w-full h-12 flex flex-row justify-start items-center px-4 sticky top-0 z-1 mb-4 mt-2 rounded-lg text-sm text-gray-600 dark:text-gray-400">
|
<div className="w-full h-12 flex flex-row justify-start items-center px-4 sticky top-0 z-1 mb-4 rounded-lg text-sm text-gray-600 dark:text-gray-400">
|
||||||
<Icon.BiLoaderAlt className="w-4 h-auto animate-spin mr-1" /> {t("common.loading")}
|
<Icon.BiLoaderAlt className="w-4 h-auto animate-spin mr-1" /> {t("common.loading")}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
@ -245,14 +255,6 @@ const ConnectionSidebar = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="sticky bottom-0 w-full flex flex-col justify-center bg-gray-100 dark:bg-zinc-700 backdrop-blur bg-opacity-60 pb-4 py-2">
|
<div className="sticky bottom-0 w-full flex flex-col justify-center bg-gray-100 dark:bg-zinc-700 backdrop-blur bg-opacity-60 pb-4 py-2">
|
||||||
{currentConnectionCtx && (
|
|
||||||
<div className="flex justify-between text-sm text-gray-700 dark:text-gray-300 mb-2">
|
|
||||||
<div>{t("connection.total-token")}</div>
|
|
||||||
<div>
|
|
||||||
{totalToken}/{maxToken}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{!settingStore.setting.openAIApiConfig?.key && hasFeature("quota") && (
|
{!settingStore.setting.openAIApiConfig?.key && hasFeature("quota") && (
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<QuotaView />
|
<QuotaView />
|
||||||
|
Reference in New Issue
Block a user