2021-07-25 17:44:30 +07:00
|
|
|
import '@vaadin/vaadin-login';
|
|
|
|
import { LoginI18n } from '@vaadin/vaadin-login';
|
|
|
|
import { html } from 'lit';
|
|
|
|
import { customElement, state } from 'lit/decorators';
|
|
|
|
import { View } from '../../views/view';
|
|
|
|
|
|
|
|
const loginI18nDefault: LoginI18n = {
|
|
|
|
form: {
|
|
|
|
title: 'Log in',
|
|
|
|
username: 'Username',
|
|
|
|
password: 'Password',
|
|
|
|
submit: 'Log in',
|
|
|
|
forgotPassword: 'Forgot password',
|
|
|
|
},
|
|
|
|
errorMessage: {
|
|
|
|
title: 'Incorrect username or password',
|
|
|
|
message: 'Check that you have entered the correct username and password and try again.',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
@customElement('login-view')
|
|
|
|
export class LoginView extends View {
|
|
|
|
@state()
|
|
|
|
private error = false;
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return html`
|
|
|
|
<vaadin-login-overlay
|
|
|
|
opened
|
|
|
|
.error=${this.error}
|
|
|
|
action="login"
|
|
|
|
no-forgot-password
|
|
|
|
.i18n=${Object.assign(
|
2021-07-25 20:04:59 +07:00
|
|
|
{ header: { title: 'Fusion', description: 'Login using user/user or admin/admin' } },
|
2021-07-25 17:44:30 +07:00
|
|
|
loginI18nDefault
|
|
|
|
)}
|
|
|
|
>
|
|
|
|
</vaadin-login-overlay>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
}
|