@mangoc/dsh-sub2api-sync 0.2.0 → 0.2.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/lib/client.cjs CHANGED
@@ -125,8 +125,8 @@ const zh = {
125
125
  detailSectionEmpty: "还没有同步过——在设置 → Sub2API 同步 完成首次同步",
126
126
  activationTitle: "开始使用 Sub2API 同步",
127
127
  activationStep1: "1. 在设置中连接面板(账号密码或网页授权)",
128
- activationStep2: "2. 勾选要同步的分组(key 自动准备)",
129
- activationStep3: "3. 点击「立即同步」,模型即可使用",
128
+ activationStep2: "2. 在 Keys 卡勾选要同步的 key(可跨分组)",
129
+ activationStep3: "3. 点击「同步所选」,模型即可使用",
130
130
  activationOpenConfig: "打开配置页",
131
131
  activationDismiss: "知道了",
132
132
  keysTitle: "Keys",
@@ -235,8 +235,8 @@ const en = {
235
235
  detailSectionEmpty: "Never synced — finish the first sync in Settings → Sub2API Sync",
236
236
  activationTitle: "Get started with Sub2API Sync",
237
237
  activationStep1: "1. Connect the panel in Settings (account password or web authorization)",
238
- activationStep2: "2. Check the groups to sync (keys are prepared automatically)",
239
- activationStep3: "3. Click \"Sync now\" and the models are ready",
238
+ activationStep2: "2. Tick the keys to sync on the Keys card (cross-group)",
239
+ activationStep3: "3. Click \"Sync selected\" and the models are ready",
240
240
  activationOpenConfig: "Open configuration",
241
241
  activationDismiss: "Got it",
242
242
  keysTitle: "Keys",
@@ -2313,7 +2313,7 @@ function DetailSectionBody({ t }) {
2313
2313
  //#endregion
2314
2314
  //#region src/client/plugins/ActivationGuide.tsx
2315
2315
  function ActivationGuide(props) {
2316
- const { t, onDismiss, onOpenDetails } = props;
2316
+ const { t, onDismiss, onOpenDetails, openBundleDetails } = props;
2317
2317
  return (0, react_jsx_runtime.jsxs)("div", {
2318
2318
  className: "s2s-card",
2319
2319
  children: [
@@ -2333,7 +2333,9 @@ function ActivationGuide(props) {
2333
2333
  className: "s2s-actions",
2334
2334
  children: [(0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.Button, {
2335
2335
  variant: "primary",
2336
- onClick: onOpenDetails,
2336
+ onClick: () => {
2337
+ if (!(openBundleDetails?.() ?? false)) onOpenDetails();
2338
+ },
2337
2339
  children: t("activationOpenConfig")
2338
2340
  }), (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.Button, {
2339
2341
  variant: "ghost",
@@ -2391,10 +2393,17 @@ function mount(ctx) {
2391
2393
  id: "sub2api-sync",
2392
2394
  locale: NS
2393
2395
  }, DetailSection));
2396
+ const activationOps = { openBundleDetails: () => {
2397
+ const nav = ctx.pluginNavigation;
2398
+ if (nav === undefined) return false;
2399
+ nav.openBundle(PKG_NAME);
2400
+ return true;
2401
+ } };
2394
2402
  ctx.slots.inject("plugins.bundle.activation", () => ctx.slots.register({
2395
2403
  name: "plugins.bundle.activation",
2396
2404
  key: PKG_NAME,
2397
- locale: NS
2405
+ locale: NS,
2406
+ inject: () => activationOps
2398
2407
  }, ActivationGuide));
2399
2408
  }
2400
2409
 
@@ -2404,7 +2413,8 @@ const name = "dsh-sub2api-sync-client";
2404
2413
  const inject = [
2405
2414
  "slots",
2406
2415
  "locale",
2407
- "configForms"
2416
+ "configForms",
2417
+ "pluginNavigation"
2408
2418
  ];
2409
2419
  function apply(ctx) {
2410
2420
  mount(ctx);
package/lib/client.js CHANGED
@@ -131,8 +131,8 @@ const zh = {
131
131
  detailSectionEmpty: "还没有同步过——在设置 → Sub2API 同步 完成首次同步",
132
132
  activationTitle: "开始使用 Sub2API 同步",
133
133
  activationStep1: "1. 在设置中连接面板(账号密码或网页授权)",
134
- activationStep2: "2. 勾选要同步的分组(key 自动准备)",
135
- activationStep3: "3. 点击「立即同步」,模型即可使用",
134
+ activationStep2: "2. 在 Keys 卡勾选要同步的 key(可跨分组)",
135
+ activationStep3: "3. 点击「同步所选」,模型即可使用",
136
136
  activationOpenConfig: "打开配置页",
137
137
  activationDismiss: "知道了",
138
138
  keysTitle: "Keys",
@@ -241,8 +241,8 @@ const en = {
241
241
  detailSectionEmpty: "Never synced — finish the first sync in Settings → Sub2API Sync",
242
242
  activationTitle: "Get started with Sub2API Sync",
243
243
  activationStep1: "1. Connect the panel in Settings (account password or web authorization)",
244
- activationStep2: "2. Check the groups to sync (keys are prepared automatically)",
245
- activationStep3: "3. Click \"Sync now\" and the models are ready",
244
+ activationStep2: "2. Tick the keys to sync on the Keys card (cross-group)",
245
+ activationStep3: "3. Click \"Sync selected\" and the models are ready",
246
246
  activationOpenConfig: "Open configuration",
247
247
  activationDismiss: "Got it",
248
248
  keysTitle: "Keys",
@@ -2319,7 +2319,7 @@ function DetailSectionBody({ t }) {
2319
2319
  //#endregion
2320
2320
  //#region src/client/plugins/ActivationGuide.tsx
2321
2321
  function ActivationGuide(props) {
2322
- const { t, onDismiss, onOpenDetails } = props;
2322
+ const { t, onDismiss, onOpenDetails, openBundleDetails } = props;
2323
2323
  return (0, react_jsx_runtime.jsxs)("div", {
2324
2324
  className: "s2s-card",
2325
2325
  children: [
@@ -2339,7 +2339,9 @@ function ActivationGuide(props) {
2339
2339
  className: "s2s-actions",
2340
2340
  children: [(0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.Button, {
2341
2341
  variant: "primary",
2342
- onClick: onOpenDetails,
2342
+ onClick: () => {
2343
+ if (!(openBundleDetails?.() ?? false)) onOpenDetails();
2344
+ },
2343
2345
  children: t("activationOpenConfig")
2344
2346
  }), (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.Button, {
2345
2347
  variant: "ghost",
@@ -2397,10 +2399,17 @@ function mount(ctx) {
2397
2399
  id: "sub2api-sync",
2398
2400
  locale: NS
2399
2401
  }, DetailSection));
2402
+ const activationOps = { openBundleDetails: () => {
2403
+ const nav = ctx.pluginNavigation;
2404
+ if (nav === undefined) return false;
2405
+ nav.openBundle(PKG_NAME);
2406
+ return true;
2407
+ } };
2400
2408
  ctx.slots.inject("plugins.bundle.activation", () => ctx.slots.register({
2401
2409
  name: "plugins.bundle.activation",
2402
2410
  key: PKG_NAME,
2403
- locale: NS
2411
+ locale: NS,
2412
+ inject: () => activationOps
2404
2413
  }, ActivationGuide));
2405
2414
  }
2406
2415
 
@@ -2410,7 +2419,8 @@ const name = "dsh-sub2api-sync-client";
2410
2419
  const inject = [
2411
2420
  "slots",
2412
2421
  "locale",
2413
- "configForms"
2422
+ "configForms",
2423
+ "pluginNavigation"
2414
2424
  ];
2415
2425
  function apply(ctx) {
2416
2426
  mount(ctx);
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Sub2API Sync",
4
- "description": "Sync one sub2api instance's groups, keys, and models into dsh-llm-pi-ai provider routes: panel-driven login (PAT / password / OAuth) first, one group one provider."
4
+ "description": "Sync one sub2api instance's groups, keys, and models into dsh-llm-pi-ai provider routes: panel-driven login (password / OAuth), one relay key one provider."
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Sub2API 同步",
4
- "description": "把一个 sub2api 实例的分组、key 与模型同步为 dsh-llm-pi-ai 供应商路由:先连接面板(PAT / 密码 / OAuth),一个分组一个供应商。"
4
+ "description": "把一个 sub2api 实例的分组、key 与模型同步为 dsh-llm-pi-ai 供应商路由:面板登录(密码 / OAuth),一把 key 一个供应商。"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mangoc/dsh-sub2api-sync",
3
- "description": "Sync one sub2api instance's groups, keys, and models into dsh-llm-pi-ai provider routes: panel-driven login (password / OAuth) first, one group one provider.",
4
- "version": "0.2.0",
3
+ "description": "Sync one sub2api instance's groups, keys, and models into dsh-llm-pi-ai provider routes: panel-driven login (password / OAuth), one relay key one provider.",
4
+ "version": "0.2.1",
5
5
  "license": "MIT",
6
6
  "author": "Shuai-S",
7
7
  "homepage": "https://github.com/Shuai-S/dsh-sub2api-sync#readme",