mirror of
https://github.com/YFGaia/dify-plus.git
synced 2026-06-04 10:14:00 +08:00
feat: 合并近期功能与修复
- GLM/MiniMax 模型支持及 provider_name 修复 - OAuth2 登录跳转与重定向 hash 保留 - Azure 模型支持与转发特殊处理 - 后台登录与钉钉邮箱默认域名 - 转发获取密钥、Jinja 路径、RSA 私钥加载 - 模型管理可用模型输入与新增 - 自动更新权限、健康监测、admin 配置等 Co-authored-by: Cursor <github@npc0.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
'use client'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { fetchUserMoney } from '@/service/common-extend'
|
||||
import type { UserMoney } from '@/models/common-extend'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { fetchUserMoney } from '@/service/common-extend'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import {useTranslation} from "react-i18next";
|
||||
|
||||
const AccountMoneyExtend = () => {
|
||||
const [userMoney, setUserMoney] = useState<UserMoney>({ used_quota: 0, total_quota: 0 })
|
||||
@@ -12,12 +12,15 @@ const AccountMoneyExtend = () => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const getUserMoney = async () => {
|
||||
const data: any = await fetchUserMoney()
|
||||
// eslint-disable-next-line ts/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
const data: never = await fetchUserMoney()
|
||||
setUserMoney(data)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getUserMoney()
|
||||
// eslint-disable-next-line react-hooks-extra/no-direct-set-state-in-use-effect
|
||||
setIsFetched(true)
|
||||
}, [])
|
||||
|
||||
@@ -51,14 +54,14 @@ const AccountMoneyExtend = () => {
|
||||
|
||||
return (
|
||||
<div
|
||||
rel='noopener noreferrer'
|
||||
className='flex items-center overflow-hidden rounded-md border border-divider-regular text-xs leading-[18px]'
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center overflow-hidden rounded-md border border-divider-regular text-xs leading-[18px]"
|
||||
>
|
||||
<div className='flex items-center bg-background-default-dimmed px-2 py-1 font-medium text-text-secondary'>
|
||||
<div className="flex items-center bg-background-default-dimmed px-2 py-1 font-medium text-text-secondary">
|
||||
{t('user.credit', { ns: 'extend' })}
|
||||
</div>
|
||||
<div className='flex items-center border-l border-divider-regular bg-background-default px-2 py-1.5'>
|
||||
<span className='mr-1 text-text-tertiary'>{t('user.used', { ns: 'extend' })}</span>
|
||||
<div className="flex items-center border-l border-divider-regular bg-background-default px-2 py-1.5">
|
||||
<span className="mr-1 text-text-tertiary">{t('user.used', { ns: 'extend' })}</span>
|
||||
<span
|
||||
className={cn(
|
||||
'font-bold transition-all duration-300',
|
||||
@@ -66,11 +69,13 @@ const AccountMoneyExtend = () => {
|
||||
'text-sm md:text-base', // 默认字体稍大,响应式设计
|
||||
)}
|
||||
>
|
||||
¥{usedRMB}
|
||||
¥
|
||||
{usedRMB}
|
||||
</span>
|
||||
<span className='mx-1 text-text-quaternary'>/</span>
|
||||
<span className='text-text-tertiary'>
|
||||
¥{totalRMB.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
|
||||
<span className="mx-1 text-text-quaternary">/</span>
|
||||
<span className="text-text-tertiary">
|
||||
¥
|
||||
{totalRMB.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { WorkspaceProvider } from '@/context/workspace-context'
|
||||
import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
|
||||
import { Plan } from '../billing/type'
|
||||
import AccountDropdown from './account-dropdown'
|
||||
import AccountMoneyExtend from './account-money-extend' // 二开部分 - 额度限制
|
||||
import AppNav from './app-nav'
|
||||
import DatasetNav from './dataset-nav'
|
||||
import EnvNav from './env-nav'
|
||||
@@ -20,9 +21,8 @@ import LicenseNav from './license-env'
|
||||
import PlanBadge from './plan-badge'
|
||||
import PluginsNav from './plugins-nav'
|
||||
import ToolsNav from './tools-nav'
|
||||
import AccountMoneyExtend from './account-money-extend' // 二开部分 - 额度限制
|
||||
import DrawNav from './draw-nav-extend' // Extend draw nav
|
||||
import { AmazonMarketingNav } from './nav-extend/index' // Extend draw nav
|
||||
// import DrawNav from './draw-nav-extend' // Extend draw nav
|
||||
// import { AmazonMarketingNav } from './nav-extend/index' // Extend draw nav
|
||||
|
||||
const navClassName = `
|
||||
flex items-center relative px-3 h-8 rounded-xl
|
||||
@@ -48,7 +48,7 @@ const Header = () => {
|
||||
|
||||
const renderLogo = () => (
|
||||
<h1>
|
||||
{/*extend: 跳转修改*/}
|
||||
{/* extend: 跳转修改 */}
|
||||
<Link href="/explore/apps-center-extend" className="flex h-8 shrink-0 items-center justify-center overflow-hidden whitespace-nowrap px-0.5 indent-[-9999px]">
|
||||
{isBrandingEnabled && systemFeatures.branding.application_title ? systemFeatures.branding.application_title : 'Dify'}
|
||||
{systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo
|
||||
@@ -89,11 +89,11 @@ const Header = () => {
|
||||
{(isCurrentWorkspaceEditor || isCurrentWorkspaceDatasetOperator) && <DatasetNav />}
|
||||
{!isCurrentWorkspaceDatasetOperator && <ToolsNav className={navClassName} />}
|
||||
{/* gaia exnend begin */}
|
||||
<DrawNav className={navClassName}/>
|
||||
{<AmazonMarketingNav className={navClassName}/>}
|
||||
{ /* <DrawNav className={navClassName} /> */ }
|
||||
{ /* <AmazonMarketingNav className={navClassName} /> */ }
|
||||
{/* gaia extend end */}
|
||||
{/* 二开部分 - 额度限制 */}
|
||||
{<AccountMoneyExtend />}
|
||||
<AccountMoneyExtend />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
@@ -109,7 +109,7 @@ const Header = () => {
|
||||
</WorkspaceProvider>
|
||||
{enableBilling ? <PlanBadge allowHover sandboxAsUpgrade plan={plan.type} onClick={handlePlanClick} /> : <LicenseNav />}
|
||||
{/* 二开部分 - 额度限制 */}
|
||||
{<AccountMoneyExtend />}
|
||||
<AccountMoneyExtend />
|
||||
</div>
|
||||
<div className="flex items-center space-x-2">
|
||||
{!isCurrentWorkspaceDatasetOperator && <ExploreNav className={navClassName} />}
|
||||
|
||||
Generated
+15570
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user