fix(agent): polish selector capability status chips
This commit is contained in:
@@ -142,16 +142,22 @@
|
|||||||
<div class="detail-tag-group-title">{{ $t('agent.selector.capabilitiesSection') }}</div>
|
<div class="detail-tag-group-title">{{ $t('agent.selector.capabilitiesSection') }}</div>
|
||||||
<div class="detail-tags detail-tags--capabilities">
|
<div class="detail-tags detail-tags--capabilities">
|
||||||
<span class="detail-tag detail-capability-tag"
|
<span class="detail-tag detail-capability-tag"
|
||||||
:class="isWebSearchReadyForAgent(activeDetail.agent) ? 'detail-tag--on' : 'detail-tag--off'">
|
:class="getWebSearchCapabilityClass(activeDetail.agent)">
|
||||||
<TIcon :name="isWebSearchReadyForAgent(activeDetail.agent) ? 'check' : 'close'" size="12px"
|
<span class="detail-capability-icon-wrap">
|
||||||
class="detail-capability-icon" />
|
<TIcon :name="getWebSearchCapabilityIcon(activeDetail.agent)" size="10px"
|
||||||
<span>{{ getWebSearchCapability(activeDetail.agent) }}</span>
|
class="detail-capability-icon" />
|
||||||
|
</span>
|
||||||
|
<span class="detail-capability-name">{{ $t('agent.selector.webSearchCapability') }}</span>
|
||||||
|
<span class="detail-capability-state">{{ getWebSearchCapabilityState(activeDetail.agent) }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="detail-tag detail-capability-tag"
|
<span class="detail-tag detail-capability-tag"
|
||||||
:class="isImageUploadEnabledForAgent(activeDetail.agent) ? 'detail-tag--on' : 'detail-tag--off'">
|
:class="isImageUploadEnabledForAgent(activeDetail.agent) ? 'detail-capability-tag--on' : 'detail-capability-tag--off'">
|
||||||
<TIcon :name="isImageUploadEnabledForAgent(activeDetail.agent) ? 'check' : 'close'" size="12px"
|
<span class="detail-capability-icon-wrap">
|
||||||
class="detail-capability-icon" />
|
<TIcon :name="isImageUploadEnabledForAgent(activeDetail.agent) ? 'check' : 'close'" size="10px"
|
||||||
<span>{{ getImageUploadCapability(activeDetail.agent) }}</span>
|
class="detail-capability-icon" />
|
||||||
|
</span>
|
||||||
|
<span class="detail-capability-name">{{ $t('agent.selector.imageUploadCapability') }}</span>
|
||||||
|
<span class="detail-capability-state">{{ getImageUploadCapabilityState(activeDetail.agent) }}</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -324,20 +330,28 @@ const isImageUploadEnabledForAgent = (agent: CustomAgent): boolean => {
|
|||||||
return config.image_upload_enabled === true;
|
return config.image_upload_enabled === true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getWebSearchCapability = (agent: CustomAgent): string => {
|
const getWebSearchCapabilityClass = (agent: CustomAgent): string => {
|
||||||
if (!isWebSearchEnabledForAgent(agent)) {
|
if (isWebSearchReadyForAgent(agent)) return 'detail-capability-tag--on';
|
||||||
return t('agent.capabilities.webSearchOff');
|
if (isWebSearchEnabledForAgent(agent)) return 'detail-capability-tag--warning';
|
||||||
}
|
return 'detail-capability-tag--off';
|
||||||
if (!isWebSearchReadyForAgent(agent)) {
|
|
||||||
return t('agent.capabilities.webSearchUnconfigured');
|
|
||||||
}
|
|
||||||
return t('agent.capabilities.webSearchOn');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getImageUploadCapability = (agent: CustomAgent): string => {
|
const getWebSearchCapabilityIcon = (agent: CustomAgent): string => {
|
||||||
|
if (isWebSearchReadyForAgent(agent)) return 'check';
|
||||||
|
if (isWebSearchEnabledForAgent(agent)) return 'error-circle';
|
||||||
|
return 'close';
|
||||||
|
};
|
||||||
|
|
||||||
|
const getWebSearchCapabilityState = (agent: CustomAgent): string => {
|
||||||
|
if (isWebSearchReadyForAgent(agent)) return t('agent.selector.capabilityEnabled');
|
||||||
|
if (isWebSearchEnabledForAgent(agent)) return t('agent.selector.capabilityUnconfigured');
|
||||||
|
return t('agent.selector.capabilityDisabled');
|
||||||
|
};
|
||||||
|
|
||||||
|
const getImageUploadCapabilityState = (agent: CustomAgent): string => {
|
||||||
return isImageUploadEnabledForAgent(agent)
|
return isImageUploadEnabledForAgent(agent)
|
||||||
? t('agent.capabilities.imageUploadOn')
|
? t('agent.selector.capabilitySupported')
|
||||||
: t('agent.capabilities.imageUploadOff');
|
: t('agent.selector.capabilityUnsupported');
|
||||||
};
|
};
|
||||||
|
|
||||||
const getMcpCapability = (agent: CustomAgent): string => {
|
const getMcpCapability = (agent: CustomAgent): string => {
|
||||||
@@ -1002,32 +1016,86 @@ watch(activeDetail, (detail) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.detail-capability-tag {
|
.detail-capability-tag {
|
||||||
gap: 4px;
|
gap: 5px;
|
||||||
padding: 3px 8px;
|
max-width: 100%;
|
||||||
|
padding: 3px 7px 3px 5px;
|
||||||
|
|
||||||
&--on {
|
.detail-capability-name {
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
color: var(--td-text-color-secondary);
|
color: var(--td-text-color-secondary);
|
||||||
border-color: var(--td-component-border);
|
font-weight: 500;
|
||||||
background: var(--td-bg-color-secondarycontainer);
|
|
||||||
|
|
||||||
.detail-capability-icon {
|
|
||||||
color: var(--td-text-color-primary);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&--off {
|
.detail-capability-state {
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 14px;
|
||||||
color: var(--td-text-color-placeholder);
|
color: var(--td-text-color-placeholder);
|
||||||
border-style: dashed;
|
|
||||||
border-color: var(--td-component-stroke);
|
|
||||||
background: transparent;
|
|
||||||
|
|
||||||
.detail-capability-icon {
|
|
||||||
color: var(--td-text-color-placeholder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.detail-capability-tag--on {
|
||||||
|
border-color: rgba(0, 168, 112, 0.2);
|
||||||
|
background: rgba(0, 168, 112, 0.06);
|
||||||
|
|
||||||
|
.detail-capability-icon-wrap {
|
||||||
|
color: var(--td-success-color, #00a870);
|
||||||
|
background: rgba(0, 168, 112, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-capability-icon {
|
||||||
|
color: var(--td-success-color, #00a870);
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-capability-state {
|
||||||
|
color: var(--td-success-color, #00a870);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-capability-tag--warning {
|
||||||
|
border-color: rgba(237, 123, 47, 0.22);
|
||||||
|
background: rgba(237, 123, 47, 0.06);
|
||||||
|
|
||||||
|
.detail-capability-icon-wrap {
|
||||||
|
color: var(--td-warning-color, #ed7b2f);
|
||||||
|
background: rgba(237, 123, 47, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-capability-icon,
|
||||||
|
.detail-capability-state {
|
||||||
|
color: var(--td-warning-color, #ed7b2f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-capability-tag--off {
|
||||||
|
border-color: var(--td-component-stroke);
|
||||||
|
background: var(--td-bg-color-secondarycontainer);
|
||||||
|
|
||||||
|
.detail-capability-icon-wrap {
|
||||||
|
color: var(--td-text-color-placeholder);
|
||||||
|
background: var(--td-bg-color-component, rgba(0, 0, 0, 0.04));
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-capability-icon {
|
||||||
|
color: var(--td-text-color-placeholder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-capability-icon-wrap {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
border-radius: 50%;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.detail-capability-icon {
|
.detail-capability-icon {
|
||||||
|
display: inline-flex;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1155,6 +1155,13 @@ export default {
|
|||||||
configureAction: 'Configure',
|
configureAction: 'Configure',
|
||||||
sharedNotReadyContact: 'Ask the sharing organization admin to finish setup',
|
sharedNotReadyContact: 'Ask the sharing organization admin to finish setup',
|
||||||
capabilitiesSection: 'Capabilities',
|
capabilitiesSection: 'Capabilities',
|
||||||
|
webSearchCapability: 'Web search',
|
||||||
|
imageUploadCapability: 'Image upload',
|
||||||
|
capabilityEnabled: 'On',
|
||||||
|
capabilityDisabled: 'Off',
|
||||||
|
capabilitySupported: 'Supported',
|
||||||
|
capabilityUnsupported: 'Unsupported',
|
||||||
|
capabilityUnconfigured: 'Not set',
|
||||||
},
|
},
|
||||||
// Built-in agent information
|
// Built-in agent information
|
||||||
builtinInfo: {
|
builtinInfo: {
|
||||||
|
|||||||
@@ -2170,6 +2170,13 @@ export default {
|
|||||||
configureAction: "구성",
|
configureAction: "구성",
|
||||||
sharedNotReadyContact: "공유한 조직 관리자에게 구성을 요청하세요",
|
sharedNotReadyContact: "공유한 조직 관리자에게 구성을 요청하세요",
|
||||||
capabilitiesSection: "능력",
|
capabilitiesSection: "능력",
|
||||||
|
webSearchCapability: "웹 검색",
|
||||||
|
imageUploadCapability: "이미지 업로드",
|
||||||
|
capabilityEnabled: "켜짐",
|
||||||
|
capabilityDisabled: "꺼짐",
|
||||||
|
capabilitySupported: "지원",
|
||||||
|
capabilityUnsupported: "미지원",
|
||||||
|
capabilityUnconfigured: "미구성",
|
||||||
},
|
},
|
||||||
// 내장 에이전트 정보
|
// 내장 에이전트 정보
|
||||||
builtinInfo: {
|
builtinInfo: {
|
||||||
|
|||||||
@@ -1069,6 +1069,13 @@ export default {
|
|||||||
configureAction: 'Configure',
|
configureAction: 'Configure',
|
||||||
sharedNotReadyContact: 'Ask the sharing organization admin to finish setup',
|
sharedNotReadyContact: 'Ask the sharing organization admin to finish setup',
|
||||||
capabilitiesSection: 'Возможности',
|
capabilitiesSection: 'Возможности',
|
||||||
|
webSearchCapability: 'Web search',
|
||||||
|
imageUploadCapability: 'Image upload',
|
||||||
|
capabilityEnabled: 'On',
|
||||||
|
capabilityDisabled: 'Off',
|
||||||
|
capabilitySupported: 'Supported',
|
||||||
|
capabilityUnsupported: 'Unsupported',
|
||||||
|
capabilityUnconfigured: 'Not set',
|
||||||
},
|
},
|
||||||
builtinInfo: {
|
builtinInfo: {
|
||||||
quickAnswer: {
|
quickAnswer: {
|
||||||
|
|||||||
@@ -2166,6 +2166,13 @@ export default {
|
|||||||
configureAction: "去配置",
|
configureAction: "去配置",
|
||||||
sharedNotReadyContact: "请联系分享方管理员完成配置",
|
sharedNotReadyContact: "请联系分享方管理员完成配置",
|
||||||
capabilitiesSection: "能力",
|
capabilitiesSection: "能力",
|
||||||
|
webSearchCapability: "网络搜索",
|
||||||
|
imageUploadCapability: "图片上传",
|
||||||
|
capabilityEnabled: "开启",
|
||||||
|
capabilityDisabled: "关闭",
|
||||||
|
capabilitySupported: "支持",
|
||||||
|
capabilityUnsupported: "不支持",
|
||||||
|
capabilityUnconfigured: "未配置",
|
||||||
},
|
},
|
||||||
// 内置智能体信息
|
// 内置智能体信息
|
||||||
builtinInfo: {
|
builtinInfo: {
|
||||||
|
|||||||
Reference in New Issue
Block a user