]>
git.proxmox.com Git - proxmox-backup.git/blob - www/LoginView.js
1 Ext
.define('PBS.LoginView', {
2 extend
: 'Ext.container.Container',
6 xclass
: 'Ext.app.ViewController',
8 submitForm: function() {
10 var view
= me
.getView();
11 var loginForm
= me
.lookupReference('loginForm');
13 if (loginForm
.isValid()) {
14 if (loginForm
.isVisible()) {
15 loginForm
.mask(gettext('Please wait...'), 'x-mask-loading');
18 success: function(form
, action
) {
19 // save login data and create cookie
20 PBS
.Utils
.updateLoginData(action
.result
.data
);
21 PBS
.app
.changeView('mainview');
23 failure: function(form
, action
) {
27 gettext('Login failed. Please try again')
35 'button[reference=loginButton]': {
74 reference
: 'loginwindow',
78 //defaultFocus: 'usernameField',
79 // TODO: use usernameField again once we have a real user-,
80 // permission system and root@pam isn't the default anymore
81 defaultFocus
: 'passwordField',
87 title
: gettext('Proxmox Backup Server Login'),
95 defaultButton
: 'loginButton',
96 url
: '/api2/extjs/access/ticket',
97 reference
: 'loginForm',
107 fieldLabel
: gettext('User name'),
110 itemId
: 'usernameField',
111 reference
: 'usernameField'
115 inputType
: 'password',
116 fieldLabel
: gettext('Password'),
118 itemId
: 'passwordField',
119 reference
: 'passwordField',
124 text
: gettext('Login'),
125 reference
: 'loginButton',