Skip to content

Commit f3660f9

Browse files
authored
Merge pull request #9223 from zexi/automated-cherry-pick-of-#9222-upstream-master
Automated cherry pick of #9222: fix(ai): 更新 LLM 规格时容器密钥显示凭证名称
2 parents 899e25e + 4f47948 commit f3660f9

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

containers/Ai/views/llm/dialogs/UpdateSpec.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
:params="credentialParamsForProvider(item.key)"
5555
:label-format="credentialLabelFormat"
5656
:extra-opts="credentialExtraOpts(openclawProviderCredentialId[item.key])"
57-
:selectProps="{ placeholder: $t('common.tips.select', [$t('aice.container_secret')]) }"
57+
:selectProps="{ placeholder: $t('common.tips.select', [$t('aice.container_secret')]), optionLabelProp: 'label' }"
5858
@change="val => onProviderCredentialChange(item.key, val)" />
5959
</a-form-item>
6060
<a-form-item :label="$t('aice.container_secret.export_keys')" :extra="$t('aice.container_secret.export_keys_tip')">
@@ -159,7 +159,7 @@
159159
:params="credentialParamsForChannel(section.sectionKey)"
160160
:label-format="credentialLabelFormat"
161161
:extra-opts="credentialExtraOpts(openclawChannelCredentialId[section.sectionKey])"
162-
:selectProps="{ placeholder: $t('common.tips.select', [$t('aice.container_secret')]) }"
162+
:selectProps="{ placeholder: $t('common.tips.select', [$t('aice.container_secret')]), optionLabelProp: 'label' }"
163163
@change="val => onChannelCredentialChange(section.sectionKey, val)" />
164164
</a-form-item>
165165
<a-form-item :label="$t('aice.container_secret.export_keys')" :extra="$t('aice.container_secret.export_keys_tip')">
@@ -542,6 +542,9 @@ export default {
542542
this.ensureProviderState(labelKey)
543543
const cred = p.credential || {}
544544
if (cred.id) {
545+
if (cred.name) {
546+
this.$set(this.credentialNameMap, String(cred.id), cred.name)
547+
}
545548
this.$set(this.openclawProviderCredentialMode, labelKey, 'existing')
546549
this.$set(this.openclawProviderCredentialId, labelKey, cred.id)
547550
const exportKeys = cred.export_keys || []
@@ -570,6 +573,9 @@ export default {
570573
this.ensureChannelState(key)
571574
const cred = item.credential || {}
572575
if (cred.id) {
576+
if (cred.name) {
577+
this.$set(this.credentialNameMap, String(cred.id), cred.name)
578+
}
573579
this.$set(this.openclawChannelCredentialMode, key, 'existing')
574580
this.$set(this.openclawChannelCredentialId, key, cred.id)
575581
const exportKeys = cred.export_keys || []
@@ -599,6 +605,9 @@ export default {
599605
const cred = item.credential || item || {}
600606
const id = cred.id
601607
if (id) {
608+
if (cred.name) {
609+
this.$set(this.credentialNameMap, String(id), cred.name)
610+
}
602611
this.$set(this.openclawChannelCredentialMode, key, 'existing')
603612
this.$set(this.openclawChannelCredentialId, key, id)
604613
const exportKeys = cred.export_keys || []
@@ -656,6 +665,11 @@ export default {
656665
if (!credentialId) return []
657666
const manager = new this.$Manager('credentials', 'v1')
658667
const { data } = await manager.get({ id: credentialId })
668+
const idStr = String(credentialId)
669+
const credName = data && data.name
670+
if (credName) {
671+
this.$set(this.credentialNameMap, idStr, credName)
672+
}
659673
const blob = data?.blob
660674
let obj = blob
661675
if (typeof blob === 'string') {

0 commit comments

Comments
 (0)