@openremote/manager 1.8.0-snapshot.20250725120001 → 1.8.0-snapshot.20250725123024

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.
@@ -41,82 +41,82 @@ let OrConfMapGlobal = class OrConfMapGlobal extends LitElement {
41
41
  var _a, _b, _c, _d, _e;
42
42
  const isCustom = (_b = (_a = this.config.sources) === null || _a === void 0 ? void 0 : _a.vector_tiles) === null || _b === void 0 ? void 0 : _b.custom;
43
43
  const hasExternalSource = Object.keys(this.config.sources).length > 1;
44
- return html `
45
- <div class="map-tile-settings">
46
- <div class="map-tile-server-group">
47
- <div class="subheader"><or-translate value="configuration.global.mapTileServer"></or-translate></div>
48
- <span>
49
- <or-translate value="configuration.global.mapTileServerDescription"></or-translate><br>
50
- <or-translate class="note" value="configuration.global.mapTileServerNote"></or-translate>
51
- </span>
52
- <or-mwc-input class="input"
53
- .value="${isCustom ? (_e = (_d = (_c = this.config.sources) === null || _c === void 0 ? void 0 : _c.vector_tiles) === null || _d === void 0 ? void 0 : _d.tiles) === null || _e === void 0 ? void 0 : _e[0] : undefined}"
54
- .type="${InputType.URL}"
55
- .label="${i18next.t("configuration.global.mapTileServerPlaceholder")}"
56
- placeholder="https://api.example.com/tileset/{z}/{x}/{y}"
44
+ return html `
45
+ <div class="map-tile-settings">
46
+ <div class="map-tile-server-group">
47
+ <div class="subheader"><or-translate value="configuration.global.mapTileServer"></or-translate></div>
48
+ <span>
49
+ <or-translate value="configuration.global.mapTileServerDescription"></or-translate><br>
50
+ <or-translate class="note" value="configuration.global.mapTileServerNote"></or-translate>
51
+ </span>
52
+ <or-mwc-input class="input"
53
+ .value="${isCustom ? (_e = (_d = (_c = this.config.sources) === null || _c === void 0 ? void 0 : _c.vector_tiles) === null || _d === void 0 ? void 0 : _d.tiles) === null || _e === void 0 ? void 0 : _e[0] : undefined}"
54
+ .type="${InputType.URL}"
55
+ .label="${i18next.t("configuration.global.mapTileServerPlaceholder")}"
56
+ placeholder="https://api.example.com/tileset/{z}/{x}/{y}"
57
57
  @or-mwc-input-changed="${(e) => {
58
58
  this.config.sources.vector_tiles.tiles = e.detail.value ? [e.detail.value] : undefined;
59
59
  this.config.sources.vector_tiles.custom = !!e.detail.value;
60
60
  this.notifyConfigChange(this.config);
61
- }}"
62
- ></or-mwc-input>
63
- </div>
64
- <div class="map-tile-upload-group">
65
- <div class="subheader"><or-translate value="configuration.global.mapTiles"></or-translate></div>
66
- <span>
67
- <or-translate value="configuration.global.uploadMapTiles"></or-translate><br>
68
- <or-translate class="note" value="configuration.global.uploadMapTilesNote"
69
- .options=${{ limit: this.humanReadableBytes(this.limit) }}
70
- ></or-translate>
71
- </span>
72
- <div class="input d-inline-flex" style="height: 56px">
73
- <div id="fileupload" style="display: flex; align-items: center">
74
- <or-mwc-input outlined label="selectFile" style="width: fit-content; padding-right: 12px;" .type="${InputType.BUTTON}" @or-mwc-input-changed="${() => this.shadowRoot.getElementById('fileupload-elem').click()}">
75
- <input id="fileupload-elem" name="configfile" type="file" accept=".mbtiles" @change="${this.notifyMapFileChange}"/>
76
- </or-mwc-input>
77
- <or-mwc-input id="filename-elem" style="width: unset" .value="${this.filename}" .label="${i18next.t("file")}" .type="${InputType.TEXT}" disabled>
78
- </or-mwc-input>
79
- ${when(this.filename, () => html `<or-mwc-input type="${InputType.BUTTON}" iconColor="black" icon="delete"
80
- @or-mwc-input-changed="${this.notifyMapFileChange}"
81
- ></or-mwc-input>`)}
82
- </div>
83
- </div>
84
- </div>
85
- </div>
86
- <div class="map-style-settings">
87
- <div class="map-style-server-group">
88
- <span>
89
- <div class="subheader"><or-translate value="configuration.global.mapStyleJsonUrl"></or-translate></div>
90
- <or-translate value="configuration.global.mapStyleJsonUrlDescription"></or-translate><br>
91
- <or-translate class="note" value="configuration.global.mapStyleJsonUrlNote"></or-translate>
92
- </span>
93
- <div style="display: flex; height: 56px; align-items: center">
94
- <or-mwc-input class="input"
95
- .value="${this.config.override}"
96
- .type="${InputType.URL}"
97
- .label="${i18next.t("configuration.global.mapStyleJsonUrlPlaceholder")}"
98
- placeholder="https://api.example.com/tileset/style.json"
61
+ }}"
62
+ ></or-mwc-input>
63
+ </div>
64
+ <div class="map-tile-upload-group">
65
+ <div class="subheader"><or-translate value="configuration.global.mapTiles"></or-translate></div>
66
+ <span>
67
+ <or-translate value="configuration.global.uploadMapTiles"></or-translate><br>
68
+ <or-translate class="note" value="configuration.global.uploadMapTilesNote"
69
+ .options=${{ limit: this.humanReadableBytes(this.limit) }}
70
+ ></or-translate>
71
+ </span>
72
+ <div class="input d-inline-flex" style="height: 56px">
73
+ <div id="fileupload" style="display: flex; align-items: center">
74
+ <or-mwc-input outlined label="selectFile" style="width: fit-content; padding-right: 12px;" .type="${InputType.BUTTON}" @or-mwc-input-changed="${() => this.shadowRoot.getElementById('fileupload-elem').click()}">
75
+ <input id="fileupload-elem" name="configfile" type="file" accept=".mbtiles" @change="${this.notifyMapFileChange}"/>
76
+ </or-mwc-input>
77
+ <or-mwc-input id="filename-elem" style="width: unset" .value="${this.filename}" .label="${i18next.t("file")}" .type="${InputType.TEXT}" disabled>
78
+ </or-mwc-input>
79
+ ${when(this.filename, () => html `<or-mwc-input type="${InputType.BUTTON}" iconColor="black" icon="delete"
80
+ @or-mwc-input-changed="${this.notifyMapFileChange}"
81
+ ></or-mwc-input>`)}
82
+ </div>
83
+ </div>
84
+ </div>
85
+ </div>
86
+ <div class="map-style-settings">
87
+ <div class="map-style-server-group">
88
+ <span>
89
+ <div class="subheader"><or-translate value="configuration.global.mapStyleJsonUrl"></or-translate></div>
90
+ <or-translate value="configuration.global.mapStyleJsonUrlDescription"></or-translate><br>
91
+ <or-translate class="note" value="configuration.global.mapStyleJsonUrlNote"></or-translate>
92
+ </span>
93
+ <div style="display: flex; height: 56px; align-items: center">
94
+ <or-mwc-input class="input"
95
+ .value="${this.config.override}"
96
+ .type="${InputType.URL}"
97
+ .label="${i18next.t("configuration.global.mapStyleJsonUrlPlaceholder")}"
98
+ placeholder="https://api.example.com/tileset/style.json"
99
99
  @or-mwc-input-changed="${(e) => {
