DeviceControl.js 2.1 KB
Ext.define('App.controller.DeviceControl', {
    extend : 'Ext.app.Controller',
    
    init : function() {
 
    	this.control({
    		'toolbar  button[action=DcOff]' : {
                click : this.DcOffClick
            },
            
            'toolbar  button[action=DcReboot]' : {
                click : this.DcRebootClick
            }
        });
    	 
    },
    
    DcOffClick:function() { 
    	
    	 Ext.getBody().mask('Выключение устройства ...');
    	
    	/*
            Ext.Ajax.request({
             	  method: "GET",
                   url: 'api/devinfo/',
                   headers: {
                       'Accept': 'application/json',
                       'Content-Type': 'application/json'
                   },
              
                   success: function(response, opts) {
                  	 
                  	var result = Ext.JSON.decode(response.responseText);
                  	 
                  	Ext.getCmp('guid').setValue(result.guid);
                  	Ext.getCmp('title').setValue(result.description);
                  			
                   }, failure: function(response, opts) {
                   }
              });
              */
        
    },
    
    
    DcRebootClick : function(btn) {
    	
    	
    	 Ext.getBody().mask('Перезагрузка устройства ...');
    	 
    	 /*
    	 Ext.Ajax.request({
        	  method: "GET",
              url: 'api/devinfo/',
              headers: {
                  'Accept': 'application/json',
                  'Content-Type': 'application/json'
              },
         
              success: function(response, opts) {
             	 
             	//var result = Ext.JSON.decode(response.responseText);
            	  Ext.getBody('Перезагрузка устройства ...');
             	 
             //	Ext.getCmp('guid').setValue(result.guid);
             //	Ext.getCmp('title').setValue(result.description);
             			
              }, failure: function(response, opts) {
              }
         });
         */
       
     
    } 
    });