@openremote/manager 1.8.0-snapshot.20250725120002 → 1.8.0-snapshot.20250728102340

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.
@@ -43,183 +43,183 @@ let PageRoles = class PageRoles extends Page {
43
43
  // language=CSS
44
44
  return [
45
45
  unsafeCSS(tableStyle),
46
- css `
47
- #wrapper {
48
- height: 100%;
49
- width: 100%;
50
- display: flex;
51
- flex-direction: column;
52
- overflow: auto;
53
- }
54
-
55
- #title {
56
- padding: 0 20px;
57
- font-size: 18px;
58
- font-weight: bold;
59
- width: calc(100% - 40px);
60
- max-width: 1360px;
61
- margin: 20px auto;
62
- align-items: center;
63
- display: flex;
64
- color: var(--or-app-color3, ${unsafeCSS(DefaultColor3)});
65
- }
66
-
67
- #title or-icon {
68
- margin-right: 10px;
69
- margin-left: 14px;
70
- }
71
-
72
- .panel {
73
- width: calc(100% - 90px);
74
- max-width: 1310px;
75
- background-color: white;
76
- border: 1px solid #e5e5e5;
77
- border-radius: 5px;
78
- position: relative;
79
- margin: 0 auto;
80
- padding: 18px 24px 24px;
81
- }
82
-
83
- .panel-title {
84
- text-transform: uppercase;
85
- font-weight: bolder;
86
- line-height: 1em;
87
- color: var(--or-app-color3, ${unsafeCSS(DefaultColor3)});
88
- margin-bottom: 20px;
89
- margin-top: 0;
90
- flex: 0 0 auto;
91
- letter-spacing: 0.025em;
92
- }
93
-
94
- #table-roles,
95
- #table-roles table{
96
- width: 100%;
97
- white-space: nowrap;
98
- }
99
-
100
- .mdc-data-table__row {
101
- cursor: pointer;
102
- border-top-color: #D3D3D3;
103
- }
104
-
105
- td, th {
106
- width: 25%;
107
- border: none;
108
- }
109
-
110
- td.large, th.large {
111
- width: 50%
112
- }
113
-
114
- .meta-item-container {
115
- flex-direction: row;
116
- overflow: hidden;
117
- max-height: 0;
118
- transition: max-height 0.25s ease-out;
119
- padding-left: 16px;
120
- }
121
-
122
- or-mwc-input {
123
- margin-bottom: 10px;
124
- margin-right: 16px;
125
- }
126
-
127
- or-icon {
128
- vertical-align: middle;
129
- --or-icon-width: 20px;
130
- --or-icon-height: 20px;
131
- margin-right: 2px;
132
- margin-left: -5px;
133
- }
134
-
135
- .row {
136
- display: flex;
137
- flex-direction: row;
138
- margin: 10px 0;
139
- flex: 1 1 0;
140
- }
141
-
142
- .column {
143
- display: flex;
144
- flex-direction: column;
145
- margin: 0px;
146
- flex: 1 1 0;
147
- }
148
-
149
- .column-title {
150
- padding-bottom: 10px;
151
- }
152
-
153
- .mdc-data-table__header-cell {
154
- font-weight: bold;
155
- color: ${unsafeCSS(DefaultColor3)};
156
- }
157
-
158
- .mdc-data-table__header-cell:first-child {
159
- padding-left: 36px;
160
- }
161
-
162
- .padded-cell {
163
- overflow-wrap: break-word;
164
- word-wrap: break-word;
165
- }
166
-
167
- .attribute-meta-row td {
168
- padding: 0;
169
- }
170
-
171
- .attribute-meta-row {
172
- max-width: 0px;
173
- }
174
-
175
- .attribute-meta-row.expanded .meta-item-container {
176
- max-height: 1000px;
177
- max-width: none;
178
- transition: max-height 1s ease-in;
179
- }
180
-
181
- .button {
182
- cursor: pointer;
183
- display: flex;
184
- flex-direction: row;
185
- align-content: center;
186
- padding: 16px;
187
- align-items: center;
188
- font-size: 14px;
189
- text-transform: uppercase;
190
- color: var(--or-app-color4);
191
- }
192
-
193
- .button or-icon {
194
- --or-icon-fill: var(--or-app-color4);
195
- margin-right: 5px;
196
- }
197
-
198
- @media screen and (max-width: 1024px){
199
- .row {
200
- display: block;
201
- flex-direction: column;
202
- }
203
- }
204
-
205
- @media screen and (max-width: 768px){
206
- #title {
207
- padding: 0;
208
- width: 100%;
209
- }
210
- .panel {
211
- border-left: 0px;
212
- border-right: 0px;
213
- width: calc(100% - 48px);
214
- border-radius: 0;
215
- }
216
- .hide-mobile {
217
- display: none;
218
- }
219
- td, th {
220
- width: 50%
221
- }
222
- }
46
+ css `
47
+ #wrapper {
48
+ height: 100%;
49
+ width: 100%;
50
+ display: flex;
51
+ flex-direction: column;
52
+ overflow: auto;
53
+ }
54
+
55
+ #title {
56
+ padding: 0 20px;
57
+ font-size: 18px;
58
+ font-weight: bold;
59
+ width: calc(100% - 40px);
60
+ max-width: 1360px;
61
+ margin: 20px auto;
62
+ align-items: center;
63
+ display: flex;
64
+ color: var(--or-app-color3, ${unsafeCSS(DefaultColor3)});
65
+ }
66
+
67
+ #title or-icon {
68
+ margin-right: 10px;
69
+ margin-left: 14px;
70
+ }
71
+
72
+ .panel {
73
+ width: calc(100% - 90px);
74
+ max-width: 1310px;
75
+ background-color: white;
76
+ border: 1px solid #e5e5e5;
77
+ border-radius: 5px;
78
+ position: relative;
79
+ margin: 0 auto;
80
+ padding: 18px 24px 24px;
81
+ }
82
+
83
+ .panel-title {
84
+ text-transform: uppercase;
85
+ font-weight: bolder;
86
+ line-height: 1em;
87
+ color: var(--or-app-color3, ${unsafeCSS(DefaultColor3)});
88
+ margin-bottom: 20px;
89
+ margin-top: 0;
90
+ flex: 0 0 auto;
91
+ letter-spacing: 0.025em;
92
+ }
93
+
94
+ #table-roles,
95
+ #table-roles table{
96
+ width: 100%;
97
+ white-space: nowrap;
98
+ }
99
+
100
+ .mdc-data-table__row {
101
+ cursor: pointer;
102
+ border-top-color: #D3D3D3;
103
+ }
104
+
105
+ td, th {
106
+ width: 25%;
107
+ border: none;
108
+ }
109
+
110
+ td.large, th.large {
111
+ width: 50%
112
+ }
113
+
114
+ .meta-item-container {
115
+ flex-direction: row;
116
+ overflow: hidden;
117
+ max-height: 0;
118
+ transition: max-height 0.25s ease-out;
119
+ padding-left: 16px;
120
+ }
121
+
122
+ or-mwc-input {
123
+ margin-bottom: 10px;
124
+ margin-right: 16px;
125
+ }
126
+
127
+ or-icon {
128
+ vertical-align: middle;
129
+ --or-icon-width: 20px;
130
+ --or-icon-height: 20px;
131
+ margin-right: 2px;
132
+ margin-left: -5px;
133
+ }
134
+
135
+ .row {
136
+ display: flex;
137
+ flex-direction: row;
138
+ margin: 10px 0;
139
+ flex: 1 1 0;
140
+ }
141
+
142
+ .column {
143
+ display: flex;
144
+ flex-direction: column;
145
+ margin: 0px;
146
+ flex: 1 1 0;
147
+ }
148
+
149
+ .column-title {
150
+ padding-bottom: 10px;
151
+ }
152
+
153
+ .mdc-data-table__header-cell {
154
+ font-weight: bold;
155
+ color: ${unsafeCSS(DefaultColor3)};
156
+ }
157
+
158
+ .mdc-data-table__header-cell:first-child {
159
+ padding-left: 36px;
160
+ }
161
+
162
+ .padded-cell {
163
+ overflow-wrap: break-word;
164
+ word-wrap: break-word;
165
+ }
166
+
167
+ .attribute-meta-row td {
168
+ padding: 0;
169
+ }
170
+
171
+ .attribute-meta-row {
172
+ max-width: 0px;
173
+ }
174
+
175
+ .attribute-meta-row.expanded .meta-item-container {
176
+ max-height: 1000px;
177
+ max-width: none;
178
+ transition: max-height 1s ease-in;
179
+ }
180
+
181
+ .button {
182
+ cursor: pointer;
183
+ display: flex;
184
+ flex-direction: row;
185
+ align-content: center;
186
+ padding: 16px;
187
+ align-items: center;
188
+ font-size: 14px;
189
+ text-transform: uppercase;
190
+ color: var(--or-app-color4);
191
+ }
192
+
193
+ .button or-icon {
194
+ --or-icon-fill: var(--or-app-color4);
195
+ margin-right: 5px;
196
+ }
197
+
198
+ @media screen and (max-width: 1024px){
199
+ .row {
200
+ display: block;
201
+ flex-direction: column;
202
+ }
203
+ }
204
+
205
+ @media screen and (max-width: 768px){
206
+ #title {
207
+ padding: 0;
208
+ width: 100%;
209
+ }
210
+ .panel {
211
+ border-left: 0px;
212
+ border-right: 0px;
213
+ width: calc(100% - 48px);
214
+ border-radius: 0;
215
+ }
216
+ .hide-mobile {
217
+ display: none;
218
+ }
219
+ td, th {
220
+ width: 50%
221
+ }
222
+ }
223
223
  `,
224
224
  ];
225
225
  }
@@ -295,13 +295,13 @@ let PageRoles = class PageRoles extends Page {
295
295
  }
296
296
  render() {
297
297
  if (!manager.authenticated) {
298
- return html `
299
- <or-translate value="notAuthenticated"></or-translate>
298
+ return html `
299
+ <or-translate value="notAuthenticated"></or-translate>
300
300
  `;
