mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-21 17:01:25 -07:00
feat(hachidori): derive Docker management URL from the linked host
- Default character dictionary uploads to the linked host on port 8780; externalHostManagementUrl is now an optional override - Warn when the override points at a different machine than the link - Browser/app hosts report where to import the merged ZIP manually - Name the management origin when the upload request cannot connect - Update config descriptions, generated examples, docs, and changelog fragment
This commit is contained in:
11 files changed
+142
-37
No files matched your search
@@ -1,7 +1,10 @@
|
||||
import type { BrowserWindow, Extension, Session } from 'electron';
|
||||
import type { AnkiConnectConfig } from '../../../types';
|
||||
import { buildHachidoriAnkiHints } from './hachidori-anki-settings';
|
||||
import { uploadHachidoriDictionary } from './hachidori-dictionary-import';
|
||||
import {
|
||||
resolveHachidoriManagementUrl,
|
||||
uploadHachidoriDictionary,
|
||||
} from './hachidori-dictionary-import';
|
||||
import {
|
||||
buildHachidoriSharingScript,
|
||||
parseHachidoriHostStatus,
|
||||
@@ -1815,7 +1818,13 @@ export async function importYomitanDictionaryFromZip(
|
||||
if (host.kind === 'disconnected' || host.kind === 'unavailable')
|
||||
throw new Error(host.message);
|
||||
if (host.kind === 'connected') {
|
||||
await uploadHachidoriDictionary(normalizedZipPath, hachidoriManagementUrl);
|
||||
const origin = resolveHachidoriManagementUrl(
|
||||
host,
|
||||
hachidoriManagementUrl,
|
||||
normalizedZipPath,
|
||||
logger.warn,
|
||||
);
|
||||
await uploadHachidoriDictionary(normalizedZipPath, origin);
|
||||
const window = deps.getYomitanParserWindow();
|
||||
if (window) clearYomitanParserCachesForWindow(window);
|
||||
logger.info?.(
|
||||
|
||||
Reference in new issue
Block a user