diff --git a/web/app/components/app/overview/apikey-info-panel/index.tsx b/web/app/components/app/overview/apikey-info-panel/index.tsx index 661a88e823..2ca098a313 100644 --- a/web/app/components/app/overview/apikey-info-panel/index.tsx +++ b/web/app/components/app/overview/apikey-info-panel/index.tsx @@ -27,8 +27,8 @@ const APIKeyInfoPanel: FC = () => { return null return ( -
-
+
+
{isCloud && } {isCloud ? ( @@ -42,11 +42,11 @@ const APIKeyInfoPanel: FC = () => { )}
{isCloud && ( -
{t(`appOverview.apiKeyInfo.cloud.${'trial'}.description`)}
+
{t(`appOverview.apiKeyInfo.cloud.${'trial'}.description`)}
)}
) diff --git a/web/app/components/app/overview/apikey-info-panel/progress/index.tsx b/web/app/components/app/overview/apikey-info-panel/progress/index.tsx deleted file mode 100644 index cc8356e754..0000000000 --- a/web/app/components/app/overview/apikey-info-panel/progress/index.tsx +++ /dev/null @@ -1,29 +0,0 @@ -'use client' -import type { FC } from 'react' -import React from 'react' -import s from './style.module.css' -import cn from '@/utils/classnames' - -export type IProgressProps = { - className?: string - value: number // percent -} - -const Progress: FC = ({ - className, - value, -}) => { - const exhausted = value === 100 - return ( -
-
- {Array.from({ length: 10 }).fill(0).map((i, k) => ( -
- ))} -
- ) -} -export default React.memo(Progress) diff --git a/web/app/components/app/overview/apikey-info-panel/progress/style.module.css b/web/app/components/app/overview/apikey-info-panel/progress/style.module.css deleted file mode 100644 index 94c3ef45cf..0000000000 --- a/web/app/components/app/overview/apikey-info-panel/progress/style.module.css +++ /dev/null @@ -1,16 +0,0 @@ -.bar { - background: linear-gradient(90deg, rgba(41, 112, 255, 0.9) 0%, rgba(21, 94, 239, 0.9) 100%); -} - -.bar-error { - background: linear-gradient(90deg, rgba(240, 68, 56, 0.72) 0%, rgba(217, 45, 32, 0.9) 100%); -} - -.bar-item { - width: 10%; - border-right: 1px solid rgba(255, 255, 255, 0.5); -} - -.bar-item:last-of-type { - border-right: 0; -} \ No newline at end of file diff --git a/web/app/components/app/overview/appCard.tsx b/web/app/components/app/overview/appCard.tsx index f9f5c1fbff..99e847f8b6 100644 --- a/web/app/components/app/overview/appCard.tsx +++ b/web/app/components/app/overview/appCard.tsx @@ -1,6 +1,9 @@ 'use client' import type { HTMLProps } from 'react' import React, { useMemo, useState } from 'react' +import { + RiLoopLeftLine, +} from '@remixicon/react' import { Cog8ToothIcon, DocumentTextIcon, @@ -16,24 +19,25 @@ import style from './style.module.css' import type { ConfigParams } from './settings' import Tooltip from '@/app/components/base/tooltip' import AppBasic from '@/app/components/app-sidebar/basic' -import { asyncRunSafe, randomString } from '@/utils' +import { asyncRunSafe } from '@/utils' import Button from '@/app/components/base/button' import Tag from '@/app/components/base/tag' import Switch from '@/app/components/base/switch' import Divider from '@/app/components/base/divider' import CopyFeedback from '@/app/components/base/copy-feedback' +import ActionButton from '@/app/components/base/action-button' import Confirm from '@/app/components/base/confirm' import ShareQRCode from '@/app/components/base/qrcode' import SecretKeyButton from '@/app/components/develop/secret-key/secret-key-button' import type { AppDetailResponse } from '@/models/app' import { useAppContext } from '@/context/app-context' import type { AppSSO } from '@/types/app' +import cn from '@/utils/classnames' export type IAppCardProps = { className?: string appInfo: AppDetailResponse & Partial cardType?: 'api' | 'webapp' - customBgColor?: string onChangeStatus: (val: boolean) => Promise onSaveSiteConfig?: (params: ConfigParams) => Promise onGenerateCode?: () => Promise @@ -46,7 +50,6 @@ const EmbedIcon = ({ className = '' }: HTMLProps) => { function AppCard({ appInfo, cardType = 'webapp', - customBgColor, onChangeStatus, onSaveSiteConfig, onGenerateCode, @@ -92,10 +95,6 @@ function AppCard({ const appUrl = `${app_base_url}/${appMode}/${access_token}` const apiUrl = appInfo?.api_base_url - let bgColor = 'bg-primary-50 bg-opacity-40' - if (cardType === 'api') - bgColor = 'bg-purple-50' - const genClickFuncByName = (opName: string) => { switch (opName) { case t('appOverview.overview.appInfo.preview'): @@ -133,11 +132,8 @@ function AppCard({ } return ( -
-
+
+
-
+
{isApp ? t('appOverview.overview.appInfo.accessibleAddress') : t('appOverview.overview.apiInfo.accessibleAddress')}
-
+
-
+
{isApp ? appUrl : apiUrl}
- - {isApp && } - + + {isApp && } + {/* button copy link/ button regenerate */} {showConfirmDelete && ( -
setShowConfirmDelete(true)} - > -
-
+ setShowConfirmDelete(true)}> + + )}
- {!isApp && } + {!isApp && } {OPERATIONS_MAP[cardType].map((op) => { const disabled = op.opName === t('appOverview.overview.appInfo.settings.entry') diff --git a/web/app/components/base/copy-feedback/index.tsx b/web/app/components/base/copy-feedback/index.tsx index ead1eb1d18..bc1cca5205 100644 --- a/web/app/components/base/copy-feedback/index.tsx +++ b/web/app/components/base/copy-feedback/index.tsx @@ -1,10 +1,15 @@ 'use client' import React, { useState } from 'react' import { useTranslation } from 'react-i18next' +import { + RiClipboardFill, + RiClipboardLine, +} from '@remixicon/react' import { debounce } from 'lodash-es' import copy from 'copy-to-clipboard' import copyStyle from './style.module.css' import Tooltip from '@/app/components/base/tooltip' +import ActionButton from '@/app/components/base/action-button' type Props = { content: string @@ -13,7 +18,7 @@ type Props = { const prefixEmbedded = 'appOverview.overview.appInfo.embedded' -const CopyFeedback = ({ content, className }: Props) => { +const CopyFeedback = ({ content }: Props) => { const { t } = useTranslation() const [isCopied, setIsCopied] = useState(false) @@ -34,19 +39,15 @@ const CopyFeedback = ({ content, className }: Props) => { : t(`${prefixEmbedded}.copy`)) || '' } > -
+
-
+ > + {isCopied && } + {!isCopied && } +
+ ) } diff --git a/web/app/components/base/qrcode/index.tsx b/web/app/components/base/qrcode/index.tsx index c5549192cf..08569a8c89 100644 --- a/web/app/components/base/qrcode/index.tsx +++ b/web/app/components/base/qrcode/index.tsx @@ -1,19 +1,20 @@ 'use client' import React, { useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' +import { + RiQrCodeLine, +} from '@remixicon/react' import { QRCodeCanvas as QRCode } from 'qrcode.react' -import QrcodeStyle from './style.module.css' +import ActionButton from '@/app/components/base/action-button' import Tooltip from '@/app/components/base/tooltip' -interface Props { +type Props = { content: string - selectorId: string - className?: string } const prefixEmbedded = 'appOverview.overview.appInfo.qrcode.title' -const ShareQRCode = ({ content, selectorId, className }: Props) => { +const ShareQRCode = ({ content }: Props) => { const { t } = useTranslation() const [isShow, setIsShow] = useState(false) const qrCodeRef = useRef(null) @@ -53,22 +54,21 @@ const ShareQRCode = ({ content, selectorId, className }: Props) => { -
-
+
+ + + {isShow && (
- -
-
{t('appOverview.overview.appInfo.qrcode.scan')}
-
·
-
{t('appOverview.overview.appInfo.qrcode.download')}
+ +
+
{t('appOverview.overview.appInfo.qrcode.scan')}
+
·
+
{t('appOverview.overview.appInfo.qrcode.download')}
)} diff --git a/web/app/components/base/qrcode/style.module.css b/web/app/components/base/qrcode/style.module.css deleted file mode 100644 index d84e5fa45c..0000000000 --- a/web/app/components/base/qrcode/style.module.css +++ /dev/null @@ -1,62 +0,0 @@ -.QrcodeIcon { - background-image: url(~@/app/components/develop/secret-key/assets/qrcode.svg); - background-position: center; - background-repeat: no-repeat; -} - -.QrcodeIcon:hover { - background-image: url(~@/app/components/develop/secret-key/assets/qrcode-hover.svg); - background-position: center; - background-repeat: no-repeat; -} - -.QrcodeIcon.show { - background-image: url(~@/app/components/develop/secret-key/assets/qrcode-hover.svg); - background-position: center; - background-repeat: no-repeat; -} - -.qrcodeimage { - position: relative; - object-fit: cover; -} -.scan { - margin: 0; - line-height: 1rem; - font-size: 0.75rem; -} -.download { - position: relative; - color: #155eef; - font-size: 0.75rem; - line-height: 1rem; -} -.text { - align-self: stretch; - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - white-space: nowrap; - gap: 4px; -} -.qrcodeform { - z-index: 50; - border: 0.5px solid #eaecf0; - display: flex; - flex-direction: column; - margin: 0 !important; - margin-top: 4px !important; - margin-left: -75px !important; - width: fit-content; - position: relative; - border-radius: 8px; - background-color: #fff; - box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.08), - 0 4px 6px -2px rgba(16, 24, 40, 0.03); - overflow: hidden; - align-items: center; - justify-content: center; - padding: 15px; - gap: 8px; -} diff --git a/web/app/components/develop/secret-key/secret-key-button.tsx b/web/app/components/develop/secret-key/secret-key-button.tsx index dab319bab4..a9f2656392 100644 --- a/web/app/components/develop/secret-key/secret-key-button.tsx +++ b/web/app/components/develop/secret-key/secret-key-button.tsx @@ -23,7 +23,7 @@ const SecretKeyButton = ({ className, appId, iconCls, textCls }: ISecretKeyButto
-
{t('appApi.apiKey')}
+
{t('appApi.apiKey')}
setVisible(false)} appId={appId} /> diff --git a/web/context/app-context.tsx b/web/context/app-context.tsx index 25a313a76b..7addfb83d4 100644 --- a/web/context/app-context.tsx +++ b/web/context/app-context.tsx @@ -127,7 +127,7 @@ export const AppContextProvider: FC = ({ children }) => setCurrentWorkspace(currentWorkspaceResponse) }, [currentWorkspaceResponse]) - const [theme, setTheme] = useState(Theme.dark) + const [theme, setTheme] = useState(Theme.light) const handleSetTheme = useCallback((theme: Theme) => { setTheme(theme) globalThis.document.documentElement.setAttribute('data-theme', theme)