dsh-magpie-connector 0.4.0 → 0.4.1
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/CHANGELOG.md +4 -0
- package/lib/client/SettingsPage.js +6 -2
- package/lib/client.js +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
- **Check refreshes latency.** A completed line check on a **saved** line now also re-runs the settings-page latency measurement (one `GET /api/dsh-magpie-connector/latency` pass), so the signal reading next to that line reflects the same moment as the check instead of the last panel open or save. Unsaved drafts trigger nothing (they have no latency row), the host measurement stays single-flight with its 600 ms deadline, and there is still no polling.
|
|
6
|
+
|
|
3
7
|
## 0.4.0
|
|
4
8
|
|
|
5
9
|
- **Line panel polish.** Settings now collapses every configured line by default (it no longer force-expands the active one); clicking a line header toggles it, and the add/remove/reorder actions are always-visible DSH product-icon buttons with accessible names and tooltips. A newly added line still opens for editing and stays open through its first save (including when it was moved before saving) and when a save fails.
|
|
@@ -250,7 +250,7 @@ export function MagpieSettings({ api }) {
|
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
252
|
const groupNote = (provider) => noteScope === provider ? { notice, alert: usageAlert } : {};
|
|
253
|
-
return h('div', { className: 'dmg-settings' }, h('style', null, settingsCss), h('p', { className: 'dmg-intro' }, '通过自托管的 Magpie 网关使用模型。用量卡片只读,打开本页时读取一次,之后只在你点击卡片上的刷新时重新读取。'), settingsError ? h('p', { className: 'dmg-error', role: 'alert' }, `无法读取设置:${settingsError}`) : null, settings ? h(Connection, { settings, saving: savingSettings, mutateSettings, api, latency,
|
|
253
|
+
return h('div', { className: 'dmg-settings' }, h('style', null, settingsCss), h('p', { className: 'dmg-intro' }, '通过自托管的 Magpie 网关使用模型。用量卡片只读,打开本页时读取一次,之后只在你点击卡片上的刷新时重新读取。'), settingsError ? h('p', { className: 'dmg-error', role: 'alert' }, `无法读取设置:${settingsError}`) : null, settings ? h(Connection, { settings, saving: savingSettings, mutateSettings, api, latency, onRefreshLatency: () => { void readLatency(); },
|
|
254
254
|
usage: h(UsageStatus, { cards, busy, ...(noteScope === undefined ? { notice, alert: usageAlert } : {}), onFetchAll: () => { void fetchAll(); }, saving: savingSettings }) })
|
|
255
255
|
: settingsError ? null : h('p', { role: 'status', className: 'dmg-hint' }, '正在读取设置…'), ...providerOrder(groups, cardList).map(provider => h(ProviderGroup, {
|
|
256
256
|
key: provider, provider,
|
|
@@ -328,7 +328,7 @@ function lineDrafts(settings) {
|
|
|
328
328
|
}));
|
|
329
329
|
}
|
|
330
330
|
const lineSignature = (draft) => JSON.stringify([draft.id ?? null, draft.baseUrl.trim(), draft.accessMode]);
|
|
331
|
-
function Connection({ settings, saving, mutateSettings, api, usage, latency }) {
|
|
331
|
+
function Connection({ settings, saving, mutateSettings, api, usage, latency, onRefreshLatency }) {
|
|
332
332
|
const baseline = lineDrafts(settings);
|
|
333
333
|
const [drafts, setDrafts] = useState(baseline);
|
|
334
334
|
const [expanded, setExpanded] = useState(null);
|
|
@@ -477,6 +477,10 @@ function Connection({ settings, saving, mutateSettings, api, usage, latency }) {
|
|
|
477
477
|
return;
|
|
478
478
|
}
|
|
479
479
|
setChecks(current => ({ ...current, [draft.draftId]: { signature, activeLineId: activeId, result: snapshot } }));
|
|
480
|
+
// A completed check is a fresh network sample of this line: saved lines re-measure latency
|
|
481
|
+
// alongside it (unsaved drafts have no reading row, so they trigger nothing).
|
|
482
|
+
if (draft.id)
|
|
483
|
+
onRefreshLatency();
|
|
480
484
|
}
|
|
481
485
|
catch (error) {
|
|
482
486
|
if (epoch === checkEpoch.current)
|
package/lib/client.js
CHANGED
|
@@ -586,6 +586,9 @@ window.__ModuleLoader__.load({
|
|
|
586
586
|
mutateSettings,
|
|
587
587
|
api,
|
|
588
588
|
latency,
|
|
589
|
+
onRefreshLatency: () => {
|
|
590
|
+
readLatency();
|
|
591
|
+
},
|
|
589
592
|
usage: (0, react.createElement)(UsageStatus, {
|
|
590
593
|
cards,
|
|
591
594
|
busy,
|
|
@@ -740,7 +743,7 @@ window.__ModuleLoader__.load({
|
|
|
740
743
|
draft.baseUrl.trim(),
|
|
741
744
|
draft.accessMode
|
|
742
745
|
]);
|
|
743
|
-
function Connection({ settings, saving, mutateSettings, api, usage, latency }) {
|
|
746
|
+
function Connection({ settings, saving, mutateSettings, api, usage, latency, onRefreshLatency }) {
|
|
744
747
|
const baseline = lineDrafts(settings);
|
|
745
748
|
const [drafts, setDrafts] = (0, react.useState)(baseline);
|
|
746
749
|
const [expanded, setExpanded] = (0, react.useState)(null);
|
|
@@ -922,6 +925,7 @@ window.__ModuleLoader__.load({
|
|
|
922
925
|
result: snapshot
|
|
923
926
|
}
|
|
924
927
|
}));
|
|
928
|
+
if (draft.id) onRefreshLatency();
|
|
925
929
|
} catch (error) {
|
|
926
930
|
if (epoch === checkEpoch.current) setCheckErrors((current) => ({
|
|
927
931
|
...current,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-magpie-connector",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "DeepSeek Harness plugin: connect a self-hosted Magpie gateway with one real provider route per upstream owner (grouped model picker on stock DSH), automatic multi-line failover, read-only usage cards, model visibility, default effort and per-session fast mode",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "prgrmrwy",
|