initial upload of new Javascript Frontend based on ExtJS (by Johannes)
- contains ExtJS Library 4.1.1a, together with css and images - is related to the module 93_DbLog.pm, which holds some functions used by the frontend git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2767 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
80
www/frontend/app/controller/MainController.js
Normal file
80
www/frontend/app/controller/MainController.js
Normal file
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* The Main Controller handling Main Application Logic
|
||||
*/
|
||||
Ext.define('FHEM.controller.MainController', {
|
||||
extend: 'Ext.app.Controller',
|
||||
|
||||
refs: [
|
||||
{
|
||||
selector: 'viewport[name=mainviewport]',
|
||||
ref: 'mainviewport' //this.getMainviewport()
|
||||
},
|
||||
{
|
||||
selector: 'text[name=statustextfield]',
|
||||
ref: 'statustextfield' //this.getStatustextfield()
|
||||
},
|
||||
{
|
||||
selector: 'panel[name=culpanel]',
|
||||
ref: 'culpanel' //this.getCulpanel()
|
||||
}
|
||||
|
||||
],
|
||||
|
||||
/**
|
||||
* init function to register listeners
|
||||
*/
|
||||
init: function() {
|
||||
this.control({
|
||||
'viewport[name=mainviewport]': {
|
||||
afterrender: this.viewportRendered
|
||||
},
|
||||
'panel[name=linechartaccordionpanel]': {
|
||||
expand: this.showLineChartPanel
|
||||
},
|
||||
'panel[name=tabledataaccordionpanel]': {
|
||||
expand: this.showDatabaseTablePanel
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* load the FHEM devices and state on viewport render completion
|
||||
*/
|
||||
viewportRendered: function(){
|
||||
|
||||
if (Ext.isDefined(FHEM.version)) {
|
||||
var sp = this.getStatustextfield();
|
||||
sp.setText(FHEM.version);
|
||||
}
|
||||
|
||||
// var cp = me.getCulpanel();
|
||||
// if (result.list === "CUL") {
|
||||
// var culname = result.devices[0].NAME;
|
||||
// cp.add(
|
||||
// {
|
||||
// xtype: 'text',
|
||||
// text: culname
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
showLineChartPanel: function() {
|
||||
Ext.ComponentQuery.query('panel[name=tabledatagridpanel]')[0].hide();
|
||||
Ext.ComponentQuery.query('panel[name=linechartpanel]')[0].show();
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
showDatabaseTablePanel: function() {
|
||||
//TODO: use this when new dblog module is deployed
|
||||
//Ext.ComponentQuery.query('panel[name=linechartpanel]')[0].hide();
|
||||
//Ext.ComponentQuery.query('panel[name=tabledatagridpanel]')[0].show();
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user