100
100
  this.config.override = e.detail.value || undefined;
101
101
  this.notifyConfigChange(this.config);
102
102
  this.requestUpdate();
103
- }}"
104
- ></or-mwc-input>
105
- </div>
106
- </div>
107
- <div class="map-style-layers-group">
108
- <span>
109
- <div class="subheader"><or-translate value="configuration.global.mapLayers"></or-translate></div>
110
- <or-translate value="configuration.global.mapImportStyle"></or-translate>
111
- <or-translate class="note" value="configuration.global.mapImportStyleNote"></or-translate>
112
- </span>
113
- <div style="display: flex; gap: 12px; align-items: center">
114
- <or-mwc-input class="input fit-content" type="button" outlined icon="import"
115
- .label="${i18next.t("configuration.global.import")}"
116
- .disabled="${!this.config.override}" @or-mwc-input-changed="${this.importMapSettings}"
117
- ></or-mwc-input>
118
- <or-conf-json class="input fit-content hide-mobile" .heading="${i18next.t("configuration.global.mapLayers")}"
119
- .config="${hasExternalSource ? this.config.layers.filter(({ id }) => !id.startsWith("or:")) : this.config.layers}"
103
+ }}"
104
+ ></or-mwc-input>
105
+ </div>
106
+ </div>
107
+ <div class="map-style-layers-group">
108
+ <span>
109
+ <div class="subheader"><or-translate value="configuration.global.mapLayers"></or-translate></div>
110
+ <or-translate value="configuration.global.mapImportStyle"></or-translate>
111
+ <or-translate class="note" value="configuration.global.mapImportStyleNote"></or-translate>
112
+ </span>
113
+ <div style="display: flex; gap: 12px; align-items: center">
114
+ <or-mwc-input class="input fit-content" type="button" outlined icon="import"
115
+ .label="${i18next.t("configuration.global.import")}"
116
+ .disabled="${!this.config.override}" @or-mwc-input-changed="${this.importMapSettings}"
117
+ ></or-mwc-input>
118
+ <or-conf-json class="input fit-content hide-mobile" .heading="${i18next.t("configuration.global.mapLayers")}"
119
+ .config="${hasExternalSource ? this.config.layers.filter(({ id }) => !id.startsWith("or:")) : this.config.layers}"
120
120
  @saveLocalConfig="${(ev) => {
