codexmate 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/README.vi.md +1 -0
- package/README.zh.md +1 -0
- package/cli.js +130 -3
- package/package.json +1 -1
- package/web-ui/app.js +5 -10
- package/web-ui/index.html +1 -0
- package/web-ui/modules/app.methods.pi-config.mjs +208 -120
- package/web-ui/modules/i18n/locales/en.mjs +13 -0
- package/web-ui/modules/i18n/locales/ja.mjs +13 -0
- package/web-ui/modules/i18n/locales/vi.mjs +13 -0
- package/web-ui/modules/i18n/locales/zh-tw.mjs +13 -0
- package/web-ui/modules/i18n/locales/zh.mjs +13 -0
- package/web-ui/modules/pi-provider-templates.mjs +26 -0
- package/web-ui/partials/index/modals-pi-provider.html +96 -0
- package/web-ui/partials/index/panel-config-pi.html +0 -122
- package/web-ui/res/web-ui-render.precompiled.js +323 -348
- package/web-ui/styles/settings-panel.css +12 -0
|
@@ -3276,350 +3276,6 @@ return function render(_ctx, _cache) {
|
|
|
3276
3276
|
}, _toDisplayString(_ctx.t('pi.providers.empty')), 1 /* TEXT */))
|
|
3277
3277
|
: _createCommentVNode("v-if", true)
|
|
3278
3278
|
]),
|
|
3279
|
-
(_ctx.editingPiProvider)
|
|
3280
|
-
? (_openBlock(), _createElementBlock("section", {
|
|
3281
|
-
key: 0,
|
|
3282
|
-
class: "selector-section"
|
|
3283
|
-
}, [
|
|
3284
|
-
_createElementVNode("div", { class: "selector-header" }, [
|
|
3285
|
-
_createElementVNode("span", { class: "selector-title" }, _toDisplayString(_ctx.t('pi.providers.editorTitle')), 1 /* TEXT */),
|
|
3286
|
-
_createElementVNode("div", { class: "settings-tab-actions" }, [
|
|
3287
|
-
_createElementVNode("button", {
|
|
3288
|
-
type: "button",
|
|
3289
|
-
class: "btn-tool",
|
|
3290
|
-
onClick: _ctx.savePiProvider,
|
|
3291
|
-
disabled: !_ctx.isToolConfigWriteAllowed('pi') || _ctx.piSaving
|
|
3292
|
-
}, _toDisplayString(_ctx.t('common.save')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
|
|
3293
|
-
])
|
|
3294
|
-
]),
|
|
3295
|
-
_createElementVNode("div", { class: "codex-config-grid" }, [
|
|
3296
|
-
_createElementVNode("div", { class: "form-group codex-config-field" }, [
|
|
3297
|
-
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.fields.name')), 1 /* TEXT */),
|
|
3298
|
-
_createElementVNode("input", {
|
|
3299
|
-
class: "form-input",
|
|
3300
|
-
type: "text",
|
|
3301
|
-
value: _ctx.piProviderName(_ctx.editingPiProvider.id),
|
|
3302
|
-
readonly: ""
|
|
3303
|
-
}, null, 8 /* PROPS */, ["value"])
|
|
3304
|
-
]),
|
|
3305
|
-
_createElementVNode("div", { class: "form-group codex-config-field" }, [
|
|
3306
|
-
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.fields.baseUrl')), 1 /* TEXT */),
|
|
3307
|
-
_withDirectives(_createElementVNode("input", {
|
|
3308
|
-
class: "form-input",
|
|
3309
|
-
type: "url",
|
|
3310
|
-
"onUpdate:modelValue": $event => ((_ctx.editingPiProvider.form.baseUrl) = $event),
|
|
3311
|
-
autocomplete: "off",
|
|
3312
|
-
spellcheck: "false",
|
|
3313
|
-
placeholder: "https://"
|
|
3314
|
-
}, null, 8 /* PROPS */, ["onUpdate:modelValue"]), [
|
|
3315
|
-
[_vModelText, _ctx.editingPiProvider.form.baseUrl]
|
|
3316
|
-
])
|
|
3317
|
-
]),
|
|
3318
|
-
_createElementVNode("div", { class: "form-group codex-config-field" }, [
|
|
3319
|
-
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.fields.api')), 1 /* TEXT */),
|
|
3320
|
-
_withDirectives(_createElementVNode("select", {
|
|
3321
|
-
class: "form-input",
|
|
3322
|
-
"onUpdate:modelValue": $event => ((_ctx.editingPiProvider.form.api) = $event),
|
|
3323
|
-
disabled: !_ctx.isToolConfigWriteAllowed('pi')
|
|
3324
|
-
}, [
|
|
3325
|
-
_createElementVNode("option", { value: "openai-completions" }, "openai-completions — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.openaiCompletions')), 1 /* TEXT */),
|
|
3326
|
-
_createElementVNode("option", { value: "openai-responses" }, "openai-responses — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.openaiResponses')), 1 /* TEXT */),
|
|
3327
|
-
_createElementVNode("option", { value: "anthropic-messages" }, "anthropic-messages — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.anthropicMessages')), 1 /* TEXT */),
|
|
3328
|
-
_createElementVNode("option", { value: "google-generative-ai" }, "google-generative-ai — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.googleGenerativeAi')), 1 /* TEXT */),
|
|
3329
|
-
(!['openai-completions', 'openai-responses', 'anthropic-messages', 'google-generative-ai'].includes(_ctx.editingPiProvider.form.api))
|
|
3330
|
-
? (_openBlock(), _createElementBlock("option", {
|
|
3331
|
-
key: 0,
|
|
3332
|
-
value: _ctx.editingPiProvider.form.api
|
|
3333
|
-
}, _toDisplayString(_ctx.editingPiProvider.form.api || '—'), 9 /* TEXT, PROPS */, ["value"]))
|
|
3334
|
-
: _createCommentVNode("v-if", true)
|
|
3335
|
-
], 8 /* PROPS */, ["onUpdate:modelValue", "disabled"]), [
|
|
3336
|
-
[_vModelSelect, _ctx.editingPiProvider.form.api]
|
|
3337
|
-
])
|
|
3338
|
-
]),
|
|
3339
|
-
_createElementVNode("div", { class: "form-group codex-config-field" }, [
|
|
3340
|
-
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.fields.apiKey')), 1 /* TEXT */),
|
|
3341
|
-
_createElementVNode("div", { class: "input-with-toggle" }, [
|
|
3342
|
-
_withDirectives(_createElementVNode("input", {
|
|
3343
|
-
class: "form-input",
|
|
3344
|
-
"onUpdate:modelValue": $event => ((_ctx.editingPiProvider.form.apiKey) = $event),
|
|
3345
|
-
type: _ctx.piShowKey ? 'text' : 'password',
|
|
3346
|
-
autocomplete: "off",
|
|
3347
|
-
spellcheck: "false",
|
|
3348
|
-
placeholder: "sk-..."
|
|
3349
|
-
}, null, 8 /* PROPS */, ["onUpdate:modelValue", "type"]), [
|
|
3350
|
-
[_vModelDynamic, _ctx.editingPiProvider.form.apiKey]
|
|
3351
|
-
]),
|
|
3352
|
-
_createElementVNode("button", {
|
|
3353
|
-
type: "button",
|
|
3354
|
-
class: "input-toggle-btn",
|
|
3355
|
-
onMousedown: _withModifiers(() => {}, ["prevent"]),
|
|
3356
|
-
onClick: $event => (_ctx.piShowKey = !_ctx.piShowKey),
|
|
3357
|
-
title: _ctx.piShowKey ? _ctx.t('common.hide') : _ctx.t('common.show'),
|
|
3358
|
-
"aria-label": _ctx.piShowKey ? _ctx.t('common.hide') : _ctx.t('common.show')
|
|
3359
|
-
}, [
|
|
3360
|
-
(!_ctx.piShowKey)
|
|
3361
|
-
? (_openBlock(), _createElementBlock("svg", {
|
|
3362
|
-
key: 0,
|
|
3363
|
-
viewBox: "0 0 20 20",
|
|
3364
|
-
fill: "none",
|
|
3365
|
-
stroke: "currentColor",
|
|
3366
|
-
"stroke-width": "1.5",
|
|
3367
|
-
width: "16",
|
|
3368
|
-
height: "16"
|
|
3369
|
-
}, [
|
|
3370
|
-
_createElementVNode("path", { d: "M10 4C5 4 1.73 8.11 1 10c.73 1.89 4 6 9 6s8.27-4.11 9-6c-.73-1.89-4-6-9-6z" }),
|
|
3371
|
-
_createElementVNode("circle", {
|
|
3372
|
-
cx: "10",
|
|
3373
|
-
cy: "10",
|
|
3374
|
-
r: "3"
|
|
3375
|
-
})
|
|
3376
|
-
]))
|
|
3377
|
-
: (_openBlock(), _createElementBlock("svg", {
|
|
3378
|
-
key: 1,
|
|
3379
|
-
viewBox: "0 0 20 20",
|
|
3380
|
-
fill: "none",
|
|
3381
|
-
stroke: "currentColor",
|
|
3382
|
-
"stroke-width": "1.5",
|
|
3383
|
-
width: "16",
|
|
3384
|
-
height: "16"
|
|
3385
|
-
}, [
|
|
3386
|
-
_createElementVNode("path", { d: "M2 2l16 16M8.2 4.2A9.9 9.9 0 0 1 10 4c5 0 8.27 4.11 9 6-.44.94-1.5 2.7-3.2 4.2M14.5 14.5A5.9 5.9 0 0 1 10 16c-5 0-8.27-4.11-9-6 .76-1.66 2.2-3.6 4.3-5" })
|
|
3387
|
-
]))
|
|
3388
|
-
], 40 /* PROPS, NEED_HYDRATION */, ["onMousedown", "onClick", "title", "aria-label"])
|
|
3389
|
-
])
|
|
3390
|
-
])
|
|
3391
|
-
]),
|
|
3392
|
-
_createElementVNode("div", { class: "form-group" }, [
|
|
3393
|
-
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.fields.models')), 1 /* TEXT */),
|
|
3394
|
-
(_ctx.piRemoteModelsLoading)
|
|
3395
|
-
? (_openBlock(), _createElementBlock("p", {
|
|
3396
|
-
key: 0,
|
|
3397
|
-
class: "config-template-hint"
|
|
3398
|
-
}, _toDisplayString(_ctx.t('pi.providers.models.remoteLoading')), 1 /* TEXT */))
|
|
3399
|
-
: (_ctx.piRemoteModelError)
|
|
3400
|
-
? (_openBlock(), _createElementBlock("p", {
|
|
3401
|
-
key: 1,
|
|
3402
|
-
class: "config-template-hint"
|
|
3403
|
-
}, _toDisplayString(_ctx.piRemoteModelError) + " · " + _toDisplayString(_ctx.t('pi.providers.models.remoteFailed')), 1 /* TEXT */))
|
|
3404
|
-
: _createCommentVNode("v-if", true),
|
|
3405
|
-
_createElementVNode("div", { class: "card-list" }, [
|
|
3406
|
-
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.editingPiProvider.form.models, (model, index) => {
|
|
3407
|
-
return (_openBlock(), _createElementBlock("div", {
|
|
3408
|
-
class: "card",
|
|
3409
|
-
key: index
|
|
3410
|
-
}, [
|
|
3411
|
-
_createElementVNode("div", { class: "input-with-toggle" }, [
|
|
3412
|
-
_withDirectives(_createElementVNode("input", {
|
|
3413
|
-
class: "form-input",
|
|
3414
|
-
type: "text",
|
|
3415
|
-
"onUpdate:modelValue": $event => ((model.id) = $event),
|
|
3416
|
-
autocomplete: "off",
|
|
3417
|
-
spellcheck: "false",
|
|
3418
|
-
placeholder: "claude-sonnet-4",
|
|
3419
|
-
disabled: !_ctx.isToolConfigWriteAllowed('pi'),
|
|
3420
|
-
onInput: $event => (_ctx.piModelSearch = model.id)
|
|
3421
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */, ["onUpdate:modelValue", "disabled", "onInput"]), [
|
|
3422
|
-
[_vModelText, model.id]
|
|
3423
|
-
]),
|
|
3424
|
-
_createElementVNode("button", {
|
|
3425
|
-
type: "button",
|
|
3426
|
-
class: "btn-tool input-toggle-btn",
|
|
3427
|
-
onClick: $event => (_ctx.editingPiProvider.form.models.splice(index, 1)),
|
|
3428
|
-
disabled: !_ctx.isToolConfigWriteAllowed('pi')
|
|
3429
|
-
}, _toDisplayString(_ctx.t('pi.providers.models.remove')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
|
|
3430
|
-
])
|
|
3431
|
-
]))
|
|
3432
|
-
}), 128 /* KEYED_FRAGMENT */)),
|
|
3433
|
-
(_ctx.editingPiProvider.form.models.length === 0)
|
|
3434
|
-
? (_openBlock(), _createElementBlock("div", {
|
|
3435
|
-
key: 0,
|
|
3436
|
-
class: "card"
|
|
3437
|
-
}, [
|
|
3438
|
-
_withDirectives(_createElementVNode("input", {
|
|
3439
|
-
class: "form-input",
|
|
3440
|
-
type: "text",
|
|
3441
|
-
"onUpdate:modelValue": $event => ((_ctx.piModelSearch) = $event),
|
|
3442
|
-
autocomplete: "off",
|
|
3443
|
-
spellcheck: "false",
|
|
3444
|
-
placeholder: _ctx.t('pi.providers.models.search'),
|
|
3445
|
-
onKeydown: _withKeys(_withModifiers($event => (_ctx.addPiRemoteModel(_ctx.piModelSearch.trim())), ["prevent"]), ["enter"])
|
|
3446
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */, ["onUpdate:modelValue", "placeholder", "onKeydown"]), [
|
|
3447
|
-
[_vModelText, _ctx.piModelSearch]
|
|
3448
|
-
])
|
|
3449
|
-
]))
|
|
3450
|
-
: _createCommentVNode("v-if", true),
|
|
3451
|
-
(!_ctx.piRemoteModelsLoading && !_ctx.piRemoteModelError && _ctx.piModelSearch.trim() && _ctx.piFilteredRemoteModels().length > 0)
|
|
3452
|
-
? (_openBlock(), _createElementBlock("div", {
|
|
3453
|
-
key: 1,
|
|
3454
|
-
class: "card"
|
|
3455
|
-
}, [
|
|
3456
|
-
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.piFilteredRemoteModels(), (id) => {
|
|
3457
|
-
return (_openBlock(), _createElementBlock("button", {
|
|
3458
|
-
type: "button",
|
|
3459
|
-
class: "btn-tool",
|
|
3460
|
-
style: {"width":"100%","text-align":"left","justify-content":"flex-start"},
|
|
3461
|
-
key: id,
|
|
3462
|
-
onClick: $event => (_ctx.addPiRemoteModel(id))
|
|
3463
|
-
}, _toDisplayString(id), 9 /* TEXT, PROPS */, ["onClick"]))
|
|
3464
|
-
}), 128 /* KEYED_FRAGMENT */)),
|
|
3465
|
-
_createElementVNode("p", { class: "config-template-hint" }, _toDisplayString(_ctx.t('pi.providers.models.remoteCount', { count: _ctx.piRemoteModels.length })), 1 /* TEXT */)
|
|
3466
|
-
]))
|
|
3467
|
-
: _createCommentVNode("v-if", true),
|
|
3468
|
-
(!_ctx.piRemoteModelsLoading && !_ctx.piRemoteModelError && _ctx.piModelSearch.trim() && _ctx.piFilteredRemoteModels().length === 0)
|
|
3469
|
-
? (_openBlock(), _createElementBlock("p", {
|
|
3470
|
-
key: 2,
|
|
3471
|
-
class: "config-template-hint"
|
|
3472
|
-
}, _toDisplayString(_ctx.t('pi.providers.models.noMatch')), 1 /* TEXT */))
|
|
3473
|
-
: _createCommentVNode("v-if", true)
|
|
3474
|
-
])
|
|
3475
|
-
]),
|
|
3476
|
-
_createElementVNode("div", { class: "settings-tab-actions" }, [
|
|
3477
|
-
_createElementVNode("button", {
|
|
3478
|
-
type: "button",
|
|
3479
|
-
class: "btn-tool",
|
|
3480
|
-
onClick: _ctx.confirmDeletePiProvider,
|
|
3481
|
-
disabled: !_ctx.isToolConfigWriteAllowed('pi') || _ctx.piSaving
|
|
3482
|
-
}, _toDisplayString(_ctx.t('pi.providers.delete')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
|
|
3483
|
-
]),
|
|
3484
|
-
_createElementVNode("section", { class: "selector-section" }, [
|
|
3485
|
-
_createElementVNode("div", { class: "selector-header" }, [
|
|
3486
|
-
_createElementVNode("span", { class: "selector-title" }, _toDisplayString(_ctx.t('pi.providers.json.title')), 1 /* TEXT */)
|
|
3487
|
-
]),
|
|
3488
|
-
_createElementVNode("p", { class: "config-template-hint" }, _toDisplayString(_ctx.t('pi.providers.json.desc')), 1 /* TEXT */),
|
|
3489
|
-
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.json.previewTitle')), 1 /* TEXT */),
|
|
3490
|
-
_createElementVNode("pre", { class: "config-json-preview" }, _toDisplayString(_ctx.piProviderPreviewJson()), 1 /* TEXT */),
|
|
3491
|
-
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.json.editTitle')), 1 /* TEXT */),
|
|
3492
|
-
_withDirectives(_createElementVNode("textarea", {
|
|
3493
|
-
class: "template-textarea config-json-editor",
|
|
3494
|
-
"onUpdate:modelValue": $event => ((_ctx.editingPiProvider.form.configJsonDraft) = $event),
|
|
3495
|
-
spellcheck: "false",
|
|
3496
|
-
autocomplete: "off",
|
|
3497
|
-
disabled: !_ctx.isToolConfigWriteAllowed('pi'),
|
|
3498
|
-
onInput: _ctx.piEditorJsonDraftInput,
|
|
3499
|
-
placeholder: "{}"
|
|
3500
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */, ["onUpdate:modelValue", "disabled", "onInput"]), [
|
|
3501
|
-
[_vModelText, _ctx.editingPiProvider.form.configJsonDraft]
|
|
3502
|
-
]),
|
|
3503
|
-
(_ctx.piEditorJsonError)
|
|
3504
|
-
? (_openBlock(), _createElementBlock("p", {
|
|
3505
|
-
key: 0,
|
|
3506
|
-
class: "config-template-hint error-text"
|
|
3507
|
-
}, _toDisplayString(_ctx.piEditorJsonError), 1 /* TEXT */))
|
|
3508
|
-
: _createCommentVNode("v-if", true)
|
|
3509
|
-
])
|
|
3510
|
-
]))
|
|
3511
|
-
: _createCommentVNode("v-if", true),
|
|
3512
|
-
(_ctx.showAddPiProviderModal)
|
|
3513
|
-
? (_openBlock(), _createElementBlock("section", {
|
|
3514
|
-
key: 1,
|
|
3515
|
-
class: "selector-section"
|
|
3516
|
-
}, [
|
|
3517
|
-
_createElementVNode("div", { class: "selector-header" }, [
|
|
3518
|
-
_createElementVNode("span", { class: "selector-title" }, _toDisplayString(_ctx.t('pi.providers.addModal.title')), 1 /* TEXT */),
|
|
3519
|
-
_createElementVNode("div", { class: "settings-tab-actions" }, [
|
|
3520
|
-
_createElementVNode("button", {
|
|
3521
|
-
type: "button",
|
|
3522
|
-
class: "btn-tool",
|
|
3523
|
-
onClick: _ctx.addPiProviderFromModal,
|
|
3524
|
-
disabled: !_ctx.isToolConfigWriteAllowed('pi') || _ctx.piSaving
|
|
3525
|
-
}, _toDisplayString(_ctx.t('common.save')), 9 /* TEXT, PROPS */, ["onClick", "disabled"]),
|
|
3526
|
-
_createElementVNode("button", {
|
|
3527
|
-
type: "button",
|
|
3528
|
-
class: "btn-tool",
|
|
3529
|
-
onClick: _ctx.cancelAddPiProviderModal
|
|
3530
|
-
}, _toDisplayString(_ctx.t('common.cancel')), 9 /* TEXT, PROPS */, ["onClick"])
|
|
3531
|
-
])
|
|
3532
|
-
]),
|
|
3533
|
-
_createElementVNode("div", { class: "config-template-hint" }, _toDisplayString(_ctx.t('pi.providers.addModal.subtitle')), 1 /* TEXT */),
|
|
3534
|
-
_createElementVNode("div", { class: "codex-config-grid" }, [
|
|
3535
|
-
_createElementVNode("div", { class: "form-group codex-config-field" }, [
|
|
3536
|
-
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.addModal.fields.baseUrl')), 1 /* TEXT */),
|
|
3537
|
-
_withDirectives(_createElementVNode("input", {
|
|
3538
|
-
class: "form-input",
|
|
3539
|
-
type: "url",
|
|
3540
|
-
"onUpdate:modelValue": $event => ((_ctx.addingPiProviderBaseUrl) = $event),
|
|
3541
|
-
autocomplete: "off",
|
|
3542
|
-
spellcheck: "false",
|
|
3543
|
-
placeholder: "https://",
|
|
3544
|
-
onInput: _ctx.onAddingPiEndpointChange
|
|
3545
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */, ["onUpdate:modelValue", "onInput"]), [
|
|
3546
|
-
[_vModelText, _ctx.addingPiProviderBaseUrl]
|
|
3547
|
-
])
|
|
3548
|
-
]),
|
|
3549
|
-
_createElementVNode("div", { class: "form-group codex-config-field" }, [
|
|
3550
|
-
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.addModal.fields.api')), 1 /* TEXT */),
|
|
3551
|
-
_withDirectives(_createElementVNode("select", {
|
|
3552
|
-
class: "form-input",
|
|
3553
|
-
"onUpdate:modelValue": $event => ((_ctx.addingPiProviderApi) = $event)
|
|
3554
|
-
}, [
|
|
3555
|
-
_createElementVNode("option", { value: "openai-completions" }, "openai-completions — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.openaiCompletions')), 1 /* TEXT */),
|
|
3556
|
-
_createElementVNode("option", { value: "openai-responses" }, "openai-responses — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.openaiResponses')), 1 /* TEXT */),
|
|
3557
|
-
_createElementVNode("option", { value: "anthropic-messages" }, "anthropic-messages — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.anthropicMessages')), 1 /* TEXT */),
|
|
3558
|
-
_createElementVNode("option", { value: "google-generative-ai" }, "google-generative-ai — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.googleGenerativeAi')), 1 /* TEXT */)
|
|
3559
|
-
], 8 /* PROPS */, ["onUpdate:modelValue"]), [
|
|
3560
|
-
[_vModelSelect, _ctx.addingPiProviderApi]
|
|
3561
|
-
])
|
|
3562
|
-
]),
|
|
3563
|
-
_createElementVNode("div", { class: "form-group codex-config-field" }, [
|
|
3564
|
-
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.addModal.fields.apiKey')), 1 /* TEXT */),
|
|
3565
|
-
_withDirectives(_createElementVNode("input", {
|
|
3566
|
-
class: "form-input",
|
|
3567
|
-
type: "password",
|
|
3568
|
-
"onUpdate:modelValue": $event => ((_ctx.addingPiProviderApiKey) = $event),
|
|
3569
|
-
autocomplete: "off",
|
|
3570
|
-
spellcheck: "false",
|
|
3571
|
-
placeholder: _ctx.t('common.optional'),
|
|
3572
|
-
onInput: _ctx.onAddingPiEndpointChange
|
|
3573
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */, ["onUpdate:modelValue", "placeholder", "onInput"]), [
|
|
3574
|
-
[_vModelText, _ctx.addingPiProviderApiKey]
|
|
3575
|
-
])
|
|
3576
|
-
]),
|
|
3577
|
-
_createElementVNode("div", { class: "form-group codex-config-field" }, [
|
|
3578
|
-
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.fields.models')), 1 /* TEXT */),
|
|
3579
|
-
(_ctx.addingPiRemoteLoading)
|
|
3580
|
-
? (_openBlock(), _createElementBlock("p", {
|
|
3581
|
-
key: 0,
|
|
3582
|
-
class: "config-template-hint"
|
|
3583
|
-
}, _toDisplayString(_ctx.t('pi.providers.models.remoteLoading')), 1 /* TEXT */))
|
|
3584
|
-
: (_ctx.addingPiRemoteError)
|
|
3585
|
-
? (_openBlock(), _createElementBlock("p", {
|
|
3586
|
-
key: 1,
|
|
3587
|
-
class: "config-template-hint"
|
|
3588
|
-
}, _toDisplayString(_ctx.addingPiRemoteError) + " · " + _toDisplayString(_ctx.t('pi.providers.models.remoteFailed')), 1 /* TEXT */))
|
|
3589
|
-
: _createCommentVNode("v-if", true),
|
|
3590
|
-
_withDirectives(_createElementVNode("input", {
|
|
3591
|
-
class: "form-input",
|
|
3592
|
-
type: "text",
|
|
3593
|
-
"onUpdate:modelValue": $event => ((_ctx.addingPiProviderModel) = $event),
|
|
3594
|
-
autocomplete: "off",
|
|
3595
|
-
spellcheck: "false",
|
|
3596
|
-
placeholder: _ctx.addingPiRemoteModels.length ? _ctx.t('pi.providers.models.search') : 'claude-sonnet-4'
|
|
3597
|
-
}, null, 8 /* PROPS */, ["onUpdate:modelValue", "placeholder"]), [
|
|
3598
|
-
[_vModelText, _ctx.addingPiProviderModel]
|
|
3599
|
-
]),
|
|
3600
|
-
(!_ctx.addingPiRemoteLoading && _ctx.addingPiProviderModel.trim() && _ctx.piFilteredAddingRemoteModels().length > 0)
|
|
3601
|
-
? (_openBlock(), _createElementBlock(_Fragment, { key: 2 }, [
|
|
3602
|
-
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.piFilteredAddingRemoteModels(), (id) => {
|
|
3603
|
-
return (_openBlock(), _createElementBlock("button", {
|
|
3604
|
-
type: "button",
|
|
3605
|
-
class: "btn-tool",
|
|
3606
|
-
style: {"width":"100%","text-align":"left","justify-content":"flex-start","margin-top":"8px"},
|
|
3607
|
-
key: id,
|
|
3608
|
-
onClick: $event => (_ctx.addingPiProviderModel = id)
|
|
3609
|
-
}, _toDisplayString(id), 9 /* TEXT, PROPS */, ["onClick"]))
|
|
3610
|
-
}), 128 /* KEYED_FRAGMENT */)),
|
|
3611
|
-
_createElementVNode("p", { class: "config-template-hint" }, _toDisplayString(_ctx.t('pi.providers.models.remoteCount', { count: _ctx.addingPiRemoteModels.length })), 1 /* TEXT */)
|
|
3612
|
-
], 64 /* STABLE_FRAGMENT */))
|
|
3613
|
-
: (!_ctx.addingPiRemoteLoading && !_ctx.addingPiRemoteError && _ctx.addingPiProviderModel.trim() && _ctx.addingPiRemoteModels.length > 0)
|
|
3614
|
-
? (_openBlock(), _createElementBlock("p", {
|
|
3615
|
-
key: 3,
|
|
3616
|
-
class: "config-template-hint"
|
|
3617
|
-
}, _toDisplayString(_ctx.t('pi.providers.models.noMatch')), 1 /* TEXT */))
|
|
3618
|
-
: _createCommentVNode("v-if", true)
|
|
3619
|
-
])
|
|
3620
|
-
])
|
|
3621
|
-
]))
|
|
3622
|
-
: _createCommentVNode("v-if", true),
|
|
3623
3279
|
_createElementVNode("section", { class: "selector-section" }, [
|
|
3624
3280
|
_createElementVNode("div", { class: "selector-header" }, [
|
|
3625
3281
|
_createElementVNode("span", { class: "selector-title" }, _toDisplayString(_ctx.t('pi.files.title')), 1 /* TEXT */)
|
|
@@ -3824,7 +3480,7 @@ return function render(_ctx, _cache) {
|
|
|
3824
3480
|
]),
|
|
3825
3481
|
(!_ctx.isToolConfigWriteAllowed('pi'))
|
|
3826
3482
|
? (_openBlock(), _createElementBlock("div", {
|
|
3827
|
-
key:
|
|
3483
|
+
key: 0,
|
|
3828
3484
|
class: "tool-config-write-overlay"
|
|
3829
3485
|
}, [
|
|
3830
3486
|
_createElementVNode("div", { class: "tool-config-write-overlay-card" }, [
|
|
@@ -3844,6 +3500,325 @@ return function render(_ctx, _cache) {
|
|
|
3844
3500
|
], 8 /* PROPS */, ["aria-labelledby"]), [
|
|
3845
3501
|
[_vShow, _ctx.mainTab === 'config' && _ctx.configMode === 'pi']
|
|
3846
3502
|
]),
|
|
3503
|
+
_createCommentVNode(" Pi 新增供应商模板选择模态框 "),
|
|
3504
|
+
(_ctx.showAddPiProviderModal && !_ctx.editingPiProvider)
|
|
3505
|
+
? (_openBlock(), _createElementBlock("div", {
|
|
3506
|
+
key: 0,
|
|
3507
|
+
class: "modal-overlay",
|
|
3508
|
+
onClick: _withModifiers(_ctx.cancelAddPiProviderModal, ["self"])
|
|
3509
|
+
}, [
|
|
3510
|
+
_createElementVNode("div", {
|
|
3511
|
+
class: "modal modal-wide",
|
|
3512
|
+
role: "dialog",
|
|
3513
|
+
"aria-modal": "true",
|
|
3514
|
+
"aria-labelledby": "pi-provider-picker-modal-title"
|
|
3515
|
+
}, [
|
|
3516
|
+
_createElementVNode("div", {
|
|
3517
|
+
class: "modal-title",
|
|
3518
|
+
id: "pi-provider-picker-modal-title"
|
|
3519
|
+
}, _toDisplayString(_ctx.t('pi.providers.addModal.title')), 1 /* TEXT */),
|
|
3520
|
+
_createElementVNode("div", { class: "config-template-hint" }, _toDisplayString(_ctx.t('pi.providers.addModal.subtitle')), 1 /* TEXT */),
|
|
3521
|
+
_createElementVNode("div", { class: "pi-picker" }, [
|
|
3522
|
+
_withDirectives(_createElementVNode("input", {
|
|
3523
|
+
class: "form-input",
|
|
3524
|
+
type: "text",
|
|
3525
|
+
"onUpdate:modelValue": $event => ((_ctx.piProviderPickerQuery) = $event),
|
|
3526
|
+
autocomplete: "off",
|
|
3527
|
+
spellcheck: "false",
|
|
3528
|
+
placeholder: _ctx.t('pi.picker.searchPlaceholder')
|
|
3529
|
+
}, null, 8 /* PROPS */, ["onUpdate:modelValue", "placeholder"]), [
|
|
3530
|
+
[_vModelText, _ctx.piProviderPickerQuery]
|
|
3531
|
+
]),
|
|
3532
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.piProviderTemplateGroups(), (group) => {
|
|
3533
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
3534
|
+
class: "pi-picker-group",
|
|
3535
|
+
key: group.id
|
|
3536
|
+
}, [
|
|
3537
|
+
_createElementVNode("div", { class: "pi-picker-group-title" }, _toDisplayString(_ctx.t(group.i18nKey)), 1 /* TEXT */),
|
|
3538
|
+
_createElementVNode("div", { class: "pi-picker-grid" }, [
|
|
3539
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(group.templates, (tpl) => {
|
|
3540
|
+
return (_openBlock(), _createElementBlock("button", {
|
|
3541
|
+
type: "button",
|
|
3542
|
+
class: "card pi-picker-card",
|
|
3543
|
+
key: tpl.id,
|
|
3544
|
+
onClick: $event => (_ctx.selectPiProviderTemplate(tpl.id))
|
|
3545
|
+
}, [
|
|
3546
|
+
_createElementVNode("span", { class: "card-icon" }, _toDisplayString(tpl.name.charAt(0).toUpperCase()), 1 /* TEXT */),
|
|
3547
|
+
_createElementVNode("span", { class: "pi-picker-card-name" }, _toDisplayString(tpl.name), 1 /* TEXT */),
|
|
3548
|
+
(tpl.baseUrl)
|
|
3549
|
+
? (_openBlock(), _createElementBlock("span", {
|
|
3550
|
+
key: 0,
|
|
3551
|
+
class: "pi-picker-card-url"
|
|
3552
|
+
}, _toDisplayString(tpl.baseUrl), 1 /* TEXT */))
|
|
3553
|
+
: _createCommentVNode("v-if", true)
|
|
3554
|
+
], 8 /* PROPS */, ["onClick"]))
|
|
3555
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
3556
|
+
])
|
|
3557
|
+
]))
|
|
3558
|
+
}), 128 /* KEYED_FRAGMENT */)),
|
|
3559
|
+
(_ctx.piProviderPickerQuery.trim() && !_ctx.piProviderTemplateGroups().length)
|
|
3560
|
+
? (_openBlock(), _createElementBlock("p", {
|
|
3561
|
+
key: 0,
|
|
3562
|
+
class: "config-template-hint"
|
|
3563
|
+
}, _toDisplayString(_ctx.t('pi.picker.empty')), 1 /* TEXT */))
|
|
3564
|
+
: _createCommentVNode("v-if", true)
|
|
3565
|
+
]),
|
|
3566
|
+
_createElementVNode("div", { class: "btn-group" }, [
|
|
3567
|
+
_createElementVNode("button", {
|
|
3568
|
+
class: "btn btn-cancel",
|
|
3569
|
+
onClick: _ctx.cancelAddPiProviderModal
|
|
3570
|
+
}, _toDisplayString(_ctx.t('common.cancel')), 9 /* TEXT, PROPS */, ["onClick"])
|
|
3571
|
+
])
|
|
3572
|
+
])
|
|
3573
|
+
], 8 /* PROPS */, ["onClick"]))
|
|
3574
|
+
: _createCommentVNode("v-if", true),
|
|
3575
|
+
_createCommentVNode(" Pi 供应商编辑器模态框 "),
|
|
3576
|
+
(_ctx.editingPiProvider)
|
|
3577
|
+
? (_openBlock(), _createElementBlock("div", {
|
|
3578
|
+
key: 1,
|
|
3579
|
+
class: "modal-overlay",
|
|
3580
|
+
onClick: _withModifiers(_ctx.closePiProviderEditor, ["self"])
|
|
3581
|
+
}, [
|
|
3582
|
+
_createElementVNode("div", {
|
|
3583
|
+
class: "modal modal-wide",
|
|
3584
|
+
role: "dialog",
|
|
3585
|
+
"aria-modal": "true",
|
|
3586
|
+
"aria-labelledby": "pi-provider-editor-modal-title"
|
|
3587
|
+
}, [
|
|
3588
|
+
_createElementVNode("div", {
|
|
3589
|
+
class: "modal-title",
|
|
3590
|
+
id: "pi-provider-editor-modal-title"
|
|
3591
|
+
}, _toDisplayString(_ctx.editingPiProvider.isNew ? _ctx.t('pi.providers.addModal.title') : _ctx.t('pi.providers.editorTitle')), 1 /* TEXT */),
|
|
3592
|
+
(!_ctx.editingPiProvider.isNew)
|
|
3593
|
+
? (_openBlock(), _createElementBlock("div", {
|
|
3594
|
+
key: 0,
|
|
3595
|
+
class: "form-group"
|
|
3596
|
+
}, [
|
|
3597
|
+
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.fields.name')), 1 /* TEXT */),
|
|
3598
|
+
_createElementVNode("input", {
|
|
3599
|
+
class: "form-input",
|
|
3600
|
+
type: "text",
|
|
3601
|
+
value: _ctx.piProviderName(_ctx.editingPiProvider.id),
|
|
3602
|
+
readonly: ""
|
|
3603
|
+
}, null, 8 /* PROPS */, ["value"])
|
|
3604
|
+
]))
|
|
3605
|
+
: _createCommentVNode("v-if", true),
|
|
3606
|
+
_createElementVNode("div", { class: "form-group" }, [
|
|
3607
|
+
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.fields.baseUrl')), 1 /* TEXT */),
|
|
3608
|
+
_withDirectives(_createElementVNode("input", {
|
|
3609
|
+
class: "form-input",
|
|
3610
|
+
type: "url",
|
|
3611
|
+
"onUpdate:modelValue": $event => ((_ctx.editingPiProvider.form.baseUrl) = $event),
|
|
3612
|
+
autocomplete: "off",
|
|
3613
|
+
spellcheck: "false",
|
|
3614
|
+
placeholder: "https://",
|
|
3615
|
+
onChange: _ctx.fetchPiRemoteModels
|
|
3616
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, ["onUpdate:modelValue", "onChange"]), [
|
|
3617
|
+
[_vModelText, _ctx.editingPiProvider.form.baseUrl]
|
|
3618
|
+
])
|
|
3619
|
+
]),
|
|
3620
|
+
_createElementVNode("div", { class: "form-group" }, [
|
|
3621
|
+
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.fields.api')), 1 /* TEXT */),
|
|
3622
|
+
_withDirectives(_createElementVNode("select", {
|
|
3623
|
+
class: "form-input",
|
|
3624
|
+
"onUpdate:modelValue": $event => ((_ctx.editingPiProvider.form.api) = $event),
|
|
3625
|
+
disabled: !_ctx.isToolConfigWriteAllowed('pi')
|
|
3626
|
+
}, [
|
|
3627
|
+
_createElementVNode("option", { value: "openai-completions" }, "openai-completions — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.openaiCompletions')), 1 /* TEXT */),
|
|
3628
|
+
_createElementVNode("option", { value: "openai-responses" }, "openai-responses — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.openaiResponses')), 1 /* TEXT */),
|
|
3629
|
+
_createElementVNode("option", { value: "anthropic-messages" }, "anthropic-messages — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.anthropicMessages')), 1 /* TEXT */),
|
|
3630
|
+
_createElementVNode("option", { value: "google-generative-ai" }, "google-generative-ai — " + _toDisplayString(_ctx.t('pi.providers.addModal.api.googleGenerativeAi')), 1 /* TEXT */),
|
|
3631
|
+
(!['openai-completions', 'openai-responses', 'anthropic-messages', 'google-generative-ai'].includes(_ctx.editingPiProvider.form.api))
|
|
3632
|
+
? (_openBlock(), _createElementBlock("option", {
|
|
3633
|
+
key: 0,
|
|
3634
|
+
value: _ctx.editingPiProvider.form.api
|
|
3635
|
+
}, _toDisplayString(_ctx.editingPiProvider.form.api || '—'), 9 /* TEXT, PROPS */, ["value"]))
|
|
3636
|
+
: _createCommentVNode("v-if", true)
|
|
3637
|
+
], 8 /* PROPS */, ["onUpdate:modelValue", "disabled"]), [
|
|
3638
|
+
[_vModelSelect, _ctx.editingPiProvider.form.api]
|
|
3639
|
+
])
|
|
3640
|
+
]),
|
|
3641
|
+
_createElementVNode("div", { class: "form-group" }, [
|
|
3642
|
+
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.fields.apiKey')), 1 /* TEXT */),
|
|
3643
|
+
_createElementVNode("div", { class: "input-with-toggle" }, [
|
|
3644
|
+
_withDirectives(_createElementVNode("input", {
|
|
3645
|
+
class: "form-input",
|
|
3646
|
+
"onUpdate:modelValue": $event => ((_ctx.editingPiProvider.form.apiKey) = $event),
|
|
3647
|
+
type: _ctx.piShowKey ? 'text' : 'password',
|
|
3648
|
+
autocomplete: "off",
|
|
3649
|
+
spellcheck: "false",
|
|
3650
|
+
placeholder: "sk-...",
|
|
3651
|
+
onChange: _ctx.fetchPiRemoteModels
|
|
3652
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, ["onUpdate:modelValue", "type", "onChange"]), [
|
|
3653
|
+
[_vModelDynamic, _ctx.editingPiProvider.form.apiKey]
|
|
3654
|
+
]),
|
|
3655
|
+
_createElementVNode("button", {
|
|
3656
|
+
type: "button",
|
|
3657
|
+
class: "input-toggle-btn",
|
|
3658
|
+
onMousedown: _withModifiers(() => {}, ["prevent"]),
|
|
3659
|
+
onClick: $event => (_ctx.piShowKey = !_ctx.piShowKey),
|
|
3660
|
+
title: _ctx.piShowKey ? _ctx.t('common.hide') : _ctx.t('common.show'),
|
|
3661
|
+
"aria-label": _ctx.piShowKey ? _ctx.t('common.hide') : _ctx.t('common.show')
|
|
3662
|
+
}, [
|
|
3663
|
+
(!_ctx.piShowKey)
|
|
3664
|
+
? (_openBlock(), _createElementBlock("svg", {
|
|
3665
|
+
key: 0,
|
|
3666
|
+
viewBox: "0 0 20 20",
|
|
3667
|
+
fill: "none",
|
|
3668
|
+
stroke: "currentColor",
|
|
3669
|
+
"stroke-width": "1.5",
|
|
3670
|
+
width: "16",
|
|
3671
|
+
height: "16"
|
|
3672
|
+
}, [
|
|
3673
|
+
_createElementVNode("path", { d: "M10 4C5 4 1.73 8.11 1 10c.73 1.89 4 6 9 6s8.27-4.11 9-6c-.73-1.89-4-6-9-6z" }),
|
|
3674
|
+
_createElementVNode("circle", {
|
|
3675
|
+
cx: "10",
|
|
3676
|
+
cy: "10",
|
|
3677
|
+
r: "3"
|
|
3678
|
+
})
|
|
3679
|
+
]))
|
|
3680
|
+
: (_openBlock(), _createElementBlock("svg", {
|
|
3681
|
+
key: 1,
|
|
3682
|
+
viewBox: "0 0 20 20",
|
|
3683
|
+
fill: "none",
|
|
3684
|
+
stroke: "currentColor",
|
|
3685
|
+
"stroke-width": "1.5",
|
|
3686
|
+
width: "16",
|
|
3687
|
+
height: "16"
|
|
3688
|
+
}, [
|
|
3689
|
+
_createElementVNode("path", { d: "M2 2l16 16M8.2 4.2A9.9 9.9 0 0 1 10 4c5 0 8.27 4.11 9 6-.44.94-1.5 2.7-3.2 4.2M14.5 14.5A5.9 5.9 0 0 1 10 16c-5 0-8.27-4.11-9-6 .76-1.66 2.2-3.6 4.3-5" })
|
|
3690
|
+
]))
|
|
3691
|
+
], 40 /* PROPS, NEED_HYDRATION */, ["onMousedown", "onClick", "title", "aria-label"])
|
|
3692
|
+
])
|
|
3693
|
+
]),
|
|
3694
|
+
_createElementVNode("div", { class: "form-group" }, [
|
|
3695
|
+
_createElementVNode("label", { class: "form-label" }, _toDisplayString(_ctx.t('pi.providers.fields.models')), 1 /* TEXT */),
|
|
3696
|
+
(_ctx.piRemoteModelsLoading)
|
|
3697
|
+
? (_openBlock(), _createElementBlock("p", {
|
|
3698
|
+
key: 0,
|
|
3699
|
+
class: "config-template-hint"
|
|
3700
|
+
}, _toDisplayString(_ctx.t('pi.providers.models.remoteLoading')), 1 /* TEXT */))
|
|
3701
|
+
: (_ctx.piRemoteModelError)
|
|
3702
|
+
? (_openBlock(), _createElementBlock("p", {
|
|
3703
|
+
key: 1,
|
|
3704
|
+
class: "config-template-hint"
|
|
3705
|
+
}, _toDisplayString(_ctx.piRemoteModelError) + " · " + _toDisplayString(_ctx.t('pi.providers.models.remoteFailed')), 1 /* TEXT */))
|
|
3706
|
+
: _createCommentVNode("v-if", true),
|
|
3707
|
+
_createElementVNode("div", { class: "card-list" }, [
|
|
3708
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.editingPiProvider.form.models, (model, index) => {
|
|
3709
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
3710
|
+
class: "card",
|
|
3711
|
+
key: index
|
|
3712
|
+
}, [
|
|
3713
|
+
_createElementVNode("div", { class: "input-with-toggle" }, [
|
|
3714
|
+
_withDirectives(_createElementVNode("input", {
|
|
3715
|
+
class: "form-input",
|
|
3716
|
+
type: "text",
|
|
3717
|
+
"onUpdate:modelValue": $event => ((model.id) = $event),
|
|
3718
|
+
autocomplete: "off",
|
|
3719
|
+
spellcheck: "false",
|
|
3720
|
+
placeholder: "claude-sonnet-4",
|
|
3721
|
+
disabled: !_ctx.isToolConfigWriteAllowed('pi')
|
|
3722
|
+
}, null, 8 /* PROPS */, ["onUpdate:modelValue", "disabled"]), [
|
|
3723
|
+
[_vModelText, model.id]
|
|
3724
|
+
]),
|
|
3725
|
+
_createElementVNode("button", {
|
|
3726
|
+
type: "button",
|
|
3727
|
+
class: "btn-tool input-toggle-btn",
|
|
3728
|
+
onClick: $event => (_ctx.editingPiProvider.form.models.splice(index, 1)),
|
|
3729
|
+
disabled: !_ctx.isToolConfigWriteAllowed('pi')
|
|
3730
|
+
}, _toDisplayString(_ctx.t('pi.providers.models.remove')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
|
|
3731
|
+
])
|
|
3732
|
+
]))
|
|
3733
|
+
}), 128 /* KEYED_FRAGMENT */)),
|
|
3734
|
+
_createElementVNode("div", { class: "card" }, [
|
|
3735
|
+
_createElementVNode("div", { class: "input-with-toggle" }, [
|
|
3736
|
+
_withDirectives(_createElementVNode("input", {
|
|
3737
|
+
class: "form-input",
|
|
3738
|
+
type: "text",
|
|
3739
|
+
"onUpdate:modelValue": $event => ((_ctx.piModelSearch) = $event),
|
|
3740
|
+
autocomplete: "off",
|
|
3741
|
+
spellcheck: "false",
|
|
3742
|
+
placeholder: _ctx.t('pi.providers.models.search'),
|
|
3743
|
+
onKeydown: _withKeys(_withModifiers($event => (_ctx.addPiRemoteModel(_ctx.piModelSearch.trim())), ["prevent"]), ["enter"])
|
|
3744
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, ["onUpdate:modelValue", "placeholder", "onKeydown"]), [
|
|
3745
|
+
[_vModelText, _ctx.piModelSearch]
|
|
3746
|
+
])
|
|
3747
|
+
])
|
|
3748
|
+
]),
|
|
3749
|
+
_createElementVNode("div", { class: "pi-model-import-section" }, [
|
|
3750
|
+
_createElementVNode("span", { class: "selector-title" }, _toDisplayString(_ctx.t('pi.providers.models.importTitle')), 1 /* TEXT */),
|
|
3751
|
+
(!_ctx.piRemoteModelsLoading && _ctx.piRemoteSelectableModels().length > 0)
|
|
3752
|
+
? (_openBlock(), _createElementBlock("div", {
|
|
3753
|
+
key: 0,
|
|
3754
|
+
class: "pi-model-import-list"
|
|
3755
|
+
}, [
|
|
3756
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.piRemoteSelectableModels(), (id) => {
|
|
3757
|
+
return (_openBlock(), _createElementBlock("label", {
|
|
3758
|
+
class: "pi-model-import-item",
|
|
3759
|
+
key: id
|
|
3760
|
+
}, [
|
|
3761
|
+
_createElementVNode("input", {
|
|
3762
|
+
type: "checkbox",
|
|
3763
|
+
checked: _ctx.isPiRemoteChecked(id),
|
|
3764
|
+
onChange: $event => (_ctx.togglePiRemoteChecked(id)),
|
|
3765
|
+
disabled: !_ctx.isToolConfigWriteAllowed('pi')
|
|
3766
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, ["checked", "onChange", "disabled"]),
|
|
3767
|
+
_createElementVNode("span", { class: "pi-model-import-id" }, _toDisplayString(id), 1 /* TEXT */)
|
|
3768
|
+
]))
|
|
3769
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
3770
|
+
]))
|
|
3771
|
+
: _createCommentVNode("v-if", true),
|
|
3772
|
+
(!_ctx.piRemoteModelsLoading && _ctx.piRemoteSelectableModels().length > 0)
|
|
3773
|
+
? (_openBlock(), _createElementBlock("div", {
|
|
3774
|
+
key: 1,
|
|
3775
|
+
class: "settings-tab-actions"
|
|
3776
|
+
}, [
|
|
3777
|
+
_createElementVNode("button", {
|
|
3778
|
+
type: "button",
|
|
3779
|
+
class: "btn-tool",
|
|
3780
|
+
disabled: !_ctx.isToolConfigWriteAllowed('pi') || _ctx.piCheckedRemoteCount() === 0,
|
|
3781
|
+
onClick: _ctx.addSelectedPiRemoteModels
|
|
3782
|
+
}, _toDisplayString(_ctx.t('pi.providers.models.addSelected', { count: _ctx.piCheckedRemoteCount() })), 9 /* TEXT, PROPS */, ["disabled", "onClick"])
|
|
3783
|
+
]))
|
|
3784
|
+
: _createCommentVNode("v-if", true),
|
|
3785
|
+
(!_ctx.piRemoteModelsLoading && !_ctx.piRemoteModelError && _ctx.piRemoteModels.length)
|
|
3786
|
+
? (_openBlock(), _createElementBlock("p", {
|
|
3787
|
+
key: 2,
|
|
3788
|
+
class: "config-template-hint"
|
|
3789
|
+
}, _toDisplayString(_ctx.t('pi.providers.models.remoteCount', { count: _ctx.piRemoteModels.length })), 1 /* TEXT */))
|
|
3790
|
+
: _createCommentVNode("v-if", true),
|
|
3791
|
+
(!_ctx.piRemoteModelsLoading && !_ctx.piRemoteModelError && _ctx.piModelSearch.trim() && _ctx.piRemoteSelectableModels().length === 0)
|
|
3792
|
+
? (_openBlock(), _createElementBlock("p", {
|
|
3793
|
+
key: 3,
|
|
3794
|
+
class: "config-template-hint"
|
|
3795
|
+
}, _toDisplayString(_ctx.t('pi.providers.models.noMatch')), 1 /* TEXT */))
|
|
3796
|
+
: _createCommentVNode("v-if", true)
|
|
3797
|
+
])
|
|
3798
|
+
])
|
|
3799
|
+
]),
|
|
3800
|
+
_createElementVNode("div", { class: "btn-group" }, [
|
|
3801
|
+
_createElementVNode("button", {
|
|
3802
|
+
class: "btn btn-cancel",
|
|
3803
|
+
onClick: _ctx.closePiProviderEditor
|
|
3804
|
+
}, _toDisplayString(_ctx.t('common.cancel')), 9 /* TEXT, PROPS */, ["onClick"]),
|
|
3805
|
+
(!_ctx.editingPiProvider.isNew)
|
|
3806
|
+
? (_openBlock(), _createElementBlock("button", {
|
|
3807
|
+
key: 0,
|
|
3808
|
+
class: "btn btn-confirm btn-danger",
|
|
3809
|
+
onClick: _ctx.confirmDeletePiProvider,
|
|
3810
|
+
disabled: !_ctx.isToolConfigWriteAllowed('pi') || _ctx.piSaving
|
|
3811
|
+
}, _toDisplayString(_ctx.t('pi.providers.delete')), 9 /* TEXT, PROPS */, ["onClick", "disabled"]))
|
|
3812
|
+
: _createCommentVNode("v-if", true),
|
|
3813
|
+
_createElementVNode("button", {
|
|
3814
|
+
class: "btn btn-confirm",
|
|
3815
|
+
onClick: _ctx.savePiProvider,
|
|
3816
|
+
disabled: !_ctx.isToolConfigWriteAllowed('pi') || _ctx.piSaving
|
|
3817
|
+
}, _toDisplayString(_ctx.t(_ctx.piSaving ? 'common.saving' : 'common.save')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
|
|
3818
|
+
])
|
|
3819
|
+
])
|
|
3820
|
+
], 8 /* PROPS */, ["onClick"]))
|
|
3821
|
+
: _createCommentVNode("v-if", true),
|
|
3847
3822
|
_createCommentVNode(" 会话浏览模式 "),
|
|
3848
3823
|
_withDirectives(_createElementVNode("div", {
|
|
3849
3824
|
class: "mode-content",
|
|
@@ -6874,7 +6849,7 @@ return function render(_ctx, _cache) {
|
|
|
6874
6849
|
_createCommentVNode(" Prompts editor "),
|
|
6875
6850
|
(_ctx.mainTab === 'prompts')
|
|
6876
6851
|
? (_openBlock(), _createElementBlock("div", {
|
|
6877
|
-
key:
|
|
6852
|
+
key: 2,
|
|
6878
6853
|
class: "mode-content mode-cards",
|
|
6879
6854
|
id: "panel-prompts",
|
|
6880
6855
|
role: "tabpanel",
|
|
@@ -7698,12 +7673,12 @@ return function render(_ctx, _cache) {
|
|
|
7698
7673
|
_createCommentVNode(" 加载状态 "),
|
|
7699
7674
|
(_ctx.loading && _ctx.mainTab !== 'usage')
|
|
7700
7675
|
? (_openBlock(), _createElementBlock("div", {
|
|
7701
|
-
key:
|
|
7676
|
+
key: 3,
|
|
7702
7677
|
class: "state-message"
|
|
7703
7678
|
}, _toDisplayString(_ctx.t('app.loadingConfig')), 1 /* TEXT */))
|
|
7704
7679
|
: (_ctx.initError)
|
|
7705
7680
|
? (_openBlock(), _createElementBlock("div", {
|
|
7706
|
-
key:
|
|
7681
|
+
key: 4,
|
|
7707
7682
|
class: "state-message error"
|
|
7708
7683
|
}, [
|
|
7709
7684
|
_createCommentVNode(" 错误状态 "),
|