dustin@800: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz dustin@800: * Software engineering by Intevation GmbH dustin@800: * dustin@800: * This file is Free Software under the GNU GPL (v>=3) dustin@800: * and comes with ABSOLUTELY NO WARRANTY! Check out dustin@800: * the documentation coming with IMIS-Labordaten-Application for details. dustin@800: */ dustin@800: dustin@800: /** dustin@800: * About Window with basic information. dustin@800: */ dustin@800: Ext.define('Lada.view.window.About', { dustin@800: extend: 'Ext.window.Window', dustin@800: dustin@800: layout: 'fit', dustin@800: dustin@800: initComponent: function() { dustin@800: var i18n = Lada.getApplication().bundle; dustin@800: dustin@800: // add listeners to change the window appearence when it becomes inactive dustin@800: this.on({ dustin@800: activate: function(){ dustin@800: this.getEl().removeCls('window-inactive'); dustin@800: }, dustin@800: deactivate: function(){ dustin@800: this.getEl().addCls('window-inactive'); dustin@800: } dustin@800: }); dustin@800: dustin@800: var me = this; dustin@800: this.title = i18n.getMsg('about.window.title'); dustin@800: this.buttons = [{ dustin@800: text: i18n.getMsg('close'), dustin@800: scope: this, dustin@800: handler: this.close dustin@800: }]; dustin@800: this.items = [{ dustin@800: border: 0, dustin@800: autoscroll: 'true', dustin@800: layout: 'vbox', dustin@800: items: [{ dustin@800: xtype: 'text', dustin@800: style: { dustin@800: width: '95%', dustin@800: marginBottom: '5px' dustin@800: }, dustin@800: text: i18n.getMsg('about.window.text.login') dustin@800: }, { dustin@800: xtype: 'text', dustin@800: style: { dustin@800: width: '95%', dustin@800: marginBottom: '5px' dustin@800: }, dustin@800: text: Lada.username dustin@800: }, { dustin@800: xtype: 'text', dustin@800: style: { dustin@800: width: '95%', dustin@800: marginBottom: '5px' dustin@800: }, dustin@800: text: i18n.getMsg('about.window.text.roles') dustin@800: }, { dustin@800: xtype: 'text', dustin@800: style: { dustin@800: width: '95%', dustin@800: marginBottom: '5px' dustin@800: }, dustin@800: text: Lada.userroles dustin@800: }, { dustin@800: xtype: 'text', dustin@800: style: { dustin@800: width: '95%', dustin@800: marginBottom: '5px' dustin@800: }, dustin@800: text: i18n.getMsg('about.window.text.logintime') dustin@800: }, { dustin@800: xtype: 'text', dustin@800: style: { dustin@800: width: '95%', dustin@800: marginBottom: '5px' dustin@800: }, dustin@800: text: Ext.Date.format(new Date(Lada.logintime), 'd.m.Y H:i:s P') dustin@800: }, { dustin@800: xtype: 'text', dustin@800: style: { dustin@800: width: '95%', dustin@800: marginBottom: '5px' dustin@800: }, dustin@800: text: i18n.getMsg('about.window.text.serverversion') dustin@800: }, { dustin@800: xtype: 'text', dustin@800: style: { dustin@800: width: '95%', dustin@800: marginBottom: '5px' dustin@800: }, dustin@800: text: this.requestServerVersion() dustin@800: }] dustin@800: }]; dustin@800: dustin@800: this.callParent(arguments); dustin@800: }, dustin@800: dustin@800: requestServerVersion: function() { dustin@800: var i18n = Lada.getApplication().bundle; dustin@800: Ext.Ajax.request({ dustin@800: url: '/lada-server/version', dustin@800: method: 'GET', dustin@800: headers: { dustin@800: 'X-OPENID-PARAMS': Lada.openIDParams dustin@800: }, dustin@800: success: function(response) { dustin@800: var json = Ext.decode(response.responseText); dustin@800: // TODO dustin@800: console.log(json); dustin@800: return json.data; dustin@800: }, dustin@800: failure: function(response) { dustin@800: console.log('Error in Retrieving the Server Version.' dustin@800: + ' It might be lower than 2.0-beta2' dustin@800: + ' Or something is broken...'); dustin@800: return i18n.getMsg('err.msg.generic.body'); dustin@800: } dustin@800: }); dustin@800: } dustin@800: });