OXIESEC PANEL
- Current Dir:
/
/
home
/
cubot
/
docroot
/
iCUBOT
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/03/2023 07:42:40 AM
rwxrwxr-x
📄
._.DS_Store
82 bytes
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
._Image1.png
325 bytes
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
._Image2.png
325 bytes
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
._Image3.png
325 bytes
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
._data.xml
171 bytes
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
._data1.xml
171 bytes
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
._index.js
171 bytes
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
._login.xml
171 bytes
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
._metadata.xml
171 bytes
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
SessionExpire.html
894 bytes
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
icon.png
2.12 KB
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
icubot.js
26.06 KB
08/14/2022 11:02:52 AM
rwxr-xr-x
📁
img
-
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
index.html
6.03 KB
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
loading.gif
743 bytes
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
phone_startup.png
74.08 KB
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
sencha-touch.css
267.35 KB
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
sencha-touch.js
745.04 KB
08/14/2022 11:02:52 AM
rwxr-xr-x
📄
tablet_startup.png
434.34 KB
08/14/2022 11:02:52 AM
rwxr-xr-x
Editing: icubot.js
Close
Ext.setup({ tabletStartupScreen: 'tablet_startup.png', phoneStartupScreen: 'phone_startup.png', icon: 'icon.png', glossOnIcon: false, onReady: function() { RDCACHE=false; //Report Data Cache RLCACHE=true; //Report List Cache ONEGRAPH=true; //Jqplot destroy will destroy all graphs in the page isPhone=Ext.is.Phone; orientation=Ext.orientation; var reportListCache =""; //Make this as local if you want no cache for report list var loginStatus = false; var form; var tabs=null; // Sequence - Login - Load Metadata - Load Dashboard - Get Data in parallel - Update Report - Raise Event // Start --------------------------- Data Structure Model, Store, Load ---------------------------------- var login = function () { if(sessionid == '' || sessionid.length<5){ var db='sampledb'; var current_addr=window.top.location.href.split("?"); if(current_addr.length > 1 && current_addr[1].indexOf('db=')>=0) db=current_addr[1].split('db=')[1]; sessionid=loginCubot(db, form.getValues().userName, form.getValues().password, form.getValues().Domain); $.cookie('RXSESSION', sessionid); } if (sessionid.length>5 && sessionid != -1 ) { getUserProperties(sessionid); initLabels(); loginStatus = true; Ext.getCmp('logoutButton').setText(getLabel('Logout')); Ext.getCmp('logoutButton').show(); EnableGraph(true); tabs = new Ext.SegmentedButton({ id:'Tabs', sortable: true, ui:'light', listeners:{ /* tap:{ element:'el', fn:function (){ makeDashboardCarousel(tabs.getPressed().id); } }, */ toggle : function(container, button, pressed){ if (pressed == true) { makeDashboardCarousel(tabs.getPressed().id); } } } }); panel.doLayout(); makeGraphInternationalization(); if(RLCACHE) reportListCache=getReportMetaData(sessionid, 'null'); getUserProperties(sessionid); //Need users property for access check getDashboardJSON(); showDashboard(); } else { form.setValues({message: 'Unable to Login try again'}); form.show(); } } function loadData(Id, ReportId, moduleId, DisplayType) { if(ReportId == "ReportList.html"){ $('div#'+Id).html('<font color=Green><center>'+getLabel("Report List")+'</center></font>'); } else { prepareReport(ReportId, DisplayType, '', '', moduleId, Id, true); } } // END --------------------------- Data Structure Model, Store, Load ---------------------------------------- // Start --------------------------- Dashboard UI - Panel + Toolbar + Carousel ------------------------------ function carouselCardSwitch(container, newCard, oldCard, index, animated, options ) { console.log('Card Switch'); var reports=getActiveReport(); if(reports){ console.log('Card Switch1'); if(oldCard.id && document.getElementById('DIV'+oldCard.id)) $('#DIV'+oldCard.id).html(putLoadingImg()); if( document.getElementById('DIV'+reports.id) && (document.getElementById('DIV'+reports.id).innerHTML.indexOf('loading.gif')>0 || document.getElementById('DIV'+reports.id).innerHTML.length<1) || reports.DisplayType=='G'){ console.log('Card Switch2'); $('#DIV'+reports.id).html(putLoadingImg()); loadData('DIV'+reports.id, reports.ReportId, reports.id, reports.DisplayType); } } } var carouselHandler = function (btn, evt) { alert("Button '" + btn.id + "' tapped."+evt.type); //overlay(); } function tabActivate(options) { console.log('Tab Activate'); console.log(options.reportProperty); } //TODO: Remove this Variable and retrieve from panel var carousel; function addCarousel(divId, reportId, displayType, getReport, CarouselIndex){ //Enhancement:1170 var width=Ext.is.Phone?Ext.Element.getViewportWidth():Ext.Element.getViewportWidth();//-10; var htmlString = '<div id="DIV'+divId+ '" align="center" style="width:'+width+'px; height: 100%; padding:2px;overflow:hidden;">' + putLoadingImg() +'</div>'; var tab = new Ext.Tab({ id:divId, html: htmlString }); //carousel.add(tab); carousel.insert(CarouselIndex, tab); carousel.doLayout(); if(carousel.items.length == 1 || getReport == 1) loadData('DIV'+divId, reportId, divId, displayType); } var isEnableMenu=true; var enableDisableMenuBars=function(){ if(isEnableMenu == true){ height=carousel.getHeight(); Ext.getCmp('menu').hide(); Ext.getCmp('graphControls').hide(); isEnableMenu=false; carousel.setHeight("100%"); panel.doComponentLayout(); refreshReport(); console.log(carousel.getHeight()); } else{ Ext.getCmp('menu').show(); Ext.getCmp('graphControls').show(); isEnableMenu=true; carousel.setHeight("100%"); panel.doComponentLayout(); refreshReport(); console.log(carousel.getHeight()); } } function clearReports(){ var reports=multiDash.dashObj[multiDash.defaultDashboard].pages[multiDash.defaultPage].reports; for(var i=0; i<reports.length; i++){ var width=Ext.is.Phone?Ext.Element.getViewportWidth():Ext.Element.getViewportWidth();//-10; $('#DIV'+reports[i].id).attr('style', 'width:'+width+'px; height: 100%; padding:2px;overflow:hidden;'); $('#DIV'+reports[i].id).html(putLoadingImg()); } } var enableDisableText=function(){ if(isEnableMenu==false){ Ext.getCmp('menu').hide(); Ext.getCmp('graphControls').hide(); } if(Ext.orientation == 'landscape'){ $('#graphControls span.x-button-label').show(); } else{ $('#graphControls span.x-button-label').hide(); } var reports=getActiveReport(); if(reports){ clearReports(); loadData('DIV'+reports.id, reports.ReportId, reports.id, reports.DisplayType); } } var removeReport=function(){ if(carousel.items.length<1) Ext.Msg.alert(getLabel('Remove Report'), getLabel('No report to remove.'), Ext.emptyFn); else Ext.Msg.confirm(getLabel("Remove Report"), getLabel("Are you sure you want to remove the report ?"), function (response){ if(response == "yes"){ var report=getActiveReport(); var carouselLength=carousel.items.length; var currentIndex=carousel.getActiveIndex(); if(report) multiDash.removeReportFromPage(report.id); if(carouselLength >1 && currentIndex == carouselLength-1) carousel.setActiveItem(carousel.items.length-2); else if(carouselLength >1 && currentIndex < carouselLength-1) carousel.setActiveItem(currentIndex+1); else carousel.setActiveItem(0); if(report) carousel.remove(report.id); else carousel.remove(carousel.items.items[currentIndex].id); } } ); } function showReports(reports) { if (reports != null) { if (carousel != null && carousel != undefined) { if(panel.getComponent(carousel)){ panel.remove(carousel); console.log('Remove carousel'); } } carousel = new Ext.Carousel({ id: 'Carousel', activeItem: 0, listeners:{ doubletap:{ element:'el', fn:enableDisableMenuBars } } }); carousel.on({ cardswitch: carouselCardSwitch}); carousel.on({ taphold: function(){alert("Taphold");}}); panel.add(carousel); panel.doLayout(); for (i=0 ; i<reports.length; i++) { addCarousel(reports[i].id, reports[i].ReportId, reports[i].DisplayType, 0, i); } if(carousel.items.length>0) carousel.setActiveItem(0); } } // Multiple Report shown in Google Table - using Event custom options var makeDashboardCarousel = function (pageId) { multiDash.setDefaultPage(pageId) console.log('Make Dashboard'); showReports(multiDash.dashObj[multiDash.defaultDashboard].pages[multiDash.defaultPage].reports); } var switchDashboard = function (ev, target, options) { console.log("Dashboard Switch"); multiDash.defaultDashboard=target; multiDash.defaultPage=0; //tabs.removeAll(true); Ext.getCmp('menu').remove(tabs); tabs = new Ext.SegmentedButton({ id:'Tabs', sortable: true, ui:'light', listeners:{ /* tap:{ element:'el', fn:function (){ makeDashboardCarousel(tabs.getPressed().id); } }, */ toggle : function(container, button, pressed){ if (pressed == true) { makeDashboardCarousel(tabs.getPressed().id); } } } }); if (carousel != null && carousel != undefined) { if(panel.getComponent(carousel)){ panel.remove(carousel); console.log('Remove carousel in switchDashboard'); } } if(multiDash.dashObj[target]){ for (j=0; j<multiDash.dashObj[target].pages.length; j++) { var page = multiDash.dashObj[target].pages[j]; tabs.add({ id: page.id, text:page.name }); } Ext.getCmp('menu').add(tabs); } Ext.getCmp('menu').doLayout(); if(tabs.items.length>0) { tabs.setPressed(0); //showReports(multiDash.dashObj[target].pages[0].reports); } } // Build Dashboard Links - Create Page Buttons on the Toolbar var showDashboard = function () { console.log('Show Dashboard'); multiDash.defaultDashboard=0; multiDash.defaultPage=0; var dashArray = new Array(); for (i=0; i< multiDash.dashObj.length; i++) { var objDash = multiDash.dashObj[i]; console.log("Dashboard " + objDash.id + ": " + "Name " + objDash.name); dashArray.push({text: objDash.name, value: i}); } var dashSelect = new Ext.form.Select({ id: 'dashboardList', xtype: 'selectfield', name: 'Dashboard', //prependText: 'Dashboard:', width:Ext.is.Phone?Ext.Element.getViewportWidth()/2:undefined, options: dashArray }); dashSelect.on('change', switchDashboard, null, {dashProperty: multiDash}); Ext.getCmp('menu').add(dashSelect); for (j=0; j<multiDash.dashObj[0].pages.length; j++) { var page = multiDash.dashObj[0].pages[j]; tabs.add({ id: page.id, text:page.name }); } Ext.getCmp('menu').add(tabs); //Ext.getCmp('menu').add({iconCls:'trash'}); Ext.getCmp('menu').doLayout(); if (multiDash.dashObj.length > 0) { if (multiDash.dashObj[0].pages.length > 0) { tabs.setPressed(0); //showReports(multiDash.dashObj[0].pages[0].reports); } } if(Ext.Element.getViewportHeight()>Ext.Element.getViewportWidth()){ $('#graphControls span.x-button-label').hide(); } } // End --------------------------- Dashboard UI - Panel + Toolbar + Carousel ------------------------------ function showLoginForm() { form = new Ext.form.FormPanel({ scroll: 'vertical', url : '', standardSubmit : false, autoRender: true, floating: true, modal: true, centered: true, hideOnMaskTap: false, height: Ext.is.Phone ? Ext.Element.getViewportHeight(): Ext.Element.getViewportHeight()/2, width: Ext.is.Phone ? Ext.Element.getViewportWidth():Ext.Element.getViewportWidth()/2, items: [{ xtype: 'fieldset', title: getLabel('Login'), instructions: getLabel('Please enter user name and password.'), defaults: { required: true, labelAlign: 'left', labelWidth: '40%' }, items: [ { xtype: 'textfield', name : 'userName', label: 'Name', useClearIcon: true, autoCapitalize : false, required: true }, { xtype: 'passwordfield', name : 'password', label: 'Password', useClearIcon: true, required: true, listeners: { keyup: function(fld, e){ console.log('Login Form passwordfield: keyup event'); if (e.browserEvent.keyCode == 13) { e.stopEvent(); fld.fieldEl.dom.blur(); form.hide(); login(); } } } }, { xtype: 'selectfield', name: 'Domain', label: 'Domain', options:domainArray }, { xtype: 'textfield', name: 'message', label: 'Message', useClearIcon: false, required: false, disabled: true }] }], dockedItems: [{ xtype: 'toolbar', dock: 'bottom', items: [ {xtype: 'spacer' }, { text: 'Reset', handler: function() { form.reset(); } }, { text: 'Ok', ui: 'confirm', handler: function() { form.hide(); login(); } } ] }] }); form.show(); } function getActiveReport(){ var reportIndex=carousel.getActiveIndex(); if(multiDash.dashObj[multiDash.defaultDashboard] && multiDash.dashObj[multiDash.defaultDashboard].pages[multiDash.defaultPage]) return multiDash.dashObj[multiDash.defaultDashboard].pages[multiDash.defaultPage].reports[reportIndex]; else return ""; } var switchGraph = function (){ var report=getActiveReport(); var displayType=encodeFormat(this.id); multiDash.setReportDisplayType(report.id, displayType); $('#DIV'+report.id).html(putLoadingImg()); loadData("DIV"+report.id, report.ReportId, report.id, displayType); } var refreshReport = function (){ var report=getActiveReport(); if(report){ $('#DIV'+report.id).html(putLoadingImg()); loadData("DIV"+report.id, report.ReportId, report.id, report.DisplayType); } } function EnableGraph(show) { if (show) { Ext.getCmp('Report List').show(); Ext.getCmp('Pie').show(); Ext.getCmp('Line').show(); Ext.getCmp('Bar').show(); Ext.getCmp('Stack Bar').show(); Ext.getCmp('Column').show(); Ext.getCmp('Combo').show(); Ext.getCmp('Gauge').show(); Ext.getCmp('Text').show(); Ext.getCmp('Delete').show(); Ext.getCmp('Refresh').show(); Ext.getCmp('Settings').show(); } else { Ext.getCmp('Report List').hide(); Ext.getCmp('Pie').hide(); Ext.getCmp('Line').hide(); Ext.getCmp('Bar').hide(); Ext.getCmp('Stack Bar').hide(); Ext.getCmp('Column').hide(); Ext.getCmp('Combo').hide(); Ext.getCmp('Gauge').hide(); Ext.getCmp('Text').hide(); Ext.getCmp('Delete').hide(); Ext.getCmp('Refresh').hide(); Ext.getCmp('Settings').hide(); } } function makeGraphInternationalization(){ Ext.getCmp('Report List').setText(getLabel('Report List')); Ext.getCmp('Pie').setText(getLabel('Pie')); Ext.getCmp('Line').setText(getLabel('Line')); Ext.getCmp('Bar').setText(getLabel('Bar')); Ext.getCmp('Stack Bar').setText(getLabel('Stack Bar')); Ext.getCmp('Column').setText(getLabel('Column')); Ext.getCmp('Combo').setText(getLabel('Combo')); Ext.getCmp('Gauge').setText(getLabel('Gauge')); Ext.getCmp('Text').setText(getLabel('Text')); } var graphIcons=[ { id: 'Pie', text: 'Pie', hidden: true, icon: 'img/chart_pie.png', handler:switchGraph}, { id: 'Line', text: 'Line', hidden: true, icon: 'img/chart_line.png', handler:switchGraph }, { id: 'Bar', text: 'Bar', hidden: true, icon: 'img/chart_bar.png', handler:switchGraph }, { id: 'Stack Bar', text: 'Stack Bar', hidden: true, icon: 'img/chart_sbar.png', handler:switchGraph }, { id: 'Column', text: 'Column', hidden: true, icon: 'img/chart_column.png', handler:switchGraph }, { id: 'Combo', text: 'Combo', hidden: true, icon: 'img/chart_combo.png', handler:switchGraph }, { id: 'Gauge', text: 'Gauge', hidden: true, icon: 'img/chart_gauge.png', handler:switchGraph }, { id: 'Text', text: 'Text', hidden: true, icon: 'img/chart_text.png', handler:switchGraph }, { id: 'Report List', text: 'Report List', hidden: true, icon: 'img/chart_reports.png', handler:showReportList}, { xtype: 'toolbar', ui: 'plain', defaults: { iconMask: true, ui: 'plain' }, items:[ {id:'Settings', iconCls:'action', hidden: true, handler:showSettings}, {id:'Refresh', iconCls:'refresh', hidden: true, handler:refreshReport}, {id:'Delete', iconCls:'trash', hidden: true, handler:removeReport} ] } ]; // Main Dashboard Container var panel = new Ext.Panel({ fullscreen: true, id: 'content', layout: 'fit', listeners:{ orientationchange: enableDisableText, beforeorientationchange:function (){ if(isEnableMenu==false){ Ext.getCmp('menu').show(); Ext.getCmp('graphControls').show(); } } }, dockedItems: [{ id: 'menu', xtype: 'toolbar', ui: 'light', dock: 'top', scroll: { direction: 'horizontal', useIndicators: false }, items: [{ id: 'logoutButton', text: getLabel('Logout'), hidden: true, handler: function () { if (loginStatus == false) { showLoginForm(); } else { logoutCubot(sessionid); $.cookie('RXSESSION', '-1'); loginStatus = false; sessionid = ''; panel.remove(carousel); var pageMenu = Ext.getCmp('menu'); var pageItems = pageMenu.items; pageItems.each(function (pageButton) { if (pageButton.id != 'logoutButton') { pageMenu.remove(pageButton); } }); tabs=null; EnableGraph(false); this.setText(getLabel('Login')); panel.doLayout(); multiDash=null; } } }] }, { id:'graphControls', xtype: 'toolbar', ui: 'light', defaults: { cls: 'plain' }, scroll: { direction: 'horizontal', useIndicators: false }, layout: { pack: 'center'}, dock: 'bottom', items:graphIcons } ] }); if (sessionid.length>5 && sessionid != -1 ) login(); else showLoginForm(); function showReportList(){ console.log("Show Report list called"); Ext.regModel('rptList', { fields: ['Id', 'Name', 'Gtype', 'ParentId'] }); var store = new Ext.data.JsonStore({ model: 'rptList', sorters: 'Name', getGroupString: function(record) { return record.get('ParentId'); }, data: [ ] }); if(reportListCache.length<1) reportListCache=getReportMetaData(sessionid, 'null'); var reportList=makeReportListTree(reportListCache); for(var i=0; i<reportList.length; i++){ //store.add({Id:reportList[i][0], Name:reportList[i][3], Gtype:reportList[i][11], ParentId:reportList[i][1]}); store.add({Id:reportList[i][0], Name:reportList[i][1], Gtype:reportList[i][2], ParentId:reportList[i][3]}); } var list = new Ext.List({ fullscreen:false, width: Ext.is.Phone ? undefined : 300, height:Ext.Element.getViewportHeight()-50, centered:true, scroll:'vertical', xtype: 'list', text:'Report', store: store, itemTpl: '<div class="rptList"><strong>{Name}</strong></div>', grouped: true, indexBar: false, listeners : { itemtap : function(dataView,index,item,e){ if(multiDash.dashObj[multiDash.defaultDashboard].pages.length>0){ var id=getNextSequenceId(); var reportId=dataView.store.getAt(index).data.Id; var displayType=encodeFormat(dataView.store.getAt(index).data.Gtype); var CarouselIndex=carousel.getActiveIndex(); if(CarouselIndex<0) CarouselIndex=0; addCarousel(id, reportId, displayType,1, CarouselIndex); carousel.setActiveItem(CarouselIndex); multiDash.addReport2Page(id, reportId, displayType, 'c1', CarouselIndex); } else{ Ext.Msg.prompt(getLabel('No page defined to add report on'),getLabel('Enter page name'), addPage); } } } }); slideRight( list); list.show(); } function slideRight( item){ var sheet = new Ext.Sheet({ centered : false, hideOnMaskTap : true, cls: 'listPanel', layout: 'fit', enter: 'left', exit: 'left', width: 300, height:Ext.Element.getViewportHeight(), stretchY : true, dockedItems: [item] }); sheet.show(); } //} //}); function isExist(itemArray, item){ for(var i=0; i<itemArray.length; i++){ if(itemArray[i]==item) return i; } return -1; } function makeReportListTree(reportList){ var list=new Array(); var folder=new Array(); var folderName=new Array(); var i=0, j=0, fIndex=-1; for(i=0; i<reportList.length; i++){ folder.push(reportList[i][1]); } folder=unique(folder.sort()); for(i=0, j=0; i<reportList.length; i++){ fIndex=isExist(folder, reportList[i][0]); if(fIndex <0){ list[j]=new Array(); list[j][0]=reportList[i][0]; list[j][1]=reportList[i][3]; list[j][2]=reportList[i][11]; list[j][3]=reportList[i][1]; j++; } else{ folderName[fIndex]=reportList[i][3]; } } for(i=0; i<list.length; i++){ fIndex=isExist(folder, list[i][3]); if(fIndex>=0) list[i][3]=folderName[fIndex]; } if(list.length>0) list=list.sort(multiDimensional); return list; } var popup=""; function showSettings(){ popup=new Ext.ActionSheet({ //floating:true, //stretchX:false, //stretchY:false, //modal: false, /* hideOnMaskTap: true, modal: true, centered:false, id: 'settings', //enter: 'top', //exit: 'bottom', layout:{type:'vbox', align:'left'},*/ items: [ { id : 'Add Page', text : getLabel('Add Page'), handler : pageSetting }, { id : 'Edit Page' , text : getLabel('Edit Page'), handler : pageSetting}, { id : 'Delete Page' , text : getLabel('Delete Page'), handler : pageSetting }, { id : 'Add Dashboard' ,text : getLabel('Add Dashboard'), handler : dashboardSetting}, { id : 'Edit Dashboard',text : getLabel('Edit Dashboard'), handler : dashboardSetting}, { id : 'Delete Dashboard',text : getLabel('Delete Dashboard'), handler : dashboardSetting}, { id : 'Cancel' , text : getLabel('Cancel'), handler : function(){ popup.hide(); } }, ] }); popup.show(); //popup.setPosition(1100,-26); //popup.setPosition(0,0); } /***********************Page Settings *************************/ function addPage(response, value){ if(response == "ok" && value){ var pageId=getNextSequenceId(); var tabs=Ext.getCmp('Tabs'); multiDash.addPage2dashboard(pageId, value); Ext.getCmp('menu').remove(tabs); tabs = new Ext.SegmentedButton({ id:'Tabs', sortable: true, ui:'light', listeners:{ /* tap:{ element:'el', fn:function (){ makeDashboardCarousel(tabs.getPressed().id); } }, */ toggle : function(container, button, pressed){ if (pressed == true) { makeDashboardCarousel(tabs.getPressed().id); } } } }); for (j=0; j<multiDash.dashObj[multiDash.defaultDashboard].pages.length; j++) { var page = multiDash.dashObj[multiDash.defaultDashboard].pages[j]; tabs.add({ id: page.id, text:page.name }); } Ext.getCmp('menu').add(tabs); Ext.getCmp('menu').doLayout(); tabs.setPressed(tabs.items.length-1); multiDash.setDefaultPage(pageId) } } function editPage(response, value){ if(response == "ok" && value){ var pageId=multiDash.getSelectedPageId(); if(value && pageId>0){ multiDash.renamePage(pageId, value); Ext.getCmp(pageId).setText(value); } } } function deletePage(response){ if(response == "yes"){ var pageId=multiDash.getSelectedPageId(); if(pageId>0){ var tabs=Ext.getCmp('Tabs'); tabs.remove(pageId); multiDash.removePageFromDashboard(pageId); if(panel.getComponent(carousel)){ panel.remove(carousel); console.log('Remove carousel'); } if(tabs.items.length) tabs.setPressed(tabs.items.length-1); } } } var pageSetting=function(){ if(this.id == "Add Page"){ Ext.Msg.prompt(getLabel('Page Settings:'),getLabel('Enter page name'), addPage); } else if(this.id == "Edit Page"){ if(multiDash.dashObj[multiDash.defaultDashboard] && multiDash.dashObj[multiDash.defaultDashboard].pages.length>0) Ext.Msg.prompt(getLabel('Page Settings:'), getLabel('Enter new page name for the current page.'), editPage); else Ext.Msg.alert(getLabel('Page Settings:'), getLabel('No page to edit ..'), Ext.emptyFn); } else if(this.id == "Delete Page"){ if(multiDash.dashObj[multiDash.defaultDashboard] && multiDash.dashObj[multiDash.defaultDashboard].pages.length>0) Ext.Msg.confirm(getLabel("Remove Report"), getLabel("Are you sure you want to remove the current page ?"), deletePage); else Ext.Msg.alert(getLabel('Page Settings:'),getLabel('No page to delete ..'), Ext.emptyFn); } popup.hide(); } /***********************Dashboard*************************/ function addDashboard(response, value){ if(response == "ok" && value){ var dashId = getNextSequenceId(); var dashList=Ext.getCmp('dashboardList'); multiDash.adddashboard(dashId, value, userId, userName); multiDash.setDefaultDash(dashId); var ActiveItem=dashList.setOptions([{text: value, value: multiDash.defaultDashboard}], true) dashList.fireEvent("change", dashList,multiDash.defaultDashboard,{dashProperty: multiDash}); dashList.setValue(multiDash.defaultDashboard); dashList.render(); } } function editDashboard(response, value){ if(response == "ok" && value){ multiDash.renameDashboard(multiDash.getSelectedDashId(), value); var dashList=Ext.getCmp('dashboardList'); dashList.options[multiDash.defaultDashboard]['data'].text=value; dashList.setOptions(dashList.options, false); dashList.fireEvent("change", dashList,multiDash.defaultDashboard,{dashProperty: multiDash}); dashList.setValue(multiDash.defaultDashboard); dashList.render(); } } function deleteDashboard(response){ if(response == "yes"){ var dashList=Ext.getCmp('dashboardList'); dashList.options.splice(multiDash.defaultDashboard,1); dashList.setOptions(dashList.options, false); multiDash.removeDashboard(multiDash.getSelectedDashId()); dashList.fireEvent("change", dashList,multiDash.defaultDashboard,{dashProperty: multiDash}); dashList.setValue(multiDash.defaultDashboard); dashList.render(); } } var dashboardSetting=function(){ if(this.id == "Add Dashboard"){ Ext.Msg.prompt(getLabel('Dashboard Settings:'), getLabel('Enter dashboard name'), addDashboard); } else if(this.id == "Edit Dashboard"){ if(multiDash.dashObj[multiDash.defaultDashboard]) Ext.Msg.prompt(getLabel('Dashboard Settings:'), getLabel('Enter new page name for the current dashboard')+':"'+multiDash.dashObj[multiDash.defaultDashboard].name+'"', editDashboard); else Ext.Msg.alert(getLabel('Dashboard Settings:'),getLabel('No dashboard to edit ..'), Ext.emptyFn); } else if(this.id == "Delete Dashboard"){ if(multiDash.dashObj[multiDash.defaultDashboard]) Ext.Msg.confirm(getLabel("Dashboard Settings:"), getLabel("Are you sure you want to remove the current dashboard ?"), deleteDashboard); else Ext.Msg.alert(getLabel('Dashboard Settings:'),getLabel('No dashboard to delete ..'), Ext.emptyFn); } popup.hide(); } function putLoadingImg(){ return '<img src=loading.gif><br>'+getLabel("Loading Data")+'.....</br></img>'; } } }); function clearGraphs(){ } function initDashboard(){ } function addMeasureColumn(){ }