301
301
  }
302
302
  if (!manager.isKeycloak()) {
303
- return html `
304
- <or-translate value="notSupported"></or-translate>
303
+ return html `
304
+ <or-translate value="notSupported"></or-translate>
305
305
  `;
306
306
  }
307
307
  if (!this._roles || this._roles.length === 0) {
@@ -311,113 +311,113 @@ let PageRoles = class PageRoles extends Page {
311
311
  const readRoles = this._roles.filter(role => role.name.includes('read')).sort((a, b) => a.name.localeCompare(b.name));
312
312
  const writeRoles = this._roles.filter(role => role.name.includes('write')).sort((a, b) => a.name.localeCompare(b.name));
313
313
  const otherRoles = this._roles.filter(role => !role.name.includes('read') && !role.name.includes('write')).sort((a, b) => a.name.localeCompare(b.name));
314
- return html `
315
- <div id="wrapper">
316
- <div id="title">
317
- <or-icon icon="account-box-multiple"></or-icon>${i18next.t("role_plural")}
318
- </div>
319
- <div class="panel">
320
- <p class="panel-title">${i18next.t("role")}</p>
321
- <div id="table-roles" class="mdc-data-table">
322
- <table class="mdc-data-table__table" aria-label="attribute list">
323
- <thead>
324
- <tr class="mdc-data-table__header-row">
325
- <th class="mdc-data-table__header-cell" role="columnheader" scope="col">
326
- <or-translate value="name"></or-translate>
327
- </th>
328
- <th class="mdc-data-table__header-cell" role="columnheader" scope="col">
329
- <or-translate value="description"></or-translate>
330
- </th>
331
- <th class="mdc-data-table__header-cell hide-mobile large" role="columnheader" scope="col">
332
- <or-translate value="permissions"></or-translate>
333
- </th>
334
- </tr>
335
- </thead>
336
- <tbody class="mdc-data-table__content">
314
+ return html `
315
+ <div id="wrapper">
316
+ <div id="title">
317
+ <or-icon icon="account-box-multiple"></or-icon>${i18next.t("role_plural")}
318
+ </div>
319
+ <div class="panel">
320
+ <p class="panel-title">${i18next.t("role")}</p>
321
+ <div id="table-roles" class="mdc-data-table">
322
+ <table class="mdc-data-table__table" aria-label="attribute list">
323
+ <thead>
324
+ <tr class="mdc-data-table__header-row">
325
+ <th class="mdc-data-table__header-cell" role="columnheader" scope="col">
326
+ <or-translate value="name"></or-translate>
327
+ </th>
328
+ <th class="mdc-data-table__header-cell" role="columnheader" scope="col">
329
+ <or-translate value="description"></or-translate>
330
+ </th>
331
+ <th class="mdc-data-table__header-cell hide-mobile large" role="columnheader" scope="col">
332
+ <or-translate value="permissions"></or-translate>
333
+ </th>
334
+ </tr>
335
+ </thead>
336
+ <tbody class="mdc-data-table__content">
337
337
  ${this._compositeRoles.map((role, index) => {
338
338
  const compositeRoleName = role.compositeRoleIds.map(id => this._rolesMapper[id]).sort((a, b) => a.localeCompare(b)).join(', ');
339
- return html `
340
- <tr id="mdc-data-table-row-${index}" class="mdc-data-table__row" @click="${() => this.expanderToggle(index)}">
341
- <td class="padded-cell mdc-data-table__cell">
342
- <or-icon id="mdc-data-table-icon-${index}" icon="chevron-right"></or-icon>
343
- <span>${role.name}</span>
344
- </td>
345
- <td class="padded-cell mdc-data-table__cell">
346
- ${role.description}
347
- </td>
348
- <td class="padded-cell hide-mobile mdc-data-table__cell large">
349
- ${compositeRoleName}
350
- </td>
351
- </tr>
352
- <tr id="attribute-meta-row-${index}" class="attribute-meta-row${!role.id ? " expanded " : " "}">
353
- <td colspan="100%">
354
- <div class="meta-item-container">
355
-
356
- <div class="row">
357
- <div class="column">
358
- <or-mwc-input .label="${i18next.t("role")}" .type="${InputType.TEXT}" min="1" required .value="${role.name}" @or-mwc-input-changed="${(e) => role.name = e.detail.value}"></or-mwc-input>
359
- </div>
360
- <div class="column">
361
- <or-mwc-input .label="${i18next.t("description")}" .type="${InputType.TEXT}" min="1" required .value="${role.description}" @or-mwc-input-changed="${(e) => role.description = e.detail.value}"></or-mwc-input>
362
- </div>
363
- </div>
364
-
365
- <div class="row">
366
- <div class="column">
339
+ return html `
340
+ <tr id="mdc-data-table-row-${index}" class="mdc-data-table__row" @click="${() => this.expanderToggle(index)}">
341
+ <td class="padded-cell mdc-data-table__cell">
342
+ <or-icon id="mdc-data-table-icon-${index}" icon="chevron-right"></or-icon>
343
+ <span>${role.name}</span>
344
+ </td>
345
+ <td class="padded-cell mdc-data-table__cell">
346
+ ${role.description}
347
+ </td>
348
+ <td class="padded-cell hide-mobile mdc-data-table__cell large">
349
+ ${compositeRoleName}
350
+ </td>
351
+ </tr>
352
+ <tr id="attribute-meta-row-${index}" class="attribute-meta-row${!role.id ? " expanded " : " "}">
353
+ <td colspan="100%">
354
+ <div class="meta-item-container">
355
+
356
+ <div class="row">
357
+ <div class="column">
358
+ <or-mwc-input .label="${i18next.t("role")}" .type="${InputType.TEXT}" min="1" required .value="${role.name}" @or-mwc-input-changed="${(e) => role.name = e.detail.value}"></or-mwc-input>
359
+ </div>
360
+ <div class="column">
361
+ <or-mwc-input .label="${i18next.t("description")}" .type="${InputType.TEXT}" min="1" required .value="${role.description}" @or-mwc-input-changed="${(e) => role.description = e.detail.value}"></or-mwc-input>
362
+ </div>
363
+ </div>
364
+
365
+ <div class="row">
366
+ <div class="column">
367
367
  <strong class="column-title">${i18next.t("readPermissions")}</strong> ${readRoles.map(r => {
368
- return html `
369
- <or-mwc-input ?readonly="${readonly}" .label="${r.name.split(":")[1]}: ${r.description}" .type="${InputType.CHECKBOX}" .value="${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}" @or-mwc-input-changed="${(e) => this.addRemoveRole(e, r, index)}"></or-mwc-input>
368
+ return html `
369
+ <or-mwc-input ?readonly="${readonly}" .label="${r.name.split(":")[1]}: ${r.description}" .type="${InputType.CHECKBOX}" .value="${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}" @or-mwc-input-changed="${(e) => this.addRemoveRole(e, r, index)}"></or-mwc-input>
370
370
  `;
371
- })}
372
-
373
- </div>
374
- <div class="column">
371
+ })}
372
+
373
+ </div>
374
+ <div class="column">
375
375
  <strong class="column-title">${i18next.t("writePermissions")}</strong> ${writeRoles.map(r => {
376
- return html `
377
- <or-mwc-input ?readonly="${readonly}" .label="${r.name.split(":")[1]}: ${r.description}" .type="${InputType.CHECKBOX}" .value="${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}" @or-mwc-input-changed="${(e) => this.addRemoveRole(e, r, index)}"></or-mwc-input>
376
+ return html `
377
+ <or-mwc-input ?readonly="${readonly}" .label="${r.name.split(":")[1]}: ${r.description}" .type="${InputType.CHECKBOX}" .value="${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}" @or-mwc-input-changed="${(e) => this.addRemoveRole(e, r, index)}"></or-mwc-input>
378
378
  `;
379
- })}
380
- </div>
381
- </div>
382
-
383
- <div class="row">
384
- <div class="column">
379
+ })}
380
+ </div>
381
+ </div>
382
+
383
+ <div class="row">
384
+ <div class="column">
385
385
  ${otherRoles.map(r => {
386
- return html `
387
- <or-mwc-input ?readonly="${readonly}" .label="${r.name.split(" : ")[1]}: ${r.description}" .type="${InputType.CHECKBOX}" .value="${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}" @or-mwc-input-changed="${(e) => this.addRemoveRole(e, r, index)}"></or-mwc-input>
386
+ return html `
387
+ <or-mwc-input ?readonly="${readonly}" .label="${r.name.split(" : ")[1]}: ${r.description}" .type="${InputType.CHECKBOX}" .value="${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}" @or-mwc-input-changed="${(e) => this.addRemoveRole(e, r, index)}"></or-mwc-input>
388
388
  `;
389
- })}
390
- </div>
391
- </div>
392
-
393
- ${readonly ? html `` : html `
394
- <div class="row" style="margin-bottom: 0;">
395
- ${role.id ? html `
396
- <or-mwc-input label="delete" .type="${InputType.BUTTON}" @click="${() => this._deleteRole(role, index)}"></or-mwc-input>
397
- <or-mwc-input ?disabled="${this._compositeRoles.some(role => role.compositeRoleIds.length === 0)}" style="margin-left: auto;" label="save" .type="${InputType.BUTTON}" @click="${() => this._updateRoles()}"></or-mwc-input>
398
- ` : html `
399
- <or-mwc-input label="cancel" .type="${InputType.BUTTON}" @click="${() => { this._compositeRoles.splice(-1, 1); this._compositeRoles = [...this._compositeRoles]; }}"></or-mwc-input>
400
- <or-mwc-input ?disabled="${this._compositeRoles.some(role => role.compositeRoleIds.length === 0)}" style="margin-left: auto;" label="create" .type="${InputType.BUTTON}" @click="${() => this._updateRoles()}"></or-mwc-input>
401
- `}
402
- </div>
403
- `}
404
- </div>
405
- </td>
406
- </tr>
389
+ })}
390
+ </div>
391
+ </div>
392
+
393
+ ${readonly ? html `` : html `
394
+ <div class="row" style="margin-bottom: 0;">
395
+ ${role.id ? html `
396
+ <or-mwc-input label="delete" .type="${InputType.BUTTON}" @click="${() => this._deleteRole(role, index)}"></or-mwc-input>
397
+ <or-mwc-input ?disabled="${this._compositeRoles.some(role => role.compositeRoleIds.length === 0)}" style="margin-left: auto;" label="save" .type="${InputType.BUTTON}" @click="${() => this._updateRoles()}"></or-mwc-input>
398
+ ` : html `
399
+ <or-mwc-input label="cancel" .type="${InputType.BUTTON}" @click="${() => { this._compositeRoles.splice(-1, 1); this._compositeRoles = [...this._compositeRoles]; }}"></or-mwc-input>
400
+ <or-mwc-input ?disabled="${this._compositeRoles.some(role => role.compositeRoleIds.length === 0)}" style="margin-left: auto;" label="create" .type="${InputType.BUTTON}" @click="${() => this._updateRoles()}"></or-mwc-input>
401
+ `}
402
+ </div>
403
+ `}
404
+ </div>
405
+ </td>
406
+ </tr>
407
407
  `;
408
- })} ${this._compositeRoles.length > 0 && !!this._compositeRoles[this._compositeRoles.length - 1].id && !readonly ? html `
409
- <tr class="mdc-data-table__row">
410
- <td colspan="100%">
411
- <a class="button" @click="${() => this._compositeRoles = [...this._compositeRoles, { composite: true, name: "", compositeRoleIds: [] }]}">
412
- <or-icon icon="plus"></or-icon>${i18next.t("add")} ${i18next.t("role")}</a>
413
- </td>
414
- </tr>
415
- ` : ``}
416
- </tbody>
417
- </table>
418
- </div>
419
- </div>
420
- </div>
408
+ })} ${this._compositeRoles.length > 0 && !!this._compositeRoles[this._compositeRoles.length - 1].id && !readonly ? html `
409
+ <tr class="mdc-data-table__row">
410
+ <td colspan="100%">
411
+ <a class="button" @click="${() => this._compositeRoles = [...this._compositeRoles, { composite: true, name: "", compositeRoleIds: [] }]}">
412
+ <or-icon icon="plus"></or-icon>${i18next.t("add")} ${i18next.t("role")}</a>
413
+ </td>
414
+ </tr>
415
+ ` : ``}
416
+ </tbody>
417
+ </table>
418
+ </div>
419
+ </div>
420
+ </div>
421
421
  `;
422
422
  }
423
423
  stateChanged(state) {
@@ -66,15 +66,15 @@ export const PAGE_RULES_CONFIG_DEFAULT = {
66
66
  let PageRules = class PageRules extends Page {
67
67
  static get styles() {
68
68
  // language=CSS
69
- return css `
70
- :host {
71
-
72
- }
73
-
74
- or-rules {
75
- width: 100%;
76
- height: 100%;
77
- }
69
+ return css `
70
+ :host {
71
+
72
+ }
73
+
74
+ or-rules {
75
+ width: 100%;
76
+ height: 100%;
77
+ }
78
78
  `;
79
79
  }
80
80
  get name() {
@@ -90,8 +90,8 @@ let PageRules = class PageRules extends Page {
90
90
  }));
91
91
  }
92
92
  render() {
93
- return html `
94
- <or-rules id="rules" .config="${this.config && this.config.rules ? this.config.rules : PAGE_RULES_CONFIG_DEFAULT.rules}"></or-rules>
93
+ return html `
94
+ <or-rules id="rules" .config="${this.config && this.config.rules ? this.config.rules : PAGE_RULES_CONFIG_DEFAULT.rules}"></or-rules>
95
95
  `;
96
96
  }
97
97
  stateChanged(state) {