protocol-proxy 1.1.2 → 1.1.4
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/package.json +1 -1
- package/public/app.js +6 -3
package/package.json
CHANGED
package/public/app.js
CHANGED
|
@@ -25,7 +25,8 @@ function findProviderByUrl(url) {
|
|
|
25
25
|
return loadProviders().find(p => p.url === url);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function getProviderDisplayName(url) {
|
|
28
|
+
function getProviderDisplayName(url, serverName) {
|
|
29
|
+
if (serverName && serverName !== url) return serverName;
|
|
29
30
|
const p = findProviderByUrl(url);
|
|
30
31
|
return p ? p.name : url;
|
|
31
32
|
}
|
|
@@ -136,7 +137,7 @@ function renderProviderOptions() {
|
|
|
136
137
|
container.innerHTML = providers.map(p => `
|
|
137
138
|
<div class="model-option${p.url === currentUrl ? ' selected' : ''}" data-url="${escapeHtml(p.url)}">
|
|
138
139
|
<span class="model-option-name">${escapeHtml(p.name)}</span>
|
|
139
|
-
|
|
140
|
+
${p.name !== p.url ? `<span style="color:#64748b;font-size:12px;margin-left:4px">${escapeHtml(p.url)}</span>` : ''}
|
|
140
141
|
<button type="button" class="model-option-delete" data-delete-url="${escapeHtml(p.url)}" title="删除此供应商">×</button>
|
|
141
142
|
</div>
|
|
142
143
|
`).join('');
|
|
@@ -405,7 +406,7 @@ function renderProxies() {
|
|
|
405
406
|
|
|
406
407
|
container.innerHTML = proxies.map(p => {
|
|
407
408
|
const t = p.target || {};
|
|
408
|
-
const providerName = getProviderDisplayName(t.providerUrl || '');
|
|
409
|
+
const providerName = getProviderDisplayName(t.providerUrl || '', t.providerName);
|
|
409
410
|
return `
|
|
410
411
|
<div class="proxy-item">
|
|
411
412
|
<div class="proxy-header">
|
|
@@ -541,8 +542,10 @@ async function handleSubmit(e) {
|
|
|
541
542
|
return;
|
|
542
543
|
}
|
|
543
544
|
|
|
545
|
+
const provider = findProviderByUrl(providerUrl);
|
|
544
546
|
const target = {
|
|
545
547
|
providerUrl,
|
|
548
|
+
providerName: provider?.name || providerUrl,
|
|
546
549
|
protocol: detectProtocol(providerUrl),
|
|
547
550
|
defaultModel: document.getElementById('target-model').value.trim() || undefined,
|
|
548
551
|
models: getSelectedModels(),
|