mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-19 21:29:11 +08:00
fix: show access mode icon in app list
This commit is contained in:
parent
ab262b8506
commit
32a8c7aad7
@ -4,7 +4,7 @@ import { useContext, useContextSelector } from 'use-context-selector'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { RiGlobalLine, RiMoreFill } from '@remixicon/react'
|
||||
import { RiBuildingLine, RiGlobalLine, RiLockLine, RiMoreFill } from '@remixicon/react'
|
||||
import s from './style.module.css'
|
||||
import cn from '@/utils/classnames'
|
||||
import type { App } from '@/types/app'
|
||||
@ -33,6 +33,7 @@ import { fetchInstalledAppList } from '@/service/explore'
|
||||
import { AppTypeIcon } from '@/app/components/app/type-selector'
|
||||
import Tooltip from '@/app/components/base/tooltip'
|
||||
import AccessControl from '@/app/components/app/app-access-control'
|
||||
import { AccessMode } from '@/models/access-control'
|
||||
|
||||
export type AppCardProps = {
|
||||
app: App
|
||||
@ -74,7 +75,7 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
|
||||
})
|
||||
}
|
||||
setShowConfirmDelete(false)
|
||||
}, [app.id])
|
||||
}, [app.id, mutateApps, notify, onPlanInfoChanged, onRefresh, t])
|
||||
|
||||
const onEdit: CreateAppModalProps['onConfirm'] = useCallback(async ({
|
||||
name,
|
||||
@ -315,9 +316,15 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
|
||||
</div>
|
||||
</div>
|
||||
<div className='shrink-0 w-5 h-5 flex items-center justify-center'>
|
||||
<Tooltip asChild={false} popupContent={t('app.accessControlDialog.accessItems.anyone')}>
|
||||
{app.accessMode === AccessMode.PUBLIC && <Tooltip asChild={false} popupContent={t('app.accessControlDialog.accessItems.anyone')}>
|
||||
<RiGlobalLine className='text-text-accent w-4 h-4' />
|
||||
</Tooltip>
|
||||
</Tooltip>}
|
||||
{app.accessMode === AccessMode.SPECIFIC_GROUPS_MEMBERS && <Tooltip asChild={false} popupContent={t('app.accessControlDialog.accessItems.specific')}>
|
||||
<RiLockLine className='text-text-quaternary w-4 h-4' />
|
||||
</Tooltip>}
|
||||
{app.accessMode === AccessMode.ORGANIZATION && <Tooltip asChild={false} popupContent={t('app.accessControlDialog.accessItems.organization')}>
|
||||
<RiBuildingLine className='text-text-quaternary w-4 h-4' />
|
||||
</Tooltip>}
|
||||
</div>
|
||||
</div>
|
||||
<div className='title-wrapper h-[90px] px-[14px] text-xs leading-normal text-text-tertiary'>
|
||||
|
@ -7,6 +7,7 @@ import type {
|
||||
WeightedScoreEnum,
|
||||
} from '@/models/datasets'
|
||||
import type { UploadFileSetting } from '@/app/components/workflow/types'
|
||||
import type { AccessMode } from '@/models/access-control'
|
||||
|
||||
export enum Theme {
|
||||
light = 'light',
|
||||
@ -351,6 +352,8 @@ export type App = {
|
||||
/** api site url */
|
||||
api_base_url: string
|
||||
tags: Tag[]
|
||||
/** access control */
|
||||
accessMode: AccessMode
|
||||
}
|
||||
|
||||
export type AppSSO = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user