@things-factory/auth-ui 7.0.1-alpha.9 → 7.0.1-alpha.90
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/client/auth-style-sign.ts +29 -18
- package/client/bootstrap.ts +6 -10
- package/client/components/abstract-auth-page.ts +41 -22
- package/client/components/abstract-password-reset.ts +11 -9
- package/client/components/abstract-sign.ts +138 -0
- package/client/components/change-password.ts +3 -3
- package/client/components/contact-us.ts +19 -23
- package/client/components/create-domain-popup.ts +11 -7
- package/client/components/create-role.ts +8 -20
- package/client/components/create-user.ts +8 -16
- package/client/components/credential-manager.ts +64 -0
- package/client/components/delete-user-popup.ts +1 -1
- package/client/components/domain-switch.ts +7 -4
- package/client/components/invite-customer.ts +7 -14
- package/client/components/invite-user.ts +2 -7
- package/client/components/ownership-transfer-popup.ts +3 -3
- package/client/components/partner-role-editor.ts +10 -16
- package/client/components/profile-component.ts +124 -7
- package/client/components/role-privilege-editor.ts +10 -17
- package/client/components/user-role-editor.ts +27 -38
- package/client/entries/auth/activate.ts +17 -17
- package/client/entries/auth/checkin.ts +15 -19
- package/client/entries/auth/forgot-password.ts +8 -6
- package/client/entries/auth/result.ts +13 -12
- package/client/entries/auth/signup.ts +20 -24
- package/client/entries/oauth2/oauth2-decision-error-page.ts +2 -2
- package/client/entries/oauth2/oauth2-decision-page.ts +60 -55
- package/client/entries/public/home.ts +40 -18
- package/client/index.ts +93 -66
- package/client/pages/app-binding/app-binding.ts +5 -9
- package/client/pages/app-binding/app-bindings.ts +2 -2
- package/client/pages/appliance/appliance.ts +6 -9
- package/client/pages/appliance/home.ts +3 -3
- package/client/pages/appliance/register.ts +1 -1
- package/client/pages/application/application.ts +29 -50
- package/client/pages/application/applications.ts +4 -12
- package/client/pages/application/register.ts +1 -1
- package/client/pages/attribute/attribute-set-item-list.ts +8 -22
- package/client/pages/attribute/attribute-set-management.ts +14 -20
- package/client/pages/auth-provider/auth-provider-management.ts +10 -16
- package/client/pages/domain/domain-management.ts +4 -9
- package/client/pages/user/user-management.ts +5 -5
- package/dist-client/auth-style-sign.js +29 -18
- package/dist-client/auth-style-sign.js.map +1 -1
- package/dist-client/bootstrap.d.ts +1 -1
- package/dist-client/bootstrap.js +5 -5
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/abstract-auth-page.d.ts +4 -4
- package/dist-client/components/abstract-auth-page.js +40 -22
- package/dist-client/components/abstract-auth-page.js.map +1 -1
- package/dist-client/components/abstract-password-reset.d.ts +3 -2
- package/dist-client/components/abstract-password-reset.js +10 -9
- package/dist-client/components/abstract-password-reset.js.map +1 -1
- package/dist-client/components/abstract-sign.d.ts +3 -0
- package/dist-client/components/abstract-sign.js +110 -0
- package/dist-client/components/abstract-sign.js.map +1 -1
- package/dist-client/components/change-password.js +3 -3
- package/dist-client/components/change-password.js.map +1 -1
- package/dist-client/components/contact-us.d.ts +4 -4
- package/dist-client/components/contact-us.js +18 -23
- package/dist-client/components/contact-us.js.map +1 -1
- package/dist-client/components/create-domain-popup.d.ts +1 -1
- package/dist-client/components/create-domain-popup.js +11 -7
- package/dist-client/components/create-domain-popup.js.map +1 -1
- package/dist-client/components/create-role.d.ts +1 -1
- package/dist-client/components/create-role.js +7 -19
- package/dist-client/components/create-role.js.map +1 -1
- package/dist-client/components/create-user.js +6 -14
- package/dist-client/components/create-user.js.map +1 -1
- package/dist-client/components/credential-manager.d.ts +11 -0
- package/dist-client/components/credential-manager.js +64 -0
- package/dist-client/components/credential-manager.js.map +1 -0
- package/dist-client/components/delete-user-popup.js +1 -1
- package/dist-client/components/delete-user-popup.js.map +1 -1
- package/dist-client/components/domain-switch.d.ts +2 -0
- package/dist-client/components/domain-switch.js +9 -4
- package/dist-client/components/domain-switch.js.map +1 -1
- package/dist-client/components/invite-customer.d.ts +1 -1
- package/dist-client/components/invite-customer.js +5 -8
- package/dist-client/components/invite-customer.js.map +1 -1
- package/dist-client/components/invite-user.js +2 -7
- package/dist-client/components/invite-user.js.map +1 -1
- package/dist-client/components/ownership-transfer-popup.d.ts +1 -1
- package/dist-client/components/ownership-transfer-popup.js +3 -3
- package/dist-client/components/ownership-transfer-popup.js.map +1 -1
- package/dist-client/components/partner-role-editor.d.ts +1 -1
- package/dist-client/components/partner-role-editor.js +10 -16
- package/dist-client/components/partner-role-editor.js.map +1 -1
- package/dist-client/components/profile-component.d.ts +6 -0
- package/dist-client/components/profile-component.js +111 -7
- package/dist-client/components/profile-component.js.map +1 -1
- package/dist-client/components/role-privilege-editor.js +10 -17
- package/dist-client/components/role-privilege-editor.js.map +1 -1
- package/dist-client/components/user-role-editor.d.ts +2 -0
- package/dist-client/components/user-role-editor.js +26 -37
- package/dist-client/components/user-role-editor.js.map +1 -1
- package/dist-client/entries/auth/activate.d.ts +2 -1
- package/dist-client/entries/auth/activate.js +16 -17
- package/dist-client/entries/auth/activate.js.map +1 -1
- package/dist-client/entries/auth/checkin.d.ts +2 -2
- package/dist-client/entries/auth/checkin.js +13 -16
- package/dist-client/entries/auth/checkin.js.map +1 -1
- package/dist-client/entries/auth/forgot-password.d.ts +2 -1
- package/dist-client/entries/auth/forgot-password.js +7 -6
- package/dist-client/entries/auth/forgot-password.js.map +1 -1
- package/dist-client/entries/auth/result.d.ts +2 -2
- package/dist-client/entries/auth/result.js +12 -12
- package/dist-client/entries/auth/result.js.map +1 -1
- package/dist-client/entries/auth/signup.js +19 -24
- package/dist-client/entries/auth/signup.js.map +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-error-page.d.ts +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-error-page.js +2 -2
- package/dist-client/entries/oauth2/oauth2-decision-error-page.js.map +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-page.d.ts +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-page.js +59 -54
- package/dist-client/entries/oauth2/oauth2-decision-page.js.map +1 -1
- package/dist-client/entries/public/home.d.ts +3 -2
- package/dist-client/entries/public/home.js +40 -18
- package/dist-client/entries/public/home.js.map +1 -1
- package/dist-client/index.d.ts +11 -2
- package/dist-client/index.js +74 -66
- package/dist-client/index.js.map +1 -1
- package/dist-client/pages/app-binding/app-binding.d.ts +1 -1
- package/dist-client/pages/app-binding/app-binding.js +4 -9
- package/dist-client/pages/app-binding/app-binding.js.map +1 -1
- package/dist-client/pages/app-binding/app-bindings.js +2 -2
- package/dist-client/pages/app-binding/app-bindings.js.map +1 -1
- package/dist-client/pages/appliance/appliance.d.ts +1 -1
- package/dist-client/pages/appliance/appliance.js +5 -9
- package/dist-client/pages/appliance/appliance.js.map +1 -1
- package/dist-client/pages/appliance/home.js +3 -3
- package/dist-client/pages/appliance/home.js.map +1 -1
- package/dist-client/pages/appliance/register.js +1 -1
- package/dist-client/pages/appliance/register.js.map +1 -1
- package/dist-client/pages/application/application.d.ts +1 -1
- package/dist-client/pages/application/application.js +28 -50
- package/dist-client/pages/application/application.js.map +1 -1
- package/dist-client/pages/application/applications.js +4 -12
- package/dist-client/pages/application/applications.js.map +1 -1
- package/dist-client/pages/application/register.js +1 -1
- package/dist-client/pages/application/register.js.map +1 -1
- package/dist-client/pages/attribute/attribute-set-item-list.d.ts +1 -1
- package/dist-client/pages/attribute/attribute-set-item-list.js +6 -22
- package/dist-client/pages/attribute/attribute-set-item-list.js.map +1 -1
- package/dist-client/pages/attribute/attribute-set-management.d.ts +11 -2
- package/dist-client/pages/attribute/attribute-set-management.js +7 -11
- package/dist-client/pages/attribute/attribute-set-management.js.map +1 -1
- package/dist-client/pages/auth-provider/auth-provider-management.d.ts +11 -2
- package/dist-client/pages/auth-provider/auth-provider-management.js +8 -11
- package/dist-client/pages/auth-provider/auth-provider-management.js.map +1 -1
- package/dist-client/pages/domain/domain-management.d.ts +1 -0
- package/dist-client/pages/domain/domain-management.js +3 -7
- package/dist-client/pages/domain/domain-management.js.map +1 -1
- package/dist-client/pages/user/user-management.d.ts +1 -0
- package/dist-client/pages/user/user-management.js +4 -5
- package/dist-client/pages/user/user-management.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -12
- package/translations/en.json +1 -0
- package/translations/ja.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
- package/views/auth-page.html +3 -2
- package/views/oauth2-page.html +3 -2
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import '@material/
|
|
2
|
-
import '@material/
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '@material/web/button/text-button.js'
|
|
3
|
+
import '@material/web/button/elevated-button.js'
|
|
3
4
|
|
|
4
5
|
import { css, html, LitElement } from 'lit'
|
|
5
6
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
|
+
import { ifDefined } from 'lit/directives/if-defined.js'
|
|
6
8
|
|
|
7
9
|
import { i18next, localize } from '@operato/i18n'
|
|
8
10
|
|
|
@@ -15,19 +17,33 @@ export class HomePage extends localize(i18next)(LitElement) {
|
|
|
15
17
|
position: relative;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
.signin {
|
|
19
21
|
position: absolute;
|
|
20
|
-
|
|
22
|
+
right: 20px;
|
|
21
23
|
top: 10px;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
display: inline-block;
|
|
25
|
+
padding: 12px 24px;
|
|
26
|
+
font-size: 16px;
|
|
27
|
+
font-weight: bold;
|
|
28
|
+
color: var(--md-sys-color-on-primary);
|
|
29
|
+
background-color: var(--md-sys-color-primary-container);
|
|
30
|
+
border: none;
|
|
31
|
+
border-radius: 4px;
|
|
32
|
+
text-align: center;
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
transition:
|
|
35
|
+
background-color 0.3s,
|
|
36
|
+
transform 0.3s;
|
|
24
37
|
}
|
|
25
38
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
.signin:hover {
|
|
40
|
+
background-color: var(--md-sys-color-on-primary-container);
|
|
41
|
+
transform: translateY(-2px);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.signin:active {
|
|
45
|
+
background-color: var(--md-sys-color-primary-container);
|
|
46
|
+
transform: translateY(0);
|
|
31
47
|
}
|
|
32
48
|
|
|
33
49
|
[message] {
|
|
@@ -96,7 +112,7 @@ export class HomePage extends localize(i18next)(LitElement) {
|
|
|
96
112
|
input {
|
|
97
113
|
border: var(--border-dark-color);
|
|
98
114
|
border-radius: var(--border-radius);
|
|
99
|
-
padding: var(--
|
|
115
|
+
padding: var(--padding-default);
|
|
100
116
|
font: var(--input-font);
|
|
101
117
|
}
|
|
102
118
|
|
|
@@ -150,7 +166,7 @@ export class HomePage extends localize(i18next)(LitElement) {
|
|
|
150
166
|
margin: var(--margin-narrow) 0 var(--margin-default) 0;
|
|
151
167
|
text-align: center;
|
|
152
168
|
}
|
|
153
|
-
fieldset
|
|
169
|
+
fieldset md-text-button {
|
|
154
170
|
width: 100%;
|
|
155
171
|
}
|
|
156
172
|
}
|
|
@@ -171,8 +187,15 @@ export class HomePage extends localize(i18next)(LitElement) {
|
|
|
171
187
|
const explanation2 = this.explanation2 || 'Everything you need to go from where you are, to where you want to be.'
|
|
172
188
|
|
|
173
189
|
return html`
|
|
174
|
-
<
|
|
175
|
-
|
|
190
|
+
<a
|
|
191
|
+
class="signin"
|
|
192
|
+
@click=${e => {
|
|
193
|
+
e.preventDefault()
|
|
194
|
+
window.location.href = '/auth/signin'
|
|
195
|
+
}}
|
|
196
|
+
>
|
|
197
|
+
${i18next.t('button.sign_in')}</a
|
|
198
|
+
>
|
|
176
199
|
|
|
177
200
|
<div message>
|
|
178
201
|
<strong>${tagline}</strong> ${explanation1} <br />
|
|
@@ -181,14 +204,13 @@ export class HomePage extends localize(i18next)(LitElement) {
|
|
|
181
204
|
</div>
|
|
182
205
|
|
|
183
206
|
<div ticket>
|
|
184
|
-
<div brand><img src=${icon} /></div>
|
|
207
|
+
<div brand><img src=${ifDefined(icon)} /></div>
|
|
185
208
|
<div content>
|
|
186
|
-
<form action="/auth/join" accept-charset="utf-8" name="join" method="
|
|
209
|
+
<form action="/auth/join" accept-charset="utf-8" name="join" method="post">
|
|
187
210
|
<fieldset>
|
|
188
211
|
<legend>${title} invitation ticket</legend>
|
|
189
212
|
<input type="text" name="email" placeholder="Enter your email address" />
|
|
190
213
|
<input type="submit" value="join now" />
|
|
191
|
-
<!-- help this button, pls <mwc-button raised label="join now"></mwc-button> -->
|
|
192
214
|
</fieldset>
|
|
193
215
|
</form>
|
|
194
216
|
</div>
|
package/client/index.ts
CHANGED
|
@@ -1,97 +1,124 @@
|
|
|
1
|
-
import '@material/
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
2
|
import '@operato/i18n/ox-i18n.js'
|
|
3
3
|
|
|
4
4
|
import { html } from 'lit-html'
|
|
5
5
|
|
|
6
6
|
import { navigate, store } from '@operato/shell'
|
|
7
|
-
import { ADD_MORENDA } from '@things-factory/more-base'
|
|
7
|
+
import { ADD_MORENDA } from '@things-factory/more-base/client'
|
|
8
8
|
import { hasPrivilege } from '@things-factory/auth-base/dist-client'
|
|
9
9
|
|
|
10
10
|
export * from './components/role-selector.js'
|
|
11
11
|
export * from './components/domain-switch.js'
|
|
12
12
|
export * from './components/invite-user.js'
|
|
13
13
|
|
|
14
|
-
export
|
|
14
|
+
export type AuthManagementMenuOptions = {
|
|
15
|
+
role?: boolean
|
|
16
|
+
appliance?: boolean
|
|
17
|
+
application?: boolean
|
|
18
|
+
user?: boolean
|
|
19
|
+
authProvider?: boolean
|
|
20
|
+
domain?: boolean
|
|
21
|
+
attribute?: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function setAuthManagementMenus(options?: any) {
|
|
25
|
+
const {
|
|
26
|
+
role = true,
|
|
27
|
+
appliance = true,
|
|
28
|
+
application = true,
|
|
29
|
+
user = true,
|
|
30
|
+
authProvider = true,
|
|
31
|
+
domain = true,
|
|
32
|
+
attribute = true
|
|
33
|
+
} = options || {}
|
|
34
|
+
|
|
15
35
|
if (
|
|
16
36
|
await hasPrivilege({ privilege: 'mutation', category: 'user', domainOwnerGranted: true, superUserGranted: true })
|
|
17
37
|
) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
role &&
|
|
39
|
+
store.dispatch({
|
|
40
|
+
type: ADD_MORENDA,
|
|
41
|
+
morenda: {
|
|
42
|
+
icon: html` <md-icon>how_to_reg</md-icon> `,
|
|
43
|
+
name: html` <ox-i18n msgid="text.role_management"></ox-i18n> `,
|
|
44
|
+
action: () => {
|
|
45
|
+
navigate('roles')
|
|
46
|
+
}
|
|
25
47
|
}
|
|
26
|
-
}
|
|
27
|
-
})
|
|
48
|
+
})
|
|
28
49
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
appliance &&
|
|
51
|
+
store.dispatch({
|
|
52
|
+
type: ADD_MORENDA,
|
|
53
|
+
morenda: {
|
|
54
|
+
icon: html` <md-icon>devices</md-icon> `,
|
|
55
|
+
name: html` <ox-i18n msgid="text.appliance"></ox-i18n> `,
|
|
56
|
+
action: () => {
|
|
57
|
+
navigate('appliance-home')
|
|
58
|
+
}
|
|
36
59
|
}
|
|
37
|
-
}
|
|
38
|
-
})
|
|
60
|
+
})
|
|
39
61
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
62
|
+
application &&
|
|
63
|
+
store.dispatch({
|
|
64
|
+
type: ADD_MORENDA,
|
|
65
|
+
morenda: {
|
|
66
|
+
icon: html` <md-icon>apps</md-icon> `,
|
|
67
|
+
name: html` <ox-i18n msgid="text.application management"></ox-i18n> `,
|
|
68
|
+
action: () => {
|
|
69
|
+
navigate('applications')
|
|
70
|
+
}
|
|
47
71
|
}
|
|
48
|
-
}
|
|
49
|
-
})
|
|
72
|
+
})
|
|
50
73
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
74
|
+
user &&
|
|
75
|
+
store.dispatch({
|
|
76
|
+
type: ADD_MORENDA,
|
|
77
|
+
morenda: {
|
|
78
|
+
icon: html` <md-icon>people</md-icon> `,
|
|
79
|
+
name: html` <ox-i18n msgid="text.user management"></ox-i18n> `,
|
|
80
|
+
action: () => {
|
|
81
|
+
navigate('users')
|
|
82
|
+
}
|
|
58
83
|
}
|
|
59
|
-
}
|
|
60
|
-
})
|
|
84
|
+
})
|
|
61
85
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
86
|
+
authProvider &&
|
|
87
|
+
store.dispatch({
|
|
88
|
+
type: ADD_MORENDA,
|
|
89
|
+
morenda: {
|
|
90
|
+
icon: html` <md-icon>badge</md-icon> `,
|
|
91
|
+
name: html` <ox-i18n msgid="text.auth-provider management"></ox-i18n> `,
|
|
92
|
+
action: () => {
|
|
93
|
+
navigate('auth-providers')
|
|
94
|
+
}
|
|
69
95
|
}
|
|
70
|
-
}
|
|
71
|
-
})
|
|
96
|
+
})
|
|
72
97
|
}
|
|
73
98
|
|
|
74
99
|
if (await hasPrivilege({ superUserGranted: true })) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
100
|
+
domain &&
|
|
101
|
+
store.dispatch({
|
|
102
|
+
type: ADD_MORENDA,
|
|
103
|
+
morenda: {
|
|
104
|
+
icon: html` <md-icon>business</md-icon> `,
|
|
105
|
+
name: html` <ox-i18n msgid="text.domain management"></ox-i18n> `,
|
|
106
|
+
action: () => {
|
|
107
|
+
navigate('domains')
|
|
108
|
+
}
|
|
82
109
|
}
|
|
83
|
-
}
|
|
84
|
-
})
|
|
110
|
+
})
|
|
85
111
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
112
|
+
attribute &&
|
|
113
|
+
store.dispatch({
|
|
114
|
+
type: ADD_MORENDA,
|
|
115
|
+
morenda: {
|
|
116
|
+
icon: html` <md-icon>dataset</md-icon> `,
|
|
117
|
+
name: html` <ox-i18n msgid="text.attribute management"></ox-i18n> `,
|
|
118
|
+
action: () => {
|
|
119
|
+
navigate('attributes')
|
|
120
|
+
}
|
|
93
121
|
}
|
|
94
|
-
}
|
|
95
|
-
})
|
|
122
|
+
})
|
|
96
123
|
}
|
|
97
124
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
|
|
1
3
|
import Clipboard from 'clipboard'
|
|
2
4
|
import gql from 'graphql-tag'
|
|
3
5
|
import { css, html } from 'lit'
|
|
@@ -164,7 +166,7 @@ class AppBinding extends connect(store)(PageView) {
|
|
|
164
166
|
|
|
165
167
|
return html`
|
|
166
168
|
<div>
|
|
167
|
-
<h2><
|
|
169
|
+
<h2><md-icon>link</md-icon> ${app.name}</h2>
|
|
168
170
|
<p page-description>${app.description}</p>
|
|
169
171
|
</div>
|
|
170
172
|
|
|
@@ -235,10 +237,7 @@ class AppBinding extends connect(store)(PageView) {
|
|
|
235
237
|
<input id="access-token" type="text" .value=${this.accessToken || ''} readonly />
|
|
236
238
|
<button button-in-field clipboard-copy @click=${e => e.preventDefault()}>copy</button>
|
|
237
239
|
${accessTokenExp
|
|
238
|
-
? html`<div input-hint>
|
|
239
|
-
expired in ${new Date(accessTokenExp).toLocaleString()} :
|
|
240
|
-
${asyncReplace(this.expTimer(accessTokenExp))}
|
|
241
|
-
</div>`
|
|
240
|
+
? html`<div input-hint>expired in ${new Date(accessTokenExp).toLocaleString()} : ${asyncReplace(this.expTimer(accessTokenExp))}</div>`
|
|
242
241
|
: html``}
|
|
243
242
|
</div>
|
|
244
243
|
|
|
@@ -247,10 +246,7 @@ class AppBinding extends connect(store)(PageView) {
|
|
|
247
246
|
<input id="refresh-token" type="text" .value=${binding.refreshToken || ''} readonly />
|
|
248
247
|
<button button-in-field clipboard-copy @click=${e => e.preventDefault()}>copy</button>
|
|
249
248
|
${refreshTokenExp
|
|
250
|
-
? html`<div input-hint>
|
|
251
|
-
expired in ${new Date(refreshTokenExp).toLocaleString()} :
|
|
252
|
-
${asyncReplace(this.expTimer(refreshTokenExp))}
|
|
253
|
-
</div>`
|
|
249
|
+
? html`<div input-hint>expired in ${new Date(refreshTokenExp).toLocaleString()} : ${asyncReplace(this.expTimer(refreshTokenExp))}</div>`
|
|
254
250
|
: html``}
|
|
255
251
|
</div>
|
|
256
252
|
</div>
|
|
@@ -16,7 +16,7 @@ class AppBindings extends connect(store)(PageView) {
|
|
|
16
16
|
|
|
17
17
|
overflow: auto;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
md-elevated-button {
|
|
20
20
|
margin-right: 0;
|
|
21
21
|
float: right;
|
|
22
22
|
}
|
|
@@ -114,7 +114,7 @@ class AppBindings extends connect(store)(PageView) {
|
|
|
114
114
|
`
|
|
115
115
|
)}
|
|
116
116
|
</table>
|
|
117
|
-
<
|
|
117
|
+
<md-elevated-button @click=${e => navigate('applications')}>registered applications ..</md-elevated-button>
|
|
118
118
|
`
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
|
|
1
3
|
import Clipboard from 'clipboard'
|
|
2
4
|
import gql from 'graphql-tag'
|
|
3
5
|
import { css, html } from 'lit'
|
|
@@ -150,7 +152,7 @@ class Appliance extends connect(store)(PageView) {
|
|
|
150
152
|
|
|
151
153
|
return html`
|
|
152
154
|
<div>
|
|
153
|
-
<h2><
|
|
155
|
+
<h2><md-icon>devices</md-icon> ${appliance.name}</h2>
|
|
154
156
|
<p page-description>${appliance.description}</p>
|
|
155
157
|
</div>
|
|
156
158
|
|
|
@@ -199,13 +201,10 @@ class Appliance extends connect(store)(PageView) {
|
|
|
199
201
|
<div field grid-span>
|
|
200
202
|
<label for="access-token">${i18next.t('label.access token')}</label>
|
|
201
203
|
<input id="access-token" type="text" .value=${appliance.accessToken} readonly />
|
|
202
|
-
<button button-in-field clipboard-copy @click=${e => e.preventDefault()}>
|
|
203
|
-
${i18next.t('button.copy')}
|
|
204
|
-
</button>
|
|
204
|
+
<button button-in-field clipboard-copy @click=${e => e.preventDefault()}>${i18next.t('button.copy')}</button>
|
|
205
205
|
${accessTokenExp
|
|
206
206
|
? html`<div input-hint>
|
|
207
|
-
${i18next.t('text.token expiry time')} ${new Date(accessTokenExp * 1000).toLocaleString()} :
|
|
208
|
-
${asyncReplace(this.expTimer(accessTokenExp))}
|
|
207
|
+
${i18next.t('text.token expiry time')} ${new Date(accessTokenExp * 1000).toLocaleString()} : ${asyncReplace(this.expTimer(accessTokenExp))}
|
|
209
208
|
</div>`
|
|
210
209
|
: html``}
|
|
211
210
|
</div>
|
|
@@ -214,9 +213,7 @@ class Appliance extends connect(store)(PageView) {
|
|
|
214
213
|
</div>
|
|
215
214
|
|
|
216
215
|
<button @click=${this.deleteAppliance.bind(this)}>${i18next.t('button.delete this appliance')}</button>
|
|
217
|
-
<button @click=${this.generateApplianceSecret.bind(this)}>
|
|
218
|
-
${i18next.t('button.generate new access token')}
|
|
219
|
-
</button>
|
|
216
|
+
<button @click=${this.generateApplianceSecret.bind(this)}>${i18next.t('button.generate new access token')}</button>
|
|
220
217
|
<button @click=${this.updateAppliance.bind(this)}>${i18next.t('button.update')}</button>
|
|
221
218
|
</form>
|
|
222
219
|
`
|
|
@@ -96,10 +96,10 @@ class Appliances extends connect(store)(PageView) {
|
|
|
96
96
|
<div>
|
|
97
97
|
<h2>Registered Appliances</h2>
|
|
98
98
|
<p page-description>
|
|
99
|
-
What type of appliance are you building?<br />Choose the app type that best suits the audience you’re building
|
|
100
|
-
|
|
99
|
+
What type of appliance are you building?<br />Choose the app type that best suits the audience you’re building for. The appliance type can’t be changed after
|
|
100
|
+
it’s created.
|
|
101
101
|
</p>
|
|
102
|
-
<
|
|
102
|
+
<md-elevated-button @click=${e => navigate('appliance-register')}>register new appliance</md-elevated-button>
|
|
103
103
|
</div>
|
|
104
104
|
|
|
105
105
|
<table>
|
|
@@ -136,7 +136,7 @@ class ApplianceRegister extends connect(store)(PageView) {
|
|
|
136
136
|
<input id="netmask" type="text" name="netmask" />
|
|
137
137
|
</div>
|
|
138
138
|
|
|
139
|
-
<
|
|
139
|
+
<md-elevated-button grid-span @click=${this.createAppliance.bind(this)}>register</md-elevated-button>
|
|
140
140
|
</div>
|
|
141
141
|
</form>
|
|
142
142
|
</div>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
|
|
1
3
|
import Clipboard from 'clipboard'
|
|
2
4
|
import gql from 'graphql-tag'
|
|
3
5
|
import { css, html } from 'lit'
|
|
@@ -8,10 +10,12 @@ import { APPLICATION_TYPES } from '../../constants/application'
|
|
|
8
10
|
|
|
9
11
|
import { client } from '@operato/graphql'
|
|
10
12
|
import { navigate, PageView, store } from '@operato/shell'
|
|
13
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
|
11
14
|
|
|
12
15
|
@customElement('application-page')
|
|
13
16
|
class Application extends connect(store)(PageView) {
|
|
14
17
|
static styles = [
|
|
18
|
+
ButtonContainerStyles,
|
|
15
19
|
css`
|
|
16
20
|
:host {
|
|
17
21
|
display: flex;
|
|
@@ -53,15 +57,12 @@ class Application extends connect(store)(PageView) {
|
|
|
53
57
|
border: var(--border-dark-color);
|
|
54
58
|
border-radius: var(--border-radius);
|
|
55
59
|
margin: var(--input-margin);
|
|
56
|
-
padding:
|
|
60
|
+
padding: 9px;
|
|
57
61
|
font: var(--input-font);
|
|
58
62
|
flex: 1;
|
|
59
63
|
}
|
|
60
64
|
select:focus,
|
|
61
65
|
input:focus,
|
|
62
|
-
button {
|
|
63
|
-
outline: none;
|
|
64
|
-
}
|
|
65
66
|
form {
|
|
66
67
|
max-width: var(--content-container-max-width);
|
|
67
68
|
}
|
|
@@ -102,23 +103,19 @@ class Application extends connect(store)(PageView) {
|
|
|
102
103
|
}
|
|
103
104
|
[button-in-field] {
|
|
104
105
|
position: absolute;
|
|
105
|
-
top:
|
|
106
|
-
right:
|
|
106
|
+
top: 16px;
|
|
107
|
+
right: 2px;
|
|
108
|
+
padding: 0;
|
|
109
|
+
border-radius: 0;
|
|
107
110
|
}
|
|
108
111
|
[input-hint] {
|
|
109
112
|
font: var(--input-hint-font);
|
|
110
113
|
color: var(--input-hint-color);
|
|
111
114
|
}
|
|
112
115
|
[danger] {
|
|
113
|
-
--
|
|
114
|
-
}
|
|
115
|
-
.button-container {
|
|
116
|
-
margin-top: var(--margin-wide);
|
|
117
|
-
text-align: right;
|
|
118
|
-
}
|
|
119
|
-
.button-container mwc-button {
|
|
120
|
-
margin-left: var(--margin-narrow);
|
|
116
|
+
--md-theme-primary: var(--md-danger-button-primary-color);
|
|
121
117
|
}
|
|
118
|
+
|
|
122
119
|
@media screen and (max-width: 480px) {
|
|
123
120
|
[field] {
|
|
124
121
|
grid-column: span 2;
|
|
@@ -145,7 +142,7 @@ class Application extends connect(store)(PageView) {
|
|
|
145
142
|
|
|
146
143
|
return html`
|
|
147
144
|
<div>
|
|
148
|
-
<h2><
|
|
145
|
+
<h2><md-icon>apps</md-icon> ${app.name}</h2>
|
|
149
146
|
<p page-description>${app.description}</p>
|
|
150
147
|
</div>
|
|
151
148
|
|
|
@@ -211,28 +208,18 @@ class Application extends connect(store)(PageView) {
|
|
|
211
208
|
<div field grid-span>
|
|
212
209
|
<label for="auth-url">auth URL</label>
|
|
213
210
|
<input id="auth-url" type="text" .value=${app.authUrl} readonly />
|
|
214
|
-
<
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
button-in-field
|
|
218
|
-
clipboard-copy
|
|
219
|
-
@click=${e => e.preventDefault()}
|
|
220
|
-
label="copy"
|
|
221
|
-
></mwc-button>
|
|
211
|
+
<md-text-button dense button-in-field clipboard-copy @click=${e => e.preventDefault()}
|
|
212
|
+
>copy</md-text-button
|
|
213
|
+
>
|
|
222
214
|
The endpoint for authorization server. This is used to get the authorization code.
|
|
223
215
|
</div>
|
|
224
216
|
|
|
225
217
|
<div field grid-span>
|
|
226
218
|
<label for="access-token-url">access token URL</label>
|
|
227
219
|
<input id="access-token-url" type="text" .value=${app.accessTokenUrl} readonly />
|
|
228
|
-
<
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
button-in-field
|
|
232
|
-
clipboard-copy
|
|
233
|
-
@click=${e => e.preventDefault()}
|
|
234
|
-
label="copy"
|
|
235
|
-
></mwc-button>
|
|
220
|
+
<md-text-button dense button-in-field clipboard-copy @click=${e => e.preventDefault()}
|
|
221
|
+
>copy</md-text-button
|
|
222
|
+
>
|
|
236
223
|
The endpoint for authentication server. This is used to exchange the authorization code for an access
|
|
237
224
|
token.
|
|
238
225
|
</div>
|
|
@@ -247,36 +234,28 @@ class Application extends connect(store)(PageView) {
|
|
|
247
234
|
<div field grid-span>
|
|
248
235
|
<label for="app-key">appKey</label>
|
|
249
236
|
<input id="app-key" type="text" .value=${app.appKey} readonly />
|
|
250
|
-
<
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
button-in-field
|
|
254
|
-
clipboard-copy
|
|
255
|
-
@click=${e => e.preventDefault()}
|
|
256
|
-
label="copy"
|
|
257
|
-
></mwc-button>
|
|
237
|
+
<md-text-button dense button-in-field clipboard-copy @click=${e => e.preventDefault()}
|
|
238
|
+
>copy</md-text-button
|
|
239
|
+
>
|
|
258
240
|
</div>
|
|
259
241
|
|
|
260
242
|
<div field grid-span>
|
|
261
243
|
<label for="app-secret">appSecret</label>
|
|
262
244
|
<input id="app-secret" type="text" .value=${app.appSecret} readonly />
|
|
263
|
-
<
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
button-in-field
|
|
267
|
-
clipboard-copy
|
|
268
|
-
@click=${e => e.preventDefault()}
|
|
269
|
-
label="copy"
|
|
270
|
-
></mwc-button>
|
|
245
|
+
<md-text-button dense button-in-field clipboard-copy @click=${e => e.preventDefault()}
|
|
246
|
+
>copy</md-text-button
|
|
247
|
+
>
|
|
271
248
|
</div>
|
|
272
249
|
</div>
|
|
273
250
|
</fieldset>
|
|
274
251
|
</div>
|
|
275
252
|
|
|
276
253
|
<div class="button-container">
|
|
277
|
-
<
|
|
278
|
-
|
|
279
|
-
|
|
254
|
+
<button danger @click=${this.deleteApplication.bind(this)}>
|
|
255
|
+
<md-icon>delete_forever</md-icon>delete this app
|
|
256
|
+
</button>
|
|
257
|
+
<button @click=${this.updateApplication.bind(this)}><md-icon>save</md-icon>update</button>
|
|
258
|
+
<button><md-icon>passkey</md-icon>generate new secret</button>
|
|
280
259
|
</div>
|
|
281
260
|
</form>
|
|
282
261
|
`
|
|
@@ -17,7 +17,7 @@ class Applications extends connect(store)(PageView) {
|
|
|
17
17
|
overflow: auto;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
md-outlined-button {
|
|
21
21
|
float: right;
|
|
22
22
|
margin-top: var(--margin-default);
|
|
23
23
|
}
|
|
@@ -99,17 +99,10 @@ class Applications extends connect(store)(PageView) {
|
|
|
99
99
|
return html`
|
|
100
100
|
<div>
|
|
101
101
|
<h2>Registered Applications</h2>
|
|
102
|
-
<p page-description>
|
|
103
|
-
|
|
104
|
-
</p>
|
|
105
|
-
<mwc-button
|
|
106
|
-
raised
|
|
107
|
-
@click=${e => navigate('application-register')}
|
|
108
|
-
label="register new application"
|
|
109
|
-
></mwc-button>
|
|
102
|
+
<p page-description>What type of app are you building?<br />Choose the app type that best suits the audience you’re building for.</p>
|
|
103
|
+
<md-elevated-button @click=${e => navigate('application-register')}>register new application</md-elevated-button>
|
|
110
104
|
</div>
|
|
111
105
|
|
|
112
|
-
<!-- <div> -->
|
|
113
106
|
<table>
|
|
114
107
|
<tr>
|
|
115
108
|
<th>app name</th>
|
|
@@ -134,8 +127,7 @@ class Applications extends connect(store)(PageView) {
|
|
|
134
127
|
)}
|
|
135
128
|
</table>
|
|
136
129
|
|
|
137
|
-
<
|
|
138
|
-
<!-- </div> -->
|
|
130
|
+
<md-outlined-button @click=${e => navigate('app-bindings')}>bound applications ..</md-outlined-button>
|
|
139
131
|
`
|
|
140
132
|
}
|
|
141
133
|
|
|
@@ -165,7 +165,7 @@ class ApplicationRegister extends connect(store)(PageView) {
|
|
|
165
165
|
<input id="email" type="text" name="email" />
|
|
166
166
|
</div>
|
|
167
167
|
|
|
168
|
-
<
|
|
168
|
+
<md-elevated-button grid-span @click=${this.createApplication.bind(this)}>register</md-elevated-button>
|
|
169
169
|
</div>
|
|
170
170
|
</form>
|
|
171
171
|
</div>
|