121
121
  if (Array.isArray(ev.detail.value)) {
122
122
  if (hasExternalSource) {
@@ -131,17 +131,17 @@ let OrConfMapGlobal = class OrConfMapGlobal extends LitElement {
131
131
  this.notifyConfigChange(this.config);
132
132
  this.requestUpdate();
133
133
  }
134
- }}"
135
- ></or-conf-json>
136
- ${when(hasExternalSource, () => html `
137
- <or-mwc-input class="input fit-content" outlined type="button" icon="undo"
138
- .label="${i18next.t("configuration.global.reset")}"
139
- @or-mwc-input-changed="${this.resetMapSettings}"
140
- ></or-mwc-input>
141
- `)}
142
- </div>
143
- </div>
144
- </div>
134
+ }}"
135
+ ></or-conf-json>
136
+ ${when(hasExternalSource, () => html `
137
+ <or-mwc-input class="input fit-content" outlined type="button" icon="undo"
138
+ .label="${i18next.t("configuration.global.reset")}"
139
+ @or-mwc-input-changed="${this.resetMapSettings}"
140
+ ></or-mwc-input>
141
+ `)}
142
+ </div>
143
+ </div>
144
+ </div>
145
145
  `;
146
146
  }
147
147
  notifyConfigChange(config) {
@@ -207,80 +207,80 @@ let OrConfMapGlobal = class OrConfMapGlobal extends LitElement {
207
207
  return (bytes / Math.pow(1000, exponent)).toFixed(2) + " " + unit[exponent];
208
208
  }
209
209
  };
210
- OrConfMapGlobal.styles = css `
211
- .subheader {
212
- padding: 10px 0 4px;
213
- font-weight: bolder;
214
- }
215
-
216
- .map-tile-settings {
217
- display: flex;
218
- }
219
-
220
- .map-tile-server-group {
221
- flex-direction: column;
222
- width: 50%;
223
- }
224
-
225
- .map-tile-upload-group {
226
- flex-direction: column;
227
- padding-left: 12px;
228
- width: 50%;
229
- }
230
-
231
- .map-style-settings {
232
- display: flex;
233
- }
234
-
235
- .map-style-server-group {
236
- flex-direction: column;
237
- width: 50%;
238
- }
239
-
240
- .map-style-layers-group {
241
- flex-direction: column;
242
- padding-left: 12px;
243
- width: 50%;
244
- }
245
-
246
- @media screen and (max-width: 768px) {
247
- .map-tile-server-group, .map-tile-upload-group,
248
- .map-style-server-group, .map-style-layers-group {
249
- width: 100%;
250
- padding: unset;
251
- }
252
- .map-tile-settings, .map-style-settings {
253
- display: block;
254
- }
255
- }
256
-
257
- .input {
258
- width: 100%;
259
- max-width: 800px;
260
- padding: 10px 0;
261
- }
262
-
263
- .input or-mwc-input:not([icon]) {
264
- width: 80%;
265
- }
266
-
267
- .note {
268
- font-style: italic;
269
- color: rgba(0, 0, 0, 0.6);
270
- }
271
-
272
- or-file-uploader {
273
- width: 108px;
274
- height: 108px;
275
- }
276
-
277
- .d-inline-flex {
278
- display: inline-flex;
279
- }
280
-
281
- .fit-content {
282
- width: fit-content;
283
- }
210
+ OrConfMapGlobal.styles = css `
211
+ .subheader {
212
+ padding: 10px 0 4px;
213
+ font-weight: bolder;
214
+ }
215
+
216
+ .map-tile-settings {
217
+ display: flex;
218
+ }
219
+
220
+ .map-tile-server-group {
221
+ flex-direction: column;
222
+ width: 50%;
223
+ }
224
+
225
+ .map-tile-upload-group {
226
+ flex-direction: column;
227
+ padding-left: 12px;
228
+ width: 50%;
229
+ }
230
+
231
+ .map-style-settings {
232
+ display: flex;
233
+ }
234
+
235
+ .map-style-server-group {
236
+ flex-direction: column;
237
+ width: 50%;
238
+ }
239
+
240
+ .map-style-layers-group {
241
+ flex-direction: column;
242
+ padding-left: 12px;
243
+ width: 50%;
244
+ }
245
+
246
+ @media screen and (max-width: 768px) {
247
+ .map-tile-server-group, .map-tile-upload-group,
248
+ .map-style-server-group, .map-style-layers-group {
249
+ width: 100%;
250
+ padding: unset;
251
+ }
252
+ .map-tile-settings, .map-style-settings {
253
+ display: block;
254
+ }
255
+ }
256
+
257
+ .input {
258
+ width: 100%;
259
+ max-width: 800px;
260
+ padding: 10px 0;
261
+ }
262
+
263
+ .input or-mwc-input:not([icon]) {
264
+ width: 80%;
265
+ }
266
+
267
+ .note {
268
+ font-style: italic;
269
+ color: rgba(0, 0, 0, 0.6);
270
+ }
271
+
272
+ or-file-uploader {
273
+ width: 108px;
274
+ height: 108px;
275
+ }
276
+
277
+ .d-inline-flex {
278
+ display: inline-flex;
279
+ }
280
+
281
+ .fit-content {
282
+ width: fit-content;
283
+ }
284
284
  `;
