mirror of
https://github.com/langgenius/dify.git
synced 2026-04-30 15:38:08 +08:00
refactor(web): make Switch controlled-only and migrate call sites (#32399)
This commit is contained in:
@ -166,10 +166,10 @@ const SearchMethodOption = ({
|
||||
<div>
|
||||
{
|
||||
showRerankModelSelectorSwitch && (
|
||||
<div className="system-sm-semibold mb-1 flex items-center text-text-secondary">
|
||||
<div className="mb-1 flex items-center text-text-secondary system-sm-semibold">
|
||||
<Switch
|
||||
className="mr-1"
|
||||
defaultValue={rerankingModelEnabled}
|
||||
value={rerankingModelEnabled ?? false}
|
||||
onChange={onRerankingModelEnabledChange}
|
||||
disabled={readonly}
|
||||
/>
|
||||
@ -192,7 +192,7 @@ const SearchMethodOption = ({
|
||||
<div className="p-1">
|
||||
<AlertTriangle className="size-4 text-text-warning-secondary" />
|
||||
</div>
|
||||
<span className="system-xs-medium text-text-primary">
|
||||
<span className="text-text-primary system-xs-medium">
|
||||
{t('form.retrievalSetting.multiModalTip', { ns: 'datasetSettings' })}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -56,7 +56,7 @@ const TopKAndScoreThreshold = ({
|
||||
return (
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<div className="system-xs-medium mb-0.5 flex h-6 items-center text-text-secondary">
|
||||
<div className="mb-0.5 flex h-6 items-center text-text-secondary system-xs-medium">
|
||||
{t('datasetConfig.top_k', { ns: 'appDebug' })}
|
||||
<Tooltip
|
||||
triggerClassName="ml-0.5 shrink-0 w-3.5 h-3.5"
|
||||
@ -78,11 +78,11 @@ const TopKAndScoreThreshold = ({
|
||||
<div className="mb-0.5 flex h-6 items-center">
|
||||
<Switch
|
||||
className="mr-2"
|
||||
defaultValue={isScoreThresholdEnabled}
|
||||
value={isScoreThresholdEnabled ?? false}
|
||||
onChange={onScoreThresholdEnabledChange}
|
||||
disabled={readonly}
|
||||
/>
|
||||
<div className="system-sm-medium grow truncate text-text-secondary">
|
||||
<div className="grow truncate text-text-secondary system-sm-medium">
|
||||
{t('datasetConfig.score_threshold', { ns: 'appDebug' })}
|
||||
</div>
|
||||
<Tooltip
|
||||
|
||||
Reference in New Issue
Block a user