mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
merge main
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
import { useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import { useContext } from 'use-context-selector'
|
||||
import { useContext, useContextSelector } from 'use-context-selector'
|
||||
import Collapse from '../collapse'
|
||||
import type { IItem } from '../collapse'
|
||||
import s from './index.module.css'
|
||||
@ -11,7 +11,7 @@ import Modal from '@/app/components/base/modal'
|
||||
import Confirm from '@/app/components/base/confirm'
|
||||
import Button from '@/app/components/base/button'
|
||||
import { updateUserProfile } from '@/service/common'
|
||||
import { useAppContext } from '@/context/app-context'
|
||||
import AppContext, { useAppContext } from '@/context/app-context'
|
||||
import { ToastContext } from '@/app/components/base/toast'
|
||||
import AppIcon from '@/app/components/base/app-icon'
|
||||
import Avatar from '@/app/components/base/avatar'
|
||||
@ -42,6 +42,7 @@ export default function AccountPage() {
|
||||
const [password, setPassword] = useState('')
|
||||
const [confirmPassword, setConfirmPassword] = useState('')
|
||||
const [showDeleteAccountModal, setShowDeleteAccountModal] = useState(false)
|
||||
const systemFeatures = useContextSelector(AppContext, state => state.systemFeatures)
|
||||
|
||||
const handleEditName = () => {
|
||||
setEditNameModalVisible(true)
|
||||
@ -144,7 +145,7 @@ export default function AccountPage() {
|
||||
<div className={titleClassName}>{t('common.account.email')}</div>
|
||||
<div className={classNames(inputClassName, 'cursor-pointer')}>{userProfile.email}</div>
|
||||
</div>
|
||||
{IS_CE_EDITION && (
|
||||
{systemFeatures.enable_email_password_login && (
|
||||
<div className='mb-8'>
|
||||
<div className='mb-1 text-sm font-medium text-gray-900'>{t('common.account.password')}</div>
|
||||
<div className='mb-2 text-xs text-gray-500'>{t('common.account.passwordTip')}</div>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export type FormValue = Record<string, any>
|
||||
|
||||
export type TypeWithI18N<T = string> = {
|
||||
export interface TypeWithI18N<T = string> {
|
||||
en_US: T
|
||||
zh_Hans: T
|
||||
[key: string]: T
|
||||
@ -14,9 +14,10 @@ export enum FormTypeEnum {
|
||||
radio = 'radio',
|
||||
boolean = 'boolean',
|
||||
files = 'files',
|
||||
file = 'file',
|
||||
}
|
||||
|
||||
export type FormOption = {
|
||||
export interface FormOption {
|
||||
label: TypeWithI18N
|
||||
value: string
|
||||
show_on: FormShowOnObject[]
|
||||
@ -88,12 +89,12 @@ export enum CustomConfigurationStatusEnum {
|
||||
noConfigure = 'no-configure',
|
||||
}
|
||||
|
||||
export type FormShowOnObject = {
|
||||
export interface FormShowOnObject {
|
||||
variable: string
|
||||
value: string
|
||||
}
|
||||
|
||||
export type CredentialFormSchemaBase = {
|
||||
export interface CredentialFormSchemaBase {
|
||||
variable: string
|
||||
label: TypeWithI18N
|
||||
type: FormTypeEnum
|
||||
@ -111,7 +112,7 @@ export type CredentialFormSchemaRadio = CredentialFormSchemaBase & { options: Fo
|
||||
export type CredentialFormSchemaSecretInput = CredentialFormSchemaBase & { placeholder?: TypeWithI18N }
|
||||
export type CredentialFormSchema = CredentialFormSchemaTextInput | CredentialFormSchemaSelect | CredentialFormSchemaRadio | CredentialFormSchemaSecretInput
|
||||
|
||||
export type ModelItem = {
|
||||
export interface ModelItem {
|
||||
model: string
|
||||
label: TypeWithI18N
|
||||
model_type: ModelTypeEnum
|
||||
@ -140,7 +141,7 @@ export enum QuotaUnitEnum {
|
||||
credits = 'credits',
|
||||
}
|
||||
|
||||
export type QuotaConfiguration = {
|
||||
export interface QuotaConfiguration {
|
||||
quota_type: CurrentSystemQuotaTypeEnum
|
||||
quota_unit: QuotaUnitEnum
|
||||
quota_limit: number
|
||||
@ -149,7 +150,7 @@ export type QuotaConfiguration = {
|
||||
is_valid: boolean
|
||||
}
|
||||
|
||||
export type ModelProvider = {
|
||||
export interface ModelProvider {
|
||||
provider: string
|
||||
label: TypeWithI18N
|
||||
description?: TypeWithI18N
|
||||
@ -183,7 +184,7 @@ export type ModelProvider = {
|
||||
}
|
||||
}
|
||||
|
||||
export type Model = {
|
||||
export interface Model {
|
||||
provider: string
|
||||
icon_large: TypeWithI18N
|
||||
icon_small: TypeWithI18N
|
||||
@ -192,7 +193,7 @@ export type Model = {
|
||||
status: ModelStatusEnum
|
||||
}
|
||||
|
||||
export type DefaultModelResponse = {
|
||||
export interface DefaultModelResponse {
|
||||
model: string
|
||||
model_type: ModelTypeEnum
|
||||
provider: {
|
||||
@ -202,17 +203,17 @@ export type DefaultModelResponse = {
|
||||
}
|
||||
}
|
||||
|
||||
export type DefaultModel = {
|
||||
export interface DefaultModel {
|
||||
provider: string
|
||||
model: string
|
||||
}
|
||||
|
||||
export type CustomConfigurationModelFixedFields = {
|
||||
export interface CustomConfigurationModelFixedFields {
|
||||
__model_name: string
|
||||
__model_type: ModelTypeEnum
|
||||
}
|
||||
|
||||
export type ModelParameterRule = {
|
||||
export interface ModelParameterRule {
|
||||
default?: number | string | boolean | string[]
|
||||
help?: TypeWithI18N
|
||||
label: TypeWithI18N
|
||||
@ -227,7 +228,7 @@ export type ModelParameterRule = {
|
||||
tagPlaceholder?: TypeWithI18N
|
||||
}
|
||||
|
||||
export type ModelLoadBalancingConfigEntry = {
|
||||
export interface ModelLoadBalancingConfigEntry {
|
||||
/** model balancing config entry id */
|
||||
id?: string
|
||||
/** is config entry enabled */
|
||||
@ -242,7 +243,7 @@ export type ModelLoadBalancingConfigEntry = {
|
||||
ttl?: number
|
||||
}
|
||||
|
||||
export type ModelLoadBalancingConfig = {
|
||||
export interface ModelLoadBalancingConfig {
|
||||
enabled: boolean
|
||||
configs: ModelLoadBalancingConfigEntry[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user