homebridge-config-ui-x 5.4.2-beta.20 → 5.4.2-beta.21
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/dist/core/spa/spa-html.service.d.ts +2 -3
- package/dist/core/spa/spa-html.service.js +21 -22
- package/dist/core/spa/spa-html.service.js.map +1 -1
- package/dist/main.js +1 -3
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
- package/public/{chunk-SARARWVB.js → chunk-24MFIAJC.js} +1 -1
- package/public/{chunk-V4C2UK3E.js → chunk-2GPXWXUT.js} +1 -1
- package/public/{chunk-2WWJCZHM.js → chunk-5RI5TLFW.js} +1 -1
- package/public/{chunk-LEMGHTLZ.js → chunk-5YEBXXYW.js} +1 -1
- package/public/{chunk-H2RXQG5H.js → chunk-7FVJXUCR.js} +1 -1
- package/public/{chunk-YTQ2YMRY.js → chunk-ANRLCCQG.js} +1 -1
- package/public/{chunk-X4MPFU5C.js → chunk-BH4JDZF4.js} +1 -1
- package/public/{chunk-UWDXUOOS.js → chunk-BHMKIJVI.js} +1 -1
- package/public/{chunk-5BUCR3XW.js → chunk-C64P3A75.js} +1 -1
- package/public/{chunk-52MVDXGB.js → chunk-CDS2MSIW.js} +1 -1
- package/public/{chunk-AZV3CUCF.js → chunk-DOOSRLOB.js} +1 -1
- package/public/{chunk-SRQ6LPJT.js → chunk-E6AE64XW.js} +1 -1
- package/public/{chunk-QNIJXVUM.js → chunk-EKP4IO3L.js} +1 -1
- package/public/{chunk-YKYTNWAK.js → chunk-F6VJ3EFY.js} +1 -1
- package/public/{chunk-D6IDPBE4.js → chunk-FB6OF4XR.js} +1 -1
- package/public/{chunk-W5OGX7AA.js → chunk-G5PK6IZW.js} +1 -1
- package/public/{chunk-TGKSDRIM.js → chunk-GFPRNM6N.js} +1 -1
- package/public/{chunk-NN5OOBYB.js → chunk-GTGO4A2X.js} +1 -1
- package/public/{chunk-AOFPD5RE.js → chunk-IJXZNORX.js} +1 -1
- package/public/{chunk-OOMKUC2L.js → chunk-KCX2WQ7I.js} +1 -1
- package/public/{chunk-ZB4ICO2R.js → chunk-L432DR6J.js} +1 -1
- package/public/{chunk-2YQ45RVC.js → chunk-LNGNBQBM.js} +1 -1
- package/public/{chunk-TEH5OE3K.js → chunk-MCMJ5GFL.js} +1 -1
- package/public/{chunk-KYDJ2BOY.js → chunk-MIOXSBCB.js} +1 -1
- package/public/{chunk-W3QIEA7I.js → chunk-MKVX26LQ.js} +1 -1
- package/public/{chunk-D76J6X6T.js → chunk-MODJOHCZ.js} +1 -1
- package/public/{chunk-WRQFNDNS.js → chunk-NMHMMKMV.js} +1 -1
- package/public/{chunk-CH3TIV2C.js → chunk-NVX4KPO6.js} +1 -1
- package/public/{chunk-W7BYOOHZ.js → chunk-OLGI5A27.js} +1 -1
- package/public/{chunk-6IVWHMEH.js → chunk-P6VGWWMV.js} +1 -1
- package/public/{chunk-M6OUGTBW.js → chunk-PCCN3UQI.js} +1 -1
- package/public/{chunk-F5XX47TF.js → chunk-POHAQOWN.js} +1 -1
- package/public/{chunk-4UNAKMJH.js → chunk-PVFUJ4PR.js} +1 -1
- package/public/{chunk-T43ICSTP.js → chunk-QZJJX4BS.js} +1 -1
- package/public/{chunk-3TJEOX3U.js → chunk-RH474C2P.js} +1 -1
- package/public/{chunk-GTDOYUPC.js → chunk-RN2CW4V7.js} +1 -1
- package/public/{chunk-YK6LTORK.js → chunk-SEYIRMYP.js} +1 -1
- package/public/{chunk-2U7MBXGQ.js → chunk-SJP6OUG5.js} +1 -1
- package/public/{chunk-ZYKKMWVV.js → chunk-TXNEVPOK.js} +1 -1
- package/public/{chunk-TTXUXYHJ.js → chunk-UFFCOH7L.js} +1 -1
- package/public/{chunk-NZXJM7CQ.js → chunk-UO7UMJN3.js} +1 -1
- package/public/{chunk-YJJ3RKIW.js → chunk-UUM2722D.js} +1 -1
- package/public/{chunk-2K4LS57D.js → chunk-VNH6VAIL.js} +1 -1
- package/public/{chunk-YF4R6U5Q.js → chunk-VSICB3TW.js} +1 -1
- package/public/{chunk-TJ2BLEN2.js → chunk-W5UULTHE.js} +1 -1
- package/public/{chunk-FCS22ER4.js → chunk-XBQ6GTWH.js} +1 -1
- package/public/{chunk-CO2XUFAO.js → chunk-XHOBTVZN.js} +1 -1
- package/public/chunk-XSTH4HOH.js +1 -0
- package/public/{chunk-6EMSBLEJ.js → chunk-YBETHBKT.js} +1 -1
- package/public/{chunk-VWIK56CI.js → chunk-YGABEALD.js} +1 -1
- package/public/{chunk-3636BUVB.js → chunk-YWY6NRRB.js} +1 -1
- package/public/{chunk-XQLZOUM5.js → chunk-ZUW7E67I.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-FPE4AVNW.js → main-CVBTY5OH.js} +1 -1
- package/public/chunk-67M7OWPG.js +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare class SpaHtmlService {
|
|
2
|
-
private static originalHtml;
|
|
3
|
-
private static modifiedHtml;
|
|
4
2
|
static updateIndexHtml(webroot: string): Promise<void>;
|
|
5
|
-
static
|
|
3
|
+
private static normalizeWebroot;
|
|
4
|
+
private static transformHtmlForWebroot;
|
|
6
5
|
}
|
|
@@ -10,30 +10,29 @@ const fs_extra_1 = require("fs-extra");
|
|
|
10
10
|
class SpaHtmlService {
|
|
11
11
|
static async updateIndexHtml(webroot) {
|
|
12
12
|
const indexPath = (0, node_path_1.resolve)(node_process_1.default.env.UIX_BASE_PATH, 'public/index.html');
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (this.modifiedHtml) {
|
|
18
|
-
await (0, fs_extra_1.writeFile)(indexPath, this.originalHtml);
|
|
19
|
-
this.modifiedHtml = undefined;
|
|
20
|
-
}
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const baseHref = webroot.endsWith('/') ? webroot : `${webroot}/`;
|
|
24
|
-
this.modifiedHtml = this.originalHtml
|
|
25
|
-
.replace(/<base href="\/"(\s*)\/?>/g, `<base href="${baseHref}"$1/>`)
|
|
26
|
-
.replace(/href="\/assets\//g, `href="${webroot}/assets/`)
|
|
27
|
-
.replace(/href="\/favicon\.ico"/g, `href="${webroot}/favicon.ico"`)
|
|
28
|
-
.replace(/href="\/([^"/]+\.(png|svg|webmanifest))"/g, `href="${webroot}/$1"`);
|
|
29
|
-
await (0, fs_extra_1.writeFile)(indexPath, this.modifiedHtml);
|
|
13
|
+
const originalHtml = await (0, fs_extra_1.readFile)(indexPath, 'utf-8');
|
|
14
|
+
const normalizedWebroot = this.normalizeWebroot(webroot);
|
|
15
|
+
const modifiedHtml = this.transformHtmlForWebroot(originalHtml, normalizedWebroot);
|
|
16
|
+
await (0, fs_extra_1.writeFile)(indexPath, modifiedHtml);
|
|
30
17
|
}
|
|
31
|
-
static
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
await (0, fs_extra_1.writeFile)(indexPath, this.originalHtml);
|
|
35
|
-
this.modifiedHtml = undefined;
|
|
18
|
+
static normalizeWebroot(webroot) {
|
|
19
|
+
if (!webroot || webroot === '/') {
|
|
20
|
+
return '';
|
|
36
21
|
}
|
|
22
|
+
return webroot.replace(/^\/+|\/+$/g, '');
|
|
23
|
+
}
|
|
24
|
+
static transformHtmlForWebroot(html, webroot) {
|
|
25
|
+
const baseHref = webroot ? `/${webroot}/` : '/';
|
|
26
|
+
return html
|
|
27
|
+
.replace(/<base href="[^"]*"(\s*)\/?>/g, `<base href="${baseHref}"$1/>`)
|
|
28
|
+
.replace(/href="\/[^"]*\/assets\//g, 'href="assets/')
|
|
29
|
+
.replace(/href="\/[^"]*\/favicon\.ico"/g, 'href="favicon.ico"')
|
|
30
|
+
.replace(/href="\/[^"]*\/([^"/]+\.(png|svg|webmanifest))"/g, 'href="$1"')
|
|
31
|
+
.replace(/href="\/assets\//g, 'href="assets/')
|
|
32
|
+
.replace(/href="\/favicon\.ico"/g, 'href="favicon.ico"')
|
|
33
|
+
.replace(/href="\/([^"/]+\.(png|svg|webmanifest))"/g, 'href="$1"')
|
|
34
|
+
.replace(/src="\/[^"]*\/assets\//g, 'src="assets/')
|
|
35
|
+
.replace(/src="\/assets\//g, 'src="assets/');
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
exports.SpaHtmlService = SpaHtmlService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spa-html.service.js","sourceRoot":"","sources":["../../../src/core/spa/spa-html.service.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAmC;AACnC,gEAAkC;AAElC,uCAA8C;AAE9C,MAAa,cAAc;
|
|
1
|
+
{"version":3,"file":"spa-html.service.js","sourceRoot":"","sources":["../../../src/core/spa/spa-html.service.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAmC;AACnC,gEAAkC;AAElC,uCAA8C;AAE9C,MAAa,cAAc;IAKzB,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,OAAe;QAC1C,MAAM,SAAS,GAAG,IAAA,mBAAO,EAAC,sBAAO,CAAC,GAAG,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAA;QACzE,MAAM,YAAY,GAAG,MAAM,IAAA,mBAAQ,EAAC,SAAS,EAAE,OAAO,CAAC,CAAA;QAEvD,MAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;QACxD,MAAM,YAAY,GAAG,IAAI,CAAC,uBAAuB,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAA;QAElF,MAAM,IAAA,oBAAS,EAAC,SAAS,EAAE,YAAY,CAAC,CAAA;IAC1C,CAAC;IAOO,MAAM,CAAC,gBAAgB,CAAC,OAAe;QAC7C,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;YAChC,OAAO,EAAE,CAAA;QACX,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAA;IAC1C,CAAC;IAQO,MAAM,CAAC,uBAAuB,CAAC,IAAY,EAAE,OAAe;QAClE,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAA;QAE/C,OAAO,IAAI;aACR,OAAO,CAAC,8BAA8B,EAAE,eAAe,QAAQ,OAAO,CAAC;aACvE,OAAO,CAAC,0BAA0B,EAAE,eAAe,CAAC;aACpD,OAAO,CAAC,+BAA+B,EAAE,oBAAoB,CAAC;aAC9D,OAAO,CAAC,kDAAkD,EAAE,WAAW,CAAC;aACxE,OAAO,CAAC,mBAAmB,EAAE,eAAe,CAAC;aAC7C,OAAO,CAAC,wBAAwB,EAAE,oBAAoB,CAAC;aACvD,OAAO,CAAC,2CAA2C,EAAE,WAAW,CAAC;aACjE,OAAO,CAAC,yBAAyB,EAAE,cAAc,CAAC;aAClD,OAAO,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAA;IAChD,CAAC;CACF;AAhDD,wCAgDC"}
|
package/dist/main.js
CHANGED
|
@@ -28,9 +28,7 @@ async function bootstrap() {
|
|
|
28
28
|
const startupConfig = await (0, config_startup_1.getStartupConfig)();
|
|
29
29
|
const webroot = startupConfig.webroot || '';
|
|
30
30
|
node_process_1.default.env.UIX_WEBROOT = webroot;
|
|
31
|
-
|
|
32
|
-
await spa_html_service_1.SpaHtmlService.updateIndexHtml(webroot);
|
|
33
|
-
}
|
|
31
|
+
await spa_html_service_1.SpaHtmlService.updateIndexHtml(webroot);
|
|
34
32
|
const fAdapter = new platform_fastify_1.FastifyAdapter({
|
|
35
33
|
https: startupConfig.httpsOptions,
|
|
36
34
|
logger: startupConfig.debug || false,
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;AAGA,yCAAmC;AACnC,gEAAkC;AAElC,6DAAoC;AACpC,mEAAiD;AACjD,2CAA+C;AAC/C,uCAA0C;AAC1C,+DAAyD;AACzD,6CAAgE;AAChE,uCAAmC;AAEnC,6CAAwC;AACxC,iEAA4D;AAC5D,iEAA+D;AAC/D,iEAAqD;AACrD,kEAA4D;AAC5D,sDAAiD;AAEjD,wBAAqB;AACrB,4BAAyB;AAEzB,uFAAmF;AAA1E,8HAAA,oBAAoB,OAAA;AAE7B,sBAAO,CAAC,GAAG,CAAC,aAAa,GAAG,sBAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,IAAA,mBAAO,EAAC,SAAS,EAAE,KAAK,CAAC,CAAA;AAE3F,KAAK,UAAU,SAAS;IACtB,MAAM,aAAa,GAAG,MAAM,IAAA,iCAAgB,GAAE,CAAA;IAC9C,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,EAAE,CAAA;IAG3C,sBAAO,CAAC,GAAG,CAAC,WAAW,GAAG,OAAO,CAAA;IAGjC,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;AAGA,yCAAmC;AACnC,gEAAkC;AAElC,6DAAoC;AACpC,mEAAiD;AACjD,2CAA+C;AAC/C,uCAA0C;AAC1C,+DAAyD;AACzD,6CAAgE;AAChE,uCAAmC;AAEnC,6CAAwC;AACxC,iEAA4D;AAC5D,iEAA+D;AAC/D,iEAAqD;AACrD,kEAA4D;AAC5D,sDAAiD;AAEjD,wBAAqB;AACrB,4BAAyB;AAEzB,uFAAmF;AAA1E,8HAAA,oBAAoB,OAAA;AAE7B,sBAAO,CAAC,GAAG,CAAC,aAAa,GAAG,sBAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,IAAA,mBAAO,EAAC,SAAS,EAAE,KAAK,CAAC,CAAA;AAE3F,KAAK,UAAU,SAAS;IACtB,MAAM,aAAa,GAAG,MAAM,IAAA,iCAAgB,GAAE,CAAA;IAC9C,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,EAAE,CAAA;IAG3C,sBAAO,CAAC,GAAG,CAAC,WAAW,GAAG,OAAO,CAAA;IAGjC,MAAM,iCAAc,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;IAE7C,MAAM,QAAQ,GAAG,IAAI,iCAAc,CAAC;QAClC,KAAK,EAAE,aAAa,CAAC,YAAY;QACjC,MAAM,EAAE,aAAa,CAAC,KAAK,IAAI,KAAK;KACrC,CAAC,CAAA;IAEF,QAAQ,CAAC,QAAQ,CAAC,mBAAgB,EAAE;QAClC,MAAM,EAAE;YACN,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,aAAa;SAC1C;KACF,CAAC,CAAA;IAEF,QAAQ,CAAC,QAAQ,CAAC,gBAAM,EAAE;QACxB,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,KAAK;QACjB,cAAc,EAAE;YACd,MAAM,EAAE,aAAa;SACtB;QACD,yBAAyB,EAAE,KAAK;QAChC,uBAAuB,EAAE,KAAK;QAC9B,yBAAyB,EAAE,KAAK;QAChC,qBAAqB,EAAE;YACrB,UAAU,EAAE;gBACV,UAAU,EAAE,CAAC,UAAU,CAAC;gBACxB,SAAS,EAAE,CAAC,UAAU,EAAE,mBAAmB,EAAE,iBAAiB,CAAC;gBAC/D,QAAQ,EAAE,CAAC,UAAU,EAAE,mBAAmB,CAAC;gBAC3C,MAAM,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,mCAAmC,EAAE,2CAA2C,CAAC;gBAC/G,UAAU,EAAE,CAAC,UAAU,EAAE,4BAA4B,EAAE,gCAAgC,EAAE,CAAC,GAAG,EAAE,EAAE;wBAC/F,OAAO,SAAS,GAAG,CAAC,OAAO,CAAC,IAAI,SAAS,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,aAAa,CAAC,aAAa,IAAI,EAAE,EAAE,CAAA;oBAClG,CAAC,CAAC;gBACF,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,kCAAkC,CAAC;gBACnE,aAAa,EAAE,IAAI;gBACnB,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;gBACf,cAAc,EAAE,IAAI;gBACpB,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,IAAI;gBACb,uBAAuB,EAAE,IAAI;gBAC7B,oBAAoB,EAAE,IAAI;aAC3B;SACF;KACF,CAAC,CAAA;IAEF,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAClC,sBAAS,EACT,QAAQ,EACR;QACE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,uBAAM,EAAE,CAAC,CAAC,CAAC,KAAK;QAClD,YAAY,EAAE,aAAa,CAAC,YAAY;KACzC,CACF,CAAA;IAED,MAAM,aAAa,GAAkB,GAAG,CAAC,GAAG,CAAC,8BAAa,CAAC,CAAA;IAC3D,MAAM,MAAM,GAAW,GAAG,CAAC,GAAG,CAAC,uBAAM,CAAC,CAAA;IAGtC,GAAG,CAAC,cAAc,EAAE,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,EAAE,KAAK,EAAE,GAAmB,EAAE,GAAiB,EAAE,EAAE;QACxF,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QACrB,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,qCAAqC,CAAC,CAAA;QAClE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;QAChC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;QAC1B,GAAG,CAAC,IAAI,CAAC,MAAM,IAAA,mBAAQ,EAAC,IAAA,mBAAO,EAAC,sBAAO,CAAC,GAAG,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;IACnF,CAAC,CAAC,CAAA;IAGF,GAAG,CAAC,eAAe,CAAC;QAClB,IAAI,EAAE,IAAA,mBAAO,EAAC,sBAAO,CAAC,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC;QAClD,MAAM,EAAE,OAAO,IAAI,SAAS;QAC5B,UAAU,CAAC,GAAG;YACZ,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,mCAAmC,CAAC,CAAA;QACrE,CAAC;KACF,CAAC,CAAA;IAGF,GAAG,CAAC,eAAe,CAAC,GAAG,OAAO,MAAM,CAAC,CAAA;IAGrC,GAAG,CAAC,UAAU,CAAC;QACb,MAAM,EAAE,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;QAC1D,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC;KAC9D,CAAC,CAAA;IAIF,GAAG,CAAC,cAAc,CAAC,IAAI,uBAAc,CAAC;QACpC,SAAS,EAAE,IAAI;QACf,qBAAqB,EAAE,IAAI;KAC5B,CAAC,CAAC,CAAA;IAGH,MAAM,OAAO,GAAG,IAAI,yBAAe,EAAE;SAClC,QAAQ,CAAC,6BAA6B,CAAC;SACvC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC;SACzC,aAAa,CAAC;QACb,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE;YACL,QAAQ,EAAE;gBACR,QAAQ,EAAE,iBAAiB;gBAC3B,MAAM,EAAE,IAAI;aACb;SACF;KACF,CAAC;SACD,KAAK,EAAE,CAAA;IAEV,MAAM,QAAQ,GAAG,uBAAa,CAAC,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IAC3D,uBAAa,CAAC,KAAK,CAAC,GAAG,OAAO,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;IAG3E,GAAG,CAAC,gBAAgB,CAAC,IAAI,sBAAS,EAAE,CAAC,CAAA;IAErC,MAAM,CAAC,IAAI,CAAC,kBAAkB,aAAa,CAAC,OAAO,CAAC,OAAO,oBAAoB,aAAa,CAAC,IAAI,SAAS,aAAa,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAA;IACnI,MAAM,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IAE3D,OAAO,GAAG,CAAA;AACZ,CAAC;AAEY,QAAA,GAAG,GAAG,SAAS,EAAE,CAAA"}
|
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.2-beta.
|
|
4
|
+
"version": "5.4.2-beta.21",
|
|
5
5
|
"description": "A web based management, configuration and control platform for Homebridge.",
|
|
6
6
|
"author": "oznu <dev@oz.nu>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-YK6LTORK.js";import{a as ee,b as te,c as ie}from"./chunk-AEEAPTXE.js";import{c as ae}from"./chunk-NN5OOBYB.js";import"./chunk-VWIK56CI.js";import{a as le}from"./chunk-3TJEOX3U.js";import{a as se}from"./chunk-KNZTEJFP.js";import{m as D,n as Y,t as Z}from"./chunk-BQMDK4YS.js";import{B as X,c as q,e as G,f as J,i as K,l as Q,m as U}from"./chunk-AM53KSWA.js";import"./chunk-NZXJM7CQ.js";import{b as oe}from"./chunk-X4MPFU5C.js";import"./chunk-MDV2S56W.js";import{b as ne}from"./chunk-2WWJCZHM.js";import{l as h}from"./chunk-D6IDPBE4.js";import{Db as T,Ga as L,Gb as b,Ib as p,Jc as z,La as o,Vb as c,Wa as y,Wb as u,Xb as S,ac as k,bc as A,cc as E,fc as W,gc as B,hc as R,ja as g,kb as v,lb as M,mb as w,mc as s,nc as l,oa as x,ob as $,oc as j,pa as C,pb as V,qb as F,rb as _,sb as r,tb as a,ub as m,vb as P,wb as H,xb as O}from"./chunk-3LEW5FOJ.js";var ce=(()=>{class t{$activeModal=g(D);dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],decls:42,vars:30,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","mb-3"],[1,"fa","fa-fw","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"ms-2"],[1,"mb-0"],[1,"ms-2","mt-2"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),s(5,"translate"),a(),r(6,"button",3),s(7,"translate"),b("click",function(){return n.dismissModal()}),a()(),r(8,"div",4)(9,"div",5),m(10,"i",6),a(),r(11,"h5",7),c(12),s(13,"translate"),a(),r(14,"ul",8)(15,"li"),c(16),s(17,"translate"),a(),r(18,"li"),c(19),s(20,"translate"),a()(),r(21,"h5",9),c(22),s(23,"translate"),a(),r(24,"ul",8)(25,"li"),c(26),s(27,"translate"),a(),r(28,"li"),c(29),s(30,"translate"),a(),r(31,"li"),c(32),s(33,"translate"),a()(),m(34,"app-support-banner"),a(),r(35,"div",10),m(36,"div",11),r(37,"div",12)(38,"button",13),b("click",function(){return n.dismissModal()}),c(39),s(40,"translate"),a()(),m(41,"div",14),a()()()),i&2&&(o(4),u(l(5,10,"support.title")),o(2),v("aria-label",l(7,12,"form.button_close")),o(6),u(l(13,14,"menu.label_accessories")),o(4),u(l(17,16,"accessories.support.acc_1")),o(3),u(l(20,18,"accessories.support.acc_2")),o(3),u(l(23,20,"accessories.title_rooms")),o(4),u(l(27,22,"accessories.support.rooms_1")),o(3),u(l(30,24,"accessories.support.rooms_2")),o(3),u(l(33,26,"accessories.support.rooms_3")),o(7),S(" ",l(40,28,"form.button_close")," "))},dependencies:[le,h],encapsulation:2})}return t})();var me=()=>({standalone:!0}),de=(()=>{class t{$activeModal=g(D);roomName;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(e){this.$activeModal.close(e)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],inputs:{roomName:"roomName"},decls:28,vars:19,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","mb-3"],[1,"fas","fa-fw","fa-folder-plus","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["autocomplete","off","type","text","id","form-name","autofocus","",1,"form-control","custom-input",3,"ngModelChange","keyup.enter","ngModel","ngModelOptions"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),s(5,"translate"),a(),r(6,"button",3),s(7,"translate"),b("click",function(){return n.dismissModal()}),a()(),r(8,"div",4)(9,"div",5),m(10,"i",6),a(),r(11,"ul",7)(12,"li",8)(13,"label",9),c(14),s(15,"translate"),a(),r(16,"div",10)(17,"input",11),E("ngModelChange",function(I){return A(n.roomName,I)||(n.roomName=I),I}),b("keyup.enter",function(){return n.closeModal(n.roomName)}),a()()()()(),r(18,"div",12)(19,"div",13)(20,"button",14),b("click",function(){return n.dismissModal()}),c(21),s(22,"translate"),a()(),m(23,"div",15),r(24,"div",16)(25,"button",17),b("click",function(){return n.closeModal(n.roomName)}),c(26),s(27,"translate"),a()()()()()),i&2&&(o(4),u(l(5,8,"accessories.button_add_room")),o(2),v("aria-label",l(7,10,"form.button_close")),o(8),u(l(15,12,"accessories.room_name")),o(3),k("ngModel",n.roomName),_("ngModelOptions",W(18,me)),o(4),S(" ",l(22,14,"form.button_close")," "),o(4),_("disabled",!n.roomName),o(),S(" ",l(27,16,"form.button_save")," "))},dependencies:[X,U,q,G,J,Q,K,h],encapsulation:2})}return t})();var pe=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["app-drag-here-placeholder"]],decls:5,vars:3,consts:[[1,"accessory-box"],[1,"fas","fa-fw","fa-arrow-alt-circle-down","accessory-icon"],[1,"accessory-label"]],template:function(i,n){i&1&&(P(0,"div",0),O(1,"i",1),P(2,"div",2),c(3),s(4,"translate"),H()()),i&2&&(o(3),u(l(4,1,"accessories.control.drag_here")))},dependencies:[h],styles:[".accessory-box[_ngcontent-%COMP%]{opacity:.2}"]})}return t})();var ue=(t,f)=>({"fa-eye":t,"fa-eye-slash":f}),_e=t=>({"cursor-move":t}),be=t=>({"justify-content-between":t}),fe=t=>({link:t});function ge(t,f){if(t&1&&(r(0,"div",0)(1,"div",19)(2,"h5",20),c(3),s(4,"translate"),a()()()),t&2){let e=p().$implicit,i=p(2);o(2),_("ngClass",B(4,_e,!i.isMobile)),o(),S(" ",e.name==="Default Room"?l(4,2,"accessories.control.default_room"):e.name," ")}}function ve(t,f){if(t&1&&(r(0,"div",23),m(1,"app-accessory-tile",24),a()),t&2){let e=p().$implicit;o(),_("service",e)}}function xe(t,f){if(t&1&&M(0,ve,2,1,"div",23),t&2){let e=f.$implicit,i=p(4);w(!i.hideHidden||!e.hidden?0:-1)}}function Ce(t,f){if(t&1){let e=T();r(0,"div",21),E("dragulaModelChange",function(n){x(e);let d=p().$implicit;return A(d.services,n)||(d.services=n),C(n)}),V(1,xe,1,1,null,null,$),m(3,"div",22)(4,"div",22)(5,"div",22)(6,"div",22)(7,"div",22)(8,"div",22)(9,"div",22)(10,"div",22)(11,"div",22)(12,"div",22),a()}if(t&2){let e=p().$implicit,i=p(2);_("ngClass",B(3,be,i.isMobile))("dragula","services-bag"),k("dragulaModel",e.services),o(),F(e.services)}}function ye(t,f){if(t&1){let e=T();r(0,"div",25),E("dragulaModelChange",function(n){x(e);let d=p().$implicit;return A(d.services,n)||(d.services=n),C(n)}),m(1,"app-drag-here-placeholder",26),a()}if(t&2){let e=p().$implicit;_("dragula","services-bag"),k("dragulaModel",e.services)}}function he(t,f){if(t&1&&(r(0,"div"),M(1,ge,5,6,"div",0),r(2,"div",16),M(3,Ce,13,5,"div",17),M(4,ye,2,2,"div",18),a()()),t&2){let e=f.$implicit,i=p(2);o(),w(!i.isMobile||e.services.length?1:-1),o(2),w(e.services.length?3:-1),o(),w(!e.services.length&&!i.isMobile?4:-1)}}function Me(t,f){if(t&1){let e=T();r(0,"div",1)(1,"div",2)(2,"h3",3),c(3),s(4,"translate"),a()(),r(5,"div",4)(6,"button",5),s(7,"translate"),b("click",function(){x(e);let n=p();return C(n.openSupport())}),m(8,"i",6),a()(),r(9,"div",7)(10,"button",8),s(11,"translate"),s(12,"translate"),b("click",function(){x(e);let n=p();return C(n.addRoom())}),m(13,"i",9),a(),r(14,"button",8),s(15,"translate"),s(16,"translate"),s(17,"translate"),s(18,"translate"),b("click",function(){x(e);let n=p();return C(n.hideHidden=!n.hideHidden)}),m(19,"i",10),a(),r(20,"div",11)(21,"button",12),s(22,"translate"),s(23,"translate"),b("click",function(){x(e);let n=p();return C(n.toggleLayoutLock())}),m(24,"i",13),a(),r(25,"button",12),s(26,"translate"),s(27,"translate"),b("click",function(){x(e);let n=p();return C(n.toggleLayoutLock())}),m(28,"i",14),a()(),r(29,"button",5),s(30,"translate"),b("click",function(){x(e);let n=p();return C(n.openSupport())}),m(31,"i",6),a()()(),r(32,"div",15),E("dragulaModelChange",function(n){x(e);let d=p();return A(d.$accessories.rooms,n)||(d.$accessories.rooms=n),C(n)}),V(33,he,5,3,"div",null,$),a()}if(t&2){let e=p();o(3),u(l(4,22,"menu.label_accessories")),o(3),v("aria-label",l(7,24,"support.title")),o(4),_("hidden",e.isMobile)("openDelay",150)("ngbTooltip",l(11,26,"accessories.button_add_room")),v("aria-label",l(12,28,"accessories.button_add_room")),o(4),_("hidden",e.isMobile)("openDelay",150)("ngbTooltip",e.hideHidden?l(15,30,"accessories.button_hidden_show"):l(16,32,"accessories.button_hidden_hide")),v("aria-label",e.hideHidden?l(17,34,"accessories.button_hidden_show"):l(18,36,"accessories.button_hidden_hide")),o(5),_("ngClass",R(48,ue,!e.hideHidden,e.hideHidden)),o(2),_("disabled",!e.isMobile)("openDelay",150)("ngbTooltip",l(22,38,"form.button_unlock")),v("aria-label",l(23,40,"form.button_unlock")),o(4),_("disabled",e.isMobile)("openDelay",150)("ngbTooltip",l(26,42,"form.button_lock")),v("aria-label",l(27,44,"form.button_lock")),o(4),v("aria-label",l(30,46,"support.title")),o(3),_("dragula","rooms-bag"),k("dragulaModel",e.$accessories.rooms),o(),F(e.$accessories.rooms)}}function we(t,f){t&1&&(r(0,"p",33),c(1),s(2,"translate"),a()),t&2&&(o(),u(l(2,1,"accessories.settings_link")))}function Se(t,f){if(t&1&&(r(0,"div",0)(1,"div",27)(2,"h3",28),c(3),s(4,"translate"),a()(),r(5,"div",29)(6,"div",30)(7,"h5",31),c(8),s(9,"translate"),a(),m(10,"p",32),s(11,"translate"),M(12,we,3,3,"p",33),a()()()),t&2){let e=p();o(3),u(l(4,4,"menu.label_accessories")),o(5),u(l(9,6,"accessories.control_disabled")),o(2),_("innerHTML",j(11,8,"accessories.message_must_use_insecure_mode",B(11,fe,e.linkInsecure)),L),o(2),w(e.isAdmin?12:-1)}}var nt=(()=>{class t{$accessories=g(ae);$auth=g(oe);dragulaService=g(ee);$modal=g(Y);$settings=g(ne);$md=g(se);orderSubscription;isAdmin=this.$auth.user.admin;enableAccessories=this.$settings.env.enableAccessories;isMobile=!1;hideHidden=!0;linkInsecure='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Enabling-Accessory-Control" target="_blank"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){let e=this.dragulaService;this.isMobile=this.$md.detect.mobile(),e.createGroup("rooms-bag",{moves:(i,n,d)=>!this.isMobile&&d.classList.contains("drag-handle")}),e.createGroup("services-bag",{moves:i=>!this.isMobile&&!i.classList.contains("no-drag")}),this.orderSubscription=e.drop().subscribe(()=>{setTimeout(()=>{this.$accessories.saveLayout()})}),this.isMobile=!0}ngOnInit(){this.$accessories.start()}addRoom(){this.$modal.open(de,{size:"lg",backdrop:"static"}).result.then(e=>{!e||!e.length||this.$accessories.rooms.find(i=>i.name===e)||(this.$accessories.rooms.push({name:e,services:[]}),this.isMobile&&this.toggleLayoutLock())}).catch(()=>{})}toggleLayoutLock(){this.isMobile=!this.isMobile,this.isMobile?document.querySelectorAll(".services-bag").forEach(i=>{for(let n=0;n<10;n++){let d=document.createElement("div");d.className="accessory-box invisible py-0 my-0",d.style.height="0",i.appendChild(d)}}):document.querySelectorAll(".invisible").forEach(i=>i.remove())}openSupport(){this.$modal.open(ce,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.$accessories.stop(),this.orderSubscription.unsubscribe(),this.dragulaService.destroy("rooms-bag"),this.dragulaService.destroy("services-bag")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["app-accessories"]],decls:2,vars:1,consts:[[1,"row"],[1,"row","mb-3"],[1,"col-9","col-sm-6"],[1,"primary-text","m-0"],[1,"col-3","col-sm-6","text-end","d-inline-block","d-sm-none"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"col-3","col-sm-6","text-end","d-none","d-sm-inline-block"],["type","button","container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","hidden","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-folder-plus"],[1,"fas","fa-fw",3,"ngClass"],["role","group",1,"btn-group","me-2"],["type","button","container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-unlock"],[1,"fas","fa-fw","fa-lock"],[3,"dragulaModelChange","dragula","dragulaModel"],[1,"row","mb-4"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"ngClass","dragula","dragulaModel"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragula","dragulaModel"],[1,"col-md-12"],[1,"primary-text","drag-handle","room-title","m-0","mb-1","mb-sm-0",3,"ngClass"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"dragulaModelChange","ngClass","dragula","dragulaModel"],[1,"accessory-box","invisible","py-0","my-0",2,"height","0"],[1,"accessory-item","accessory-tab"],[3,"service"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragulaModelChange","dragula","dragulaModel"],[1,"no-drag"],[1,"col-12"],[1,"primary-text","m-0","mb-3"],[1,"col-12","text-center"],["role","alert",1,"alert","alert-warning","p-4"],[1,"mb-3","mt-0"],[1,"mb-0",3,"innerHTML"],[1,"mt-3","mb-0"]],template:function(i,n){i&1&&M(0,Me,35,51)(1,Se,13,13,"div",0),i&2&&w(n.enableAccessories?0:1)},dependencies:[Z,z,ie,te,re,pe,h],styles:[".room-title[_ngcontent-%COMP%]{margin-left:10px}@media (max-width: 575px){.room-title[_ngcontent-%COMP%]{margin-left:7px}}.services-bag[_ngcontent-%COMP%]{min-height:170px}@media (max-width: 575px){.services-bag[_ngcontent-%COMP%]{min-height:initial}}.cursor-move[_ngcontent-%COMP%]{cursor:move}.gu-transit[_ngcontent-%COMP%] .manage-accessory-button[_ngcontent-%COMP%]{display:none}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return t})();export{nt as AccessoriesComponent};
|
|
1
|
+
import{a as re}from"./chunk-SEYIRMYP.js";import{a as ee,b as te,c as ie}from"./chunk-AEEAPTXE.js";import{c as ae}from"./chunk-GTGO4A2X.js";import"./chunk-YGABEALD.js";import{a as le}from"./chunk-RH474C2P.js";import{a as se}from"./chunk-KNZTEJFP.js";import{m as D,n as Y,t as Z}from"./chunk-BQMDK4YS.js";import{B as X,c as q,e as G,f as J,i as K,l as Q,m as U}from"./chunk-AM53KSWA.js";import"./chunk-UO7UMJN3.js";import{b as oe}from"./chunk-BH4JDZF4.js";import"./chunk-MDV2S56W.js";import{b as ne}from"./chunk-5RI5TLFW.js";import{l as h}from"./chunk-FB6OF4XR.js";import{Db as T,Ga as L,Gb as b,Ib as p,Jc as z,La as o,Vb as c,Wa as y,Wb as u,Xb as S,ac as k,bc as A,cc as E,fc as W,gc as B,hc as R,ja as g,kb as v,lb as M,mb as w,mc as s,nc as l,oa as x,ob as $,oc as j,pa as C,pb as V,qb as F,rb as _,sb as r,tb as a,ub as m,vb as P,wb as H,xb as O}from"./chunk-3LEW5FOJ.js";var ce=(()=>{class t{$activeModal=g(D);dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],decls:42,vars:30,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","mb-3"],[1,"fa","fa-fw","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"ms-2"],[1,"mb-0"],[1,"ms-2","mt-2"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),s(5,"translate"),a(),r(6,"button",3),s(7,"translate"),b("click",function(){return n.dismissModal()}),a()(),r(8,"div",4)(9,"div",5),m(10,"i",6),a(),r(11,"h5",7),c(12),s(13,"translate"),a(),r(14,"ul",8)(15,"li"),c(16),s(17,"translate"),a(),r(18,"li"),c(19),s(20,"translate"),a()(),r(21,"h5",9),c(22),s(23,"translate"),a(),r(24,"ul",8)(25,"li"),c(26),s(27,"translate"),a(),r(28,"li"),c(29),s(30,"translate"),a(),r(31,"li"),c(32),s(33,"translate"),a()(),m(34,"app-support-banner"),a(),r(35,"div",10),m(36,"div",11),r(37,"div",12)(38,"button",13),b("click",function(){return n.dismissModal()}),c(39),s(40,"translate"),a()(),m(41,"div",14),a()()()),i&2&&(o(4),u(l(5,10,"support.title")),o(2),v("aria-label",l(7,12,"form.button_close")),o(6),u(l(13,14,"menu.label_accessories")),o(4),u(l(17,16,"accessories.support.acc_1")),o(3),u(l(20,18,"accessories.support.acc_2")),o(3),u(l(23,20,"accessories.title_rooms")),o(4),u(l(27,22,"accessories.support.rooms_1")),o(3),u(l(30,24,"accessories.support.rooms_2")),o(3),u(l(33,26,"accessories.support.rooms_3")),o(7),S(" ",l(40,28,"form.button_close")," "))},dependencies:[le,h],encapsulation:2})}return t})();var me=()=>({standalone:!0}),de=(()=>{class t{$activeModal=g(D);roomName;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(e){this.$activeModal.close(e)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],inputs:{roomName:"roomName"},decls:28,vars:19,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","mb-3"],[1,"fas","fa-fw","fa-folder-plus","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["autocomplete","off","type","text","id","form-name","autofocus","",1,"form-control","custom-input",3,"ngModelChange","keyup.enter","ngModel","ngModelOptions"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),s(5,"translate"),a(),r(6,"button",3),s(7,"translate"),b("click",function(){return n.dismissModal()}),a()(),r(8,"div",4)(9,"div",5),m(10,"i",6),a(),r(11,"ul",7)(12,"li",8)(13,"label",9),c(14),s(15,"translate"),a(),r(16,"div",10)(17,"input",11),E("ngModelChange",function(I){return A(n.roomName,I)||(n.roomName=I),I}),b("keyup.enter",function(){return n.closeModal(n.roomName)}),a()()()()(),r(18,"div",12)(19,"div",13)(20,"button",14),b("click",function(){return n.dismissModal()}),c(21),s(22,"translate"),a()(),m(23,"div",15),r(24,"div",16)(25,"button",17),b("click",function(){return n.closeModal(n.roomName)}),c(26),s(27,"translate"),a()()()()()),i&2&&(o(4),u(l(5,8,"accessories.button_add_room")),o(2),v("aria-label",l(7,10,"form.button_close")),o(8),u(l(15,12,"accessories.room_name")),o(3),k("ngModel",n.roomName),_("ngModelOptions",W(18,me)),o(4),S(" ",l(22,14,"form.button_close")," "),o(4),_("disabled",!n.roomName),o(),S(" ",l(27,16,"form.button_save")," "))},dependencies:[X,U,q,G,J,Q,K,h],encapsulation:2})}return t})();var pe=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["app-drag-here-placeholder"]],decls:5,vars:3,consts:[[1,"accessory-box"],[1,"fas","fa-fw","fa-arrow-alt-circle-down","accessory-icon"],[1,"accessory-label"]],template:function(i,n){i&1&&(P(0,"div",0),O(1,"i",1),P(2,"div",2),c(3),s(4,"translate"),H()()),i&2&&(o(3),u(l(4,1,"accessories.control.drag_here")))},dependencies:[h],styles:[".accessory-box[_ngcontent-%COMP%]{opacity:.2}"]})}return t})();var ue=(t,f)=>({"fa-eye":t,"fa-eye-slash":f}),_e=t=>({"cursor-move":t}),be=t=>({"justify-content-between":t}),fe=t=>({link:t});function ge(t,f){if(t&1&&(r(0,"div",0)(1,"div",19)(2,"h5",20),c(3),s(4,"translate"),a()()()),t&2){let e=p().$implicit,i=p(2);o(2),_("ngClass",B(4,_e,!i.isMobile)),o(),S(" ",e.name==="Default Room"?l(4,2,"accessories.control.default_room"):e.name," ")}}function ve(t,f){if(t&1&&(r(0,"div",23),m(1,"app-accessory-tile",24),a()),t&2){let e=p().$implicit;o(),_("service",e)}}function xe(t,f){if(t&1&&M(0,ve,2,1,"div",23),t&2){let e=f.$implicit,i=p(4);w(!i.hideHidden||!e.hidden?0:-1)}}function Ce(t,f){if(t&1){let e=T();r(0,"div",21),E("dragulaModelChange",function(n){x(e);let d=p().$implicit;return A(d.services,n)||(d.services=n),C(n)}),V(1,xe,1,1,null,null,$),m(3,"div",22)(4,"div",22)(5,"div",22)(6,"div",22)(7,"div",22)(8,"div",22)(9,"div",22)(10,"div",22)(11,"div",22)(12,"div",22),a()}if(t&2){let e=p().$implicit,i=p(2);_("ngClass",B(3,be,i.isMobile))("dragula","services-bag"),k("dragulaModel",e.services),o(),F(e.services)}}function ye(t,f){if(t&1){let e=T();r(0,"div",25),E("dragulaModelChange",function(n){x(e);let d=p().$implicit;return A(d.services,n)||(d.services=n),C(n)}),m(1,"app-drag-here-placeholder",26),a()}if(t&2){let e=p().$implicit;_("dragula","services-bag"),k("dragulaModel",e.services)}}function he(t,f){if(t&1&&(r(0,"div"),M(1,ge,5,6,"div",0),r(2,"div",16),M(3,Ce,13,5,"div",17),M(4,ye,2,2,"div",18),a()()),t&2){let e=f.$implicit,i=p(2);o(),w(!i.isMobile||e.services.length?1:-1),o(2),w(e.services.length?3:-1),o(),w(!e.services.length&&!i.isMobile?4:-1)}}function Me(t,f){if(t&1){let e=T();r(0,"div",1)(1,"div",2)(2,"h3",3),c(3),s(4,"translate"),a()(),r(5,"div",4)(6,"button",5),s(7,"translate"),b("click",function(){x(e);let n=p();return C(n.openSupport())}),m(8,"i",6),a()(),r(9,"div",7)(10,"button",8),s(11,"translate"),s(12,"translate"),b("click",function(){x(e);let n=p();return C(n.addRoom())}),m(13,"i",9),a(),r(14,"button",8),s(15,"translate"),s(16,"translate"),s(17,"translate"),s(18,"translate"),b("click",function(){x(e);let n=p();return C(n.hideHidden=!n.hideHidden)}),m(19,"i",10),a(),r(20,"div",11)(21,"button",12),s(22,"translate"),s(23,"translate"),b("click",function(){x(e);let n=p();return C(n.toggleLayoutLock())}),m(24,"i",13),a(),r(25,"button",12),s(26,"translate"),s(27,"translate"),b("click",function(){x(e);let n=p();return C(n.toggleLayoutLock())}),m(28,"i",14),a()(),r(29,"button",5),s(30,"translate"),b("click",function(){x(e);let n=p();return C(n.openSupport())}),m(31,"i",6),a()()(),r(32,"div",15),E("dragulaModelChange",function(n){x(e);let d=p();return A(d.$accessories.rooms,n)||(d.$accessories.rooms=n),C(n)}),V(33,he,5,3,"div",null,$),a()}if(t&2){let e=p();o(3),u(l(4,22,"menu.label_accessories")),o(3),v("aria-label",l(7,24,"support.title")),o(4),_("hidden",e.isMobile)("openDelay",150)("ngbTooltip",l(11,26,"accessories.button_add_room")),v("aria-label",l(12,28,"accessories.button_add_room")),o(4),_("hidden",e.isMobile)("openDelay",150)("ngbTooltip",e.hideHidden?l(15,30,"accessories.button_hidden_show"):l(16,32,"accessories.button_hidden_hide")),v("aria-label",e.hideHidden?l(17,34,"accessories.button_hidden_show"):l(18,36,"accessories.button_hidden_hide")),o(5),_("ngClass",R(48,ue,!e.hideHidden,e.hideHidden)),o(2),_("disabled",!e.isMobile)("openDelay",150)("ngbTooltip",l(22,38,"form.button_unlock")),v("aria-label",l(23,40,"form.button_unlock")),o(4),_("disabled",e.isMobile)("openDelay",150)("ngbTooltip",l(26,42,"form.button_lock")),v("aria-label",l(27,44,"form.button_lock")),o(4),v("aria-label",l(30,46,"support.title")),o(3),_("dragula","rooms-bag"),k("dragulaModel",e.$accessories.rooms),o(),F(e.$accessories.rooms)}}function we(t,f){t&1&&(r(0,"p",33),c(1),s(2,"translate"),a()),t&2&&(o(),u(l(2,1,"accessories.settings_link")))}function Se(t,f){if(t&1&&(r(0,"div",0)(1,"div",27)(2,"h3",28),c(3),s(4,"translate"),a()(),r(5,"div",29)(6,"div",30)(7,"h5",31),c(8),s(9,"translate"),a(),m(10,"p",32),s(11,"translate"),M(12,we,3,3,"p",33),a()()()),t&2){let e=p();o(3),u(l(4,4,"menu.label_accessories")),o(5),u(l(9,6,"accessories.control_disabled")),o(2),_("innerHTML",j(11,8,"accessories.message_must_use_insecure_mode",B(11,fe,e.linkInsecure)),L),o(2),w(e.isAdmin?12:-1)}}var nt=(()=>{class t{$accessories=g(ae);$auth=g(oe);dragulaService=g(ee);$modal=g(Y);$settings=g(ne);$md=g(se);orderSubscription;isAdmin=this.$auth.user.admin;enableAccessories=this.$settings.env.enableAccessories;isMobile=!1;hideHidden=!0;linkInsecure='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Enabling-Accessory-Control" target="_blank"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){let e=this.dragulaService;this.isMobile=this.$md.detect.mobile(),e.createGroup("rooms-bag",{moves:(i,n,d)=>!this.isMobile&&d.classList.contains("drag-handle")}),e.createGroup("services-bag",{moves:i=>!this.isMobile&&!i.classList.contains("no-drag")}),this.orderSubscription=e.drop().subscribe(()=>{setTimeout(()=>{this.$accessories.saveLayout()})}),this.isMobile=!0}ngOnInit(){this.$accessories.start()}addRoom(){this.$modal.open(de,{size:"lg",backdrop:"static"}).result.then(e=>{!e||!e.length||this.$accessories.rooms.find(i=>i.name===e)||(this.$accessories.rooms.push({name:e,services:[]}),this.isMobile&&this.toggleLayoutLock())}).catch(()=>{})}toggleLayoutLock(){this.isMobile=!this.isMobile,this.isMobile?document.querySelectorAll(".services-bag").forEach(i=>{for(let n=0;n<10;n++){let d=document.createElement("div");d.className="accessory-box invisible py-0 my-0",d.style.height="0",i.appendChild(d)}}):document.querySelectorAll(".invisible").forEach(i=>i.remove())}openSupport(){this.$modal.open(ce,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.$accessories.stop(),this.orderSubscription.unsubscribe(),this.dragulaService.destroy("rooms-bag"),this.dragulaService.destroy("services-bag")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["app-accessories"]],decls:2,vars:1,consts:[[1,"row"],[1,"row","mb-3"],[1,"col-9","col-sm-6"],[1,"primary-text","m-0"],[1,"col-3","col-sm-6","text-end","d-inline-block","d-sm-none"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"col-3","col-sm-6","text-end","d-none","d-sm-inline-block"],["type","button","container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","hidden","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-folder-plus"],[1,"fas","fa-fw",3,"ngClass"],["role","group",1,"btn-group","me-2"],["type","button","container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-unlock"],[1,"fas","fa-fw","fa-lock"],[3,"dragulaModelChange","dragula","dragulaModel"],[1,"row","mb-4"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"ngClass","dragula","dragulaModel"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragula","dragulaModel"],[1,"col-md-12"],[1,"primary-text","drag-handle","room-title","m-0","mb-1","mb-sm-0",3,"ngClass"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"dragulaModelChange","ngClass","dragula","dragulaModel"],[1,"accessory-box","invisible","py-0","my-0",2,"height","0"],[1,"accessory-item","accessory-tab"],[3,"service"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragulaModelChange","dragula","dragulaModel"],[1,"no-drag"],[1,"col-12"],[1,"primary-text","m-0","mb-3"],[1,"col-12","text-center"],["role","alert",1,"alert","alert-warning","p-4"],[1,"mb-3","mt-0"],[1,"mb-0",3,"innerHTML"],[1,"mt-3","mb-0"]],template:function(i,n){i&1&&M(0,Me,35,51)(1,Se,13,13,"div",0),i&2&&w(n.enableAccessories?0:1)},dependencies:[Z,z,ie,te,re,pe,h],styles:[".room-title[_ngcontent-%COMP%]{margin-left:10px}@media (max-width: 575px){.room-title[_ngcontent-%COMP%]{margin-left:7px}}.services-bag[_ngcontent-%COMP%]{min-height:170px}@media (max-width: 575px){.services-bag[_ngcontent-%COMP%]{min-height:initial}}.cursor-move[_ngcontent-%COMP%]{cursor:move}.gu-transit[_ngcontent-%COMP%] .manage-accessory-button[_ngcontent-%COMP%]{display:none}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return t})();export{nt as AccessoriesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk-KXMDG63G.js";import{k as c,n as p,q as m}from"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-KXMDG63G.js";import{k as c,n as p,q as m}from"./chunk-FB6OF4XR.js";import{ea as n,g as f,h as r,ja as a,w as s}from"./chunk-3LEW5FOJ.js";var l=f(u(),1);var $=(()=>{class e{$api=a(m);$toastr=a(p);$translate=a(c);downloadBackup(){return r(this,null,function*(){let t=yield s(this.$api.get("/backup/download",{observe:"response",responseType:"blob"})),i=t.headers.get("File-Name")||"homebridge-backup.tar.gz",o=t.body.size;if(o>globalThis.backup.maxBackupSize){let b=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(o/1048576).toFixed(1)}MB`});this.$toastr.warning(b,this.$translate.instant("toast.title_warning"))}(0,l.saveAs)(t.body,i)})}static \u0275fac=function(i){return new(i||e)};static \u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{$ as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as tt,n as et,q as it}from"./chunk-D6IDPBE4.js";import{T as G,e as ut,ea as R,g as ct,gd as X,h as P,ja as Y,n as Q,w as N}from"./chunk-3LEW5FOJ.js";var st=ut((J,K)=>{(function(b,D){typeof J=="object"&&typeof K<"u"?K.exports=D():typeof define=="function"&&define.amd?define(D):(b=typeof globalThis<"u"?globalThis:b||self).dayjs=D()})(J,function(){"use strict";var b=1e3,D=6e4,n=36e5,h="millisecond",d="second",m="minute",M="hour",v="day",f="week",L="month",B="quarter",S="year",_="date",E="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ot={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var s=String(r);return!s||s.length>=i?r:""+Array(i+1-s.length).join(t)+r},at={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),s=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(s,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var s=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(s,L),o=t-e<0,a=i.clone().add(s+(o?-1:1),L);return+(-(s+(t-e)/(o?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:L,y:S,w:f,d:v,D:_,h:M,m,s:d,ms:h,Q:B}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},j="en",T={};T[j]=ot;var Z="$isDayjsObject",U=function(r){return r instanceof C||!(!r||!r[Z])},W=function r(i,t,s){var e;if(!i)return j;if(typeof i=="string"){var o=i.toLowerCase();T[o]&&(e=o),t&&(T[o]=t,e=o);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;T[c]=i,e=c}return!s&&e&&(j=e),e||!s&&j},g=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new C(t)},u=at;u.l=W,u.i=U,u.w=function(r,i){return g(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var C=(function(){function r(t){this.$L=W(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[Z]=!0}var i=r.prototype;return i.parse=function(t){this.$d=(function(s){var e=s.date,o=s.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(nt);if(a){var c=a[2]-1||0,l=(a[7]||"0").substring(0,3);return o?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)}}return new Date(e)})(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==E},i.isSame=function(t,s){var e=g(t);return this.startOf(s)<=e&&e<=this.endOf(s)},i.isAfter=function(t,s){return g(t)<this.startOf(s)},i.isBefore=function(t,s){return this.endOf(s)<g(t)},i.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,s){var e=this,o=!!u.u(s)||s,a=u.p(t),c=function(x,y){var k=u.w(e.$u?Date.UTC(e.$y,y,x):new Date(e.$y,y,x),e);return o?k:k.endOf(v)},l=function(x,y){return u.w(e.toDate()[x].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(y)),e)},$=this.$W,p=this.$M,w=this.$D,H="set"+(this.$u?"UTC":"");switch(a){case S:return o?c(1,0):c(31,11);case L:return o?c(1,p):c(0,p+1);case f:var O=this.$locale().weekStart||0,A=($<O?$+7:$)-O;return c(o?w-A:w+(6-A),p);case v:case _:return l(H+"Hours",0);case M:return l(H+"Minutes",1);case m:return l(H+"Seconds",2);case d:return l(H+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,s){var e,o=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[v]=a+"Date",e[_]=a+"Date",e[L]=a+"Month",e[S]=a+"FullYear",e[M]=a+"Hours",e[m]=a+"Minutes",e[d]=a+"Seconds",e[h]=a+"Milliseconds",e)[o],l=o===v?this.$D+(s-this.$W):s;if(o===L||o===S){var $=this.clone().set(_,1);$.$d[c](l),$.init(),this.$d=$.set(_,Math.min(this.$D,$.daysInMonth())).$d}else c&&this.$d[c](l);return this.init(),this},i.set=function(t,s){return this.clone().$set(t,s)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,s){var e,o=this;t=Number(t);var a=u.p(s),c=function(p){var w=g(o);return u.w(w.date(w.date()+Math.round(p*t)),o)};if(a===L)return this.set(L,this.$M+t);if(a===S)return this.set(S,this.$y+t);if(a===v)return c(1);if(a===f)return c(7);var l=(e={},e[m]=D,e[M]=n,e[d]=b,e)[a]||1,$=this.$d.getTime()+t*l;return u.w($,this)},i.subtract=function(t,s){return this.add(-1*t,s)},i.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||E;var o=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,l=this.$m,$=this.$M,p=e.weekdays,w=e.months,H=e.meridiem,O=function(y,k,I,V){return y&&(y[k]||y(s,o))||I[k].slice(0,V)},A=function(y){return u.s(c%12||12,y,"0")},x=H||function(y,k,I){var V=y<12?"AM":"PM";return I?V.toLowerCase():V};return o.replace(rt,function(y,k){return k||(function(I){switch(I){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return $+1;case"MM":return u.s($+1,2,"0");case"MMM":return O(e.monthsShort,$,w,3);case"MMMM":return O(w,$);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return O(e.weekdaysMin,s.$W,p,2);case"ddd":return O(e.weekdaysShort,s.$W,p,3);case"dddd":return p[s.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return A(1);case"hh":return A(2);case"a":return x(c,l,!0);case"A":return x(c,l,!1);case"m":return String(l);case"mm":return u.s(l,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return a}return null})(y)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,s,e){var o,a=this,c=u.p(s),l=g(t),$=(l.utcOffset()-this.utcOffset())*D,p=this-l,w=function(){return u.m(a,l)};switch(c){case S:o=w()/12;break;case L:o=w();break;case B:o=w()/3;break;case f:o=(p-$)/6048e5;break;case v:o=(p-$)/864e5;break;case M:o=p/n;break;case m:o=p/D;break;case d:o=p/b;break;default:o=p}return e?o:u.a(o)},i.daysInMonth=function(){return this.endOf(L).$D},i.$locale=function(){return T[this.$L]},i.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),o=W(t,s,!0);return o&&(e.$L=o),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r})(),z=C.prototype;return g.prototype=z,[["$ms",h],["$s",d],["$m",m],["$H",M],["$W",v],["$M",L],["$y",S],["$D",_]].forEach(function(r){z[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),g.extend=function(r,i){return r.$i||(r(i,C,g),r.$i=!0),g},g.locale=W,g.isDayjs=U,g.unix=function(r){return g(1e3*r)},g.en=T[j],g.Ls=T,g.p={},g})});var q=ct(st(),1);var yt=(()=>{class b{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);settingsLoadedSubject=new Q;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];env={};host;proxyHost;webroot;originalWebroot;formAuth=!0;sessionTimeout=28800;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;keepOrphans;wallpaper;serverTimeOffset=0;rtl=!1;browserLang;onSettingsLoaded=this.settingsLoadedSubject.pipe(G());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let n=yield N(this.$api.get("/auth/settings"));this.formAuth=n.formAuth,this.sessionTimeout=n.sessionTimeout,this.env=n.env,this.host=n.host,this.webroot=n.webroot,this.originalWebroot=n.webroot,this.proxyHost=n.proxyHost,this.lightingMode=n.lightingMode,this.wallpaper=n.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(n.theme),this.setMenuMode(n.menuMode),this.setKeepOrphans(n.keepOrphans),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(n.serverTimestamp),this.setUiVersion(n.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0),this.browserLang=this.$translate.getBrowserCultureLang()})}setBrowserLightingMode(n){this.browserLightingMode=n,this.lightingMode==="auto"&&this.setLightingMode(n,"browser")}setLightingMode(n,h){h==="user"&&(this.lightingMode=n),this.currentLightingMode=n,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(n){(!n||!this.themeList.includes(n))&&(n=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:n})).catch(m=>console.error("Error saving setTheme:",m)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=n,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((m,M)=>{try{let v=m.contentDocument;if(v){let f=v.body;this.actualLightingMode==="dark"?(f.classList.contains(`config-ui-x-${this.theme}`)&&f.classList.remove(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)||f.classList.add(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")||f.classList.add("dark-mode"),f.style.backgroundColor="#242424 !important",f.style.color="#ffffff !important"):(f.classList.contains(`config-ui-x-${this.theme}`)||f.classList.add(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)&&f.classList.remove(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")&&f.classList.remove("dark-mode"),f.style.backgroundColor="#ffffff !important",f.style.color="#000000 !important"),m.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:n},window.location.origin)}}catch(v){console.warn(`Iframe ${M}: Access denied (cross-origin?)`,{error:v,src:m.src})}})}setMenuMode(n){this.menuMode=n}setKeepOrphans(n){this.keepOrphans=n}setLang(n){n?this.$translate.use(n):n="auto",this.env.lang=n}setItem(n,h){this[n]=h}setEnvItem(n,h){if(n.includes(".")){let d=n.split("."),m=this.env;for(let M=0;M<d.length-1;M++){if(this.forbiddenKeys.includes(d[M]))return;m[d[M]]||(m[d[M]]={}),m=m[d[M]]}this.forbiddenKeys.includes(d[d.length-1])||(m[d[d.length-1]]=h)}else this.env[n]=h}checkServerTime(n){let d=(0,q.default)(n).diff((0,q.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}setUiVersion(n){this.uiVersion||(this.uiVersion=n)}setTitle(n){this.$title.setTitle(n||"Homebridge")}static \u0275fac=function(h){return new(h||b)};static \u0275prov=R({token:b,factory:b.\u0275fac,providedIn:"root"})}return b})();export{st as a,yt as b};
|
|
1
|
+
import{k as tt,n as et,q as it}from"./chunk-FB6OF4XR.js";import{T as G,e as ut,ea as R,g as ct,gd as X,h as P,ja as Y,n as Q,w as N}from"./chunk-3LEW5FOJ.js";var st=ut((J,K)=>{(function(b,D){typeof J=="object"&&typeof K<"u"?K.exports=D():typeof define=="function"&&define.amd?define(D):(b=typeof globalThis<"u"?globalThis:b||self).dayjs=D()})(J,function(){"use strict";var b=1e3,D=6e4,n=36e5,h="millisecond",d="second",m="minute",M="hour",v="day",f="week",L="month",B="quarter",S="year",_="date",E="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ot={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var s=String(r);return!s||s.length>=i?r:""+Array(i+1-s.length).join(t)+r},at={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),s=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(s,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var s=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(s,L),o=t-e<0,a=i.clone().add(s+(o?-1:1),L);return+(-(s+(t-e)/(o?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:L,y:S,w:f,d:v,D:_,h:M,m,s:d,ms:h,Q:B}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},j="en",T={};T[j]=ot;var Z="$isDayjsObject",U=function(r){return r instanceof C||!(!r||!r[Z])},W=function r(i,t,s){var e;if(!i)return j;if(typeof i=="string"){var o=i.toLowerCase();T[o]&&(e=o),t&&(T[o]=t,e=o);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;T[c]=i,e=c}return!s&&e&&(j=e),e||!s&&j},g=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new C(t)},u=at;u.l=W,u.i=U,u.w=function(r,i){return g(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var C=(function(){function r(t){this.$L=W(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[Z]=!0}var i=r.prototype;return i.parse=function(t){this.$d=(function(s){var e=s.date,o=s.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(nt);if(a){var c=a[2]-1||0,l=(a[7]||"0").substring(0,3);return o?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)}}return new Date(e)})(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==E},i.isSame=function(t,s){var e=g(t);return this.startOf(s)<=e&&e<=this.endOf(s)},i.isAfter=function(t,s){return g(t)<this.startOf(s)},i.isBefore=function(t,s){return this.endOf(s)<g(t)},i.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,s){var e=this,o=!!u.u(s)||s,a=u.p(t),c=function(x,y){var k=u.w(e.$u?Date.UTC(e.$y,y,x):new Date(e.$y,y,x),e);return o?k:k.endOf(v)},l=function(x,y){return u.w(e.toDate()[x].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(y)),e)},$=this.$W,p=this.$M,w=this.$D,H="set"+(this.$u?"UTC":"");switch(a){case S:return o?c(1,0):c(31,11);case L:return o?c(1,p):c(0,p+1);case f:var O=this.$locale().weekStart||0,A=($<O?$+7:$)-O;return c(o?w-A:w+(6-A),p);case v:case _:return l(H+"Hours",0);case M:return l(H+"Minutes",1);case m:return l(H+"Seconds",2);case d:return l(H+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,s){var e,o=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[v]=a+"Date",e[_]=a+"Date",e[L]=a+"Month",e[S]=a+"FullYear",e[M]=a+"Hours",e[m]=a+"Minutes",e[d]=a+"Seconds",e[h]=a+"Milliseconds",e)[o],l=o===v?this.$D+(s-this.$W):s;if(o===L||o===S){var $=this.clone().set(_,1);$.$d[c](l),$.init(),this.$d=$.set(_,Math.min(this.$D,$.daysInMonth())).$d}else c&&this.$d[c](l);return this.init(),this},i.set=function(t,s){return this.clone().$set(t,s)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,s){var e,o=this;t=Number(t);var a=u.p(s),c=function(p){var w=g(o);return u.w(w.date(w.date()+Math.round(p*t)),o)};if(a===L)return this.set(L,this.$M+t);if(a===S)return this.set(S,this.$y+t);if(a===v)return c(1);if(a===f)return c(7);var l=(e={},e[m]=D,e[M]=n,e[d]=b,e)[a]||1,$=this.$d.getTime()+t*l;return u.w($,this)},i.subtract=function(t,s){return this.add(-1*t,s)},i.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||E;var o=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,l=this.$m,$=this.$M,p=e.weekdays,w=e.months,H=e.meridiem,O=function(y,k,I,V){return y&&(y[k]||y(s,o))||I[k].slice(0,V)},A=function(y){return u.s(c%12||12,y,"0")},x=H||function(y,k,I){var V=y<12?"AM":"PM";return I?V.toLowerCase():V};return o.replace(rt,function(y,k){return k||(function(I){switch(I){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return $+1;case"MM":return u.s($+1,2,"0");case"MMM":return O(e.monthsShort,$,w,3);case"MMMM":return O(w,$);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return O(e.weekdaysMin,s.$W,p,2);case"ddd":return O(e.weekdaysShort,s.$W,p,3);case"dddd":return p[s.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return A(1);case"hh":return A(2);case"a":return x(c,l,!0);case"A":return x(c,l,!1);case"m":return String(l);case"mm":return u.s(l,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return a}return null})(y)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,s,e){var o,a=this,c=u.p(s),l=g(t),$=(l.utcOffset()-this.utcOffset())*D,p=this-l,w=function(){return u.m(a,l)};switch(c){case S:o=w()/12;break;case L:o=w();break;case B:o=w()/3;break;case f:o=(p-$)/6048e5;break;case v:o=(p-$)/864e5;break;case M:o=p/n;break;case m:o=p/D;break;case d:o=p/b;break;default:o=p}return e?o:u.a(o)},i.daysInMonth=function(){return this.endOf(L).$D},i.$locale=function(){return T[this.$L]},i.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),o=W(t,s,!0);return o&&(e.$L=o),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r})(),z=C.prototype;return g.prototype=z,[["$ms",h],["$s",d],["$m",m],["$H",M],["$W",v],["$M",L],["$y",S],["$D",_]].forEach(function(r){z[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),g.extend=function(r,i){return r.$i||(r(i,C,g),r.$i=!0),g},g.locale=W,g.isDayjs=U,g.unix=function(r){return g(1e3*r)},g.en=T[j],g.Ls=T,g.p={},g})});var q=ct(st(),1);var yt=(()=>{class b{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);settingsLoadedSubject=new Q;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];env={};host;proxyHost;webroot;originalWebroot;formAuth=!0;sessionTimeout=28800;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;keepOrphans;wallpaper;serverTimeOffset=0;rtl=!1;browserLang;onSettingsLoaded=this.settingsLoadedSubject.pipe(G());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let n=yield N(this.$api.get("/auth/settings"));this.formAuth=n.formAuth,this.sessionTimeout=n.sessionTimeout,this.env=n.env,this.host=n.host,this.webroot=n.webroot,this.originalWebroot=n.webroot,this.proxyHost=n.proxyHost,this.lightingMode=n.lightingMode,this.wallpaper=n.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(n.theme),this.setMenuMode(n.menuMode),this.setKeepOrphans(n.keepOrphans),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(n.serverTimestamp),this.setUiVersion(n.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0),this.browserLang=this.$translate.getBrowserCultureLang()})}setBrowserLightingMode(n){this.browserLightingMode=n,this.lightingMode==="auto"&&this.setLightingMode(n,"browser")}setLightingMode(n,h){h==="user"&&(this.lightingMode=n),this.currentLightingMode=n,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(n){(!n||!this.themeList.includes(n))&&(n=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:n})).catch(m=>console.error("Error saving setTheme:",m)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=n,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((m,M)=>{try{let v=m.contentDocument;if(v){let f=v.body;this.actualLightingMode==="dark"?(f.classList.contains(`config-ui-x-${this.theme}`)&&f.classList.remove(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)||f.classList.add(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")||f.classList.add("dark-mode"),f.style.backgroundColor="#242424 !important",f.style.color="#ffffff !important"):(f.classList.contains(`config-ui-x-${this.theme}`)||f.classList.add(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)&&f.classList.remove(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")&&f.classList.remove("dark-mode"),f.style.backgroundColor="#ffffff !important",f.style.color="#000000 !important"),m.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:n},window.location.origin)}}catch(v){console.warn(`Iframe ${M}: Access denied (cross-origin?)`,{error:v,src:m.src})}})}setMenuMode(n){this.menuMode=n}setKeepOrphans(n){this.keepOrphans=n}setLang(n){n?this.$translate.use(n):n="auto",this.env.lang=n}setItem(n,h){this[n]=h}setEnvItem(n,h){if(n.includes(".")){let d=n.split("."),m=this.env;for(let M=0;M<d.length-1;M++){if(this.forbiddenKeys.includes(d[M]))return;m[d[M]]||(m[d[M]]={}),m=m[d[M]]}this.forbiddenKeys.includes(d[d.length-1])||(m[d[d.length-1]]=h)}else this.env[n]=h}checkServerTime(n){let d=(0,q.default)(n).diff((0,q.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}setUiVersion(n){this.uiVersion||(this.uiVersion=n)}setTitle(n){this.$title.setTitle(n||"Homebridge")}static \u0275fac=function(h){return new(h||b)};static \u0275prov=R({token:b,factory:b.\u0275fac,providedIn:"root"})}return b})();export{st as a,yt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as r}from"./chunk-MDV2S56W.js";import{Xa as e,fa as t}from"./chunk-3LEW5FOJ.js";var u=[{path:"",loadComponent:()=>import("./chunk-
|
|
1
|
+
import{g as r}from"./chunk-MDV2S56W.js";import{Xa as e,fa as t}from"./chunk-3LEW5FOJ.js";var u=[{path:"",loadComponent:()=>import("./chunk-NVX4KPO6.js").then(o=>o.LogsComponent)}],n=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[r.forChild(u),r]})}return o})();var p=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[n]})}return o})();export{p as LogsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as I}from"./chunk-BQMDK4YS.js";import{l as H}from"./chunk-
|
|
1
|
+
import{m as I}from"./chunk-BQMDK4YS.js";import{l as H}from"./chunk-FB6OF4XR.js";import{Db as B,Eb as p,Ga as r,Hb as f,Ib as m,La as i,Ub as v,Vb as u,Wa as L,Wb as k,Xb as E,dc as g,ja as M,kb as x,lb as d,mb as c,mc as C,nc as b,oa as T,pa as y,vb as o,wb as a,xb as s}from"./chunk-3LEW5FOJ.js";function S(t,_){if(t&1&&s(0,"i",14),t&2){let e=m();v(g("fas fa-fw ",e.faIconClass," mb-3"))}}function z(t,_){if(t&1&&s(0,"p",7),t&2){let e=m();p("innerHTML",e.message2,r)}}function h(t,_){if(t&1&&s(0,"p",7),t&2){let e=m();p("innerHTML",e.message3,r)}}function P(t,_){if(t&1){let e=B();o(0,"button",15),f("click",function(){T(e);let n=m();return y(n.closeModal())}),u(1),a()}if(t&2){let e=m();v(g("btn ",e.confirmButtonClass||"btn-primary")),i(),E(" ",e.confirmButtonLabel," ")}}var N=(()=>{class t{$activeModal=M(I);title;message;message2;message3;confirmButtonLabel;confirmButtonClass;faIconClass;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(){this.$activeModal.close()}static \u0275fac=function(l){return new(l||t)};static \u0275cmp=L({type:t,selectors:[["ng-component"]],inputs:{title:"title",message:"message",message2:"message2",message3:"message3",confirmButtonLabel:"confirmButtonLabel",confirmButtonClass:"confirmButtonClass",faIconClass:"faIconClass"},decls:20,vars:15,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],[2,"font-size","75px",3,"class"],[1,"mb-0","text-center",3,"innerHTML"],[1,"mt-2","mb-0","text-center",3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",3,"class"],[2,"font-size","75px"],["type","button","data-bs-dismiss","modal",3,"click"]],template:function(l,n){l&1&&(o(0,"div",0)(1,"div",1)(2,"h5",2),u(3),a(),o(4,"button",3),C(5,"translate"),f("click",function(){return n.dismissModal()}),a()(),o(6,"div",4),d(7,S,1,3,"i",5),s(8,"p",6),d(9,z,1,1,"p",7),d(10,h,1,1,"p",7),a(),o(11,"div",8)(12,"div",9)(13,"button",10),C(14,"translate"),f("click",function(){return n.dismissModal()}),u(15),C(16,"translate"),a()(),s(17,"div",11),o(18,"div",12),d(19,P,2,4,"button",13),a()()()),l&2&&(i(3),k(n.title),i(),x("aria-label",b(5,9,"form.button_close")),i(3),c(n.faIconClass?7:-1),i(),p("innerHTML",n.message,r),i(),c(n.message2?9:-1),i(),c(n.message3?10:-1),i(3),x("aria-label",b(14,11,"form.button_cancel")),i(2),E(" ",b(16,13,"form.button_cancel")," "),i(4),c(n.confirmButtonLabel?19:-1))},dependencies:[H],encapsulation:2})}return t})();export{N as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u,d,g as s}from"./chunk-MDV2S56W.js";import{k as l,n as p,q as g}from"./chunk-
|
|
1
|
+
import{b as u,d,g as s}from"./chunk-MDV2S56W.js";import{k as l,n as p,q as g}from"./chunk-FB6OF4XR.js";import{Xa as n,ea as m,fa as i,h as c,ja as r,w as f}from"./chunk-3LEW5FOJ.js";var a=(()=>{class t{$api=r(g);$route=r(u);$router=r(d);$toastr=r(p);$translate=r(l);resolve(){return c(this,null,function*(){try{let o=yield f(this.$api.get("/config-editor"));return JSON.stringify(o,null,4)}catch(o){console.error(o),this.$toastr.error(o.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"],{relativeTo:this.$route})}})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=m({token:t,factory:t.\u0275fac})}return t})();var h=[{path:"",loadComponent:()=>import("./chunk-KCX2WQ7I.js").then(t=>t.ConfigEditorComponent),resolve:{config:a}}],$=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=n({type:t});static \u0275inj=i({imports:[s.forChild(h),s]})}return t})();var A=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=n({type:t});static \u0275inj=i({providers:[a],imports:[$]})}return t})();export{A as ConfigEditorModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _,b as D}from"./chunk-
|
|
1
|
+
import{a as _,b as D}from"./chunk-5RI5TLFW.js";import{p as c,q as S}from"./chunk-FB6OF4XR.js";import{$c as x,C as v,Xa as I,ea as h,fa as E,g as O,h as a,ha as y,ia as l,ja as f,r as p,ta as j,w as d,x as T,z as w}from"./chunk-3LEW5FOJ.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(c.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{F as a,q as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as X}from"./chunk-YJJ3RKIW.js";import{a as G}from"./chunk-F3ULAZ4E.js";import{a as ee}from"./chunk-EWO5Q2EI.js";import"./chunk-CIVLN3HQ.js";import{a as H}from"./chunk-H2RXQG5H.js";import{n as E}from"./chunk-BQMDK4YS.js";import"./chunk-AM53KSWA.js";import{a as j}from"./chunk-NZXJM7CQ.js";import{b as A}from"./chunk-X4MPFU5C.js";import{a as W,b as q,c as N,d as $,e as D,f as R}from"./chunk-MDV2S56W.js";import{b as T}from"./chunk-2WWJCZHM.js";import{k as L,l as U,p as V}from"./chunk-D6IDPBE4.js";import{Db as S,Gb as _,Ib as C,Jc as O,La as o,Pa as F,Vb as f,Wa as P,Wb as v,Wc as K,fc as h,g as Z,gc as M,h as I,ja as m,kb as u,lb as x,mb as y,mc as d,nc as s,oa as b,pa as w,rb as c,sb as i,tb as a,ub as p,w as z}from"./chunk-3LEW5FOJ.js";var Y=Z(ee(),1);function J(){var n;return typeof window<"u"&&(window?.matchMedia("(display-mode: standalone)").matches||((n=window.navigator)===null||n===void 0?void 0:n.standalone)||document.referrer.startsWith("android-app://")||window?.Windows||/trident.+(msapphost|webview)\//i.test(navigator.userAgent)||document.referrer.startsWith("app-info://platform/microsoft-store"))}var B=()=>["/"],ie=n=>({"hamburger-icon-cross":n}),ne=n=>({expanded:n}),oe=()=>({exact:!0}),re=()=>["/plugins"],ae=()=>["/accessories"],de=()=>["/logs"],se=()=>["/support"],le=()=>["/platform-tools/terminal"],pe=()=>["/config"],ce=()=>["/settings"],me=()=>["/power-options"];function ue(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),d(3,"translate"),_("click",function(){b(e);let t=C();return w(t.openUnderVoltageModal())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(4,"div",12),p(5,"i",21),a(),i(6,"div",14),f(7),d(8,"translate"),a()()()}n&2&&(o(),u("aria-label",s(2,2,"rpi.throttled.undervoltage_title")+" - "+s(3,4,"rpi.throttled.undervoltage_description")),o(6),v(s(8,6,"rpi.throttled.undervoltage_title")))}function _e(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",22),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),c("routerLink",h(8,le))("routerLinkActive","active"),u("aria-label",s(2,4,"menu.linux.label_terminal")),o(5),v(s(7,6,"menu.linux.label_terminal")))}function fe(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",23),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),c("routerLink",h(8,pe))("routerLinkActive","active"),u("aria-label",s(2,4,"menu.config_json_editor")),o(5),v(s(7,6,"menu.config_json_editor")))}function ge(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",24),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),c("routerLink",h(8,ce))("routerLinkActive","active"),u("aria-label",s(2,4,"menu.label_settings")),o(5),v(s(7,6,"menu.label_settings")))}function ve(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",25),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),c("routerLink",h(8,me))("routerLinkActive","active"),u("aria-label",s(2,4,"menu.restart.title")),o(5),v(s(7,6,"menu.restart.title")))}function he(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),_("click",function(){b(e);let t=C();return w(t.reloadPage())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",26),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),u("aria-label",s(2,2,"menu.reload")),o(5),v(s(7,4,"menu.reload")))}function be(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),_("click",function(){b(e);let t=C();return w(t.logout())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",27),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),u("aria-label",s(2,2,"menu.tooltip_logout")),o(5),v(s(7,4,"menu.tooltip_logout")))}var Q=(()=>{class n{$auth=m(A);$settings=m(T);$modal=m(E);$notification=m(G);$renderer=m(F);$router=m($);$translate=m(L);isExpanded=!1;formAuth=this.$settings.formAuth;isAdmin=this.$auth.user.admin;enableTerminalAccess=this.$settings.env.enableTerminalAccess;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;isPwa=J();constructor(){this.isMobile=window.innerWidth<768;let e;window.addEventListener("resize",()=>{clearTimeout(e),e=setTimeout(()=>{this.updateListeners()},500)}),this.$router.events.subscribe(l=>{l instanceof W&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},750))})}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(r=>{r["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),r["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)}),this.$notification.formAuthEnabled.subscribe(r=>{this.formAuth=r});let e=document.querySelector(".sidebar"),l=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",r=>{if(t.contains(r.target)&&this.isExpanded){r.preventDefault(),this.toggleSidebar();return}!e.contains(r.target)&&!l.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(this.updateListeners(),l.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),l.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}openUnderVoltageModal(){let e=this.$modal.open(X,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-fw fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let l=e.target;["menuitem","button"].includes(l.getAttribute("role"))&&l.click()}}reloadPage(){window.location.reload()}ngOnDestroy(){document.removeEventListener("touchstart",()=>{}),document.removeEventListener("click",()=>{})}logout(){this.$auth.logout()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.$renderer.setStyle(e,"opacity","20%"),this.$renderer.setStyle(e,"pointer-events","none"),this.$renderer.setStyle(e,"overflow","hidden")):(this.$renderer.removeStyle(e,"opacity"),this.$renderer.removeStyle(e,"pointer-events"),this.$renderer.removeStyle(e,"overflow"))}updateListeners(){this.isMobile=window.innerWidth<768;let e=document.querySelector(".sidebar");e.removeAllListeners(),(this.isMobile||!this.isMobile&&this.$settings.menuMode!=="freeze")&&(e.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),e.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}))}static \u0275fac=function(l){return new(l||n)};static \u0275cmp=P({type:n,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:68,vars:75,consts:[["tabindex","0","role","button",1,"m-header","text-end",3,"click","keydown"],[1,"me-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-fw","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-fw","fa-plug"],[1,"fa","fa-fw","fa-lightbulb"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-question-circle-o"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-fw","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-power-off"],[1,"fa","fa-fw","fa-refresh"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(l,t){l&1&&(i(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(g){return t.handleKeydown(g)}),p(2,"span",1),i(3,"a",2),d(4,"translate"),p(5,"img",3),i(6,"div",4),f(7,"Homebridge"),a()(),i(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),a()(),i(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(g){return t.handleKeydown(g)}),i(15,"a",2),d(16,"translate"),p(17,"img",3),i(18,"div",8),f(19,"Homebridge"),a()()(),i(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),i(24,"div",12),p(25,"i",13),a(),i(26,"div",14),f(27),d(28,"translate"),a()()(),x(29,ue,9,8,"div",10),i(30,"div",10)(31,"div",15),d(32,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),i(33,"div",12),p(34,"i",16),a(),i(35,"div",14),f(36),d(37,"translate"),a()()(),i(38,"div",10)(39,"div",15),d(40,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),i(41,"div",12),p(42,"i",17),a(),i(43,"div",14),f(44),d(45,"translate"),a()()(),i(46,"div",10)(47,"div",15),d(48,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),i(49,"div",12),p(50,"i",18),a(),i(51,"div",14),f(52),d(53,"translate"),a()()(),x(54,_e,8,9,"div",10),x(55,fe,8,9,"div",10),x(56,ge,8,9,"div",10),i(57,"div",10)(58,"div",15),d(59,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),i(60,"div",12),p(61,"i",19),a(),i(62,"div",14),f(63),d(64,"translate"),a()()(),x(65,ve,8,9,"div",10),x(66,he,8,6,"div",10),x(67,be,8,6,"div",10),a()()),l&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",s(1,37,"menu.sidebar.aria_menu")),o(3),c("routerLink",h(63,B)),u("aria-label",s(4,39,"menu.label_status")),o(5),c("ngClass",M(64,ie,t.isExpanded)),o(5),c("ngClass",M(66,ne,t.isExpanded)),o(2),c("routerLink",h(68,B)),u("aria-label",s(16,41,"menu.label_status")),o(7),c("routerLink",h(69,B))("routerLinkActive","active")("routerLinkActiveOptions",h(70,oe)),u("aria-label",s(23,43,"menu.label_status")),o(5),v(s(28,45,"menu.label_status")),o(2),y(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(2),c("routerLink",h(71,re))("routerLinkActive","active"),u("aria-label",s(32,47,"menu.label_plugins")),o(5),v(s(37,49,"menu.label_plugins")),o(3),c("routerLink",h(72,ae))("routerLinkActive","active"),u("aria-label",s(40,51,"menu.label_accessories")),o(5),v(s(45,53,"menu.label_accessories")),o(3),c("routerLink",h(73,de))("routerLinkActive","active"),u("aria-label",s(48,55,"menu.linux.label_logs")),o(5),v(s(53,57,"menu.linux.label_logs")),o(2),y(t.enableTerminalAccess&&t.isAdmin?54:-1),o(),y(t.isAdmin?55:-1),o(),y(t.isAdmin?56:-1),o(2),c("routerLink",h(74,se))("routerLinkActive","active"),u("aria-label",s(59,59,"support.title")),o(5),v(s(64,61,"support.title")),o(2),y(t.isAdmin?65:-1),o(),y(t.isPwa?66:-1),o(),y(t.formAuth?67:-1))},dependencies:[D,K,O,R,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 80px)!important}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;transform:rotate(0);transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;transform:rotate(0);transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return n})();var we=n=>({sidebarExpanded:n}),Xe=(()=>{class n{$auth=m(A);$modal=m(E);$route=m(q);$router=m($);$settings=m(T);$translate=m(L);$ws=m(j);io;sidebarExpanded=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return I(this,null,function*(){if(this.$settings.settingsLoaded||(yield z(this.$settings.onSettingsLoaded)),this.$router.url!=="/restart"&&(0,Y.lt)(this.$settings.uiVersion,V.serverTarget)){console.log(`Server restart required. UI Version: ${V.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(H,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:V.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-power-off orange-text",e.result.then(()=>this.$router.navigate(["/restart"],{relativeTo:this.$route})).catch(()=>{})}})}static \u0275fac=function(l){return new(l||n)};static \u0275cmp=P({type:n,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(l,t){l&1&&(p(0,"app-sidebar",0),i(1,"div",1),p(2,"router-outlet"),a()),l&2&&(c("isExpanded",t.sidebarExpanded),o(),c("ngClass",M(2,we,t.sidebarExpanded)))},dependencies:[Q,O,N],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return n})();export{Xe as LayoutComponent};
|
|
1
|
+
import{a as X}from"./chunk-UUM2722D.js";import{a as G}from"./chunk-F3ULAZ4E.js";import{a as ee}from"./chunk-EWO5Q2EI.js";import"./chunk-CIVLN3HQ.js";import{a as H}from"./chunk-7FVJXUCR.js";import{n as E}from"./chunk-BQMDK4YS.js";import"./chunk-AM53KSWA.js";import{a as j}from"./chunk-UO7UMJN3.js";import{b as A}from"./chunk-BH4JDZF4.js";import{a as W,b as q,c as N,d as $,e as D,f as R}from"./chunk-MDV2S56W.js";import{b as T}from"./chunk-5RI5TLFW.js";import{k as L,l as U,p as V}from"./chunk-FB6OF4XR.js";import{Db as S,Gb as _,Ib as C,Jc as O,La as o,Pa as F,Vb as f,Wa as P,Wb as v,Wc as K,fc as h,g as Z,gc as M,h as I,ja as m,kb as u,lb as x,mb as y,mc as d,nc as s,oa as b,pa as w,rb as c,sb as i,tb as a,ub as p,w as z}from"./chunk-3LEW5FOJ.js";var Y=Z(ee(),1);function J(){var n;return typeof window<"u"&&(window?.matchMedia("(display-mode: standalone)").matches||((n=window.navigator)===null||n===void 0?void 0:n.standalone)||document.referrer.startsWith("android-app://")||window?.Windows||/trident.+(msapphost|webview)\//i.test(navigator.userAgent)||document.referrer.startsWith("app-info://platform/microsoft-store"))}var B=()=>["/"],ie=n=>({"hamburger-icon-cross":n}),ne=n=>({expanded:n}),oe=()=>({exact:!0}),re=()=>["/plugins"],ae=()=>["/accessories"],de=()=>["/logs"],se=()=>["/support"],le=()=>["/platform-tools/terminal"],pe=()=>["/config"],ce=()=>["/settings"],me=()=>["/power-options"];function ue(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),d(3,"translate"),_("click",function(){b(e);let t=C();return w(t.openUnderVoltageModal())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(4,"div",12),p(5,"i",21),a(),i(6,"div",14),f(7),d(8,"translate"),a()()()}n&2&&(o(),u("aria-label",s(2,2,"rpi.throttled.undervoltage_title")+" - "+s(3,4,"rpi.throttled.undervoltage_description")),o(6),v(s(8,6,"rpi.throttled.undervoltage_title")))}function _e(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",22),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),c("routerLink",h(8,le))("routerLinkActive","active"),u("aria-label",s(2,4,"menu.linux.label_terminal")),o(5),v(s(7,6,"menu.linux.label_terminal")))}function fe(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",23),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),c("routerLink",h(8,pe))("routerLinkActive","active"),u("aria-label",s(2,4,"menu.config_json_editor")),o(5),v(s(7,6,"menu.config_json_editor")))}function ge(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",24),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),c("routerLink",h(8,ce))("routerLinkActive","active"),u("aria-label",s(2,4,"menu.label_settings")),o(5),v(s(7,6,"menu.label_settings")))}function ve(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",25),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),c("routerLink",h(8,me))("routerLinkActive","active"),u("aria-label",s(2,4,"menu.restart.title")),o(5),v(s(7,6,"menu.restart.title")))}function he(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),_("click",function(){b(e);let t=C();return w(t.reloadPage())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",26),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),u("aria-label",s(2,2,"menu.reload")),o(5),v(s(7,4,"menu.reload")))}function be(n,k){if(n&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),_("click",function(){b(e);let t=C();return w(t.logout())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),i(3,"div",12),p(4,"i",27),a(),i(5,"div",14),f(6),d(7,"translate"),a()()()}n&2&&(o(),u("aria-label",s(2,2,"menu.tooltip_logout")),o(5),v(s(7,4,"menu.tooltip_logout")))}var Q=(()=>{class n{$auth=m(A);$settings=m(T);$modal=m(E);$notification=m(G);$renderer=m(F);$router=m($);$translate=m(L);isExpanded=!1;formAuth=this.$settings.formAuth;isAdmin=this.$auth.user.admin;enableTerminalAccess=this.$settings.env.enableTerminalAccess;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;isPwa=J();constructor(){this.isMobile=window.innerWidth<768;let e;window.addEventListener("resize",()=>{clearTimeout(e),e=setTimeout(()=>{this.updateListeners()},500)}),this.$router.events.subscribe(l=>{l instanceof W&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},750))})}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(r=>{r["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),r["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)}),this.$notification.formAuthEnabled.subscribe(r=>{this.formAuth=r});let e=document.querySelector(".sidebar"),l=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",r=>{if(t.contains(r.target)&&this.isExpanded){r.preventDefault(),this.toggleSidebar();return}!e.contains(r.target)&&!l.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(this.updateListeners(),l.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),l.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}openUnderVoltageModal(){let e=this.$modal.open(X,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-fw fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let l=e.target;["menuitem","button"].includes(l.getAttribute("role"))&&l.click()}}reloadPage(){window.location.reload()}ngOnDestroy(){document.removeEventListener("touchstart",()=>{}),document.removeEventListener("click",()=>{})}logout(){this.$auth.logout()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.$renderer.setStyle(e,"opacity","20%"),this.$renderer.setStyle(e,"pointer-events","none"),this.$renderer.setStyle(e,"overflow","hidden")):(this.$renderer.removeStyle(e,"opacity"),this.$renderer.removeStyle(e,"pointer-events"),this.$renderer.removeStyle(e,"overflow"))}updateListeners(){this.isMobile=window.innerWidth<768;let e=document.querySelector(".sidebar");e.removeAllListeners(),(this.isMobile||!this.isMobile&&this.$settings.menuMode!=="freeze")&&(e.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),e.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}))}static \u0275fac=function(l){return new(l||n)};static \u0275cmp=P({type:n,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:68,vars:75,consts:[["tabindex","0","role","button",1,"m-header","text-end",3,"click","keydown"],[1,"me-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-fw","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-fw","fa-plug"],[1,"fa","fa-fw","fa-lightbulb"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-question-circle-o"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-fw","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-power-off"],[1,"fa","fa-fw","fa-refresh"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(l,t){l&1&&(i(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(g){return t.handleKeydown(g)}),p(2,"span",1),i(3,"a",2),d(4,"translate"),p(5,"img",3),i(6,"div",4),f(7,"Homebridge"),a()(),i(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),a()(),i(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(g){return t.handleKeydown(g)}),i(15,"a",2),d(16,"translate"),p(17,"img",3),i(18,"div",8),f(19,"Homebridge"),a()()(),i(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),i(24,"div",12),p(25,"i",13),a(),i(26,"div",14),f(27),d(28,"translate"),a()()(),x(29,ue,9,8,"div",10),i(30,"div",10)(31,"div",15),d(32,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),i(33,"div",12),p(34,"i",16),a(),i(35,"div",14),f(36),d(37,"translate"),a()()(),i(38,"div",10)(39,"div",15),d(40,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),i(41,"div",12),p(42,"i",17),a(),i(43,"div",14),f(44),d(45,"translate"),a()()(),i(46,"div",10)(47,"div",15),d(48,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),i(49,"div",12),p(50,"i",18),a(),i(51,"div",14),f(52),d(53,"translate"),a()()(),x(54,_e,8,9,"div",10),x(55,fe,8,9,"div",10),x(56,ge,8,9,"div",10),i(57,"div",10)(58,"div",15),d(59,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),i(60,"div",12),p(61,"i",19),a(),i(62,"div",14),f(63),d(64,"translate"),a()()(),x(65,ve,8,9,"div",10),x(66,he,8,6,"div",10),x(67,be,8,6,"div",10),a()()),l&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",s(1,37,"menu.sidebar.aria_menu")),o(3),c("routerLink",h(63,B)),u("aria-label",s(4,39,"menu.label_status")),o(5),c("ngClass",M(64,ie,t.isExpanded)),o(5),c("ngClass",M(66,ne,t.isExpanded)),o(2),c("routerLink",h(68,B)),u("aria-label",s(16,41,"menu.label_status")),o(7),c("routerLink",h(69,B))("routerLinkActive","active")("routerLinkActiveOptions",h(70,oe)),u("aria-label",s(23,43,"menu.label_status")),o(5),v(s(28,45,"menu.label_status")),o(2),y(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(2),c("routerLink",h(71,re))("routerLinkActive","active"),u("aria-label",s(32,47,"menu.label_plugins")),o(5),v(s(37,49,"menu.label_plugins")),o(3),c("routerLink",h(72,ae))("routerLinkActive","active"),u("aria-label",s(40,51,"menu.label_accessories")),o(5),v(s(45,53,"menu.label_accessories")),o(3),c("routerLink",h(73,de))("routerLinkActive","active"),u("aria-label",s(48,55,"menu.linux.label_logs")),o(5),v(s(53,57,"menu.linux.label_logs")),o(2),y(t.enableTerminalAccess&&t.isAdmin?54:-1),o(),y(t.isAdmin?55:-1),o(),y(t.isAdmin?56:-1),o(2),c("routerLink",h(74,se))("routerLinkActive","active"),u("aria-label",s(59,59,"support.title")),o(5),v(s(64,61,"support.title")),o(2),y(t.isAdmin?65:-1),o(),y(t.isPwa?66:-1),o(),y(t.formAuth?67:-1))},dependencies:[D,K,O,R,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 80px)!important}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;transform:rotate(0);transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;transform:rotate(0);transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return n})();var we=n=>({sidebarExpanded:n}),Xe=(()=>{class n{$auth=m(A);$modal=m(E);$route=m(q);$router=m($);$settings=m(T);$translate=m(L);$ws=m(j);io;sidebarExpanded=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return I(this,null,function*(){if(this.$settings.settingsLoaded||(yield z(this.$settings.onSettingsLoaded)),this.$router.url!=="/restart"&&(0,Y.lt)(this.$settings.uiVersion,V.serverTarget)){console.log(`Server restart required. UI Version: ${V.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(H,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:V.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-power-off orange-text",e.result.then(()=>this.$router.navigate(["/restart"],{relativeTo:this.$route})).catch(()=>{})}})}static \u0275fac=function(l){return new(l||n)};static \u0275cmp=P({type:n,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(l,t){l&1&&(p(0,"app-sidebar",0),i(1,"div",1),p(2,"router-outlet"),a()),l&2&&(c("isExpanded",t.sidebarExpanded),o(),c("ngClass",M(2,we,t.sidebarExpanded)))},dependencies:[Q,O,N],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return n})();export{Xe as LayoutComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
1
|
+
import{a as l}from"./chunk-MKVX26LQ.js";import{a as m}from"./chunk-7FVJXUCR.js";import{n as s}from"./chunk-BQMDK4YS.js";import{b as o}from"./chunk-5RI5TLFW.js";import{k as i}from"./chunk-FB6OF4XR.js";import{ea as r,ja as n}from"./chunk-3LEW5FOJ.js";var I=(()=>{class e{$terminal=n(l);$settings=n(o);$modal=n(s);$translate=n(i);handleBeforeUnload(t){if(!this.$settings.env.terminal?.persistence&&!this.$settings.env.terminal?.hideWarning&&this.$terminal.hasActiveSession()&&this.$terminal.hasUserTypedInSession()){let a=this.$translate.instant("platform.terminal.terminate_unload");return t.preventDefault(),t.returnValue=a,a}}canDeactivate(){if(this.$settings.env.terminal?.persistence||this.$settings.env.terminal?.hideWarning||!this.$terminal.hasActiveSession()||!this.$terminal.hasUserTypedInSession())return!0;let t=this.$modal.open(m,{size:"lg",backdrop:"static"});return t.componentInstance.title=this.$translate.instant("platform.terminal.terminate_title"),t.componentInstance.message=this.$translate.instant("platform.terminal.terminate_message_1"),t.componentInstance.message2=this.$translate.instant("platform.terminal.terminate_message_2"),t.componentInstance.message3=this.$translate.instant("common.phrases.are_you_sure"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_continue"),t.componentInstance.confirmButtonClass="btn-primary",t.componentInstance.faIconClass="fas fa-exclamation-triangle text-warning",t.result.then(()=>!0).catch(()=>!1)}static \u0275fac=function(a){return new(a||e)};static \u0275prov=r({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{I as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as l,d,g as n}from"./chunk-MDV2S56W.js";import{k as f,n as u,q as v}from"./chunk-
|
|
1
|
+
import{b as l,d,g as n}from"./chunk-MDV2S56W.js";import{k as f,n as u,q as v}from"./chunk-FB6OF4XR.js";import{Xa as s,ea as p,fa as i,h as m,ja as t,w as c}from"./chunk-3LEW5FOJ.js";var a=(()=>{class r{$api=t(v);$route=t(l);$router=t(d);$toastr=t(u);$translate=t(f);resolve(){return m(this,null,function*(){try{return yield c(this.$api.get("/users"))}catch(e){console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"],{relativeTo:this.$route})}})}static \u0275fac=function(o){return new(o||r)};static \u0275prov=p({token:r,factory:r.\u0275fac})}return r})();var $=[{path:"",loadComponent:()=>import("./chunk-YBETHBKT.js").then(r=>r.UsersComponent),resolve:{homebridgeUsers:a}}],h=(()=>{class r{static \u0275fac=function(o){return new(o||r)};static \u0275mod=s({type:r});static \u0275inj=i({imports:[n.forChild($),n]})}return r})();var A=(()=>{class r{static \u0275fac=function(o){return new(o||r)};static \u0275mod=s({type:r});static \u0275inj=i({providers:[a],imports:[h]})}return r})();export{A as UsersModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
1
|
+
import{b as n}from"./chunk-BH4JDZF4.js";import{b as u,d as f}from"./chunk-MDV2S56W.js";import{b as m}from"./chunk-5RI5TLFW.js";import{k as c,n as h,p as l}from"./chunk-FB6OF4XR.js";import{ea as a,h as o,ja as r,w as s}from"./chunk-3LEW5FOJ.js";var $=(()=>{class t{cache=null;CACHE_DURATION_MS=6e4;getToken(){let i=Date.now();if(this.cache&&i-this.cache.timestamp<this.CACHE_DURATION_MS)return this.cache.token;let e=window.localStorage.getItem(l.jwt.tokenKey);return this.cache={token:e,timestamp:i},e}invalidateCache(){this.cache=null}static \u0275fac=function(e){return new(e||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var d=(()=>{class t{$auth=r(n);$tokenCache=r($);isAuthenticated(){return o(this,null,function*(){if(!this.$tokenCache.getToken())return this.$auth.token=null,this.$auth.user={},this.$tokenCache.invalidateCache(),!1;try{return this.$auth.isLoggedIn()}catch{return this.$auth.logout(),this.$tokenCache.invalidateCache(),!1}})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var L=(()=>{class t{$auth=r(n);$authHelper=r(d);$route=r(u);$router=r(f);$settings=r(m);$translate=r(c);$toastr=r(h);canActivate(i,e){return o(this,null,function*(){return this.$settings.settingsLoaded||(yield s(this.$settings.onSettingsLoaded)),this.$settings.formAuth===!1?(yield this.$auth.noauth(),!0):(yield this.$authHelper.isAuthenticated())?this.$auth.user?.admin?!0:(this.$toastr.error(this.$translate.instant("toast.no_auth"),this.$translate.instant("toast.title_error")),yield this.$router.navigate(["/"],{relativeTo:this.$route}),!1):(window.sessionStorage.setItem("target_route",e.url),yield this.$router.navigate(["login"],{relativeTo:this.$route}),!1)})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{$ as a,d as b,L as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as z,b as A,c as k}from"./chunk-MVMZJM7B.js";import{a as l}from"./chunk-
|
|
1
|
+
import{a as z,b as A,c as k}from"./chunk-MVMZJM7B.js";import{a as l}from"./chunk-UO7UMJN3.js";import{M as n,ea as c,g as r,ja as d,n as h}from"./chunk-3LEW5FOJ.js";var f=r(z(),1),a=r(A(),1),p=r(k(),1);var $=(()=>{class t{$ws=d(l);io;fitAddon;webLinksAddon;resize;elementResize;pluginName;term;startTerminal(m,s={},u,w){this.pluginName=w,this.elementResize=u,this.io=this.$ws.connectToNamespace("log"),this.term=new p.Terminal(s),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new f.FitAddon,this.webLinksAddon=new a.WebLinksAddon,this.resize=new h,this.term.open(m.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.subscribe(()=>{this.term.reset(),this.io.socket.emit("tail-log",{cols:this.term.cols,rows:this.term.rows})}),this.io.socket.on("disconnect",()=>{this.term.write(`
|
|
2
2
|
\r
|
|
3
3
|
\rWebsocket failed to connect. Is the server running?
|
|
4
4
|
\r
|