diff --git a/web/app/components/app/annotation/index.tsx b/web/app/components/app/annotation/index.tsx index 92276e43e8..418079abe8 100644 --- a/web/app/components/app/annotation/index.tsx +++ b/web/app/components/app/annotation/index.tsx @@ -25,7 +25,7 @@ import AnnotationFullModal from '@/app/components/billing/annotation-full/modal' import { Settings04 } from '@/app/components/base/icons/src/vender/line/general' import type { App } from '@/types/app' -interface Props { +type Props = { appDetail: App } diff --git a/web/app/components/app/configuration/features/chat-group/opening-statement/index.tsx b/web/app/components/app/configuration/features/chat-group/opening-statement/index.tsx index 6d16660e81..f5fb96da08 100644 --- a/web/app/components/app/configuration/features/chat-group/opening-statement/index.tsx +++ b/web/app/components/app/configuration/features/chat-group/opening-statement/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable multiline-ternary */ 'use client' import type { FC } from 'react' import React, { useEffect, useRef, useState } from 'react' diff --git a/web/app/components/app/log/index.tsx b/web/app/components/app/log/index.tsx index 7e037c8355..592233facd 100644 --- a/web/app/components/app/log/index.tsx +++ b/web/app/components/app/log/index.tsx @@ -114,35 +114,12 @@ const Logs: FC = ({ appDetail }) => { {/* Show Pagination only if the total is more than the limit */} {(total && total > APP_PAGE_LIMIT) ? - - - {t('appLog.table.pagination.previous')} - -
- -
- - {t('appLog.table.pagination.next')} - - -
+ current={currPage} + onChange={setCurrPage} + total={total} + limit={limit} + onLimitChange={setLimit} + /> : null} diff --git a/web/app/components/base/badge.tsx b/web/app/components/base/badge.tsx index c44057b9a4..fb1ceca1e6 100644 --- a/web/app/components/base/badge.tsx +++ b/web/app/components/base/badge.tsx @@ -17,7 +17,7 @@ const Badge = ({ return (
{ - const pages = Array(totalPages) + const pages = new Array(totalPages) .fill(0) .map((_, i) => i + 1) diff --git a/web/app/components/base/pagination/index.tsx b/web/app/components/base/pagination/index.tsx index b64c712425..2285db9230 100644 --- a/web/app/components/base/pagination/index.tsx +++ b/web/app/components/base/pagination/index.tsx @@ -33,20 +33,20 @@ const CustomizedPagination: FC = ({ const [showPerPageTip, setShowPerPageTip] = React.useState(false) const { run: handlePaging } = useDebounceFn((value: string) => { - if (parseInt(value) > totalPages) { + if (Number.parseInt(value) > totalPages) { setInputValue(totalPages) onChange(totalPages - 1) setShowInput(false) return } - if (parseInt(value) < 1) { + if (Number.parseInt(value) < 1) { setInputValue(1) onChange(0) setShowInput(false) return } - onChange(parseInt(value) - 1) - setInputValue(parseInt(value)) + onChange(Number.parseInt(value) - 1) + setInputValue(Number.parseInt(value)) setShowInput(false) }, { wait: 500 }) @@ -54,9 +54,9 @@ const CustomizedPagination: FC = ({ const value = e.target.value if (!value) return setInputValue('') - if (isNaN(parseInt(value))) + if (isNaN(Number.parseInt(value))) return setInputValue('') - setInputValue(parseInt(value)) + setInputValue(Number.parseInt(value)) handlePaging(value) } diff --git a/web/app/components/datasets/create/step-two/index.tsx b/web/app/components/datasets/create/step-two/index.tsx index 6c69e6c3ce..af7ec2136f 100644 --- a/web/app/components/datasets/create/step-two/index.tsx +++ b/web/app/components/datasets/create/step-two/index.tsx @@ -675,7 +675,7 @@ const StepTwo = ({ value={maxChunkLength} max={limitMaxChunkLength} min={1} - onChange={e => setMaxChunkLength(parseInt(e.target.value.replace(/^0+/, ''), 10))} + onChange={e => setMaxChunkLength(Number.parseInt(e.target.value.replace(/^0+/, ''), 10))} />
diff --git a/web/app/components/header/account-dropdown/workplace-selector/index.tsx b/web/app/components/header/account-dropdown/workplace-selector/index.tsx index fc6a42338a..f8bde33d51 100644 --- a/web/app/components/header/account-dropdown/workplace-selector/index.tsx +++ b/web/app/components/header/account-dropdown/workplace-selector/index.tsx @@ -41,9 +41,11 @@ const WorkplaceSelector = () => { group hover:bg-state-base-hover cursor-pointer ${open && 'bg-state-base-hover'} rounded-[10px] `, )}> -
{currentWorkspace?.name[0].toLocaleUpperCase()}
-
{currentWorkspace?.name}
- +
{currentWorkspace?.name[0].toLocaleUpperCase()}
+
+
{currentWorkspace?.name}
+ +
{ { workspaces.map(workspace => (
handleSwitchWorkspace(workspace.id)}> -
{workspace.name[0].toLocaleUpperCase()}
+
{workspace.name[0].toLocaleUpperCase()}
{workspace.name}
{ diff --git a/web/app/components/header/index.tsx b/web/app/components/header/index.tsx index 57b86e315a..217cf12aed 100644 --- a/web/app/components/header/index.tsx +++ b/web/app/components/header/index.tsx @@ -13,10 +13,9 @@ import EnvNav from './env-nav' import PluginsNav from './plugins-nav' import ExploreNav from './explore-nav' import ToolsNav from './tools-nav' -import GithubStar from './github-star' import LicenseNav from './license-env' import { WorkspaceProvider } from '@/context/workspace-context' -import AppContext, { useAppContext } from '@/context/app-context' +import { useAppContext } from '@/context/app-context' import LogoSite from '@/app/components/base/logo/logo-site' import WorkplaceSelector from '@/app/components/header/account-dropdown/workplace-selector' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' @@ -61,7 +60,8 @@ const Header = () => { >
} - {!isMobile + { + !isMobile &&
@@ -93,29 +93,32 @@ const Header = () => {
/
- {enableBilling && ( -
- - -
- - {t('billing.upgradeBtn.encourageShort')} - -
-
-
- )} - -
- )} - {!isMobile && ( -
- {!isCurrentWorkspaceDatasetOperator && } - {!isCurrentWorkspaceDatasetOperator && } - {(isCurrentWorkspaceEditor || isCurrentWorkspaceDatasetOperator) && } - {!isCurrentWorkspaceDatasetOperator && } -
+ { + enableBilling && ( +
+ + +
+ + {t('billing.upgradeBtn.encourageShort')} + +
+
+
+ ) + } + )} + { + !isMobile && ( +
+ {!isCurrentWorkspaceDatasetOperator && } + {!isCurrentWorkspaceDatasetOperator && } + {(isCurrentWorkspaceEditor || isCurrentWorkspaceDatasetOperator) && } + {!isCurrentWorkspaceDatasetOperator && } +
+ ) + }
@@ -124,15 +127,17 @@ const Header = () => {
- {(isMobile && isShowNavMenu) && ( -
- {!isCurrentWorkspaceDatasetOperator && } - {!isCurrentWorkspaceDatasetOperator && } - {(isCurrentWorkspaceEditor || isCurrentWorkspaceDatasetOperator) && } - {!isCurrentWorkspaceDatasetOperator && } -
- )} - + { + (isMobile && isShowNavMenu) && ( +
+ {!isCurrentWorkspaceDatasetOperator && } + {!isCurrentWorkspaceDatasetOperator && } + {(isCurrentWorkspaceEditor || isCurrentWorkspaceDatasetOperator) && } + {!isCurrentWorkspaceDatasetOperator && } +
+ ) + } + ) } export default Header diff --git a/web/app/components/workflow/nodes/_base/components/field.tsx b/web/app/components/workflow/nodes/_base/components/field.tsx index e284e91cfc..eb8976f78d 100644 --- a/web/app/components/workflow/nodes/_base/components/field.tsx +++ b/web/app/components/workflow/nodes/_base/components/field.tsx @@ -51,7 +51,7 @@ const Field: FC = ({
{operations &&
{operations}
} {supportFold && ( - + )}
diff --git a/web/app/components/workflow/nodes/assigner/components/operation-selector.tsx b/web/app/components/workflow/nodes/assigner/components/operation-selector.tsx index 8542bb4829..b2f8e8cb5b 100644 --- a/web/app/components/workflow/nodes/assigner/components/operation-selector.tsx +++ b/web/app/components/workflow/nodes/assigner/components/operation-selector.tsx @@ -108,7 +108,7 @@ const OperationSelector: FC = ({ }} >
- {t(`${i18nPrefix}.operations.${item.name}`)} + {t(`${i18nPrefix}.operations.${item.name}`)}
{item.value === value && (
diff --git a/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx b/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx index 42ee9845dd..52d076624d 100644 --- a/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx +++ b/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx @@ -128,7 +128,7 @@ const VarList: FC = ({ return (
-
+
= ({
diff --git a/web/app/components/workflow/nodes/assigner/panel.tsx b/web/app/components/workflow/nodes/assigner/panel.tsx index d82155196b..6b151a7cb0 100644 --- a/web/app/components/workflow/nodes/assigner/panel.tsx +++ b/web/app/components/workflow/nodes/assigner/panel.tsx @@ -7,11 +7,9 @@ import { import VarList from './components/var-list' import useConfig from './use-config' import type { AssignerNodeType } from './types' -import Field from '@/app/components/workflow/nodes/_base/components/field' import type { NodePanelProps } from '@/app/components/workflow/types' -import cn from '@/utils/classnames' -import ActionButton from '@/app/components/base/action-button' import { useHandleAddOperationItem } from './hooks' +import ActionButton from '@/app/components/base/action-button' const i18nPrefix = 'workflow.nodes.assigner' @@ -42,7 +40,7 @@ const Panel: FC> = ({
-
{t(`${i18nPrefix}.variables`)}
+
{t(`${i18nPrefix}.variables`)}
diff --git a/web/i18n/th-TH/plugin-tags.ts b/web/i18n/th-TH/plugin-tags.ts new file mode 100644 index 0000000000..928649474b --- /dev/null +++ b/web/i18n/th-TH/plugin-tags.ts @@ -0,0 +1,4 @@ +const translation = { +} + +export default translation diff --git a/web/i18n/th-TH/plugin.ts b/web/i18n/th-TH/plugin.ts new file mode 100644 index 0000000000..928649474b --- /dev/null +++ b/web/i18n/th-TH/plugin.ts @@ -0,0 +1,4 @@ +const translation = { +} + +export default translation