Merge branch 'feat/plugins' of https://github.com/langgenius/dify into feat/plugins

This commit is contained in:
AkaraChen 2024-11-07 11:46:32 +08:00
commit 8ed0963c6b
4 changed files with 8 additions and 13 deletions

View File

@ -331,20 +331,20 @@ const PortalSelect: FC<PortalSelectProps> = ({
: (
<div
className={classNames(`
flex items-center justify-between px-2.5 h-9 rounded-lg border-0 bg-gray-100 text-sm ${readonly ? 'cursor-not-allowed' : 'cursor-pointer'}
group flex items-center justify-between px-2.5 h-9 rounded-lg border-0 bg-components-input-bg-normal hover:bg-state-base-hover-alt text-sm ${readonly ? 'cursor-not-allowed' : 'cursor-pointer'}
`, triggerClassName, triggerClassNameFn?.(open))}
title={selectedItem?.name}
>
<span
className={`
grow truncate
${!selectedItem?.name && 'text-gray-400'}
${!selectedItem?.name && 'text-components-input-text-placeholder'}
`}
>
{selectedItem?.name ?? localPlaceholder}
</span>
<div className='mx-0.5'>{installedValue && selectedItem && selectedItem.value !== installedValue && <Badge>{installedValue} {'->'} {selectedItem.value} </Badge>}</div>
<ChevronDownIcon className='shrink-0 h-4 w-4 text-gray-400' />
<ChevronDownIcon className='shrink-0 h-4 w-4 text-text-quaternary group-hover:text-text-secondary' />
</div>
)}

View File

@ -26,14 +26,8 @@ type InstallFromGitHubProps = {
const InstallFromGitHub: React.FC<InstallFromGitHubProps> = ({ updatePayload, onClose, onSuccess }) => {
const { t } = useTranslation()
// const updatePayloadTest = {
// originalPackageInfo: {
// id: '0299ff5e-40cc-4690-9308-6687cf344a21',
// repo: 'YIXIAO0/test',
// version: '1.10.1',
// package: 'openai.difypkg',
// }
// }
const { getIconUrl } = useGetIcon()
const { fetchReleases } = useGitHubReleases()
const [state, setState] = useState<InstallState>({
step: updatePayload ? InstallStepFromGitHub.selectPackage : InstallStepFromGitHub.setUrl,
repoUrl: updatePayload?.originalPackageInfo?.repo
@ -43,8 +37,6 @@ const InstallFromGitHub: React.FC<InstallFromGitHubProps> = ({ updatePayload, on
selectedPackage: '',
releases: [],
})
const { getIconUrl } = useGetIcon()
const { fetchReleases } = useGitHubReleases()
const [uniqueIdentifier, setUniqueIdentifier] = useState<string | null>(null)
const [manifest, setManifest] = useState<PluginDeclaration | null>(null)
const [errorMsg, setErrorMsg] = useState<string | null>(null)

View File

@ -93,6 +93,7 @@ const SelectPackage: React.FC<SelectPackageProps> = ({
value={selectedPackage}
onSelect={onSelectPackage}
items={packages}
readonly={!selectedVersion}
placeholder={t('plugin.installFromGitHub.selectPackagePlaceholder') || ''}
popupClassName='w-[512px] z-[1001]'
/>

View File

@ -9,6 +9,7 @@ export const pluginManifestToCardPluginProps = (pluginManifest: PluginDeclaratio
name: pluginManifest.name,
version: pluginManifest.version,
latest_version: '',
latest_package_identifier: '',
org: pluginManifest.author,
label: pluginManifest.label,
brief: pluginManifest.description,
@ -32,6 +33,7 @@ export const pluginManifestInMarketToPluginProps = (pluginManifest: PluginManife
name: pluginManifest.name,
version: pluginManifest.latest_version,
latest_version: pluginManifest.latest_version,
latest_package_identifier: '',
org: pluginManifest.org,
label: pluginManifest.label,
brief: pluginManifest.brief,