iobroker.mywebui 1.37.56 → 1.37.57

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/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "mywebui",
4
- "version": "1.37.56",
4
+ "version": "1.37.57",
5
5
  "titleLang": {
6
6
  "en": "mywebui",
7
7
  "de": "mywebui",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.mywebui",
3
- "version": "1.37.56",
3
+ "version": "1.37.57",
4
4
  "description": "ioBroker mywebui - Custom edited mywebui by gokturk413",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -87,6 +87,10 @@ export class IobrokerHandler {
87
87
  try { this.userName = await this.connection.getCurrentUser(); } catch (e) {}
88
88
  let cfg = await this._getConfig();
89
89
  this.config = cfg ?? { globalStyle: null, globalScript: null, globalConfig: null, fontDeclarations: null };
90
+ try {
91
+ const adapterObj = await this.connection.getObject('system.adapter.mywebui.0');
92
+ this.grafanaLangSyncEnabled = !!(adapterObj?.native?.grafanaEnabled && adapterObj?.native?.grafanaLangSyncEnabled);
93
+ } catch (e) { this.grafanaLangSyncEnabled = false; }
90
94
  if (this.config.globalConfig == null) {
91
95
  this.config.globalConfig = {
92
96
  headerTags: `<meta name="apple-mobile-web-app-capable" content="yes" />
@@ -507,12 +511,14 @@ export class IobrokerHandler {
507
511
  // Keep local_language in sync so bindings/formulas can read current language
508
512
  if (this.#localValues.get('local_language')?.val !== lang)
509
513
  this.setState('local_language', { val: lang });
510
- fetch('/mywebui-grafana-lang', {
511
- method: 'POST',
512
- headers: { 'Content-Type': 'application/json' },
513
- credentials: 'include',
514
- body: JSON.stringify({ lang })
515
- }).catch(() => {});
514
+ if (this.grafanaLangSyncEnabled) {
515
+ fetch('/mywebui-grafana-lang', {
516
+ method: 'POST',
517
+ headers: { 'Content-Type': 'application/json' },
518
+ credentials: 'include',
519
+ body: JSON.stringify({ lang })
520
+ }).catch(() => {});
521
+ }
516
522
  }
517
523
  /** Translation helper - hər yerdən istifadə üçün
518
524
  * iobrokerHandler.t('pid.op')