changeset 259:d19ad9d28de5

Added code to show general information about the application in the probenauswahlliste.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Thu, 25 Jul 2013 14:26:06 +0200
parents 62e92e470a1e
children 70a1b5962930
files app/store/Info.js app/view/Viewport.js
diffstat 2 files changed, 39 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/store/Info.js	Thu Jul 25 14:26:06 2013 +0200
@@ -0,0 +1,13 @@
+Ext.define('Lada.store.Info', {
+    extend: 'Ext.data.Store',
+    fields: ['user', 'groups', 'version'],
+    proxy: {
+         type: 'rest',
+         url: 'server/rest/info',
+         reader: {
+             type: 'json',
+             root: 'data'
+         }
+     }
+});
+
--- a/app/view/Viewport.js	Thu Jul 25 11:01:52 2013 +0200
+++ b/app/view/Viewport.js	Thu Jul 25 14:26:06 2013 +0200
@@ -1,13 +1,14 @@
 Ext.define('Lada.view.Viewport' ,{
     extend: 'Ext.container.Viewport',
     requires: [
+        'Lada.store.Info',
+        'Lada.view.search.List',
         'Lada.view.search.List',
         'Lada.view.proben.List',
         'Lada.view.widgets.Mst',
         'Lada.view.widgets.Uwb',
         'Lada.view.widgets.Datetime'
     ],
-
     initComponent: function() {
         console.log('Setting up Viewport');
         this.initSearch();
@@ -21,8 +22,25 @@
         //this.initMessung();
         //this.initMesswert();
 
+        this.setInfo();
         this.callParent(arguments);
     },
+    setInfo: function() {
+        var store = Ext.create('Lada.store.Info');
+        store.load({
+            callback: function(a,b,c) {
+                var info = store.data.items[0];
+                var clientVersion = "-/- (-/-)";
+                var user = info.get('user');
+                var groups = info.get('groups');
+                var serverVersion = info.get('version');
+                var info = Ext.getCmp('systeminfo');
+                info.update('Nutzer: '+user+' | Gruppe(n): '+groups+' | Server: '+serverVersion+' | Client: '+clientVersion);
+                info.show();
+                console.log(info);
+            }
+        });
+    },
     initProbe: function() {
         var store = Ext.getStore('Proben');
         store.load({
@@ -102,6 +120,13 @@
             title: '<center>Probenauswahlmaske</center>',
             bodyPadding: '10 10',
             items: [
+                // Informationen über Nutzer/Gruppe/Version
+                {
+                    xtype: 'panel',
+                    id:  'systeminfo',
+                    bodyPadding: '5',
+                    hidden: true,
+                },
                 // Auswahl einer Abfrage.
                 {
                     xtype: 'queryselector',

http://lada.wald.intevation.org