@elementspanel/epanel-plugin-config 1.0.1 → 1.0.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 +1 -5
- package/daemon/backend/index.cjs +270 -134
- package/daemon/plugin.json +0 -3
- package/package.json +8 -7
- package/panel/backend/index.cjs +3400 -146
- package/panel/frontend/assets/style-0-_panel-plugin-build-entry_config-f6a935f2.css +1 -0
- package/panel/frontend/panel-plugin-config-106e7df7.js +1 -0
- package/panel/plugin.json +1 -4
- package/panel/frontend/assets/style-0-_panel-plugin-build-entry_config-6c3cbd56.css +0 -1
- package/panel/frontend/panel-plugin-config-1f7cc416.js +0 -1
package/daemon/backend/index.cjs
CHANGED
|
@@ -1,10 +1,107 @@
|
|
|
1
1
|
/******/ (() => { // webpackBootstrap
|
|
2
|
-
/******/ "use strict";
|
|
3
2
|
/******/ var __webpack_modules__ = ({
|
|
4
3
|
|
|
4
|
+
/***/ "../../plugins/config/daemon/src/backend/settings.ts"
|
|
5
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10
|
+
exports.SettingsFormService = void 0;
|
|
11
|
+
const mcsmanager_common_1 = __webpack_require__("../common/src/index.ts");
|
|
12
|
+
const cordis_1 = __webpack_require__("cordis");
|
|
13
|
+
const cosmokit_1 = __webpack_require__("cosmokit");
|
|
14
|
+
/** Configuration declarations are owned by the daemon config plugin. */
|
|
15
|
+
class SettingsFormService extends cordis_1.Service {
|
|
16
|
+
declarations = [];
|
|
17
|
+
constructor(ctx) {
|
|
18
|
+
super(ctx, "settingsForm", true);
|
|
19
|
+
}
|
|
20
|
+
declare(declaration) {
|
|
21
|
+
const entry = { id: this.ctx.name, declaration };
|
|
22
|
+
return this.ctx.effect(() => {
|
|
23
|
+
this.declarations.push(entry);
|
|
24
|
+
return () => (0, cosmokit_1.remove)(this.declarations, entry);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
declared() {
|
|
28
|
+
return this.declarations.map((entry) => entry.id);
|
|
29
|
+
}
|
|
30
|
+
async read(id) {
|
|
31
|
+
const entry = this.declarations.find((item) => item.id === id);
|
|
32
|
+
if (!entry) {
|
|
33
|
+
const schema = this.ctx.plugins.configuration(id);
|
|
34
|
+
return schema.fields.length ? schema : null;
|
|
35
|
+
}
|
|
36
|
+
return { id, fields: entry.declaration.fields(), values: await entry.declaration.read() };
|
|
37
|
+
}
|
|
38
|
+
async write(id, values) {
|
|
39
|
+
const entry = this.declarations.find((item) => item.id === id);
|
|
40
|
+
if (!entry)
|
|
41
|
+
return (await this.ctx.plugins.configure(id, values)).result;
|
|
42
|
+
return this.ctx.plugins.runExclusive(async () => {
|
|
43
|
+
(0, mcsmanager_common_1.validatePluginSettings)(entry.declaration.fields(), values);
|
|
44
|
+
await entry.declaration.write(values);
|
|
45
|
+
return {
|
|
46
|
+
saved: true,
|
|
47
|
+
application: entry.declaration.restartRequired ? "restart-required" : "applied"
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.SettingsFormService = SettingsFormService;
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/***/ },
|
|
56
|
+
|
|
57
|
+
/***/ "../../plugins/config/daemon/src/i18n/index.ts"
|
|
58
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
59
|
+
|
|
60
|
+
"use strict";
|
|
61
|
+
|
|
62
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
63
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
64
|
+
};
|
|
65
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
66
|
+
exports.localeMessages = void 0;
|
|
67
|
+
const de_DE_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/de_DE.json"));
|
|
68
|
+
const en_US_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/en_US.json"));
|
|
69
|
+
const es_ES_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/es_ES.json"));
|
|
70
|
+
const fr_FR_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/fr_FR.json"));
|
|
71
|
+
const ja_JP_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/ja_JP.json"));
|
|
72
|
+
const ko_KR_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/ko_KR.json"));
|
|
73
|
+
const pt_BR_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/pt_BR.json"));
|
|
74
|
+
const ru_RU_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/ru_RU.json"));
|
|
75
|
+
const th_TH_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/th_TH.json"));
|
|
76
|
+
const tr_TR_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/tr_TR.json"));
|
|
77
|
+
const zh_CN_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/zh_CN.json"));
|
|
78
|
+
const zh_TW_json_1 = __importDefault(__webpack_require__("../../plugins/config/daemon/src/i18n/zh_TW.json"));
|
|
79
|
+
// The refusals this plugin's protocol handlers throw. The panel surfaces them
|
|
80
|
+
// verbatim on its plugin manager page, so they are translated here rather than
|
|
81
|
+
// in the panel: this daemon knows which of its own plugins may not be switched
|
|
82
|
+
// off remotely, and it answers in the language it was told to speak.
|
|
83
|
+
exports.localeMessages = {
|
|
84
|
+
de_de: de_DE_json_1.default,
|
|
85
|
+
en_us: en_US_json_1.default,
|
|
86
|
+
es_es: es_ES_json_1.default,
|
|
87
|
+
fr_fr: fr_FR_json_1.default,
|
|
88
|
+
ja_jp: ja_JP_json_1.default,
|
|
89
|
+
ko_kr: ko_KR_json_1.default,
|
|
90
|
+
pt_br: pt_BR_json_1.default,
|
|
91
|
+
ru_ru: ru_RU_json_1.default,
|
|
92
|
+
th_th: th_TH_json_1.default,
|
|
93
|
+
tr_tr: tr_TR_json_1.default,
|
|
94
|
+
zh_cn: zh_CN_json_1.default,
|
|
95
|
+
zh_tw: zh_TW_json_1.default
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
/***/ },
|
|
100
|
+
|
|
5
101
|
/***/ "../common/src/array.ts"
|
|
6
102
|
(__unused_webpack_module, exports) {
|
|
7
103
|
|
|
104
|
+
"use strict";
|
|
8
105
|
|
|
9
106
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10
107
|
exports.arrayUnique = arrayUnique;
|
|
@@ -21,6 +118,7 @@ function arrayUnique(arr, felidName) {
|
|
|
21
118
|
/***/ "../common/src/docker_utils.ts"
|
|
22
119
|
(__unused_webpack_module, exports) {
|
|
23
120
|
|
|
121
|
+
"use strict";
|
|
24
122
|
|
|
25
123
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
26
124
|
exports.normalizeDockerArchitecture = normalizeDockerArchitecture;
|
|
@@ -63,6 +161,7 @@ function normalizeDockerPlatform(platform) {
|
|
|
63
161
|
/***/ "../common/src/global_variable.ts"
|
|
64
162
|
(__unused_webpack_module, exports) {
|
|
65
163
|
|
|
164
|
+
"use strict";
|
|
66
165
|
|
|
67
166
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
68
167
|
class GlobalVariable {
|
|
@@ -90,6 +189,7 @@ exports["default"] = GlobalVariable;
|
|
|
90
189
|
/***/ "../common/src/index.ts"
|
|
91
190
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
92
191
|
|
|
192
|
+
"use strict";
|
|
93
193
|
|
|
94
194
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
95
195
|
if (k2 === undefined) k2 = k;
|
|
@@ -173,6 +273,7 @@ Object.defineProperty(exports, "normalizeDockerPlatform", ({ enumerable: true, g
|
|
|
173
273
|
/***/ "../common/src/instance_stream.ts"
|
|
174
274
|
(__unused_webpack_module, exports) {
|
|
175
275
|
|
|
276
|
+
"use strict";
|
|
176
277
|
|
|
177
278
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
178
279
|
// Application instance data stream forwarding adapter
|
|
@@ -232,6 +333,7 @@ exports["default"] = InstanceStreamListener;
|
|
|
232
333
|
/***/ "../common/src/mcping.ts"
|
|
233
334
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
234
335
|
|
|
336
|
+
"use strict";
|
|
235
337
|
|
|
236
338
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
237
339
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -350,6 +452,7 @@ exports["default"] = PingMinecraftServer;
|
|
|
350
452
|
/***/ "../common/src/plugin_contract.ts"
|
|
351
453
|
(__unused_webpack_module, exports) {
|
|
352
454
|
|
|
455
|
+
"use strict";
|
|
353
456
|
|
|
354
457
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
355
458
|
exports.PLUGIN_SDK_VERSION = exports.PLUGIN_API_VERSION = void 0;
|
|
@@ -516,6 +619,7 @@ function validatePluginSettings(fields, values) {
|
|
|
516
619
|
/***/ "../common/src/plugin_lifecycle.ts"
|
|
517
620
|
(__unused_webpack_module, exports) {
|
|
518
621
|
|
|
622
|
+
"use strict";
|
|
519
623
|
|
|
520
624
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
521
625
|
exports.trackPluginDisposal = trackPluginDisposal;
|
|
@@ -582,6 +686,7 @@ function trackPluginDisposal(ctx) {
|
|
|
582
686
|
/***/ "../common/src/plugin_manifest.ts"
|
|
583
687
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
584
688
|
|
|
689
|
+
"use strict";
|
|
585
690
|
|
|
586
691
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
587
692
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -637,7 +742,7 @@ function objectValue(value) {
|
|
|
637
742
|
* keep it at the package root, with runtime metadata under elementspanel.<side>.
|
|
638
743
|
* Stop at the first package boundary so a host's metadata cannot reach a plugin.
|
|
639
744
|
*/
|
|
640
|
-
function readPackageMetadata(directory
|
|
745
|
+
function readPackageMetadata(directory) {
|
|
641
746
|
const pluginDirectory = node_path_1.default.resolve(directory);
|
|
642
747
|
let current = pluginDirectory;
|
|
643
748
|
while (true) {
|
|
@@ -649,12 +754,19 @@ function readPackageMetadata(directory, id) {
|
|
|
649
754
|
.map(objectValue)
|
|
650
755
|
.find((side) => typeof side.directory === "string" &&
|
|
651
756
|
node_path_1.default.resolve(current, side.directory) === pluginDirectory);
|
|
652
|
-
if (current !== pluginDirectory && (packageId !==
|
|
757
|
+
if (current !== pluginDirectory && (typeof packageId !== "string" || !definition))
|
|
653
758
|
return {};
|
|
654
759
|
const { directory: _directory, folder: _folder, ...sideMetadata } = definition ?? {};
|
|
655
|
-
const result = {
|
|
760
|
+
const result = {
|
|
761
|
+
...metadata,
|
|
762
|
+
...shared,
|
|
763
|
+
...sideMetadata,
|
|
764
|
+
...(packageId === undefined ? {} : { id: packageId })
|
|
765
|
+
};
|
|
766
|
+
if (metadata.version !== undefined)
|
|
767
|
+
result.version = metadata.version;
|
|
656
768
|
// npm's main/entry fields do not define a side's execution entry.
|
|
657
|
-
for (const field of
|
|
769
|
+
for (const field of ENTRY_FIELDS)
|
|
658
770
|
delete result[field];
|
|
659
771
|
return result;
|
|
660
772
|
}
|
|
@@ -664,7 +776,7 @@ function readPackageMetadata(directory, id) {
|
|
|
664
776
|
current = parent;
|
|
665
777
|
}
|
|
666
778
|
}
|
|
667
|
-
/**
|
|
779
|
+
/** Combines execution entries with package metadata. Legacy manifests still load. */
|
|
668
780
|
function readPluginManifest(directory, onWarning, fallbackId = node_path_1.default.basename(directory)) {
|
|
669
781
|
for (const file of MANIFEST_FILES) {
|
|
670
782
|
const filePath = node_path_1.default.join(directory, file);
|
|
@@ -674,17 +786,22 @@ function readPluginManifest(directory, onWarning, fallbackId = node_path_1.defau
|
|
|
674
786
|
const value = JSON.parse(node_fs_1.default.readFileSync(filePath, "utf8"));
|
|
675
787
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
676
788
|
return null;
|
|
677
|
-
const
|
|
789
|
+
const packageMetadata = readPackageMetadata(directory);
|
|
790
|
+
const id = typeof packageMetadata.id === "string"
|
|
791
|
+
? packageMetadata.id
|
|
792
|
+
: typeof value.id === "string"
|
|
793
|
+
? value.id
|
|
794
|
+
: fallbackId;
|
|
678
795
|
if (!id.trim())
|
|
679
796
|
return null;
|
|
680
797
|
const manifest = {
|
|
681
798
|
...value,
|
|
682
|
-
...
|
|
799
|
+
...packageMetadata,
|
|
683
800
|
id: id.trim()
|
|
684
801
|
};
|
|
685
|
-
//
|
|
686
|
-
//
|
|
687
|
-
for (const field of
|
|
802
|
+
// Only execution paths come from plugin.json; package.json owns identity,
|
|
803
|
+
// version, dual status and all other metadata.
|
|
804
|
+
for (const field of ENTRY_FIELDS) {
|
|
688
805
|
if (value[field] !== undefined)
|
|
689
806
|
manifest[field] = value[field];
|
|
690
807
|
}
|
|
@@ -811,6 +928,7 @@ function sortPlugins(plugins) {
|
|
|
811
928
|
/***/ "../common/src/plugin_modules.ts"
|
|
812
929
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
813
930
|
|
|
931
|
+
"use strict";
|
|
814
932
|
|
|
815
933
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
816
934
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -982,6 +1100,7 @@ async function loadPluginModule(entry, directory, revision) {
|
|
|
982
1100
|
/***/ "../common/src/plugin_npm.ts"
|
|
983
1101
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
984
1102
|
|
|
1103
|
+
"use strict";
|
|
985
1104
|
|
|
986
1105
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
987
1106
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1026,7 +1145,7 @@ function stringValue(value) {
|
|
|
1026
1145
|
return typeof value === "string" ? value : "";
|
|
1027
1146
|
}
|
|
1028
1147
|
function currentPackageRoot() {
|
|
1029
|
-
return path_1.default.resolve(process.env.EPANEL_PACKAGE_ROOT || process.cwd());
|
|
1148
|
+
return path_1.default.resolve(process.env.EPANEL_PACKAGE_ROOT || process.env.EPANEL_SOURCE_ROOT || process.cwd());
|
|
1030
1149
|
}
|
|
1031
1150
|
function currentProjectRoot(packageRoot = currentPackageRoot()) {
|
|
1032
1151
|
// The npm worker sets EPANEL_PROJECT_ROOT to the installation directory. In a
|
|
@@ -1034,6 +1153,8 @@ function currentProjectRoot(packageRoot = currentPackageRoot()) {
|
|
|
1034
1153
|
if (process.env.EPANEL_PROJECT_ROOT)
|
|
1035
1154
|
return path_1.default.resolve(process.env.EPANEL_PROJECT_ROOT);
|
|
1036
1155
|
const scope = path_1.default.resolve(packageRoot, "..");
|
|
1156
|
+
if (path_1.default.basename(scope) === "core")
|
|
1157
|
+
return path_1.default.dirname(scope);
|
|
1037
1158
|
const nodeModules = path_1.default.dirname(scope);
|
|
1038
1159
|
if (path_1.default.basename(nodeModules) === "node_modules" && path_1.default.basename(scope).startsWith("@"))
|
|
1039
1160
|
return path_1.default.dirname(nodeModules);
|
|
@@ -1497,6 +1618,7 @@ async function uninstallNpmPlugin(pluginId, options = {}) {
|
|
|
1497
1618
|
/***/ "../common/src/plugin_overrides.ts"
|
|
1498
1619
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
1499
1620
|
|
|
1621
|
+
"use strict";
|
|
1500
1622
|
|
|
1501
1623
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
1502
1624
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1585,6 +1707,7 @@ function writePluginOverride(id, patch, filename = pluginOverridesPath()) {
|
|
|
1585
1707
|
/***/ "../common/src/plugin_revision.ts"
|
|
1586
1708
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
1587
1709
|
|
|
1710
|
+
"use strict";
|
|
1588
1711
|
|
|
1589
1712
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
1590
1713
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1640,6 +1763,7 @@ function pluginDirectoryRevision(directory) {
|
|
|
1640
1763
|
/***/ "../common/src/plugin_watch.ts"
|
|
1641
1764
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
1642
1765
|
|
|
1766
|
+
"use strict";
|
|
1643
1767
|
|
|
1644
1768
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
1645
1769
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1716,6 +1840,7 @@ function watchNpmPlugins(ctx, side, reload, changed) {
|
|
|
1716
1840
|
/***/ "../common/src/process_tools.ts"
|
|
1717
1841
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
1718
1842
|
|
|
1843
|
+
"use strict";
|
|
1719
1844
|
|
|
1720
1845
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
1721
1846
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1880,6 +2005,7 @@ function killProcess(pid, process, signal) {
|
|
|
1880
2005
|
/***/ "../common/src/query_wrapper.ts"
|
|
1881
2006
|
(__unused_webpack_module, exports) {
|
|
1882
2007
|
|
|
2008
|
+
"use strict";
|
|
1883
2009
|
|
|
1884
2010
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1885
2011
|
exports.QueryWrapper = exports.LocalFileSource = exports.MySqlSource = exports.QueryMapWrapper = void 0;
|
|
@@ -1993,6 +2119,7 @@ exports.QueryWrapper = QueryWrapper;
|
|
|
1993
2119
|
/***/ "../common/src/runtime_paths.ts"
|
|
1994
2120
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
1995
2121
|
|
|
2122
|
+
"use strict";
|
|
1996
2123
|
|
|
1997
2124
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
1998
2125
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -2007,22 +2134,24 @@ exports.ensureExecutable = ensureExecutable;
|
|
|
2007
2134
|
const node_fs_1 = __importDefault(__webpack_require__("node:fs"));
|
|
2008
2135
|
const node_os_1 = __importDefault(__webpack_require__("node:os"));
|
|
2009
2136
|
const node_path_1 = __importDefault(__webpack_require__("node:path"));
|
|
2137
|
+
// @ts-ignore Shared source layout is also consumed by the Node build tools.
|
|
2138
|
+
const workspace_layout_cjs_1 = __webpack_require__("../../scripts/workspace-layout.cjs");
|
|
2010
2139
|
/** Set by the npm worker before any application module is loaded. */
|
|
2011
2140
|
function isPackagedRuntime() {
|
|
2012
2141
|
return Boolean(process.env.EPANEL_PACKAGE_ROOT);
|
|
2013
2142
|
}
|
|
2014
2143
|
/** Code and bundled assets belong to the package; cwd always belongs to the user. */
|
|
2015
2144
|
function packagePath(...parts) {
|
|
2016
|
-
return node_path_1.default.resolve(process.env.EPANEL_PACKAGE_ROOT || process.cwd(), ...parts);
|
|
2145
|
+
return node_path_1.default.resolve(process.env.EPANEL_PACKAGE_ROOT || process.env.EPANEL_SOURCE_ROOT || process.cwd(), ...parts);
|
|
2017
2146
|
}
|
|
2018
2147
|
function npmPluginRoots(side) {
|
|
2019
2148
|
// The same resolver is used by the CLI before the bundled application starts.
|
|
2020
|
-
// A development checkout keeps it in the repository
|
|
2149
|
+
// A development checkout keeps it in the repository above core/<side>,
|
|
2021
2150
|
// so project-installed npm plugins work there as well.
|
|
2022
2151
|
const runtimeRequire = eval("require");
|
|
2023
2152
|
const resolver = isPackagedRuntime()
|
|
2024
2153
|
? packagePath("runtime/npm-plugins.cjs")
|
|
2025
|
-
: node_path_1.default.resolve(packagePath(), "
|
|
2154
|
+
: node_path_1.default.resolve(packagePath(), "../..", "scripts", "runtime", "npm-plugins.cjs");
|
|
2026
2155
|
// A development process may run from a fixture directory without a runtime
|
|
2027
2156
|
// package; there is nothing to resolve in that case.
|
|
2028
2157
|
if (!node_fs_1.default.existsSync(node_path_1.default.join(packagePath(), "package.json")))
|
|
@@ -2043,9 +2172,16 @@ function npmPluginRoots(side) {
|
|
|
2043
2172
|
}));
|
|
2044
2173
|
}
|
|
2045
2174
|
function packagePluginRoots(side) {
|
|
2175
|
+
const sourceCheckout = process.env.EPANEL_SOURCE_ROOT || node_path_1.default.basename(node_path_1.default.dirname(packagePath())) === "core";
|
|
2046
2176
|
const roots = isPackagedRuntime()
|
|
2047
2177
|
? []
|
|
2048
|
-
:
|
|
2178
|
+
: !sourceCheckout
|
|
2179
|
+
? [{ directory: packagePath("plugins"), defaultEnabled: true }]
|
|
2180
|
+
: (0, workspace_layout_cjs_1.sourcePlugins)(side, node_path_1.default.resolve(packagePath(), "../..")).map((plugin) => ({
|
|
2181
|
+
directory: plugin.directory,
|
|
2182
|
+
folder: plugin.folder,
|
|
2183
|
+
defaultEnabled: true
|
|
2184
|
+
}));
|
|
2049
2185
|
// Project-installed npm plugins load in development too: they are dependencies
|
|
2050
2186
|
// of the development project, not of the published runtime package.
|
|
2051
2187
|
roots.push(...npmPluginRoots(side));
|
|
@@ -2066,7 +2202,7 @@ function bundledToolPath(name) {
|
|
|
2066
2202
|
// Published daemon packages download native tools into the installation's
|
|
2067
2203
|
// writable lib directory on first start. Development checkouts use the same
|
|
2068
2204
|
// repository-local sibling of data and logs.
|
|
2069
|
-
const root =
|
|
2205
|
+
const root = node_path_1.default.resolve(process.cwd(), "lib");
|
|
2070
2206
|
const primary = node_path_1.default.join(root, filename);
|
|
2071
2207
|
// Zip-Tools names its Intel macOS binary "amd64", while Node reports "x64".
|
|
2072
2208
|
if (!node_fs_1.default.existsSync(primary) && name === "file_zip" && platform === "darwin" && arch === "x64") {
|
|
@@ -2094,6 +2230,7 @@ function ensureExecutable(filename) {
|
|
|
2094
2230
|
/***/ "../common/src/string_utils.ts"
|
|
2095
2231
|
(__unused_webpack_module, exports) {
|
|
2096
2232
|
|
|
2233
|
+
"use strict";
|
|
2097
2234
|
|
|
2098
2235
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2099
2236
|
exports.removeTrail = removeTrail;
|
|
@@ -2112,6 +2249,7 @@ function removeTrail(origin, trail) {
|
|
|
2112
2249
|
/***/ "../common/src/system_info.ts"
|
|
2113
2250
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
2114
2251
|
|
|
2252
|
+
"use strict";
|
|
2115
2253
|
|
|
2116
2254
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
2117
2255
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -2204,6 +2342,7 @@ function systemInfo() {
|
|
|
2204
2342
|
/***/ "../common/src/system_storage.ts"
|
|
2205
2343
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
2206
2344
|
|
|
2345
|
+
"use strict";
|
|
2207
2346
|
|
|
2208
2347
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
2209
2348
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -2335,6 +2474,7 @@ exports["default"] = StorageSubsystem;
|
|
|
2335
2474
|
/***/ "../common/src/typecheck.ts"
|
|
2336
2475
|
(__unused_webpack_module, exports) {
|
|
2337
2476
|
|
|
2477
|
+
"use strict";
|
|
2338
2478
|
|
|
2339
2479
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2340
2480
|
exports.configureEntityParams = configureEntityParams;
|
|
@@ -2409,113 +2549,12 @@ function supposeValue(v, def) {
|
|
|
2409
2549
|
}
|
|
2410
2550
|
|
|
2411
2551
|
|
|
2412
|
-
/***/ },
|
|
2413
|
-
|
|
2414
|
-
/***/ "./plugins/config/src/backend/settings.ts"
|
|
2415
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2419
|
-
exports.SettingsFormService = void 0;
|
|
2420
|
-
const mcsmanager_common_1 = __webpack_require__("../common/src/index.ts");
|
|
2421
|
-
const cordis_1 = __webpack_require__("cordis");
|
|
2422
|
-
const cosmokit_1 = __webpack_require__("cosmokit");
|
|
2423
|
-
/** Configuration declarations are owned by the daemon config plugin. */
|
|
2424
|
-
class SettingsFormService extends cordis_1.Service {
|
|
2425
|
-
declarations = [];
|
|
2426
|
-
constructor(ctx) {
|
|
2427
|
-
super(ctx, "settingsForm", true);
|
|
2428
|
-
}
|
|
2429
|
-
declare(declaration) {
|
|
2430
|
-
const entry = { id: this.ctx.name, declaration };
|
|
2431
|
-
return this.ctx.effect(() => {
|
|
2432
|
-
this.declarations.push(entry);
|
|
2433
|
-
return () => (0, cosmokit_1.remove)(this.declarations, entry);
|
|
2434
|
-
});
|
|
2435
|
-
}
|
|
2436
|
-
declared() {
|
|
2437
|
-
return this.declarations.map((entry) => entry.id);
|
|
2438
|
-
}
|
|
2439
|
-
async read(id) {
|
|
2440
|
-
const entry = this.declarations.find((item) => item.id === id);
|
|
2441
|
-
if (!entry) {
|
|
2442
|
-
const schema = this.ctx.plugins.configuration(id);
|
|
2443
|
-
return schema.fields.length ? schema : null;
|
|
2444
|
-
}
|
|
2445
|
-
return { id, fields: entry.declaration.fields(), values: await entry.declaration.read() };
|
|
2446
|
-
}
|
|
2447
|
-
async write(id, values) {
|
|
2448
|
-
const entry = this.declarations.find((item) => item.id === id);
|
|
2449
|
-
if (!entry)
|
|
2450
|
-
return (await this.ctx.plugins.configure(id, values)).result;
|
|
2451
|
-
return this.ctx.plugins.runExclusive(async () => {
|
|
2452
|
-
(0, mcsmanager_common_1.validatePluginSettings)(entry.declaration.fields(), values);
|
|
2453
|
-
await entry.declaration.write(values);
|
|
2454
|
-
return {
|
|
2455
|
-
saved: true,
|
|
2456
|
-
application: entry.declaration.restartRequired ? "restart-required" : "applied"
|
|
2457
|
-
};
|
|
2458
|
-
});
|
|
2459
|
-
}
|
|
2460
|
-
}
|
|
2461
|
-
exports.SettingsFormService = SettingsFormService;
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
/***/ },
|
|
2465
|
-
|
|
2466
|
-
/***/ "./plugins/config/src/i18n/index.ts"
|
|
2467
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
2471
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
2472
|
-
};
|
|
2473
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2474
|
-
exports.localeMessages = void 0;
|
|
2475
|
-
const de_DE_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/de_DE.json"));
|
|
2476
|
-
const en_US_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/en_US.json"));
|
|
2477
|
-
const es_ES_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/es_ES.json"));
|
|
2478
|
-
const fr_FR_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/fr_FR.json"));
|
|
2479
|
-
const ja_JP_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/ja_JP.json"));
|
|
2480
|
-
const ko_KR_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/ko_KR.json"));
|
|
2481
|
-
const pt_BR_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/pt_BR.json"));
|
|
2482
|
-
const ru_RU_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/ru_RU.json"));
|
|
2483
|
-
const th_TH_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/th_TH.json"));
|
|
2484
|
-
const tr_TR_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/tr_TR.json"));
|
|
2485
|
-
const zh_CN_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/zh_CN.json"));
|
|
2486
|
-
const zh_TW_json_1 = __importDefault(__webpack_require__("./plugins/config/src/i18n/zh_TW.json"));
|
|
2487
|
-
// The refusals this plugin's protocol handlers throw. The panel surfaces them
|
|
2488
|
-
// verbatim on its plugin manager page, so they are translated here rather than
|
|
2489
|
-
// in the panel: this daemon knows which of its own plugins may not be switched
|
|
2490
|
-
// off remotely, and it answers in the language it was told to speak.
|
|
2491
|
-
exports.localeMessages = {
|
|
2492
|
-
de_de: de_DE_json_1.default,
|
|
2493
|
-
en_us: en_US_json_1.default,
|
|
2494
|
-
es_es: es_ES_json_1.default,
|
|
2495
|
-
fr_fr: fr_FR_json_1.default,
|
|
2496
|
-
ja_jp: ja_JP_json_1.default,
|
|
2497
|
-
ko_kr: ko_KR_json_1.default,
|
|
2498
|
-
pt_br: pt_BR_json_1.default,
|
|
2499
|
-
ru_ru: ru_RU_json_1.default,
|
|
2500
|
-
th_th: th_TH_json_1.default,
|
|
2501
|
-
tr_tr: tr_TR_json_1.default,
|
|
2502
|
-
zh_cn: zh_CN_json_1.default,
|
|
2503
|
-
zh_tw: zh_TW_json_1.default
|
|
2504
|
-
};
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
/***/ },
|
|
2508
|
-
|
|
2509
|
-
/***/ "events"
|
|
2510
|
-
(module) {
|
|
2511
|
-
|
|
2512
|
-
module.exports = require("events");
|
|
2513
|
-
|
|
2514
2552
|
/***/ },
|
|
2515
2553
|
|
|
2516
2554
|
/***/ "fs-extra"
|
|
2517
2555
|
(module) {
|
|
2518
2556
|
|
|
2557
|
+
"use strict";
|
|
2519
2558
|
module.exports = require("fs-extra");
|
|
2520
2559
|
|
|
2521
2560
|
/***/ },
|
|
@@ -2523,6 +2562,7 @@ module.exports = require("fs-extra");
|
|
|
2523
2562
|
/***/ "iconv-lite"
|
|
2524
2563
|
(module) {
|
|
2525
2564
|
|
|
2565
|
+
"use strict";
|
|
2526
2566
|
module.exports = require("iconv-lite");
|
|
2527
2567
|
|
|
2528
2568
|
/***/ },
|
|
@@ -2530,6 +2570,7 @@ module.exports = require("iconv-lite");
|
|
|
2530
2570
|
/***/ "os-utils"
|
|
2531
2571
|
(module) {
|
|
2532
2572
|
|
|
2573
|
+
"use strict";
|
|
2533
2574
|
module.exports = require("os-utils");
|
|
2534
2575
|
|
|
2535
2576
|
/***/ },
|
|
@@ -2537,6 +2578,7 @@ module.exports = require("os-utils");
|
|
|
2537
2578
|
/***/ "cordis"
|
|
2538
2579
|
(module) {
|
|
2539
2580
|
|
|
2581
|
+
"use strict";
|
|
2540
2582
|
module.exports = require("cordis");
|
|
2541
2583
|
|
|
2542
2584
|
/***/ },
|
|
@@ -2544,6 +2586,7 @@ module.exports = require("cordis");
|
|
|
2544
2586
|
/***/ "cosmokit"
|
|
2545
2587
|
(module) {
|
|
2546
2588
|
|
|
2589
|
+
"use strict";
|
|
2547
2590
|
module.exports = require("cosmokit");
|
|
2548
2591
|
|
|
2549
2592
|
/***/ },
|
|
@@ -2551,6 +2594,7 @@ module.exports = require("cosmokit");
|
|
|
2551
2594
|
/***/ "child_process"
|
|
2552
2595
|
(module) {
|
|
2553
2596
|
|
|
2597
|
+
"use strict";
|
|
2554
2598
|
module.exports = require("child_process");
|
|
2555
2599
|
|
|
2556
2600
|
/***/ },
|
|
@@ -2558,13 +2602,23 @@ module.exports = require("child_process");
|
|
|
2558
2602
|
/***/ "crypto"
|
|
2559
2603
|
(module) {
|
|
2560
2604
|
|
|
2605
|
+
"use strict";
|
|
2561
2606
|
module.exports = require("crypto");
|
|
2562
2607
|
|
|
2563
2608
|
/***/ },
|
|
2564
2609
|
|
|
2610
|
+
/***/ "events"
|
|
2611
|
+
(module) {
|
|
2612
|
+
|
|
2613
|
+
"use strict";
|
|
2614
|
+
module.exports = require("events");
|
|
2615
|
+
|
|
2616
|
+
/***/ },
|
|
2617
|
+
|
|
2565
2618
|
/***/ "fs"
|
|
2566
2619
|
(module) {
|
|
2567
2620
|
|
|
2621
|
+
"use strict";
|
|
2568
2622
|
module.exports = require("fs");
|
|
2569
2623
|
|
|
2570
2624
|
/***/ },
|
|
@@ -2572,6 +2626,7 @@ module.exports = require("fs");
|
|
|
2572
2626
|
/***/ "module"
|
|
2573
2627
|
(module) {
|
|
2574
2628
|
|
|
2629
|
+
"use strict";
|
|
2575
2630
|
module.exports = require("module");
|
|
2576
2631
|
|
|
2577
2632
|
/***/ },
|
|
@@ -2579,6 +2634,7 @@ module.exports = require("module");
|
|
|
2579
2634
|
/***/ "net"
|
|
2580
2635
|
(module) {
|
|
2581
2636
|
|
|
2637
|
+
"use strict";
|
|
2582
2638
|
module.exports = require("net");
|
|
2583
2639
|
|
|
2584
2640
|
/***/ },
|
|
@@ -2586,6 +2642,7 @@ module.exports = require("net");
|
|
|
2586
2642
|
/***/ "node:crypto"
|
|
2587
2643
|
(module) {
|
|
2588
2644
|
|
|
2645
|
+
"use strict";
|
|
2589
2646
|
module.exports = require("node:crypto");
|
|
2590
2647
|
|
|
2591
2648
|
/***/ },
|
|
@@ -2593,6 +2650,7 @@ module.exports = require("node:crypto");
|
|
|
2593
2650
|
/***/ "node:fs"
|
|
2594
2651
|
(module) {
|
|
2595
2652
|
|
|
2653
|
+
"use strict";
|
|
2596
2654
|
module.exports = require("node:fs");
|
|
2597
2655
|
|
|
2598
2656
|
/***/ },
|
|
@@ -2600,6 +2658,7 @@ module.exports = require("node:fs");
|
|
|
2600
2658
|
/***/ "node:module"
|
|
2601
2659
|
(module) {
|
|
2602
2660
|
|
|
2661
|
+
"use strict";
|
|
2603
2662
|
module.exports = require("node:module");
|
|
2604
2663
|
|
|
2605
2664
|
/***/ },
|
|
@@ -2607,6 +2666,7 @@ module.exports = require("node:module");
|
|
|
2607
2666
|
/***/ "node:os"
|
|
2608
2667
|
(module) {
|
|
2609
2668
|
|
|
2669
|
+
"use strict";
|
|
2610
2670
|
module.exports = require("node:os");
|
|
2611
2671
|
|
|
2612
2672
|
/***/ },
|
|
@@ -2614,6 +2674,7 @@ module.exports = require("node:os");
|
|
|
2614
2674
|
/***/ "node:path"
|
|
2615
2675
|
(module) {
|
|
2616
2676
|
|
|
2677
|
+
"use strict";
|
|
2617
2678
|
module.exports = require("node:path");
|
|
2618
2679
|
|
|
2619
2680
|
/***/ },
|
|
@@ -2621,6 +2682,7 @@ module.exports = require("node:path");
|
|
|
2621
2682
|
/***/ "node:url"
|
|
2622
2683
|
(module) {
|
|
2623
2684
|
|
|
2685
|
+
"use strict";
|
|
2624
2686
|
module.exports = require("node:url");
|
|
2625
2687
|
|
|
2626
2688
|
/***/ },
|
|
@@ -2628,6 +2690,7 @@ module.exports = require("node:url");
|
|
|
2628
2690
|
/***/ "os"
|
|
2629
2691
|
(module) {
|
|
2630
2692
|
|
|
2693
|
+
"use strict";
|
|
2631
2694
|
module.exports = require("os");
|
|
2632
2695
|
|
|
2633
2696
|
/***/ },
|
|
@@ -2635,6 +2698,7 @@ module.exports = require("os");
|
|
|
2635
2698
|
/***/ "path"
|
|
2636
2699
|
(module) {
|
|
2637
2700
|
|
|
2701
|
+
"use strict";
|
|
2638
2702
|
module.exports = require("path");
|
|
2639
2703
|
|
|
2640
2704
|
/***/ },
|
|
@@ -2642,90 +2706,157 @@ module.exports = require("path");
|
|
|
2642
2706
|
/***/ "process"
|
|
2643
2707
|
(module) {
|
|
2644
2708
|
|
|
2709
|
+
"use strict";
|
|
2645
2710
|
module.exports = require("process");
|
|
2646
2711
|
|
|
2647
2712
|
/***/ },
|
|
2648
2713
|
|
|
2649
|
-
/***/ "
|
|
2714
|
+
/***/ "../../scripts/workspace-layout.cjs"
|
|
2715
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
2716
|
+
|
|
2717
|
+
const fs = __webpack_require__("node:fs");
|
|
2718
|
+
const path = __webpack_require__("node:path");
|
|
2719
|
+
|
|
2720
|
+
const repository = path.resolve(__dirname, "..");
|
|
2721
|
+
const coreDirectory = (side, root = repository) => path.join(root, "core", side);
|
|
2722
|
+
const developmentDirectory = (side, root = repository) => path.join(root, "data", side);
|
|
2723
|
+
|
|
2724
|
+
/** Source packages use the same per-side metadata as their published npm packages. */
|
|
2725
|
+
function sourcePlugins(side, root = repository) {
|
|
2726
|
+
if (!["panel", "daemon"].includes(side)) throw new Error(`Unknown plugin side: ${side}`);
|
|
2727
|
+
const directory = path.join(root, "plugins");
|
|
2728
|
+
if (!fs.existsSync(directory)) return [];
|
|
2729
|
+
const plugins = [];
|
|
2730
|
+
for (const item of fs.readdirSync(directory, { withFileTypes: true })) {
|
|
2731
|
+
if (!item.isDirectory()) continue;
|
|
2732
|
+
const packageRoot = path.join(directory, item.name);
|
|
2733
|
+
const filename = path.join(packageRoot, "package.json");
|
|
2734
|
+
if (!fs.existsSync(filename)) continue;
|
|
2735
|
+
const metadata = JSON.parse(fs.readFileSync(filename, "utf8"));
|
|
2736
|
+
const definition = metadata.elementspanel?.[side];
|
|
2737
|
+
if (!definition) continue;
|
|
2738
|
+
const id = metadata.elementspanel.id;
|
|
2739
|
+
if (typeof id !== "string" || typeof definition.directory !== "string")
|
|
2740
|
+
throw new Error(`Invalid ${side} plugin metadata: ${filename}`);
|
|
2741
|
+
const pluginDirectory = path.resolve(packageRoot, definition.directory);
|
|
2742
|
+
const relative = path.relative(packageRoot, pluginDirectory);
|
|
2743
|
+
if (
|
|
2744
|
+
!relative ||
|
|
2745
|
+
relative === ".." ||
|
|
2746
|
+
relative.startsWith(`..${path.sep}`) ||
|
|
2747
|
+
path.isAbsolute(relative)
|
|
2748
|
+
)
|
|
2749
|
+
throw new Error(`Plugin directory must stay inside its package: ${filename}`);
|
|
2750
|
+
if (!fs.existsSync(path.join(pluginDirectory, "plugin.json")))
|
|
2751
|
+
throw new Error(`Missing ${side} plugin manifest: ${pluginDirectory}`);
|
|
2752
|
+
plugins.push({
|
|
2753
|
+
id,
|
|
2754
|
+
folder: definition.folder || id,
|
|
2755
|
+
directory: pluginDirectory,
|
|
2756
|
+
packageRoot,
|
|
2757
|
+
metadata
|
|
2758
|
+
});
|
|
2759
|
+
}
|
|
2760
|
+
return plugins.sort((a, b) => a.id.localeCompare(b.id));
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2763
|
+
module.exports = { repository, coreDirectory, developmentDirectory, sourcePlugins };
|
|
2764
|
+
|
|
2765
|
+
|
|
2766
|
+
/***/ },
|
|
2767
|
+
|
|
2768
|
+
/***/ "../../plugins/config/daemon/src/i18n/de_DE.json"
|
|
2650
2769
|
(module) {
|
|
2651
2770
|
|
|
2771
|
+
"use strict";
|
|
2652
2772
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"Der Webserver kann nicht aus der Ferne deaktiviert werden: Das Panel würde die Verbindung verlieren, über die es diesen Daemon verwaltet. Setze plugins.server.enabled auf dem Host in seiner data/plugin-overrides.json auf false.","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"Eine Plugin-ID ist erforderlich.","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"Die Plugin-Verwaltung kann sich nicht selbst deaktivieren: Das Panel würde die Events verlieren, mit denen es diesen Daemon verwaltet. Setze plugins.config.enabled auf dem Host in seiner data/plugin-overrides.json auf false."}');
|
|
2653
2773
|
|
|
2654
2774
|
/***/ },
|
|
2655
2775
|
|
|
2656
|
-
/***/ "
|
|
2776
|
+
/***/ "../../plugins/config/daemon/src/i18n/en_US.json"
|
|
2657
2777
|
(module) {
|
|
2658
2778
|
|
|
2779
|
+
"use strict";
|
|
2659
2780
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"The web server cannot be disabled remotely: the panel would lose the connection it manages this daemon over. Set plugins.server.enabled to false in its data/plugin-overrides.json on the host instead.","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"A plugin id is required.","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"Plugin management cannot disable itself: the panel would lose the events it administers this daemon with. Set plugins.config.enabled to false in its data/plugin-overrides.json on the host instead."}');
|
|
2660
2781
|
|
|
2661
2782
|
/***/ },
|
|
2662
2783
|
|
|
2663
|
-
/***/ "
|
|
2784
|
+
/***/ "../../plugins/config/daemon/src/i18n/es_ES.json"
|
|
2664
2785
|
(module) {
|
|
2665
2786
|
|
|
2787
|
+
"use strict";
|
|
2666
2788
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"El servidor web no puede desactivarse de forma remota: el panel perdería la conexión con la que administra este demonio. Establece plugins.server.enabled en false en su data/plugin-overrides.json en el host.","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"Se requiere un id de complemento.","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"La gestión de complementos no puede desactivarse a sí misma: el panel perdería los eventos con los que administra este demonio. Establece plugins.config.enabled en false en su data/plugin-overrides.json en el host."}');
|
|
2667
2789
|
|
|
2668
2790
|
/***/ },
|
|
2669
2791
|
|
|
2670
|
-
/***/ "
|
|
2792
|
+
/***/ "../../plugins/config/daemon/src/i18n/fr_FR.json"
|
|
2671
2793
|
(module) {
|
|
2672
2794
|
|
|
2795
|
+
"use strict";
|
|
2673
2796
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"Le serveur web ne peut pas être désactivé à distance : le panneau perdrait la connexion par laquelle il administre ce démon. Définissez plugins.server.enabled à false dans son data/plugin-overrides.json sur l hôte.","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"Un identifiant d extension est requis.","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"Le gestionnaire d extensions ne peut pas se désactiver lui-même : le panneau perdrait les événements par lesquels il administre ce démon. Définissez plugins.config.enabled à false dans son data/plugin-overrides.json sur l hôte."}');
|
|
2674
2797
|
|
|
2675
2798
|
/***/ },
|
|
2676
2799
|
|
|
2677
|
-
/***/ "
|
|
2800
|
+
/***/ "../../plugins/config/daemon/src/i18n/ja_JP.json"
|
|
2678
2801
|
(module) {
|
|
2679
2802
|
|
|
2803
|
+
"use strict";
|
|
2680
2804
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"Web サーバーはリモートから無効にできません。パネルがこのデーモンを管理している接続を失います。ホスト上で data/plugin-overrides.json の plugins.server.enabled を false に設定してください。","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"プラグイン ID を指定してください。","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"プラグイン管理は自身を無効にできません。パネルがこのデーモンを管理しているイベントを失います。ホスト上で data/plugin-overrides.json の plugins.config.enabled を false に設定してください。"}');
|
|
2681
2805
|
|
|
2682
2806
|
/***/ },
|
|
2683
2807
|
|
|
2684
|
-
/***/ "
|
|
2808
|
+
/***/ "../../plugins/config/daemon/src/i18n/ko_KR.json"
|
|
2685
2809
|
(module) {
|
|
2686
2810
|
|
|
2811
|
+
"use strict";
|
|
2687
2812
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"웹 서버는 원격으로 비활성화할 수 없습니다. 패널이 이 데몬을 관리하는 연결을 잃게 됩니다. 호스트에서 data/plugin-overrides.json의 plugins.server.enabled 를 false 로 설정하세요.","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"플러그인 ID가 필요합니다.","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"플러그인 관리는 자신을 비활성화할 수 없습니다. 패널이 이 데몬을 관리하는 이벤트를 잃게 됩니다. 호스트에서 data/plugin-overrides.json의 plugins.config.enabled 를 false 로 설정하세요."}');
|
|
2688
2813
|
|
|
2689
2814
|
/***/ },
|
|
2690
2815
|
|
|
2691
|
-
/***/ "
|
|
2816
|
+
/***/ "../../plugins/config/daemon/src/i18n/pt_BR.json"
|
|
2692
2817
|
(module) {
|
|
2693
2818
|
|
|
2819
|
+
"use strict";
|
|
2694
2820
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"O servidor web não pode ser desativado remotamente: o painel perderia a conexão pela qual administra este daemon. Defina plugins.server.enabled como false no data/plugin-overrides.json dele no host.","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"É necessário informar o id do plugin.","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"O gerenciador de plugins não pode desativar a si mesmo: o painel perderia os eventos pelos quais administra este daemon. Defina plugins.config.enabled como false no data/plugin-overrides.json dele no host."}');
|
|
2695
2821
|
|
|
2696
2822
|
/***/ },
|
|
2697
2823
|
|
|
2698
|
-
/***/ "
|
|
2824
|
+
/***/ "../../plugins/config/daemon/src/i18n/ru_RU.json"
|
|
2699
2825
|
(module) {
|
|
2700
2826
|
|
|
2827
|
+
"use strict";
|
|
2701
2828
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"Веб-сервер нельзя отключить удалённо: панель потеряет соединение, через которое управляет этим демоном. Укажите plugins.server.enabled: false в его data/plugin-overrides.json на хосте.","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"Требуется идентификатор плагина.","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"Менеджер плагинов не может отключить сам себя: панель потеряет события, через которые управляет этим демоном. Укажите plugins.config.enabled: false в его data/plugin-overrides.json на хосте."}');
|
|
2702
2829
|
|
|
2703
2830
|
/***/ },
|
|
2704
2831
|
|
|
2705
|
-
/***/ "
|
|
2832
|
+
/***/ "../../plugins/config/daemon/src/i18n/th_TH.json"
|
|
2706
2833
|
(module) {
|
|
2707
2834
|
|
|
2835
|
+
"use strict";
|
|
2708
2836
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"ไม่สามารถปิดใช้งานเว็บเซิร์ฟเวอร์จากระยะไกลได้ แผงควบคุมจะเสียการเชื่อมต่อที่ใช้จัดการดีมอนนี้ กรุณาตั้ง plugins.server.enabled เป็น false ใน data/plugin-overrides.json ของมันบนเครื่องโฮสต์","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"ต้องระบุรหัสปลั๊กอิน","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"ตัวจัดการปลั๊กอินปิดใช้งานตัวเองไม่ได้ แผงควบคุมจะเสียอีเวนต์ที่ใช้จัดการดีมอนนี้ กรุณาตั้ง plugins.config.enabled เป็น false ใน data/plugin-overrides.json ของมันบนเครื่องโฮสต์"}');
|
|
2709
2837
|
|
|
2710
2838
|
/***/ },
|
|
2711
2839
|
|
|
2712
|
-
/***/ "
|
|
2840
|
+
/***/ "../../plugins/config/daemon/src/i18n/tr_TR.json"
|
|
2713
2841
|
(module) {
|
|
2714
2842
|
|
|
2843
|
+
"use strict";
|
|
2715
2844
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"Web sunucusu uzaktan devre dışı bırakılamaz: panel bu daemon u yönettiği bağlantıyı kaybeder. Bunun yerine ana makinede data/plugin-overrides.json dosyasında plugins.server.enabled değerini false yapın.","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"Bir eklenti kimliği gerekli.","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"Eklenti yöneticisi kendisini devre dışı bırakamaz: panel bu daemon u yönettiği olayları kaybeder. Bunun yerine ana makinede data/plugin-overrides.json dosyasında plugins.config.enabled değerini false yapın."}');
|
|
2716
2845
|
|
|
2717
2846
|
/***/ },
|
|
2718
2847
|
|
|
2719
|
-
/***/ "
|
|
2848
|
+
/***/ "../../plugins/config/daemon/src/i18n/zh_CN.json"
|
|
2720
2849
|
(module) {
|
|
2721
2850
|
|
|
2851
|
+
"use strict";
|
|
2722
2852
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"Web 服务器不能远程禁用:面板会失去用来管理这个守护进程的连接。请在宿主机上把它的 data/plugin-overrides.json 里的 plugins.server.enabled 设为 false。","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"必须提供插件 ID。","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"插件管理无法禁用自己:面板会失去用来管理这个守护进程的事件。请在宿主机上把它的 data/plugin-overrides.json 里的 plugins.config.enabled 设为 false。"}');
|
|
2723
2853
|
|
|
2724
2854
|
/***/ },
|
|
2725
2855
|
|
|
2726
|
-
/***/ "
|
|
2856
|
+
/***/ "../../plugins/config/daemon/src/i18n/zh_TW.json"
|
|
2727
2857
|
(module) {
|
|
2728
2858
|
|
|
2859
|
+
"use strict";
|
|
2729
2860
|
module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DISABLE":"Web 伺服器不能遠端停用:面板會失去用來管理這個守護行程的連線。請在主機上把它的 data/plugin-overrides.json 裡的 plugins.server.enabled 設為 false。","TXT_CODE_DAEMON_PLUGIN_ID_REQUIRED":"必須提供外掛 ID。","TXT_CODE_DAEMON_PLUGIN_SELF_DISABLE":"外掛管理無法停用自己:面板會失去用來管理這個守護行程的事件。請在主機上把它的 data/plugin-overrides.json 裡的 plugins.config.enabled 設為 false。"}');
|
|
2730
2861
|
|
|
2731
2862
|
/***/ }
|
|
@@ -2758,16 +2889,18 @@ module.exports = /*#__PURE__*/JSON.parse('{"TXT_CODE_DAEMON_PLUGIN_ESSENTIAL_DIS
|
|
|
2758
2889
|
/******/
|
|
2759
2890
|
/************************************************************************/
|
|
2760
2891
|
var __webpack_exports__ = {};
|
|
2761
|
-
// This entry needs to be wrapped in an IIFE because it
|
|
2892
|
+
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
|
|
2762
2893
|
(() => {
|
|
2894
|
+
"use strict";
|
|
2763
2895
|
var exports = __webpack_exports__;
|
|
2764
2896
|
|
|
2765
2897
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2766
2898
|
exports.inject = void 0;
|
|
2767
2899
|
exports.apply = apply;
|
|
2768
2900
|
const mcsmanager_common_1 = __webpack_require__("../common/src/index.ts");
|
|
2769
|
-
const i18n_1 = __webpack_require__("
|
|
2770
|
-
const settings_1 = __webpack_require__("
|
|
2901
|
+
const i18n_1 = __webpack_require__("../../plugins/config/daemon/src/i18n/index.ts");
|
|
2902
|
+
const settings_1 = __webpack_require__("../../plugins/config/daemon/src/backend/settings.ts");
|
|
2903
|
+
const mcsmanager_common_2 = __webpack_require__("../common/src/index.ts");
|
|
2771
2904
|
// Daemon side of the plugin manager. The daemon core owns the mechanism —
|
|
2772
2905
|
// `ctx.plugins` lists what is installed and persists the enable switch — and
|
|
2773
2906
|
// this plugin only exposes it over the protocol, because the panel's plugin
|
|
@@ -2901,6 +3034,9 @@ function apply(ctx) {
|
|
|
2901
3034
|
try {
|
|
2902
3035
|
const pluginId = String(data?.pluginId ?? "");
|
|
2903
3036
|
await ctx.plugins.remove(pluginId);
|
|
3037
|
+
if (data?.removeConfig === true) {
|
|
3038
|
+
await ctx.plugins.runExclusive(async () => (0, mcsmanager_common_2.writePluginOverride)(pluginId, { config: {} }));
|
|
3039
|
+
}
|
|
2904
3040
|
ctx.protocol.response(routerCtx, { removed: true, pluginId });
|
|
2905
3041
|
}
|
|
2906
3042
|
catch (error) {
|