codexmate 0.0.37 → 0.0.39
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/cli/analytics-export-args.js +68 -0
- package/cli/builtin-proxy.js +626 -207
- package/cli/openai-bridge.js +541 -210
- package/cli/session-usage.js +187 -1
- package/cli.js +84 -2
- package/package.json +1 -1
- package/web-ui/app.js +12 -3
- package/web-ui/modules/app.computed.main-tabs.mjs +37 -30
- package/web-ui/modules/app.methods.claude-config.mjs +111 -9
- package/web-ui/modules/app.methods.openclaw-editing.mjs +48 -0
- package/web-ui/modules/app.methods.openclaw-persist.mjs +13 -7
- package/web-ui/modules/app.methods.providers.mjs +36 -10
- package/web-ui/modules/app.methods.runtime.mjs +76 -1
- package/web-ui/modules/app.methods.startup-claude.mjs +1 -0
- package/web-ui/modules/config-mode.computed.mjs +3 -3
- package/web-ui/modules/i18n.dict.mjs +13 -0
- package/web-ui/modules/i18n.mjs +65 -16
- package/web-ui/modules/skills.methods.mjs +1 -1
- package/web-ui/partials/index/layout-header.html +16 -46
- package/web-ui/partials/index/modal-openclaw-config.html +135 -71
- package/web-ui/partials/index/modal-webhook.html +8 -8
- package/web-ui/partials/index/modals-basic.html +56 -16
- package/web-ui/partials/index/panel-config-claude.html +20 -20
- package/web-ui/partials/index/panel-config-codex.html +5 -5
- package/web-ui/partials/index/panel-config-openclaw.html +70 -64
- package/web-ui/partials/index/panel-dashboard.html +62 -77
- package/web-ui/partials/index/panel-settings.html +28 -7
- package/web-ui/partials/index/panel-trash.html +14 -14
- package/web-ui/res/web-ui-render.precompiled.js +846 -539
- package/web-ui/styles/controls-forms.css +6 -0
- package/web-ui/styles/dashboard.css +46 -14
- package/web-ui/styles/layout-shell.css +45 -0
- package/web-ui/styles/navigation-panels.css +3 -3
- package/web-ui/styles/openclaw-structured.css +383 -33
- package/web-ui/styles/responsive.css +68 -0
- package/web-ui/styles/sessions-usage.css +105 -9
- package/web-ui/styles/settings-panel.css +4 -0
- package/web-ui/partials/index/panel-config-codex.html.bak +0 -337
|
@@ -382,6 +382,10 @@ textarea:focus-visible {
|
|
|
382
382
|
display: none;
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
+
.openclaw-card-list .card-trailing .pill {
|
|
386
|
+
display: block;
|
|
387
|
+
}
|
|
388
|
+
|
|
385
389
|
.auth-profile-item {
|
|
386
390
|
padding: 10px;
|
|
387
391
|
}
|
|
@@ -431,3 +435,67 @@ textarea:focus-visible {
|
|
|
431
435
|
font-size: 11px;
|
|
432
436
|
}
|
|
433
437
|
}
|
|
438
|
+
|
|
439
|
+
@media (max-width: 820px) {
|
|
440
|
+
.container {
|
|
441
|
+
display: flex;
|
|
442
|
+
flex-direction: column;
|
|
443
|
+
height: 100vh;
|
|
444
|
+
min-height: 100vh;
|
|
445
|
+
overflow: hidden;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.app-shell {
|
|
449
|
+
grid-template-columns: 1fr;
|
|
450
|
+
flex: 1 1 auto;
|
|
451
|
+
min-height: 0;
|
|
452
|
+
height: auto;
|
|
453
|
+
overflow: hidden;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.side-rail {
|
|
457
|
+
display: none !important;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.lang-fab {
|
|
461
|
+
display: none !important;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.top-tabs {
|
|
465
|
+
display: flex !important;
|
|
466
|
+
flex: 0 0 auto;
|
|
467
|
+
width: 100%;
|
|
468
|
+
max-width: 100%;
|
|
469
|
+
margin: 8px 0 10px;
|
|
470
|
+
padding: 0 max(18px, calc(env(safe-area-inset-right, 0px) + 14px)) 4px max(10px, calc(env(safe-area-inset-left, 0px) + 10px));
|
|
471
|
+
gap: 5px;
|
|
472
|
+
overflow-x: auto;
|
|
473
|
+
overflow-y: hidden;
|
|
474
|
+
scroll-padding-inline: 10px 18px;
|
|
475
|
+
background: rgba(255, 248, 241, 0.96);
|
|
476
|
+
position: relative;
|
|
477
|
+
z-index: 30;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.top-tab:last-child {
|
|
481
|
+
margin-right: 8px;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.main-panel {
|
|
485
|
+
padding: 0 12px 16px;
|
|
486
|
+
height: 100%;
|
|
487
|
+
min-height: 0;
|
|
488
|
+
overflow-y: auto;
|
|
489
|
+
-webkit-overflow-scrolling: touch;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.main-panel-topbar {
|
|
493
|
+
position: sticky;
|
|
494
|
+
top: 0;
|
|
495
|
+
z-index: 20;
|
|
496
|
+
margin: 0 0 10px;
|
|
497
|
+
padding: 0 0 8px;
|
|
498
|
+
background: rgba(255, 248, 241, 0.96);
|
|
499
|
+
backdrop-filter: blur(14px) saturate(130%);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
@@ -135,10 +135,10 @@
|
|
|
135
135
|
.usage-hero::before {
|
|
136
136
|
content: '';
|
|
137
137
|
position: absolute;
|
|
138
|
-
top: -
|
|
139
|
-
right:
|
|
140
|
-
width:
|
|
141
|
-
height:
|
|
138
|
+
top: -72px;
|
|
139
|
+
right: 0;
|
|
140
|
+
width: min(320px, 62%);
|
|
141
|
+
height: min(320px, 62%);
|
|
142
142
|
background: radial-gradient(circle, rgba(200, 121, 99, 0.06) 0%, transparent 70%);
|
|
143
143
|
pointer-events: none;
|
|
144
144
|
}
|
|
@@ -175,10 +175,14 @@
|
|
|
175
175
|
.usage-hero-active-label {
|
|
176
176
|
font-weight: 600;
|
|
177
177
|
color: var(--color-text-primary);
|
|
178
|
+
min-width: 0;
|
|
179
|
+
overflow-wrap: anywhere;
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
.usage-hero-active-stat {
|
|
181
183
|
color: var(--color-text-tertiary);
|
|
184
|
+
min-width: 0;
|
|
185
|
+
overflow-wrap: anywhere;
|
|
182
186
|
}
|
|
183
187
|
|
|
184
188
|
.usage-hero-active-stat::before {
|
|
@@ -221,6 +225,15 @@
|
|
|
221
225
|
justify-content: center;
|
|
222
226
|
gap: 14px;
|
|
223
227
|
flex-wrap: wrap;
|
|
228
|
+
min-width: 0;
|
|
229
|
+
overflow-wrap: anywhere;
|
|
230
|
+
text-align: center;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.usage-hero-sub > span {
|
|
234
|
+
min-width: 0;
|
|
235
|
+
max-width: 100%;
|
|
236
|
+
overflow-wrap: anywhere;
|
|
224
237
|
}
|
|
225
238
|
|
|
226
239
|
.usage-hero-delta {
|
|
@@ -372,6 +385,7 @@
|
|
|
372
385
|
border: none;
|
|
373
386
|
background: transparent;
|
|
374
387
|
padding: 0;
|
|
388
|
+
min-width: 0;
|
|
375
389
|
}
|
|
376
390
|
|
|
377
391
|
.hourly-heatmap-wrapper {
|
|
@@ -380,6 +394,8 @@
|
|
|
380
394
|
gap: 3px;
|
|
381
395
|
margin-top: 14px;
|
|
382
396
|
min-width: 500px;
|
|
397
|
+
max-width: 100%;
|
|
398
|
+
box-sizing: border-box;
|
|
383
399
|
padding: 16px;
|
|
384
400
|
border-radius: 18px;
|
|
385
401
|
background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(252,248,241,0.6));
|
|
@@ -656,10 +672,14 @@
|
|
|
656
672
|
/* ---- 图表网格 (加大间距) ---- */
|
|
657
673
|
.usage-chart-grid {
|
|
658
674
|
display: grid;
|
|
659
|
-
grid-template-columns: repeat(2, 1fr);
|
|
675
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
660
676
|
gap: 20px;
|
|
661
677
|
}
|
|
662
678
|
|
|
679
|
+
.usage-chart-grid > * {
|
|
680
|
+
min-width: 0;
|
|
681
|
+
}
|
|
682
|
+
|
|
663
683
|
/* 为非 paths 卡片添加容器 */
|
|
664
684
|
.usage-chart-grid > .usage-card:not(.usage-paths-section):not(.usage-wave-section):not(.usage-card-hourly-heatmap) {
|
|
665
685
|
padding: 16px;
|
|
@@ -704,10 +724,13 @@
|
|
|
704
724
|
}
|
|
705
725
|
|
|
706
726
|
/* ---- 响应式 ---- */
|
|
707
|
-
@media (max-width:
|
|
727
|
+
@media (max-width: 1100px) {
|
|
708
728
|
.usage-chart-grid {
|
|
709
729
|
grid-template-columns: 1fr;
|
|
710
730
|
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
@media (max-width: 960px) {
|
|
711
734
|
|
|
712
735
|
.usage-hero-main {
|
|
713
736
|
font-size: 44px;
|
|
@@ -726,12 +749,26 @@
|
|
|
726
749
|
}
|
|
727
750
|
|
|
728
751
|
.usage-hero {
|
|
729
|
-
padding:
|
|
752
|
+
padding: 22px 16px;
|
|
730
753
|
min-height: 140px;
|
|
754
|
+
gap: 16px;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.usage-hero::before {
|
|
758
|
+
top: -56px;
|
|
759
|
+
right: 0;
|
|
760
|
+
width: 220px;
|
|
761
|
+
height: 220px;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.usage-hero-active {
|
|
765
|
+
padding: 10px 12px;
|
|
766
|
+
gap: 8px 10px;
|
|
731
767
|
}
|
|
732
768
|
|
|
733
769
|
.usage-hero-main {
|
|
734
|
-
font-size: 38px;
|
|
770
|
+
font-size: clamp(32px, 10vw, 38px);
|
|
771
|
+
line-height: 1.08;
|
|
735
772
|
}
|
|
736
773
|
|
|
737
774
|
.usage-wave-chart {
|
|
@@ -743,11 +780,70 @@
|
|
|
743
780
|
}
|
|
744
781
|
|
|
745
782
|
.hourly-heatmap-wrapper {
|
|
783
|
+
width: 100%;
|
|
746
784
|
min-width: 100%;
|
|
747
|
-
|
|
785
|
+
max-width: 100%;
|
|
786
|
+
overflow-x: visible;
|
|
787
|
+
padding: 12px;
|
|
788
|
+
gap: 2px;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
.usage-card-hourly-heatmap {
|
|
792
|
+
overflow-x: visible;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.hourly-heatmap-header,
|
|
796
|
+
.hourly-heatmap-row {
|
|
797
|
+
gap: 2px;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.hourly-heatmap-corner,
|
|
801
|
+
.hourly-heatmap-weekday-label {
|
|
802
|
+
width: 28px;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.hourly-heatmap-weekday-label {
|
|
806
|
+
font-size: 10px;
|
|
807
|
+
padding-right: 4px;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
.hourly-heatmap-hour-label {
|
|
811
|
+
font-size: 8px;
|
|
812
|
+
line-height: 12px;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
.hourly-heatmap-cell {
|
|
816
|
+
height: 8px;
|
|
817
|
+
border-radius: 3px;
|
|
748
818
|
}
|
|
749
819
|
|
|
750
820
|
.usage-chart-grid {
|
|
751
821
|
gap: 16px;
|
|
752
822
|
}
|
|
753
823
|
}
|
|
824
|
+
|
|
825
|
+
@media (max-width: 420px) {
|
|
826
|
+
.hourly-heatmap-wrapper {
|
|
827
|
+
padding: 10px;
|
|
828
|
+
gap: 1px;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.hourly-heatmap-header,
|
|
832
|
+
.hourly-heatmap-row {
|
|
833
|
+
gap: 1px;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
.hourly-heatmap-corner,
|
|
837
|
+
.hourly-heatmap-weekday-label {
|
|
838
|
+
width: 24px;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
.hourly-heatmap-weekday-label {
|
|
842
|
+
font-size: 9px;
|
|
843
|
+
padding-right: 3px;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
.hourly-heatmap-hour-label {
|
|
847
|
+
font-size: 7px;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
<!-- Provider 配置模式(Codex) -->
|
|
2
|
-
<div
|
|
3
|
-
v-show="mainTab === 'config' && isProviderConfigMode"
|
|
4
|
-
class="mode-content mode-cards"
|
|
5
|
-
id="panel-config-provider"
|
|
6
|
-
role="tabpanel"
|
|
7
|
-
:aria-labelledby="forceCompactLayout ? 'tab-config' : ('side-tab-config-' + configMode)">
|
|
8
|
-
<div v-if="forceCompactLayout && !sessionStandalone" class="segmented-control">
|
|
9
|
-
<button type="button" :class="['segment', { active: configMode === 'codex' }]" @click="switchConfigMode('codex')">{{ t('tab.config.codex') }}</button>
|
|
10
|
-
<button type="button" :class="['segment', { active: configMode === 'claude' }]" @click="switchConfigMode('claude')">{{ t('tab.config.claude') }}</button>
|
|
11
|
-
<button type="button" :class="['segment', { active: configMode === 'openclaw' }]" @click="switchConfigMode('openclaw')">{{ t('tab.config.openclaw') }}</button>
|
|
12
|
-
</div>
|
|
13
|
-
<template v-if="isCodexConfigMode && shouldShowCliInstallPlaceholder('codex')">
|
|
14
|
-
<div class="selector-section">
|
|
15
|
-
<div class="empty-state">
|
|
16
|
-
<div class="empty-state-title">{{ t('cli.missing.title', { name: 'Codex' }) }}</div>
|
|
17
|
-
<div class="empty-state-subtitle">{{ t('cli.missing.subtitle', { name: 'Codex' }) }}</div>
|
|
18
|
-
<div class="docs-command-row">
|
|
19
|
-
<div class="docs-command-box" role="group" :aria-label="t('cli.missing.commandAria', { name: 'Codex' })">
|
|
20
|
-
<code class="install-command">{{ getInstallCommand('codex', 'install') }}</code>
|
|
21
|
-
<button
|
|
22
|
-
type="button"
|
|
23
|
-
class="btn-mini docs-copy-btn"
|
|
24
|
-
:disabled="!getInstallCommand('codex', 'install')"
|
|
25
|
-
@click="copyInstallCommand(getInstallCommand('codex', 'install'))">{{ t('common.copy') }}</button>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
<button type="button" class="btn-tool btn-tool-compact" @click="mainTab = 'docs'; setInstallCommandAction('install')">{{ t('cli.missing.openDocs') }}</button>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
<template v-else>
|
|
33
|
-
<!-- 添加提供商按钮 -->
|
|
34
|
-
<button class="btn-add" @click="showAddModal = true" v-if="!loading && !initError">
|
|
35
|
-
<svg class="icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2">
|
|
36
|
-
<path d="M10 4v12M4 10h12"/>
|
|
37
|
-
</svg>
|
|
38
|
-
{{ t('config.addProvider') }}
|
|
39
|
-
</button>
|
|
40
|
-
|
|
41
|
-
<!-- 服务预设 -->
|
|
42
|
-
<div class="selector-section" v-if="isCodexConfigMode && codexProviderTemplates.length">
|
|
43
|
-
<div class="selector-header">
|
|
44
|
-
<span class="selector-title">{{ t('config.providerTemplate.title') }}</span>
|
|
45
|
-
</div>
|
|
46
|
-
<div class="btn-group" style="flex-wrap: wrap; gap: 8px; margin-top: 0;">
|
|
47
|
-
<button
|
|
48
|
-
v-for="tpl in codexProviderTemplates"
|
|
49
|
-
:key="tpl.name"
|
|
50
|
-
type="button"
|
|
51
|
-
class="btn-mini"
|
|
52
|
-
@click="newProvider.name = tpl.name;
|
|
53
|
-
newProvider.url = tpl.url;
|
|
54
|
-
newProvider._suggestedModel = tpl.model || '';
|
|
55
|
-
newProvider.useTransform = !!tpl.useTransform;
|
|
56
|
-
showAddModal = true">
|
|
57
|
-
{{ tpl.label }}
|
|
58
|
-
</button>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<!-- 模型选择器 -->
|
|
63
|
-
<div class="selector-section">
|
|
64
|
-
<div class="selector-header">
|
|
65
|
-
<span class="selector-title">{{ t('config.models') }}</span>
|
|
66
|
-
<div class="selector-actions">
|
|
67
|
-
<button class="btn-icon" @click="showModelModal = true" :aria-label="t('modal.modelAdd.title')" :title="t('modal.modelAdd.title')" v-if="modelsSource === 'legacy'">+</button>
|
|
68
|
-
<button class="btn-icon" @click="showModelListModal = true" :aria-label="t('modal.modelManage.title')" :title="t('modal.modelManage.title')" v-if="modelsSource === 'legacy'">≡</button>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
<select
|
|
72
|
-
v-if="codexModelsLoading || modelsSource === 'remote'"
|
|
73
|
-
class="model-select"
|
|
74
|
-
v-model="currentModel"
|
|
75
|
-
@change="onModelChange"
|
|
76
|
-
:disabled="codexModelsLoading"
|
|
77
|
-
>
|
|
78
|
-
<option v-if="codexModelsLoading" value="">{{ t('config.modelLoading') }}</option>
|
|
79
|
-
<option v-else v-for="model in codexModelOptions" :key="model" :value="model">{{ model }}</option>
|
|
80
|
-
</select>
|
|
81
|
-
<input
|
|
82
|
-
v-if="!codexModelsLoading && (modelsSource !== 'remote' || !modelsHasCurrent)"
|
|
83
|
-
class="model-input"
|
|
84
|
-
v-model="currentModel"
|
|
85
|
-
@blur="onModelChange"
|
|
86
|
-
@keyup.enter="onModelChange"
|
|
87
|
-
:placeholder="activeProviderModelPlaceholder"
|
|
88
|
-
:list="codexModelHasList ? 'codex-model-options' : null"
|
|
89
|
-
>
|
|
90
|
-
<datalist v-if="codexModelHasList" id="codex-model-options">
|
|
91
|
-
<option v-for="model in codexModelOptions" :key="model" :value="model"></option>
|
|
92
|
-
</datalist>
|
|
93
|
-
<div class="config-template-hint" v-if="modelsSource === 'unlimited'">
|
|
94
|
-
{{ t('config.models.unlimited') }}
|
|
95
|
-
</div>
|
|
96
|
-
<div class="config-template-hint" v-if="modelsSource === 'error'">
|
|
97
|
-
{{ t('config.models.error') }}
|
|
98
|
-
</div>
|
|
99
|
-
<div class="config-template-hint" v-if="modelsSource === 'remote' && !modelsHasCurrent">
|
|
100
|
-
{{ isCodexConfigMode ? t('config.models.notInList.codex') : t('config.models.notInList.other') }}
|
|
101
|
-
</div>
|
|
102
|
-
<div class="config-template-hint" v-if="isCodexConfigMode">
|
|
103
|
-
{{ t('config.template.editFirst') }}
|
|
104
|
-
</div>
|
|
105
|
-
<div class="config-template-hint" v-else-if="activeProviderBridgeHint">
|
|
106
|
-
{{ t('config.template.bridgeCodexOnly', { hint: activeProviderBridgeHint }) }}
|
|
107
|
-
</div>
|
|
108
|
-
<button class="btn-tool btn-template-editor" v-if="isCodexConfigMode" @click="openConfigTemplateEditor" :disabled="loading || !!initError">
|
|
109
|
-
{{ t('config.template.openEditor') }}
|
|
110
|
-
</button>
|
|
111
|
-
</div>
|
|
112
|
-
|
|
113
|
-
<template v-if="isCodexConfigMode">
|
|
114
|
-
<div class="selector-section">
|
|
115
|
-
<div class="selector-header">
|
|
116
|
-
<span class="selector-title">{{ t('config.serviceTier') }}</span>
|
|
117
|
-
</div>
|
|
118
|
-
<select class="model-select" v-model="serviceTier" @change="onServiceTierChange">
|
|
119
|
-
<option value="fast">{{ t('config.serviceTier.fast') }}</option>
|
|
120
|
-
<option value="standard">{{ t('config.serviceTier.standard') }}</option>
|
|
121
|
-
</select>
|
|
122
|
-
<div class="config-template-hint">
|
|
123
|
-
{{ t('config.serviceTier.hint', { field: 'service_tier' }) }}
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
|
|
127
|
-
<div class="selector-section">
|
|
128
|
-
<div class="selector-header">
|
|
129
|
-
<span class="selector-title">{{ t('config.reasoningEffort') }}</span>
|
|
130
|
-
</div>
|
|
131
|
-
<select class="model-select" v-model="modelReasoningEffort" @change="onReasoningEffortChange">
|
|
132
|
-
<option value="high">high</option>
|
|
133
|
-
<option value="medium">{{ t('config.reasoningEffort.medium') }}</option>
|
|
134
|
-
<option value="low">low</option>
|
|
135
|
-
<option value="xhigh">xhigh</option>
|
|
136
|
-
</select>
|
|
137
|
-
<div class="config-template-hint">
|
|
138
|
-
{{ t('config.reasoningEffort.hint') }}
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
<div class="selector-section">
|
|
143
|
-
<div class="selector-header">
|
|
144
|
-
<span class="selector-title">{{ t('config.contextBudget') }}</span>
|
|
145
|
-
<div class="selector-actions">
|
|
146
|
-
<button
|
|
147
|
-
class="btn-tool btn-tool-compact"
|
|
148
|
-
@click="resetCodexContextBudgetDefaults"
|
|
149
|
-
:disabled="loading || !!initError || codexApplying">
|
|
150
|
-
{{ t('config.reset') }}
|
|
151
|
-
</button>
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
<div class="codex-config-grid">
|
|
155
|
-
<div class="form-group codex-config-field">
|
|
156
|
-
<label class="form-label" for="codex-model-context-window">model_context_window</label>
|
|
157
|
-
<input
|
|
158
|
-
id="codex-model-context-window"
|
|
159
|
-
v-model="modelContextWindowInput"
|
|
160
|
-
class="form-input"
|
|
161
|
-
inputmode="numeric"
|
|
162
|
-
autocomplete="off"
|
|
163
|
-
:placeholder="t('config.example', { value: 190000 })"
|
|
164
|
-
@focus="editingCodexBudgetField = 'modelContextWindowInput'"
|
|
165
|
-
@input="sanitizePositiveIntegerDraft('modelContextWindowInput')"
|
|
166
|
-
@blur="onModelContextWindowBlur"
|
|
167
|
-
@keydown.enter.prevent="onModelContextWindowBlur">
|
|
168
|
-
<div class="form-hint">{{ t('config.contextWindow.hint') }}</div>
|
|
169
|
-
</div>
|
|
170
|
-
<div class="form-group codex-config-field">
|
|
171
|
-
<label class="form-label" for="codex-model-auto-compact-token-limit">model_auto_compact_token_limit</label>
|
|
172
|
-
<input
|
|
173
|
-
id="codex-model-auto-compact-token-limit"
|
|
174
|
-
v-model="modelAutoCompactTokenLimitInput"
|
|
175
|
-
class="form-input"
|
|
176
|
-
inputmode="numeric"
|
|
177
|
-
autocomplete="off"
|
|
178
|
-
:placeholder="t('config.example', { value: 185000 })"
|
|
179
|
-
@focus="editingCodexBudgetField = 'modelAutoCompactTokenLimitInput'"
|
|
180
|
-
@input="sanitizePositiveIntegerDraft('modelAutoCompactTokenLimitInput')"
|
|
181
|
-
@blur="onModelAutoCompactTokenLimitBlur"
|
|
182
|
-
@keydown.enter.prevent="onModelAutoCompactTokenLimitBlur">
|
|
183
|
-
<div class="form-hint">{{ t('config.autoCompact.hint') }}</div>
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
|
|
188
|
-
<div class="selector-section">
|
|
189
|
-
<div class="selector-header">
|
|
190
|
-
<span class="selector-title">AGENTS.md</span>
|
|
191
|
-
</div>
|
|
192
|
-
<button class="btn-tool" @click="openAgentsEditor" :disabled="loading || !!initError || agentsLoading">
|
|
193
|
-
{{ agentsLoading ? t('config.modelLoading') : t('config.agents.open') }}
|
|
194
|
-
</button>
|
|
195
|
-
</div>
|
|
196
|
-
|
|
197
|
-
<div class="selector-section">
|
|
198
|
-
<div class="selector-header">
|
|
199
|
-
<span class="selector-title">{{ t('config.health.title') }}</span>
|
|
200
|
-
</div>
|
|
201
|
-
<button class="btn-tool" @click="runHealthCheck" :disabled="healthCheckLoading || loading || !!initError">
|
|
202
|
-
{{ healthCheckLoading ? t('config.health.running') : t('config.health.run') }}
|
|
203
|
-
</button>
|
|
204
|
-
<div class="config-template-hint">{{ t('config.health.hint') }}</div>
|
|
205
|
-
<div v-if="healthCheckLoading && healthCheckBatchTotal" class="config-template-hint">
|
|
206
|
-
{{ t('config.health.progress', { done: healthCheckBatchDone, total: healthCheckBatchTotal, failed: healthCheckBatchFailed }) }}
|
|
207
|
-
</div>
|
|
208
|
-
<div v-if="healthCheckResult && !healthCheckLoading" class="config-template-hint">
|
|
209
|
-
{{ healthCheckResult.ok ? t('config.health.ok') : t('config.health.fail') }} · {{ t('config.health.issues', { count: (healthCheckResult.issues || []).length }) }}
|
|
210
|
-
</div>
|
|
211
|
-
<button v-if="healthCheckResult && !healthCheckLoading" type="button" class="btn-mini" @click="showHealthCheckModal = true">
|
|
212
|
-
{{ t('common.detail') }}
|
|
213
|
-
</button>
|
|
214
|
-
<div v-if="healthCheckResult && !healthCheckLoading && (healthCheckResult.issues || []).length">
|
|
215
|
-
<div v-for="(issue, index) in healthCheckResult.issues" :key="issue.code || ('issue-' + index)" class="config-template-hint">
|
|
216
|
-
{{ issue.message || issue.code || '' }}<span v-if="issue.suggestion"> · {{ issue.suggestion }}</span>
|
|
217
|
-
</div>
|
|
218
|
-
</div>
|
|
219
|
-
</div>
|
|
220
|
-
|
|
221
|
-
</template>
|
|
222
|
-
|
|
223
|
-
<div v-if="!loading && !initError" class="card-list">
|
|
224
|
-
<div v-for="provider in displayProvidersList" :key="provider.name"
|
|
225
|
-
:class="['card', { active: displayCurrentProvider === provider.name }]"
|
|
226
|
-
@click="switchProvider(provider.name)"
|
|
227
|
-
@keydown.enter.self.prevent="switchProvider(provider.name)"
|
|
228
|
-
@keydown.space.self.prevent="switchProvider(provider.name)"
|
|
229
|
-
tabindex="0"
|
|
230
|
-
role="button"
|
|
231
|
-
:aria-current="displayCurrentProvider === provider.name ? 'true' : null">
|
|
232
|
-
<div class="card-leading">
|
|
233
|
-
<div class="card-icon">{{ provider.name.charAt(0).toUpperCase() }}<span v-if="isTransformProvider(provider)" class="card-icon-dot" title="通过内建转换适配"></span></div>
|
|
234
|
-
<div class="card-content">
|
|
235
|
-
<div class="card-title">
|
|
236
|
-
<span>{{ provider.name }}</span>
|
|
237
|
-
<span v-if="provider.readOnly" class="provider-readonly-badge">{{ t('config.badge.system') }}</span>
|
|
238
|
-
</div>
|
|
239
|
-
<div v-if="provider.name !== 'local'" class="card-subtitle card-subtitle-model">
|
|
240
|
-
{{ activeProviderModel(provider.name) || t('config.model.unset') }}
|
|
241
|
-
</div>
|
|
242
|
-
<div v-if="provider.name !== 'local'" class="card-subtitle card-subtitle-url">
|
|
243
|
-
{{ displayProviderUrl(provider) || t('config.url.unset') }}
|
|
244
|
-
</div>
|
|
245
|
-
</div>
|
|
246
|
-
</div>
|
|
247
|
-
<div class="card-trailing">
|
|
248
|
-
<span v-if="speedResults[provider.name]" :class="['latency', speedResults[provider.name].ok ? 'ok' : 'error']">
|
|
249
|
-
{{ formatLatency(speedResults[provider.name]) }}
|
|
250
|
-
</span>
|
|
251
|
-
<span :class="['pill', providerPillConfigured(provider) ? 'configured' : 'empty']">
|
|
252
|
-
{{ providerPillText(provider) }}
|
|
253
|
-
</span>
|
|
254
|
-
<div class="card-actions" @click.stop>
|
|
255
|
-
<button
|
|
256
|
-
class="card-action-btn"
|
|
257
|
-
:class="{ loading: speedLoading[provider.name] }"
|
|
258
|
-
:disabled="!!speedLoading[provider.name]"
|
|
259
|
-
@click="runSpeedTest(provider.name, { silent: true })"
|
|
260
|
-
:aria-label="t('config.availabilityTestAria', { name: provider.name })"
|
|
261
|
-
:title="t('config.availabilityTest')"
|
|
262
|
-
>
|
|
263
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
264
|
-
<path d="M13 2L3 14h7l-1 8 12-14h-7l1-6z"/>
|
|
265
|
-
</svg>
|
|
266
|
-
</button>
|
|
267
|
-
<button
|
|
268
|
-
v-if="!provider.readOnly"
|
|
269
|
-
class="card-action-btn"
|
|
270
|
-
:class="{ loading: providerShareLoading[provider.name], disabled: !shouldAllowProviderShare(provider) }"
|
|
271
|
-
:disabled="providerShareLoading[provider.name] || !shouldAllowProviderShare(provider)"
|
|
272
|
-
@click="copyProviderShareCommand(provider)"
|
|
273
|
-
:title="shouldAllowProviderShare(provider) ? t('config.shareCommand') : t('config.shareDisabled')"
|
|
274
|
-
:aria-label="t('config.shareCommand.aria')">
|
|
275
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
276
|
-
<path d="M4 12v7a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7"/>
|
|
277
|
-
<path d="M16 6l-4-4-4 4"/>
|
|
278
|
-
<path d="M12 2v14"/>
|
|
279
|
-
</svg>
|
|
280
|
-
</button>
|
|
281
|
-
<button
|
|
282
|
-
v-if="!provider.readOnly"
|
|
283
|
-
class="card-action-btn"
|
|
284
|
-
:class="{ disabled: !shouldShowProviderEdit(provider) }"
|
|
285
|
-
:disabled="!shouldShowProviderEdit(provider)"
|
|
286
|
-
@click="openEditModal(provider)"
|
|
287
|
-
:aria-label="t('config.provider.edit.aria', { name: provider.name })"
|
|
288
|
-
:title="shouldShowProviderEdit(provider) ? t('common.edit') : t('common.notEditable')">
|
|
289
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
290
|
-
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>
|
|
291
|
-
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/>
|
|
292
|
-
</svg>
|
|
293
|
-
</button>
|
|
294
|
-
<button
|
|
295
|
-
v-if="!provider.readOnly"
|
|
296
|
-
class="card-action-btn"
|
|
297
|
-
@click="openCloneProviderModal(provider)"
|
|
298
|
-
:aria-label="t('config.provider.clone.aria', { name: provider.name })"
|
|
299
|
-
:title="t('config.provider.clone')">
|
|
300
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
301
|
-
<rect x="9" y="9" width="13" height="13" rx="2"/>
|
|
302
|
-
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
|
|
303
|
-
</svg>
|
|
304
|
-
</button>
|
|
305
|
-
<button
|
|
306
|
-
v-if="!provider.readOnly"
|
|
307
|
-
class="card-action-btn delete"
|
|
308
|
-
:class="{ disabled: !shouldShowProviderDelete(provider) }"
|
|
309
|
-
:disabled="!shouldShowProviderDelete(provider)"
|
|
310
|
-
@click="deleteProvider(provider.name)"
|
|
311
|
-
:aria-label="t('config.provider.delete.aria', { name: provider.name })"
|
|
312
|
-
:title="shouldShowProviderDelete(provider) ? t('common.delete') : t('common.notDeletable')">
|
|
313
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
314
|
-
<path d="M3 6h18"/>
|
|
315
|
-
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
|
|
316
|
-
</svg>
|
|
317
|
-
</button>
|
|
318
|
-
</div>
|
|
319
|
-
</div>
|
|
320
|
-
</div>
|
|
321
|
-
</div>
|
|
322
|
-
|
|
323
|
-
<div v-if="displayCurrentProvider === 'local'" class="local-bridge-panel" style="margin-top:12px;padding:12px;background:var(--card-bg);border-radius:8px;border:1px solid var(--border-color)">
|
|
324
|
-
<div style="font-size:13px;font-weight:600;margin-bottom:8px;color:var(--text-secondary)">轮询池 — 勾选参与负载均衡的提供商</div>
|
|
325
|
-
<div v-if="localBridgeCandidateProviders().length === 0" style="font-size:12px;color:var(--text-muted)">暂无可用上游 provider,请先添加直连 provider</div>
|
|
326
|
-
<label v-for="cp in localBridgeCandidateProviders()" :key="cp.name"
|
|
327
|
-
style="display:flex;align-items:center;gap:8px;padding:6px 0;cursor:pointer;font-size:13px">
|
|
328
|
-
<input type="checkbox"
|
|
329
|
-
:checked="!isLocalBridgeExcluded(cp.name)"
|
|
330
|
-
@change="toggleLocalBridgeExcluded(cp.name)"
|
|
331
|
-
style="accent-color:var(--accent-color)" />
|
|
332
|
-
<span>{{ cp.name }}</span>
|
|
333
|
-
</label>
|
|
334
|
-
</div>
|
|
335
|
-
|
|
336
|
-
</template>
|
|
337
|
-
</div>
|