homebridge-config-ui-x 5.2.1-beta.8 → 5.3.0
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 +6 -9
- package/config.schema.json +0 -32
- package/dist/bin/standalone.d.ts +2 -0
- package/dist/bin/standalone.js +58 -0
- package/dist/bin/standalone.js.map +1 -0
- package/dist/core/auth/auth.controller.d.ts +0 -5
- package/dist/core/config/config.service.d.ts +0 -10
- package/dist/core/config/config.service.js +0 -5
- package/dist/core/config/config.service.js.map +1 -1
- package/dist/globalDefaults.js +0 -3
- package/dist/globalDefaults.js.map +1 -1
- package/dist/modules/config-editor/config-editor.controller.d.ts +0 -1
- package/dist/modules/config-editor/config-editor.controller.js +0 -13
- package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
- package/dist/modules/config-editor/config-editor.service.d.ts +0 -1
- package/dist/modules/config-editor/config-editor.service.js +0 -7
- package/dist/modules/config-editor/config-editor.service.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +0 -2
- package/dist/modules/platform-tools/terminal/terminal.gateway.js +0 -18
- package/dist/modules/platform-tools/terminal/terminal.gateway.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.module.js +0 -4
- package/dist/modules/platform-tools/terminal/terminal.module.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.service.d.ts +0 -10
- package/dist/modules/platform-tools/terminal/terminal.service.js +6 -167
- package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
- package/package.json +6 -6
- package/public/3rdpartylicenses.txt +58 -58
- package/public/chunk-2V74YNKO.js +20 -0
- package/public/chunk-3AKLELGT.js +1 -0
- package/public/{chunk-2KOR6LRK.js → chunk-4TP3IKT3.js} +1 -1
- package/public/{chunk-QRQBCPWO.js → chunk-4XLPIGSD.js} +1 -1
- package/public/chunk-55DKEZRT.js +4 -0
- package/public/{chunk-A5MWQCGQ.js → chunk-65R3WGJK.js} +1 -1
- package/public/{chunk-NEMQW5FW.js → chunk-6ICMDOE6.js} +1 -1
- package/public/{chunk-2PP2VDL6.js → chunk-6QCBKKQ7.js} +1 -1
- package/public/{chunk-2LSH3KMC.js → chunk-6U2B3ZIB.js} +1 -1
- package/public/{chunk-CQAWPDW3.js → chunk-7L7OF6NJ.js} +1 -1
- package/public/chunk-7LC5ILOZ.js +8 -0
- package/public/{chunk-RABTAB22.js → chunk-7NRDWLRV.js} +1 -1
- package/public/{chunk-GBJM2RI4.js → chunk-A5YPMEVZ.js} +1 -1
- package/public/{chunk-IZBB7SRV.js → chunk-AOQFASDR.js} +1 -1
- package/public/{chunk-IKNF2DEX.js → chunk-BCQ7O7GT.js} +1 -1
- package/public/{chunk-NCB3IL32.js → chunk-BSFL67L2.js} +1 -1
- package/public/{chunk-EXI6FL7A.js → chunk-BUFCBMS4.js} +1 -1
- package/public/{chunk-IU5EKYXQ.js → chunk-CIFVKKCL.js} +1 -1
- package/public/{chunk-HHU6FT77.js → chunk-CN6AIV2G.js} +1 -1
- package/public/{chunk-S3TEEEYY.js → chunk-EJUHSQJT.js} +1 -1
- package/public/{chunk-6BLWRML2.js → chunk-EY4TL7MQ.js} +1 -1
- package/public/chunk-FBKZG6NW.js +5 -0
- package/public/{chunk-NSTN7R3D.js → chunk-HCLPERDW.js} +1 -1
- package/public/{chunk-LGEE7SWW.js → chunk-HPDPYCCU.js} +1 -1
- package/public/chunk-J647HPEO.js +1 -0
- package/public/chunk-JOWPFOJ6.js +1 -0
- package/public/{chunk-GRCWZ7OU.js → chunk-JWNACTNS.js} +1 -1
- package/public/{chunk-A7SXZCLG.js → chunk-KTVSDY3J.js} +1 -1
- package/public/chunk-L5YI32XL.js +1 -0
- package/public/chunk-MM4VXTF7.js +1 -0
- package/public/{chunk-ERUJZRID.js → chunk-MQDZYQ4P.js} +1 -1
- package/public/{chunk-ZXXBIF5D.js → chunk-NXD65TQY.js} +1 -1
- package/public/chunk-P3YJZITV.js +1 -0
- package/public/{chunk-RZG4H7FG.js → chunk-PYA727PD.js} +1 -1
- package/public/{chunk-BLJ3CFZV.js → chunk-QMWOYMP2.js} +1 -1
- package/public/chunk-QOU7SWHO.js +1 -0
- package/public/{chunk-LKEDVYVC.js → chunk-RKLVJKRV.js} +1 -1
- package/public/{chunk-GPMC6ZMO.js → chunk-RM73XLPO.js} +1 -1
- package/public/{chunk-DUY46UE5.js → chunk-RS2XIQ2D.js} +1 -1
- package/public/chunk-SNMQAZT2.js +1 -0
- package/public/{chunk-VCWRZM6U.js → chunk-SS2BB5BR.js} +1 -1
- package/public/{chunk-UCRZ7BF5.js → chunk-T33UVRIX.js} +1 -1
- package/public/chunk-TDCLTQMH.js +1 -0
- package/public/chunk-TNHTCUOR.js +1 -0
- package/public/{chunk-D7PVXFSB.js → chunk-UEO5SW2H.js} +1 -1
- package/public/{chunk-7TWHYDPQ.js → chunk-UJT6ID6R.js} +1 -1
- package/public/{chunk-A2NEEDZO.js → chunk-ULBODTVI.js} +1 -1
- package/public/chunk-WU2LDFGK.js +2 -0
- package/public/chunk-X7V7CXS5.js +14 -0
- package/public/chunk-Y5LCR2EO.js +28 -0
- package/public/{chunk-YFZSQHUV.js → chunk-ZZMY2IKC.js} +1 -1
- package/public/index.html +2 -2
- package/public/main-5SJ6EOYL.js +1 -0
- package/public/media/fa-brands-400-WVWUIHCX.woff2 +0 -0
- package/public/media/fa-regular-400-I5DJMINO.woff2 +0 -0
- package/public/media/fa-solid-900-C5F6UWGT.woff2 +0 -0
- package/public/styles-QT7KIM52.css +1 -0
- package/dist/modules/platform-tools/terminal/terminal.controller.d.ts +0 -11
- package/dist/modules/platform-tools/terminal/terminal.controller.js +0 -46
- package/dist/modules/platform-tools/terminal/terminal.controller.js.map +0 -1
- package/public/chunk-42RLCU53.js +0 -1
- package/public/chunk-5MLTGVMM.js +0 -1
- package/public/chunk-6BFSUFRQ.js +0 -8
- package/public/chunk-6LWEFB5T.js +0 -14
- package/public/chunk-EBQHWKQC.js +0 -4
- package/public/chunk-JBKS3BI7.js +0 -28
- package/public/chunk-K7QEGT3E.js +0 -2
- package/public/chunk-NGBI2CLV.js +0 -20
- package/public/chunk-P2X74Q5E.js +0 -1
- package/public/chunk-PKUXB6QF.js +0 -1
- package/public/chunk-Q2SY7ITC.js +0 -1
- package/public/chunk-QJZIEGHX.js +0 -1
- package/public/chunk-SH42QPYC.js +0 -1
- package/public/chunk-SUJJIFP4.js +0 -5
- package/public/chunk-TFTVFLPX.js +0 -1
- package/public/chunk-W6RS6NBX.js +0 -1
- package/public/chunk-XTDDD6WY.js +0 -1
- package/public/chunk-XWQ7NZSB.js +0 -1
- package/public/chunk-YFQVSUDS.js +0 -1
- package/public/chunk-Z43SQI6H.js +0 -1
- package/public/main-76WAOLPU.js +0 -1
- package/public/media/fa-brands-400-Q3XCMWHQ.woff2 +0 -0
- package/public/media/fa-brands-400-R2XQZCET.ttf +0 -0
- package/public/media/fa-regular-400-QSNYFYRT.woff2 +0 -0
- package/public/media/fa-regular-400-XUOPSR7E.ttf +0 -0
- package/public/media/fa-solid-900-5ZUYHGA7.woff2 +0 -0
- package/public/media/fa-solid-900-PJNKLK6W.ttf +0 -0
- package/public/styles-IOQZHT3N.css +0 -1
|
@@ -11,30 +11,20 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
|
-
var TerminalService_1;
|
|
15
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
15
|
exports.TerminalService = void 0;
|
|
17
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
18
16
|
const node_process_1 = __importDefault(require("node:process"));
|
|
19
17
|
const common_1 = require("@nestjs/common");
|
|
20
18
|
const fs_extra_1 = require("fs-extra");
|
|
21
19
|
const config_service_1 = require("../../../core/config/config.service");
|
|
22
20
|
const logger_service_1 = require("../../../core/logger/logger.service");
|
|
23
21
|
const node_pty_service_1 = require("../../../core/node-pty/node-pty.service");
|
|
24
|
-
let TerminalService =
|
|
22
|
+
let TerminalService = class TerminalService {
|
|
25
23
|
constructor(configService, logger, nodePtyService) {
|
|
26
24
|
this.configService = configService;
|
|
27
25
|
this.logger = logger;
|
|
28
26
|
this.nodePtyService = nodePtyService;
|
|
29
27
|
this.ending = false;
|
|
30
|
-
this.instanceId = Math.random().toString(36).substring(2, 11);
|
|
31
|
-
this.logger.log(`TerminalService instance created: ${this.instanceId}`);
|
|
32
|
-
}
|
|
33
|
-
async getPreferredShell() {
|
|
34
|
-
if (node_os_1.default.platform() === 'darwin' && await (0, fs_extra_1.pathExists)('/bin/zsh')) {
|
|
35
|
-
return '/bin/zsh';
|
|
36
|
-
}
|
|
37
|
-
return await (0, fs_extra_1.pathExists)('/bin/bash') ? '/bin/bash' : '/bin/sh';
|
|
38
28
|
}
|
|
39
29
|
async startSession(client, size) {
|
|
40
30
|
this.ending = false;
|
|
@@ -43,17 +33,8 @@ let TerminalService = TerminalService_1 = class TerminalService {
|
|
|
43
33
|
client.disconnect();
|
|
44
34
|
return;
|
|
45
35
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return this.attachToPersistentTerminal(client, size);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
return this.createNewTerminal(client, size);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
async createNewTerminal(client, size) {
|
|
55
|
-
this.logger.log('Starting new terminal session.');
|
|
56
|
-
const shell = await this.getPreferredShell();
|
|
36
|
+
this.logger.log('Starting terminal session.');
|
|
37
|
+
const shell = await (0, fs_extra_1.pathExists)('/bin/bash') ? '/bin/bash' : '/bin/sh';
|
|
57
38
|
const term = this.nodePtyService.spawn(shell, [], {
|
|
58
39
|
name: 'xterm-color',
|
|
59
40
|
cols: size.cols,
|
|
@@ -64,10 +45,10 @@ let TerminalService = TerminalService_1 = class TerminalService {
|
|
|
64
45
|
term.onData((data) => {
|
|
65
46
|
client.emit('stdout', data);
|
|
66
47
|
});
|
|
67
|
-
term.onExit((
|
|
48
|
+
term.onExit((code) => {
|
|
68
49
|
try {
|
|
69
50
|
if (!this.ending) {
|
|
70
|
-
client.emit('process-exit',
|
|
51
|
+
client.emit('process-exit', code);
|
|
71
52
|
}
|
|
72
53
|
}
|
|
73
54
|
catch (e) {
|
|
@@ -97,151 +78,9 @@ let TerminalService = TerminalService_1 = class TerminalService {
|
|
|
97
78
|
client.on('end', onEnd.bind(this));
|
|
98
79
|
client.on('disconnect', onEnd.bind(this));
|
|
99
80
|
}
|
|
100
|
-
async attachToPersistentTerminal(client, size) {
|
|
101
|
-
this.logger.log(`[${this.instanceId}] attachToPersistentTerminal called`);
|
|
102
|
-
if (!TerminalService_1.persistentTerminal) {
|
|
103
|
-
this.logger.log(`[${this.instanceId}] Creating new persistent terminal session.`);
|
|
104
|
-
const shell = await this.getPreferredShell();
|
|
105
|
-
TerminalService_1.persistentTerminal = this.nodePtyService.spawn(shell, [], {
|
|
106
|
-
name: 'xterm-color',
|
|
107
|
-
cols: size.cols,
|
|
108
|
-
rows: size.rows,
|
|
109
|
-
cwd: this.configService.storagePath,
|
|
110
|
-
env: node_process_1.default.env,
|
|
111
|
-
});
|
|
112
|
-
if (!TerminalService_1.dataListenerAttached) {
|
|
113
|
-
this.logger.log(`[${this.instanceId}] Attaching data listener`);
|
|
114
|
-
TerminalService_1.persistentTerminal.onData((data) => {
|
|
115
|
-
try {
|
|
116
|
-
this.logger.debug(`[${this.instanceId}] Terminal output: ${data.length} characters`);
|
|
117
|
-
TerminalService_1.terminalBuffer += data;
|
|
118
|
-
const maxBufferSize = this.configService.ui.terminal?.bufferSize;
|
|
119
|
-
if (TerminalService_1.terminalBuffer.length > maxBufferSize) {
|
|
120
|
-
TerminalService_1.terminalBuffer = TerminalService_1.terminalBuffer.slice(-maxBufferSize);
|
|
121
|
-
}
|
|
122
|
-
if (TerminalService_1.connectedClients.size > 0) {
|
|
123
|
-
this.logger.log(`[${this.instanceId}] Sending output to ${TerminalService_1.connectedClients.size} connected clients`);
|
|
124
|
-
TerminalService_1.connectedClients.forEach((client) => {
|
|
125
|
-
try {
|
|
126
|
-
client.emit('stdout', data);
|
|
127
|
-
}
|
|
128
|
-
catch (e) {
|
|
129
|
-
this.logger.log(`[${this.instanceId}] Error sending output to a client: ${e}`);
|
|
130
|
-
TerminalService_1.connectedClients.delete(client);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
catch (e) {
|
|
136
|
-
this.logger.log(`[${this.instanceId}] Error sending output to client: ${e}`);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
TerminalService_1.dataListenerAttached = true;
|
|
140
|
-
}
|
|
141
|
-
TerminalService_1.persistentTerminal.onExit((exitInfo) => {
|
|
142
|
-
this.logger.log(`[${this.instanceId}] Persistent terminal exited.`);
|
|
143
|
-
TerminalService_1.connectedClients.forEach((client) => {
|
|
144
|
-
try {
|
|
145
|
-
client.emit('process-exit', exitInfo.exitCode);
|
|
146
|
-
}
|
|
147
|
-
catch (e) {
|
|
148
|
-
TerminalService_1.connectedClients.delete(client);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
TerminalService_1.persistentTerminal = null;
|
|
152
|
-
TerminalService_1.connectedClients.clear();
|
|
153
|
-
TerminalService_1.dataListenerAttached = false;
|
|
154
|
-
TerminalService_1.terminalBuffer = '';
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
this.logger.log(`[${this.instanceId}] Attaching to existing persistent terminal.`);
|
|
159
|
-
try {
|
|
160
|
-
TerminalService_1.persistentTerminal.resize(size.cols, size.rows);
|
|
161
|
-
}
|
|
162
|
-
catch (e) { }
|
|
163
|
-
}
|
|
164
|
-
this.logger.log(`[${this.instanceId}] Cleaning up existing client listeners`);
|
|
165
|
-
client.removeAllListeners('stdin');
|
|
166
|
-
client.removeAllListeners('resize');
|
|
167
|
-
this.logger.log(`[${this.instanceId}] Adding client to connected clients`);
|
|
168
|
-
TerminalService_1.connectedClients.add(client);
|
|
169
|
-
if (TerminalService_1.terminalBuffer && TerminalService_1.terminalBuffer.length > 0) {
|
|
170
|
-
this.logger.log(`[${this.instanceId}] Sending ${TerminalService_1.terminalBuffer.length} chars of buffer to new client`);
|
|
171
|
-
try {
|
|
172
|
-
client.emit('stdout', TerminalService_1.terminalBuffer);
|
|
173
|
-
}
|
|
174
|
-
catch (e) {
|
|
175
|
-
this.logger.log(`[${this.instanceId}] Error sending buffer to client: ${e}`);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
this.logger.log(`[${this.instanceId}] No buffer to send to new client`);
|
|
180
|
-
}
|
|
181
|
-
this.logger.log(`[${this.instanceId}] Adding stdin and resize listeners`);
|
|
182
|
-
client.on('stdin', (data) => {
|
|
183
|
-
this.logger.debug(`[${this.instanceId}] Received stdin from client: ${data.length} characters`);
|
|
184
|
-
if (TerminalService_1.persistentTerminal) {
|
|
185
|
-
this.logger.debug(`[${this.instanceId}] Writing to persistent terminal: ${data.length} characters`);
|
|
186
|
-
TerminalService_1.persistentTerminal.write(data);
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
this.logger.log(`[${this.instanceId}] No persistent terminal to write to!`);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
client.on('resize', (resize) => {
|
|
193
|
-
this.logger.log(`[${this.instanceId}] Received resize from client`);
|
|
194
|
-
try {
|
|
195
|
-
if (TerminalService_1.persistentTerminal) {
|
|
196
|
-
TerminalService_1.persistentTerminal.resize(resize.cols, resize.rows);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
catch (e) { }
|
|
200
|
-
});
|
|
201
|
-
const onEnd = () => {
|
|
202
|
-
this.logger.log(`[${this.instanceId}] Client disconnecting`);
|
|
203
|
-
client.removeAllListeners('stdin');
|
|
204
|
-
client.removeAllListeners('resize');
|
|
205
|
-
client.removeAllListeners('end');
|
|
206
|
-
client.removeAllListeners('disconnect');
|
|
207
|
-
if (TerminalService_1.connectedClients.has(client)) {
|
|
208
|
-
TerminalService_1.connectedClients.delete(client);
|
|
209
|
-
this.logger.log(`[${this.instanceId}] Removed client from connected clients`);
|
|
210
|
-
}
|
|
211
|
-
this.logger.log(`[${this.instanceId}] Client cleanup complete`);
|
|
212
|
-
};
|
|
213
|
-
client.on('end', onEnd);
|
|
214
|
-
client.on('disconnect', onEnd);
|
|
215
|
-
}
|
|
216
|
-
hasPersistentSession() {
|
|
217
|
-
const hasPersistent = TerminalService_1.persistentTerminal !== null;
|
|
218
|
-
this.logger.log(`[${this.instanceId}] hasPersistentSession: ${hasPersistent}`);
|
|
219
|
-
return hasPersistent;
|
|
220
|
-
}
|
|
221
|
-
destroyPersistentSession() {
|
|
222
|
-
this.logger.log(`[${this.instanceId}] Destroying persistent terminal session`);
|
|
223
|
-
if (TerminalService_1.persistentTerminal) {
|
|
224
|
-
try {
|
|
225
|
-
this.logger.log(`[${this.instanceId}] Killing persistent terminal process`);
|
|
226
|
-
TerminalService_1.persistentTerminal.kill();
|
|
227
|
-
}
|
|
228
|
-
catch (e) {
|
|
229
|
-
this.logger.log(`[${this.instanceId}] Error killing persistent terminal: ${e}`);
|
|
230
|
-
}
|
|
231
|
-
TerminalService_1.persistentTerminal = null;
|
|
232
|
-
}
|
|
233
|
-
TerminalService_1.terminalBuffer = '';
|
|
234
|
-
TerminalService_1.dataListenerAttached = false;
|
|
235
|
-
TerminalService_1.connectedClients.clear();
|
|
236
|
-
this.logger.log(`[${this.instanceId}] Persistent terminal session destroyed`);
|
|
237
|
-
}
|
|
238
81
|
};
|
|
239
82
|
exports.TerminalService = TerminalService;
|
|
240
|
-
TerminalService
|
|
241
|
-
TerminalService.connectedClients = new Set();
|
|
242
|
-
TerminalService.dataListenerAttached = false;
|
|
243
|
-
TerminalService.terminalBuffer = '';
|
|
244
|
-
exports.TerminalService = TerminalService = TerminalService_1 = __decorate([
|
|
83
|
+
exports.TerminalService = TerminalService = __decorate([
|
|
245
84
|
(0, common_1.Injectable)(),
|
|
246
85
|
__metadata("design:paramtypes", [config_service_1.ConfigService,
|
|
247
86
|
logger_service_1.Logger,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.service.js","sourceRoot":"","sources":["../../../../src/modules/platform-tools/terminal/terminal.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"terminal.service.js","sourceRoot":"","sources":["../../../../src/modules/platform-tools/terminal/terminal.service.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-config-ui-x",
|
|
3
3
|
"displayName": "Homebridge UI",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.3.0",
|
|
5
5
|
"description": "A web based management, configuration and control platform for Homebridge.",
|
|
6
6
|
"author": "oznu <dev@oz.nu>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"@fastify/helmet": "13.0.1",
|
|
82
82
|
"@fastify/multipart": "9.0.3",
|
|
83
83
|
"@fastify/static": "8.2.0",
|
|
84
|
-
"@homebridge/hap-client": "3.1.
|
|
85
|
-
"@homebridge/node-pty-prebuilt-multiarch": "0.
|
|
84
|
+
"@homebridge/hap-client": "3.1.1",
|
|
85
|
+
"@homebridge/node-pty-prebuilt-multiarch": "0.13.1",
|
|
86
86
|
"@nestjs/axios": "4.0.1",
|
|
87
87
|
"@nestjs/common": "11.1.5",
|
|
88
88
|
"@nestjs/core": "11.1.5",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@nestjs/platform-socket.io": "11.1.5",
|
|
93
93
|
"@nestjs/swagger": "11.2.0",
|
|
94
94
|
"@nestjs/websockets": "11.1.5",
|
|
95
|
-
"axios": "1.
|
|
95
|
+
"axios": "1.11.0",
|
|
96
96
|
"bash-color": "0.0.4",
|
|
97
97
|
"class-transformer": "0.5.1",
|
|
98
98
|
"class-validator": "0.14.2",
|
|
@@ -119,12 +119,12 @@
|
|
|
119
119
|
"unzipper": "0.12.3"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
|
-
"@antfu/eslint-config": "^4.
|
|
122
|
+
"@antfu/eslint-config": "^4.18.0",
|
|
123
123
|
"@nestjs/testing": "^11.1.5",
|
|
124
124
|
"@prettier/plugin-xml": "^3.4.2",
|
|
125
125
|
"@types/fs-extra": "^11.0.4",
|
|
126
126
|
"@types/lodash": "^4.17.20",
|
|
127
|
-
"@types/node": "^24.0
|
|
127
|
+
"@types/node": "^24.1.0",
|
|
128
128
|
"@types/node-schedule": "^2.1.8",
|
|
129
129
|
"@types/passport-jwt": "^4.0.1",
|
|
130
130
|
"@types/semver": "^7.7.0",
|
|
@@ -684,48 +684,6 @@ Package: nxt-sortablejs
|
|
|
684
684
|
License: "MIT"
|
|
685
685
|
|
|
686
686
|
|
|
687
|
-
--------------------------------------------------------------------------------
|
|
688
|
-
Package: uuid
|
|
689
|
-
License: "MIT"
|
|
690
|
-
|
|
691
|
-
The MIT License (MIT)
|
|
692
|
-
|
|
693
|
-
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
|
694
|
-
|
|
695
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
696
|
-
|
|
697
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
698
|
-
|
|
699
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
700
|
-
|
|
701
|
-
--------------------------------------------------------------------------------
|
|
702
|
-
Package: json5
|
|
703
|
-
License: "MIT"
|
|
704
|
-
|
|
705
|
-
MIT License
|
|
706
|
-
|
|
707
|
-
Copyright (c) 2012-2018 Aseem Kishore, and [others].
|
|
708
|
-
|
|
709
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
710
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
711
|
-
in the Software without restriction, including without limitation the rights
|
|
712
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
713
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
714
|
-
furnished to do so, subject to the following conditions:
|
|
715
|
-
|
|
716
|
-
The above copyright notice and this permission notice shall be included in all
|
|
717
|
-
copies or substantial portions of the Software.
|
|
718
|
-
|
|
719
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
720
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
721
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
722
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
723
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
724
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
725
|
-
SOFTWARE.
|
|
726
|
-
|
|
727
|
-
[others]: https://github.com/json5/json5/contributors
|
|
728
|
-
|
|
729
687
|
--------------------------------------------------------------------------------
|
|
730
688
|
Package: lodash-es
|
|
731
689
|
License: "MIT"
|
|
@@ -778,6 +736,48 @@ maintained libraries used by this software which have their own
|
|
|
778
736
|
licenses; we recommend you read them, as their terms may differ from the
|
|
779
737
|
terms above.
|
|
780
738
|
|
|
739
|
+
--------------------------------------------------------------------------------
|
|
740
|
+
Package: uuid
|
|
741
|
+
License: "MIT"
|
|
742
|
+
|
|
743
|
+
The MIT License (MIT)
|
|
744
|
+
|
|
745
|
+
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
|
746
|
+
|
|
747
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
748
|
+
|
|
749
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
750
|
+
|
|
751
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
752
|
+
|
|
753
|
+
--------------------------------------------------------------------------------
|
|
754
|
+
Package: json5
|
|
755
|
+
License: "MIT"
|
|
756
|
+
|
|
757
|
+
MIT License
|
|
758
|
+
|
|
759
|
+
Copyright (c) 2012-2018 Aseem Kishore, and [others].
|
|
760
|
+
|
|
761
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
762
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
763
|
+
in the Software without restriction, including without limitation the rights
|
|
764
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
765
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
766
|
+
furnished to do so, subject to the following conditions:
|
|
767
|
+
|
|
768
|
+
The above copyright notice and this permission notice shall be included in all
|
|
769
|
+
copies or substantial portions of the Software.
|
|
770
|
+
|
|
771
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
772
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
773
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
774
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
775
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
776
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
777
|
+
SOFTWARE.
|
|
778
|
+
|
|
779
|
+
[others]: https://github.com/json5/json5/contributors
|
|
780
|
+
|
|
781
781
|
--------------------------------------------------------------------------------
|
|
782
782
|
Package: ngx-monaco-editor-v2
|
|
783
783
|
License: "MIT"
|
|
@@ -808,6 +808,22 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
808
808
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
809
809
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
810
810
|
THE SOFTWARE.
|
|
811
|
+
--------------------------------------------------------------------------------
|
|
812
|
+
Package: file-saver
|
|
813
|
+
License: "MIT"
|
|
814
|
+
|
|
815
|
+
The MIT License
|
|
816
|
+
|
|
817
|
+
Copyright © 2016 [Eli Grey][1].
|
|
818
|
+
|
|
819
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
820
|
+
|
|
821
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
822
|
+
|
|
823
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
824
|
+
|
|
825
|
+
[1]: http://eligrey.com
|
|
826
|
+
|
|
811
827
|
--------------------------------------------------------------------------------
|
|
812
828
|
Package: @xterm/addon-fit
|
|
813
829
|
License: "MIT"
|
|
@@ -882,22 +898,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
882
898
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
883
899
|
THE SOFTWARE.
|
|
884
900
|
|
|
885
|
-
--------------------------------------------------------------------------------
|
|
886
|
-
Package: file-saver
|
|
887
|
-
License: "MIT"
|
|
888
|
-
|
|
889
|
-
The MIT License
|
|
890
|
-
|
|
891
|
-
Copyright © 2016 [Eli Grey][1].
|
|
892
|
-
|
|
893
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
894
|
-
|
|
895
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
896
|
-
|
|
897
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
898
|
-
|
|
899
|
-
[1]: http://eligrey.com
|
|
900
|
-
|
|
901
901
|
--------------------------------------------------------------------------------
|
|
902
902
|
Package: qrcode
|
|
903
903
|
License: "MIT"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{a as ne}from"./chunk-WAEIH452.js";import{a as oe,b as le}from"./chunk-X7V7CXS5.js";import{a as X,b as Z}from"./chunk-ZT56WXIZ.js";import{a as ie}from"./chunk-P3TP4J62.js";import{m as Y,n as G,t as Q}from"./chunk-PSSVCFFV.js";import{c as J,e as K,l as U,z as W}from"./chunk-K2NEWUWG.js";import{b as ee}from"./chunk-4XLPIGSD.js";import{b as te}from"./chunk-A5YPMEVZ.js";import{k as A,n as I}from"./chunk-L5YI32XL.js";import{a as S,b as D}from"./chunk-ZG3HINDJ.js";import"./chunk-WU2LDFGK.js";import{Hb as _,Hc as r,Ib as d,Ic as s,Jb as c,Jc as q,Lb as P,Mb as B,Nb as L,Ob as v,Pb as y,Qb as w,Rb as x,Sb as m,Tb as u,Ub as V,_b as b,ab as n,bc as E,cc as k,dc as a,fb as R,g as se,h as j,la as h,mb as M,pd as z,qc as C,ra as f,rc as $,sa as g,sc as T,w as H,xc as O,yc as N,zc as F}from"./chunk-V7SOQAC5.js";var ae=se(le(),1);function ce(o,p){o&1&&(m(0,"div",5),V(1,"i",12),u())}function me(o,p){if(o&1){let e=b();m(0,"li",17),C(1),r(2,"date"),m(3,"button",18),r(4,"translate"),k("click",function(){let t=f(e).$implicit,l=a(3);return g(l.restore(t.id))}),V(5,"i",19),u()()}if(o&2){let e=p.$implicit;n(),T(" ",q(2,2,e.timestamp,"medium")," "),n(2),_("aria-label",s(4,5,"config.restore.copy_to_editor"))}}function pe(o,p){if(o&1&&(m(0,"ul",15),B(1,me,6,7,"li",17,P),u()),o&2){let e=a(2);n(),L(e.backupList)}}function fe(o,p){o&1&&(m(0,"p",16),C(1),r(2,"translate"),u()),o&2&&(n(),$(s(2,1,"config.restore.no_backups")))}function ge(o,p){if(o&1&&(m(0,"div",13),V(1,"i",14),u(),m(2,"p",13),C(3),r(4,"translate"),u(),d(5,pe,3,0,"ul",15),d(6,fe,3,3,"p",16)),o&2){let e=a();n(3),$(s(4,3,"config.restore.title_restore_homebridge_backup")),n(2),c(e.backupList&&e.backupList.length?5:-1),n(),c(!e.backupList||!e.backupList.length?6:-1)}}function ue(o,p){if(o&1){let e=b();m(0,"button",20),r(1,"translate"),k("click",function(){f(e);let t=a();return g(t.dismissModal())}),C(2),r(3,"translate"),u()}o&2&&(_("aria-label",s(1,2,"form.button_close")),n(2),T(" ",s(3,4,"form.button_close")," "))}function he(o,p){if(o&1){let e=b();m(0,"button",20),r(1,"translate"),k("click",function(){f(e);let t=a();return g(t.dismissModal())}),C(2),r(3,"translate"),u()}o&2&&(_("aria-label",s(1,2,"form.button_close")),n(2),T(" ",s(3,4,"form.button_close")," "))}function be(o,p){if(o&1){let e=b();m(0,"button",21),r(1,"translate"),k("click",function(){f(e);let t=a();return g(t.deleteAllBackups())}),C(2),r(3,"translate"),u()}o&2&&(_("aria-label",s(1,2,"form.button_remove")),n(2),T(" ",s(3,4,"form.button_remove")," "))}var re=(()=>{class o{$activeModal=h(Y);$api=h(I);$toastr=h(A);$translate=h(S);loading=!0;backupList=[];ngOnInit(){this.$api.get("/config-editor/backups").subscribe({next:e=>{this.loading=!1,this.backupList=e},error:e=>{this.loading=!1,console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error"))}})}restore(e){return this.$activeModal.close(e)}deleteAllBackups(){return this.$api.delete("/config-editor/backups").subscribe({next:()=>{this.$activeModal.dismiss(),this.$toastr.success(this.$translate.instant("config.restore.toast_backups_deleted"),this.$translate.instant("toast.title_success"))},error:e=>{console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["ng-component"]],decls:17,vars:11,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","primary-text"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["type","button",1,"btn","btn-danger","me-auto"],[1,"fa","fa-fw","fa-cog","fa-spin",2,"font-size","75px"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-history","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box"],[1,"text-center","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"btn","btn-primary","m-0","ms-3",3,"click"],[1,"fas","fa-fw","fa-arrow-right"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button",1,"btn","btn-danger","me-auto",3,"click"]],template:function(i,t){i&1&&(m(0,"div",0)(1,"div",1)(2,"h5",2),C(3),r(4,"translate"),u(),m(5,"button",3),r(6,"translate"),k("click",function(){return t.dismissModal()}),u()(),m(7,"div",4),d(8,ce,2,0,"div",5),d(9,ge,7,5),u(),m(10,"div",6)(11,"div",7),d(12,ue,4,6,"button",8),u(),m(13,"div",9),d(14,he,4,6,"button",8),u(),m(15,"div",10),d(16,be,4,6,"button",11),u()()()),i&2&&(n(3),$(s(4,7,"form.button_restore")),n(2),_("aria-label",s(6,9,"form.button_close")),n(3),c(t.loading?8:-1),n(),c(t.loading?-1:9),n(3),c(!t.loading&&t.backupList.length?12:-1),n(2),c(t.loading||!t.loading&&!t.backupList.length?14:-1),n(2),c(!t.loading&&t.backupList.length?16:-1))},dependencies:[z,D],encapsulation:2})}return o})();function _e(o,p){if(o&1){let e=b();y(0,"button",14),r(1,"translate"),r(2,"translate"),E("click",function(){f(e);let t=a();return g(t.onExportConfig())}),x(3,"i",15),w()}o&2&&(v("ngbTooltip",s(1,2,"form.button_download")),_("aria-label",s(2,4,"form.button_download")))}function Ce(o,p){if(o&1){let e=b();y(0,"button",16),r(1,"translate"),r(2,"translate"),E("click",function(){f(e);let t=a();return g(t.onCancelRestore())}),x(3,"i",17),w()}if(o&2){let e=a();v("disabled",e.saveInProgress)("openDelay",150)("ngbTooltip",s(1,4,"form.button_cancel")),_("aria-label",s(2,6,"form.button_cancel"))}}function ye(o,p){if(o&1){let e=b();y(0,"button",18),r(1,"translate"),r(2,"translate"),E("click",function(){f(e);let t=a();return g(t.onRestore())}),x(3,"i",19),w()}o&2&&(v("openDelay",150)("ngbTooltip",s(1,3,"form.button_restore")),_("aria-label",s(2,5,"form.button_restore")))}function we(o,p){o&1&&x(0,"i",9)}function ve(o,p){o&1&&x(0,"i",10)}function Ee(o,p){if(o&1){let e=b();y(0,"ngx-monaco-editor",20),E("onInit",function(t){f(e);let l=a();return g(l.onEditorInit(t))})("keydown.control.s",function(t){f(e);let l=a();return t.preventDefault(),g(l.onSave())})("keydown.meta.s",function(t){f(e);let l=a();return t.preventDefault(),g(l.onSave())}),w()}if(o&2){let e=a();v("options",e.editorOptions)("model",e.monacoEditorModel)}}function xe(o,p){if(o&1){let e=b();y(0,"ngx-monaco-diff-editor",21),E("onInit",function(t){f(e);let l=a();return g(l.onInitDiffEditor(t))})("keydown.control.s",function(t){f(e);let l=a();return t.preventDefault(),g(l.onSave())})("keydown.meta.s",function(t){f(e);let l=a();return t.preventDefault(),g(l.onSave())}),w()}if(o&2){let e=a();v("options",e.editorOptions)("originalModel",e.monacoEditorModel)("modifiedModel",e.monacoEditorModel)}}function ke(o,p){if(o&1){let e=b();y(0,"textarea",22),F("ngModelChange",function(t){f(e);let l=a();return N(l.homebridgeConfig,t)||(l.homebridgeConfig=t),g(t)}),C(1," "),w()}if(o&2){let e=a();O("ngModel",e.homebridgeConfig)}}var Ge=(()=>{class o{$api=h(I);$md=h(ie);$modal=h(G);$monacoEditor=h(ne);$route=h(ee);$renderer=h(R);$settings=h(te);$toastr=h(A);$translate=h(S);editorDecorations=[];lastHeight;visualViewPortEventCallback;homebridgeConfig;originalConfig;saveInProgress;isMobile=!1;monacoEditor;editorOptions;monacoEditorModel;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"json",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",automaticLayout:!0};let e=document.querySelector(".content");this.$renderer.setStyle(e,"height","100%"),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(i=>{this.homebridgeConfig=i.config}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:()=>{this.setMonacoEditorModel()}})}onEditorInit(e){window.editor=e,this.monacoEditor=e,this.monacoEditor.getModel().setValue(this.homebridgeConfig)}onInitDiffEditor(e){this.monacoEditor=e.modifiedEditor,e.getModel().original.setValue(this.originalConfig),e.getModel().modified.setValue(this.homebridgeConfig),window.editor=e}onSave(){return j(this,null,function*(){if(!this.saveInProgress){this.monacoEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[])),this.saveInProgress=!0;try{if(!this.isMobile){yield this.monacoEditor.getAction("editor.action.formatDocument").run();let i=window.monaco.editor.getModelMarkers({owner:"json"});for(let t of i)if(t.message==="Duplicate object key"){this.saveInProgress=!1,this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"));return}this.homebridgeConfig=this.monacoEditor.getModel().getValue()}let e=this.parseConfigFromEditor();this.homebridgeConfig=JSON.stringify(e,null,4),typeof e.bridge!="object"?this.$toastr.error(this.$translate.instant("config.config_bridge_missing"),this.$translate.instant("toast.title_error")):/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i.test(e.bridge.username)?e.accessories&&!Array.isArray(e.accessories)?this.$toastr.error(this.$translate.instant("config.config_accessory_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&!Array.isArray(e.platforms)?this.$toastr.error(this.$translate.instant("config.config_platform_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&Array.isArray(e.platforms)&&!this.validateSection(e.platforms,"platform")||e.accessories&&Array.isArray(e.accessories)&&!this.validateSection(e.accessories,"accessory")||e.plugins&&Array.isArray(e.plugins)&&!this.validatePlugins(e.plugins,"plugins")||e.disabledPlugins&&Array.isArray(e.disabledPlugins)&&!this.validatePlugins(e.disabledPlugins,"disabledPlugins")||(yield this.saveConfig(e),this.originalConfig=""):this.$toastr.error(this.$translate.instant("config.config_username_error"),this.$translate.instant("toast.title_error"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}onRestore(){this.$modal.open(re,{size:"lg",backdrop:"static"}).result.then(e=>{this.originalConfig||(this.originalConfig=this.homebridgeConfig),this.$api.get(`/config-editor/backups/${e}`).subscribe({next:i=>{this.$toastr.info(this.$translate.instant("config.restore.confirm"),this.$translate.instant("config.title_backup_loaded")),this.homebridgeConfig=JSON.stringify(i,null,4),this.monacoEditor&&window.editor.modifiedEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[]),this.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,this.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),this.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:this.homebridgeConfig,forceMoveMarkers:!0}]))},error:i=>{console.error(i),this.$toastr.error(i.error?.message||this.$translate.instant("backup.load_error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}onExportConfig(){let e=`data:text/json;charset=utf-8,${encodeURIComponent(this.homebridgeConfig)}`,i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download","config.json"),document.body.appendChild(i),i.click(),i.remove()}onCancelRestore(){this.homebridgeConfig=this.originalConfig,this.originalConfig=""}ngOnDestroy(){let e=document.querySelector(".content");this.$renderer.removeStyle(e,"height"),window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}validateSection(e,i){for(let t of e){if(typeof t!="object"||Array.isArray(t))return this.$toastr.error(this.$translate.instant("config.error_blocks_objects",{type:i}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(t),!1;if(!t[i])return this.$toastr.error(this.$translate.instant("config.error_blocks_type",{type:i}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(t),!1;if(typeof t[i]!="string")return this.$toastr.error(this.$translate.instant("config.error_string_type",{type:i}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(t),!1}return!0}validatePlugins(e,i){for(let t of e)if(typeof t!="string")return this.$toastr.error(this.$translate.instant("config.error_string_array",{key:i}),this.$translate.instant("toast.title_error")),!1;return!0}highlightOffendingArrayItem(e){this.monacoEditor&&(e=JSON.stringify(e,null,4).split(`
|
|
2
|
+
`).map(i=>` ${i}`).join(`
|
|
3
|
+
`),setTimeout(()=>{let i=this.monacoEditor.getModel().findMatches(e);if(i.length){let t=i[0].range,l=new monaco.Range(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn);this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[{range:l,options:{isWholeLine:!0,linesDecorationsClassName:"hb-monaco-editor-line-error"}}])}},200))}setMonacoEditorModel(){if(window.monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas.some(i=>i.uri==="http://homebridge/config.json"))return;let e=monaco.Uri.parse("a://homebridge/config.json");window.monaco.languages.json.jsonDefaults.setDiagnosticsOptions({allowComments:!1,validate:!0,schemas:[{uri:"http://homebridge/config.json",fileMatch:[e.toString()],schema:{type:"object",required:["bridge"],properties:{bridge:{type:"object",required:["name","username","port","pin"],properties:{name:{type:"string",description:`The Homebridge instance name.
|
|
4
|
+
This should be unique if you are running multiple instances of Homebridge.`,default:"Homebridge"},username:{type:"string",description:`Homebridge username must be 6 pairs of colon-separated hexadecimal characters (A-F 0-9).
|
|
5
|
+
You should change this pin if you need to re-pair your instance with HomeKit.
|
|
6
|
+
Example: 0E:89:49:64:91:86`,default:"0E:89:49:64:91:86",pattern:"^([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}$"},port:{type:"number",description:`The port Homebridge listens on.
|
|
7
|
+
If running more than one instance of Homebridge on the same server make sure each instance is given a unique port.`,default:51173,minimum:1025,maximum:65534},pin:{type:"string",description:`The Homebridge instance pin.
|
|
8
|
+
This is used when pairing Homebridge to HomeKit.
|
|
9
|
+
Example: 630-27-655`,default:"630-27-655",pattern:"^([0-9]{3}-[0-9]{2}-[0-9]{3})$"},manufacturer:{type:"string",description:"The bridge manufacturer to be displayed in HomeKit"},firmwareRevision:{type:"string",description:"The bridge firmware version to be displayed in HomeKit"},model:{type:"string",description:"The bridge model to be displayed in HomeKit"},bind:{description:`A string or an array of strings with the name(s) of the network interface(s) Homebridge should bind to.
|
|
10
|
+
|
|
11
|
+
Requires Homebridge v1.3 or later.`,type:["string","array"],items:{type:"string",description:"Network Interface name that Homebridge should bind to."}}},default:{name:"Homebridge",username:"0E:89:49:64:91:86",port:51173,pin:"6302-7655"}},mdns:{type:"object",properties:{interface:{type:"string",description:`The interface or IP address of the interface you want Homebridge to listen on. This is useful if your server has multiple interfaces.
|
|
12
|
+
|
|
13
|
+
Deprecated as of Homebridge v1.3.0 - use bridge.bind instead.`},legacyAdvertiser:{type:"boolean",description:"Set to `false` to use the new mdns library, ciao."}},default:{legacyAdvertiser:!1}},plugins:{type:"array",description:"An array of plugins that should be selectively enabled. Remove this array to enable all plugins.",items:{type:"string",description:`The full plugin npm package name.
|
|
14
|
+
Example: homebridge-dummy`},default:["homebridge-config-ui-x"]},disabledPlugins:{type:"array",description:`An array of plugins that should be disabled.
|
|
15
|
+
|
|
16
|
+
Requires Homebridge v1.3 or later.`,items:{type:"string",description:`The full plugin npm package name.
|
|
17
|
+
Example: homebridge-dummy`},default:[]},ports:{type:"object",description:"The range of ports that should be used for certain accessories like cameras and TVs",required:["start","end"],properties:{start:{type:"number",default:52100,minimum:1025,maximum:65534},end:{type:"number",default:52150,minimum:1025,maximum:65534}},default:{start:52100,end:52150}},platforms:{type:"array",description:`Any plugin that exposes a platform should have its config entered in this array.
|
|
18
|
+
Separate each plugin config block using a comma.`,items:{type:"object",required:["platform"],anyOf:[{type:"object",required:["platform"],properties:{platform:{type:"string",description:"This is used by Homebridge to identify which plugin this platform belongs to.",not:{enum:["config"]}},name:{type:"string",description:"The name of the platform."}}},{type:"object",properties:{platform:{type:"string",description:`Homebridge UI platform name must be set to "config".
|
|
19
|
+
Do Not Change!`,oneOf:[{enum:"config"}]},name:{type:"string",description:"The name used in the Homebridge log."}}}]}},accessories:{type:"array",description:`Any plugin that exposes an accessory should have its config entered in this array.
|
|
20
|
+
Separate each plugin config block using a comma.`,items:{type:"object",required:["accessory","name"],properties:{accessory:{type:"string",description:"This is used by Homebridge to identify which plugin this accessory belongs to."},name:{type:"string",description:"The name of the accessory."}}}}}}}]}),this.monacoEditorModel.uri=monaco.Uri.parse("a://homebridge/config.json")}visualViewPortChanged(){this.lastHeight<window.visualViewport.height&&document.activeElement.blur(),window.visualViewport.height<window.innerHeight?(this.$md.enableTouchMove(),this.lastHeight=window.visualViewport.height):window.visualViewport.height===window.innerHeight&&(this.$md.disableTouchMove(),this.lastHeight=window.visualViewport.height)}saveConfig(e){return j(this,null,function*(){try{let i=yield H(this.$api.post("/config-editor",e));this.homebridgeConfig=JSON.stringify(i,null,4),this.$modal.open(oe,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("config.failed_to_save_config"),this.$translate.instant("toast.title_error"))}})}parseConfigFromEditor(){try{return JSON.parse(this.homebridgeConfig)}catch{let i=ae.default.parse(this.homebridgeConfig);return this.homebridgeConfig=JSON.stringify(i,null,4),this.monacoEditor&&this.monacoEditor.getModel().setValue(this.homebridgeConfig),i}}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["ng-component"]],decls:18,vars:19,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-2",3,"ngbTooltip"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-danger","waves-effect","my-0","me-2",3,"disabled","openDelay","ngbTooltip"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-2",3,"openDelay","ngbTooltip"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-0",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-floppy-disk"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"options","model"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"options","originalModel","modifiedModel"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-3",3,"ngModel"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-2",3,"click","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-danger","waves-effect","my-0","me-2",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-times"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-2",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-history"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"onInit","keydown.control.s","keydown.meta.s","options","model"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"onInit","keydown.control.s","keydown.meta.s","options","originalModel","modifiedModel"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-3",3,"ngModelChange","ngModel"]],template:function(i,t){i&1&&(y(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),C(4),r(5,"translate"),w()(),y(6,"div",4),d(7,_e,4,6,"button",5),d(8,Ce,4,8,"button",6),d(9,ye,4,7,"button",7),y(10,"button",8),r(11,"translate"),r(12,"translate"),E("click",function(){return t.onSave()}),d(13,we,1,0,"i",9),d(14,ve,1,0,"i",10),w()()(),d(15,Ee,1,2,"ngx-monaco-editor",11),d(16,xe,1,3,"ngx-monaco-diff-editor",12),d(17,ke,2,1,"textarea",13),w()),i&2&&(n(4),$(s(5,13,"menu.config_json_editor")),n(3),c(t.originalConfig?-1:7),n(),c(t.originalConfig?8:-1),n(),c(t.originalConfig?-1:9),n(),v("disabled",t.saveInProgress)("openDelay",150)("ngbTooltip",s(11,15,"form.button_save")),_("aria-label",s(12,17,"form.button_save")),n(3),c(t.saveInProgress?-1:13),n(),c(t.saveInProgress?14:-1),n(),c(!t.isMobile&&!t.originalConfig?15:-1),n(),c(!t.isMobile&&t.originalConfig?16:-1),n(),c(t.isMobile?17:-1))},dependencies:[Q,X,Z,W,J,K,U,D],encapsulation:2})}return o})();export{Ge as ConfigEditorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-6ICMDOE6.js";import"./chunk-UEO5SW2H.js";import{g as r}from"./chunk-4XLPIGSD.js";import"./chunk-A5YPMEVZ.js";import"./chunk-L5YI32XL.js";import"./chunk-ZG3HINDJ.js";import"./chunk-WU2LDFGK.js";import{ha as o,nb as e}from"./chunk-V7SOQAC5.js";var c=[{path:"",loadComponent:()=>import("./chunk-JOWPFOJ6.js").then(t=>t.SettingsComponent),canActivate:[n]}],m=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[r.forChild(c),r]})}return t})();var l=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[m]})}return t})();export{l as SettingsModule};
|