285
285
  __decorate([
286
286
  property()
@@ -66,36 +66,36 @@ let OrConfPanel = class OrConfPanel extends LitElement {
66
66
  // Render the panels
67
67
  const realmConfigs = this.getRealmsProperty(this.config);
68
68
  const availableRealms = this.getAvailableRealms(this.config, this.realmOptions);
69
- return html `
70
- <div class="panels">
69
+ return html `
70
+ <div class="panels">
71
71
  ${Object.entries(realmConfigs === undefined ? {} : realmConfigs).map(([key, value]) => {
72
72
  const realmOption = this.realmOptions.find((r) => r.name === key);
73
73
  switch (type) {
74
74
  case "managerconfig":
75
- return html `
76
- <or-conf-realm-card .expanded="${this._addedRealm === key}" .name="${key}" .realm="${value}" .canRemove="${realmOption === null || realmOption === void 0 ? void 0 : realmOption.canDelete}"
77
- @change="${() => this.notifyConfigChange(this.config)}" @remove="${() => this._removeRealm(key)}"
78
- ></or-conf-realm-card>
75
+ return html `
76
+ <or-conf-realm-card .expanded="${this._addedRealm === key}" .name="${key}" .realm="${value}" .canRemove="${realmOption === null || realmOption === void 0 ? void 0 : realmOption.canDelete}"
77
+ @change="${() => this.notifyConfigChange(this.config)}" @remove="${() => this._removeRealm(key)}"
78
+ ></or-conf-realm-card>
79
79
  `;
80
80
  case "mapconfig":
81
- return html `
82
- <or-conf-map-card .expanded="${this._addedRealm === key}" .name="${key}" .map="${value}" .canRemove="${realmOption === null || realmOption === void 0 ? void 0 : realmOption.canDelete}"
83
- @change="${() => this.notifyConfigChange(this.config)}" @remove="${() => this._removeRealm(key)}"
84
- ></or-conf-map-card>
81
+ return html `
82
+ <or-conf-map-card .expanded="${this._addedRealm === key}" .name="${key}" .map="${value}" .canRemove="${realmOption === null || realmOption === void 0 ? void 0 : realmOption.canDelete}"
83
+ @change="${() => this.notifyConfigChange(this.config)}" @remove="${() => this._removeRealm(key)}"
84
+ ></or-conf-map-card>
85
85
  `;
86
86
  default:
87
87
  return html `Unknown error.`;
88
88
  }
89
- })}
90
- </div>
91
- <!-- Show an "ADD REALM" button if there are realms available to be added -->
92
- <div style="display: flex; justify-content: space-between;">
93
- ${when(availableRealms.length > 0, () => html `
94
- <or-mwc-input id="btn-add-realm" .type="${InputType.BUTTON}" label="${type === 'mapconfig' ? 'configuration.addMapCustomization' : 'configuration.addRealmCustomization'}" icon="plus"
95
- @click="${() => this._showAddingRealmDialog()}"
96
- ></or-mwc-input>
97
- `)}
98
- </div>
89
+ })}
90
+ </div>
91
+ <!-- Show an "ADD REALM" button if there are realms available to be added -->
92
+ <div style="display: flex; justify-content: space-between;">
93
+ ${when(availableRealms.length > 0, () => html `
94
+ <or-mwc-input id="btn-add-realm" .type="${InputType.BUTTON}" label="${type === 'mapconfig' ? 'configuration.addMapCustomization' : 'configuration.addRealmCustomization'}" icon="plus"
95
+ @click="${() => this._showAddingRealmDialog()}"
96
+ ></or-mwc-input>
97
+ `)}
98
+ </div>
99
99
  `;
100
100
  }
101
101
  /* ----------------------------------- */
@@ -166,32 +166,32 @@ let OrConfPanel = class OrConfPanel extends LitElement {
166
166
  showDialog(new OrMwcDialog()
167
167
  .setHeading(i18next.t('configuration.addMapCustomization'))
168
168
  .setActions(dialogActions)
169
- .setContent(html `
170
- <or-mwc-input class="selector" label="Realm" @or-mwc-input-changed="${(e) => this._addedRealm = e.detail.value}" .type="${InputType.SELECT}"
169
+ .setContent(html `
170
+ <or-mwc-input class="selector" label="Realm" @or-mwc-input-changed="${(e) => this._addedRealm = e.detail.value}" .type="${InputType.SELECT}"
171
171
  .options="${Object.entries(this.getAvailableRealms(this.config, this.realmOptions)).map(([, value]) => {
172
172
  return [value.name, value.displayName];
173
- })}"
174
- ></or-mwc-input>
173
+ })}"
174
+ ></or-mwc-input>
175
175
  `)
176
- .setStyles(html `
177
- <style>
178
- .mdc-dialog__surface {
179
- padding: 4px 8px;
180
- }
181
-
182
- #dialog-content {
183
- flex: 1;
184
- overflow: visible;
185
- min-height: 0;
186
- padding: 0;
187
- }
188
-
189
- or-mwc-input.selector {
190
- width: 300px;
191
- display: block;
192
- padding: 10px 20px;
193
- }
194
- </style>
176
+ .setStyles(html `
177
+ <style>
178
+ .mdc-dialog__surface {
179
+ padding: 4px 8px;
180
+ }
181
+
182
+ #dialog-content {
183
+ flex: 1;
184
+ overflow: visible;
185
+ min-height: 0;
186
+ padding: 0;
187
+ }
188
+
189
+ or-mwc-input.selector {
190
+ width: 300px;
191
+ display: block;
192
+ padding: 10px 20px;
193
+ }
194
+ </style>
195
195
  `)
196
196
  .setDismissAction(null));
197
197
  }