@nite07/dsh-search 0.1.1 → 0.1.2
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/README.md +4 -0
- package/README.zh.md +4 -0
- package/dist/client.js +14 -7
- package/locale/en.json +5 -2
- package/locale/zh.json +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/README.zh.md
CHANGED
package/dist/client.js
CHANGED
|
@@ -38,7 +38,7 @@ var NiteSearchClient = (() => {
|
|
|
38
38
|
description: "Multi-backend search with explicit anonymous or key access, cost tiers, bounded retries and complete Web settings. Backends start disabled; account-backed requests may incur charges."
|
|
39
39
|
},
|
|
40
40
|
title: "Web search",
|
|
41
|
-
intro: "{{enabled}} of {{total}} backends enabled.
|
|
41
|
+
intro: "{{enabled}} of {{total}} backends enabled.",
|
|
42
42
|
loading: "Loading saved settings\u2026",
|
|
43
43
|
loadFailed: "Could not load settings. Reload to try again.",
|
|
44
44
|
reload: "Reload settings",
|
|
@@ -253,7 +253,10 @@ var NiteSearchClient = (() => {
|
|
|
253
253
|
notSpecified: "Not specified",
|
|
254
254
|
activeTitle: "This plugin is not the active search provider",
|
|
255
255
|
activeOther: "The web seam currently selects \u201C{{provider}}\u201D. Searches keep going there until this plugin is selected.",
|
|
256
|
-
activateSelf: "Use this plugin for web search"
|
|
256
|
+
activateSelf: "Use this plugin for web search",
|
|
257
|
+
tierCount: "{{total}} total",
|
|
258
|
+
tierEnabled: "{{enabled}} on",
|
|
259
|
+
tierFiltered: "{{shown}} after filter"
|
|
257
260
|
};
|
|
258
261
|
|
|
259
262
|
// locale/zh.json
|
|
@@ -263,7 +266,7 @@ var NiteSearchClient = (() => {
|
|
|
263
266
|
description: "\u591A\u540E\u7AEF\u641C\u7D22\uFF0C\u56FA\u5B9A\u9009\u62E9\u533F\u540D\u6216\u5BC6\u94A5\u6A21\u5F0F\uFF0C\u63D0\u4F9B\u8D39\u7528\u5206\u6863\u3001\u6709\u9650\u91CD\u8BD5\u548C\u5B8C\u6574 Web \u8BBE\u7F6E\u3002\u540E\u7AEF\u9ED8\u8BA4\u5173\u95ED\uFF0C\u8D26\u6237\u8C03\u7528\u53EF\u80FD\u4EA7\u751F\u8D39\u7528\u3002"
|
|
264
267
|
},
|
|
265
268
|
title: "\u7F51\u9875\u641C\u7D22",
|
|
266
|
-
intro: "\u5DF2\u542F\u7528 {{enabled}}/{{total}} \u4E2A\u540E\u7AEF\u3002
|
|
269
|
+
intro: "\u5DF2\u542F\u7528 {{enabled}}/{{total}} \u4E2A\u540E\u7AEF\u3002",
|
|
267
270
|
loading: "\u6B63\u5728\u8BFB\u53D6\u5DF2\u4FDD\u5B58\u8BBE\u7F6E\u2026",
|
|
268
271
|
loadFailed: "\u8BFB\u53D6\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D\u3002",
|
|
269
272
|
reload: "\u91CD\u65B0\u52A0\u8F7D\u8BBE\u7F6E",
|
|
@@ -478,7 +481,10 @@ var NiteSearchClient = (() => {
|
|
|
478
481
|
notSpecified: "\u4E0D\u6307\u5B9A",
|
|
479
482
|
activeTitle: "\u5F53\u524D\u672A\u542F\u7528\u672C\u63D2\u4EF6\u4F5C\u4E3A\u641C\u7D22\u6E90",
|
|
480
483
|
activeOther: "\u5185\u7F6E\u641C\u7D22\u5F53\u524D\u9009\u62E9\u7684\u662F\u300C{{provider}}\u300D\u3002\u5728\u9009\u4E2D\u672C\u63D2\u4EF6\u4E4B\u524D\uFF0C\u641C\u7D22\u4ECD\u4F1A\u8D70\u5B83\u3002",
|
|
481
|
-
activateSelf: "\u8BBE\u4E3A\u7F51\u9875\u641C\u7D22\u6765\u6E90"
|
|
484
|
+
activateSelf: "\u8BBE\u4E3A\u7F51\u9875\u641C\u7D22\u6765\u6E90",
|
|
485
|
+
tierCount: "\u5171 {{total}} \u5BB6",
|
|
486
|
+
tierEnabled: "\u542F\u7528 {{enabled}}",
|
|
487
|
+
tierFiltered: "\u7B5B\u9009\u540E {{shown}}"
|
|
482
488
|
};
|
|
483
489
|
|
|
484
490
|
// src/catalog.ts
|
|
@@ -965,9 +971,10 @@ var NiteSearchClient = (() => {
|
|
|
965
971
|
setIssues([]);
|
|
966
972
|
setNotice("defaultsRestored");
|
|
967
973
|
}), showTransfer && /* @__PURE__ */ React.createElement("div", { className: "ns-field" }, /* @__PURE__ */ React.createElement("label", { htmlFor: "ns-import" }, t("importLabel")), /* @__PURE__ */ React.createElement("textarea", { id: "ns-import", value: importText, disabled: !!pending, onChange: (event) => setImportText(event.target.value), rows: 8 }), /* @__PURE__ */ React.createElement("button", { disabled: !!pending || !importText.trim(), onClick: importConfig }, t("applyImport"))))), tab === "backends" && /* @__PURE__ */ React.createElement("div", { role: "tabpanel", id: "panel-backends", "aria-labelledby": "tab-backends" }, /* @__PURE__ */ React.createElement("section", { className: "ns-backends", id: "sec-backends", tabIndex: -1, "aria-labelledby": "sec-backends-title" }, /* @__PURE__ */ React.createElement("h3", { id: "sec-backends-title" }, t("backends"), " ", /* @__PURE__ */ React.createElement("span", { className: "ns-muted" }, tr("enabledSummary", { enabled: enabledCount, total: definitions.length }))), /* @__PURE__ */ React.createElement("p", { className: "ns-muted" }, t("backendIntro")), /* @__PURE__ */ React.createElement("div", { className: "ns-toolbar" }, /* @__PURE__ */ React.createElement("div", { className: "ns-field" }, /* @__PURE__ */ React.createElement("label", { htmlFor: "ns-backend-search" }, t("searchBackends")), /* @__PURE__ */ React.createElement("input", { id: "ns-backend-search", type: "search", value: backendQuery, onChange: (event) => setBackendQuery(event.target.value), placeholder: t("searchBackendsPlaceholder") })), /* @__PURE__ */ React.createElement("div", { className: "ns-field" }, /* @__PURE__ */ React.createElement("label", { htmlFor: "ns-backend-filter" }, t("filterBackends")), /* @__PURE__ */ React.createElement("select", { id: "ns-backend-filter", value: backendFilter, onChange: (event) => setBackendFilter(event.target.value) }, ["all", "enabled", "configured"].map((value) => /* @__PURE__ */ React.createElement("option", { key: value, value }, t(`filter.${value}`)))))), ["free", "allowance", "trial", "paid", "self-hosted", "unverified"].map((tier) => {
|
|
968
|
-
const
|
|
969
|
-
const
|
|
970
|
-
|
|
974
|
+
const inTier = definitions.filter((def) => tierOf(def) === tier);
|
|
975
|
+
const members = inTier.filter(matches);
|
|
976
|
+
const enabledInTier = inTier.filter((def) => draft.backends[def.id]?.enabled).length;
|
|
977
|
+
return members.length ? /* @__PURE__ */ React.createElement("div", { className: "ns-tier", key: tier }, /* @__PURE__ */ React.createElement("h4", null, t(`tier.${tier}`), " ", /* @__PURE__ */ React.createElement("span", { className: "ns-muted" }, tr("tierCount", { total: inTier.length }), " \xB7 ", tr("tierEnabled", { enabled: enabledInTier }), members.length < inTier.length ? ` \xB7 ${tr("tierFiltered", { shown: members.length })}` : "")), members.map((def) => {
|
|
971
978
|
const backend2 = draft.backends[def.id];
|
|
972
979
|
if (!backend2) return null;
|
|
973
980
|
const mode2 = def.modes.find((item) => item.mode === backend2.mode);
|
package/locale/en.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"description": "Multi-backend search with explicit anonymous or key access, cost tiers, bounded retries and complete Web settings. Backends start disabled; account-backed requests may incur charges."
|
|
5
5
|
},
|
|
6
6
|
"title": "Web search",
|
|
7
|
-
"intro": "{{enabled}} of {{total}} backends enabled.
|
|
7
|
+
"intro": "{{enabled}} of {{total}} backends enabled.",
|
|
8
8
|
"loading": "Loading saved settings…",
|
|
9
9
|
"loadFailed": "Could not load settings. Reload to try again.",
|
|
10
10
|
"reload": "Reload settings",
|
|
@@ -219,5 +219,8 @@
|
|
|
219
219
|
"notSpecified": "Not specified",
|
|
220
220
|
"activeTitle": "This plugin is not the active search provider",
|
|
221
221
|
"activeOther": "The web seam currently selects “{{provider}}”. Searches keep going there until this plugin is selected.",
|
|
222
|
-
"activateSelf": "Use this plugin for web search"
|
|
222
|
+
"activateSelf": "Use this plugin for web search",
|
|
223
|
+
"tierCount": "{{total}} total",
|
|
224
|
+
"tierEnabled": "{{enabled}} on",
|
|
225
|
+
"tierFiltered": "{{shown}} after filter"
|
|
223
226
|
}
|
package/locale/zh.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"description": "多后端搜索,固定选择匿名或密钥模式,提供费用分档、有限重试和完整 Web 设置。后端默认关闭,账户调用可能产生费用。"
|
|
5
5
|
},
|
|
6
6
|
"title": "网页搜索",
|
|
7
|
-
"intro": "已启用 {{enabled}}/{{total}}
|
|
7
|
+
"intro": "已启用 {{enabled}}/{{total}} 个后端。",
|
|
8
8
|
"loading": "正在读取已保存设置…",
|
|
9
9
|
"loadFailed": "读取设置失败,请重新加载。",
|
|
10
10
|
"reload": "重新加载设置",
|
|
@@ -219,5 +219,8 @@
|
|
|
219
219
|
"notSpecified": "不指定",
|
|
220
220
|
"activeTitle": "当前未启用本插件作为搜索源",
|
|
221
221
|
"activeOther": "内置搜索当前选择的是「{{provider}}」。在选中本插件之前,搜索仍会走它。",
|
|
222
|
-
"activateSelf": "设为网页搜索来源"
|
|
222
|
+
"activateSelf": "设为网页搜索来源",
|
|
223
|
+
"tierCount": "共 {{total}} 家",
|
|
224
|
+
"tierEnabled": "启用 {{enabled}}",
|
|
225
|
+
"tierFiltered": "筛选后 {{shown}}"
|
|
223
226
|
}
|