Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

409 lines
11 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * Ext JS Library 3.3.1
  3. * Copyright(c) 2006-2010 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. //
  8. // Note that these are all defined as panel configs, rather than instantiated
  9. // as panel objects. You could just as easily do this instead:
  10. //
  11. // var absolute = new Ext.Panel({ ... });
  12. //
  13. // However, by passing configs into the main container instead of objects, we can defer
  14. // layout AND object instantiation until absolutely needed. Since most of these panels
  15. // won't be shown by default until requested, this will save us some processing
  16. // time up front when initially rendering the page.
  17. //
  18. // Since all of these configs are being added into a layout container, they are
  19. // automatically assumed to be panel configs, and so the xtype of 'panel' is
  20. // implicit. To define a config of some other type of component to be added into
  21. // the layout, simply provide the appropriate xtype config explicitly.
  22. //
  23. /*
  24. * ================ Start page config =======================
  25. */
  26. // The default start page, also a simple example of a FitLayout.
  27. var start = {
  28. id: 'start-panel',
  29. title: 'Start Page',
  30. layout: 'fit',
  31. bodyStyle: 'padding:25px',
  32. contentEl: 'start-div' // pull existing content from the page
  33. };
  34. /*
  35. * ================ AbsoluteLayout config =======================
  36. */
  37. var absolute = {
  38. id: 'absolute-panel',
  39. title: 'Absolute Layout',
  40. layout: 'absolute',
  41. defaults: {
  42. bodyStyle: 'padding:15px;',
  43. width: 200,
  44. height: 100,
  45. frame: true
  46. },
  47. items:[{
  48. title: 'Panel 1',
  49. x: 50,
  50. y: 50,
  51. html: 'Positioned at x:50, y:50'
  52. },{
  53. title: 'Panel 2',
  54. x: 125,
  55. y: 125,
  56. html: 'Positioned at x:125, y:125'
  57. }]
  58. };
  59. /*
  60. * ================ AccordionLayout config =======================
  61. */
  62. var accordion = {
  63. id: 'accordion-panel',
  64. title: 'Accordion Layout',
  65. layout: 'accordion',
  66. bodyBorder: false, // useful for accordion containers since the inner panels have borders already
  67. bodyStyle: 'background-color:#DFE8F6', // if all accordion panels are collapsed, this looks better in this layout
  68. defaults: {bodyStyle: 'padding:15px'},
  69. items: [{
  70. title: 'Introduction',
  71. tools: [{id:'gear'},{id:'refresh'}],
  72. html: '<p>Here is some accordion content. Click on one of the other bars below for more.</p>'
  73. },{
  74. title: 'Basic Content',
  75. html: '<br /><p>More content. Open the third panel for a customized look and feel example.</p>',
  76. items: {
  77. xtype: 'button',
  78. text: 'Show Next Panel',
  79. handler: function(){
  80. Ext.getCmp('acc-custom').expand(true);
  81. }
  82. }
  83. },{
  84. id: 'acc-custom',
  85. title: 'Custom Panel Look and Feel',
  86. cls: 'custom-accordion', // look in layout-browser.css to see the CSS rules for this class
  87. html: '<p>Here is an example of how easy it is to completely customize the look and feel of an individual panel simply by adding a CSS class in the config.</p>'
  88. }]
  89. };
  90. /*
  91. * ================ AnchorLayout config =======================
  92. */
  93. var anchor = {
  94. id:'anchor-panel',
  95. title: 'Anchor Layout',
  96. layout:'anchor',
  97. defaults: {bodyStyle: 'padding:15px'},
  98. items: [{
  99. title: 'Panel 1',
  100. height: 100,
  101. anchor: '50%',
  102. html: '<p>Width = 50% of the container</p>'
  103. },{
  104. title: 'Panel 2',
  105. height: 100,
  106. anchor: '-100',
  107. html: '<p>Width = container width - 100 pixels</p>'
  108. },{
  109. title: 'Panel 3',
  110. anchor: '-10, -262',
  111. html: '<p>Width = container width - 10 pixels</p><p>Height = container height - 262 pixels</p>'
  112. }]
  113. };
  114. /*
  115. * ================ BorderLayout config =======================
  116. */
  117. var border = {
  118. id:'border-panel',
  119. title: 'Border Layout',
  120. layout: 'border',
  121. bodyBorder: false,
  122. defaults: {
  123. collapsible: true,
  124. split: true,
  125. animFloat: false,
  126. autoHide: false,
  127. useSplitTips: true,
  128. bodyStyle: 'padding:15px'
  129. },
  130. items: [{
  131. title: 'Footer',
  132. region: 'south',
  133. height: 150,
  134. minSize: 75,
  135. maxSize: 250,
  136. cmargins: '5 0 0 0',
  137. html: '<p>Footer content</p>'
  138. },{
  139. title: 'Navigation',
  140. region:'west',
  141. floatable: false,
  142. margins: '5 0 0 0',
  143. cmargins: '5 5 0 0',
  144. width: 175,
  145. minSize: 100,
  146. maxSize: 250,
  147. html: '<p>Secondary content like navigation links could go here</p>'
  148. },{
  149. title: 'Main Content',
  150. collapsible: false,
  151. region: 'center',
  152. margins: '5 0 0 0',
  153. html: '<h1>Main Page</h1><p>This is where the main content would go</p>'
  154. }]
  155. };
  156. /*
  157. * ================ CardLayout config (TabPanel) =======================
  158. */
  159. // Note that the TabPanel component uses an internal CardLayout -- it is not
  160. // something you have to explicitly configure. However, it is still a perfect
  161. // example of how this layout style can be used in a complex component.
  162. var cardTabs = {
  163. xtype: 'tabpanel',
  164. id: 'card-tabs-panel',
  165. plain: true, //remove the header border
  166. activeTab: 0,
  167. defaults: {bodyStyle: 'padding:15px'},
  168. items:[{
  169. title: 'Tab 1',
  170. html: 'This is tab 1 content.'
  171. },{
  172. title: 'Tab 2',
  173. html: 'This is tab 2 content.'
  174. },{
  175. title: 'Tab 3',
  176. html: 'This is tab 3 content.'
  177. }]
  178. };
  179. // This is a fake CardLayout navigation function. A real implementation would
  180. // likely be more sophisticated, with logic to validate navigation flow. It will
  181. // be assigned next as the handling function for the buttons in the CardLayout example.
  182. var cardNav = function(incr){
  183. var l = Ext.getCmp('card-wizard-panel').getLayout();
  184. var i = l.activeItem.id.split('card-')[1];
  185. var next = parseInt(i, 10) + incr;
  186. l.setActiveItem(next);
  187. Ext.getCmp('card-prev').setDisabled(next==0);
  188. Ext.getCmp('card-next').setDisabled(next==2);
  189. };
  190. /*
  191. * ================ CardLayout config (Wizard) =======================
  192. */
  193. var cardWizard = {
  194. id:'card-wizard-panel',
  195. title: 'Card Layout (Wizard)',
  196. layout:'card',
  197. activeItem: 0,
  198. bodyStyle: 'padding:15px',
  199. defaults: {border:false},
  200. bbar: ['->', {
  201. id: 'card-prev',
  202. text: '&laquo; Previous',
  203. handler: cardNav.createDelegate(this, [-1]),
  204. disabled: true
  205. },{
  206. id: 'card-next',
  207. text: 'Next &raquo;',
  208. handler: cardNav.createDelegate(this, [1])
  209. }],
  210. items: [{
  211. id: 'card-0',
  212. html: '<h1>Welcome to the Demo Wizard!</h1><p>Step 1 of 3</p><p>Please click the "Next" button to continue...</p>'
  213. },{
  214. id: 'card-1',
  215. html: '<p>Step 2 of 3</p><p>Almost there. Please click the "Next" button to continue...</p>'
  216. },{
  217. id: 'card-2',
  218. html: '<h1>Congratulations!</h1><p>Step 3 of 3 - Complete</p>'
  219. }]
  220. };
  221. /*
  222. * ================ ColumnLayout config =======================
  223. */
  224. var column = {
  225. id:'column-panel',
  226. title: 'Column Layout',
  227. layout: 'column',
  228. bodyStyle: 'padding:5px',
  229. defaults: {bodyStyle:'padding:15px'},
  230. items: [{
  231. title: 'Width = 0.25',
  232. columnWidth: 0.25,
  233. html: '<p>This is some short content.</p>'
  234. },{
  235. title: 'Width = 0.75',
  236. columnWidth: 0.75,
  237. html: '<p>This is some longer content.</p><p>This is some longer content.</p><p>This is some longer content.</p><p>This is some longer content.</p><p>This is some longer content.</p><p>This is some longer content.</p>'
  238. },{
  239. title: 'Width = 250px',
  240. width: 250,
  241. html: 'Not much here!'
  242. }]
  243. };
  244. /*
  245. * ================ FitLayout config =======================
  246. */
  247. var fit = {
  248. id: 'fit-panel',
  249. title: 'Fit Layout',
  250. layout: 'fit',
  251. items: {
  252. title: 'Inner Panel',
  253. html: '<p>This panel is fit within its container.</p>',
  254. bodyStyle: 'margin:15px',
  255. border: false
  256. }
  257. };
  258. /*
  259. * ================ FormLayout config =======================
  260. */
  261. // NOTE: While you can create a basic Panel with layout:'form', practically
  262. // you should usually use a FormPanel to also get its form-specific functionality.
  263. // Note that the layout config is not required on FormPanels.
  264. var form = {
  265. xtype: 'form', // since we are not using the default 'panel' xtype, we must specify it
  266. id: 'form-panel',
  267. labelWidth: 75,
  268. title: 'Form Layout',
  269. bodyStyle: 'padding:15px',
  270. width: 350,
  271. labelPad: 20,
  272. layoutConfig: {
  273. labelSeparator: ''
  274. },
  275. defaults: {
  276. width: 230,
  277. msgTarget: 'side'
  278. },
  279. defaultType: 'textfield',
  280. items: [{
  281. fieldLabel: 'First Name',
  282. name: 'first',
  283. allowBlank:false
  284. },{
  285. fieldLabel: 'Last Name',
  286. name: 'last'
  287. },{
  288. fieldLabel: 'Company',
  289. name: 'company'
  290. },{
  291. fieldLabel: 'Email',
  292. name: 'email',
  293. vtype:'email'
  294. }
  295. ],
  296. buttons: [{text: 'Save'},{text: 'Cancel'}]
  297. };
  298. /*
  299. * ================ TableLayout config =======================
  300. */
  301. var table = {
  302. id: 'table-panel',
  303. title: 'Table Layout',
  304. layout: 'table',
  305. layoutConfig: {
  306. columns: 4
  307. },
  308. defaults: {
  309. bodyStyle:'padding:15px 20px'
  310. },
  311. items: [{
  312. title: 'Lots of Spanning',
  313. html: '<p>Row spanning.</p><br /><p>Row spanning.</p><br /><p>Row spanning.</p><br /><p>Row spanning.</p><br /><p>Row spanning.</p><br /><p>Row spanning.</p>',
  314. rowspan: 3
  315. },{
  316. title: 'Basic Table Cell',
  317. html: '<p>Basic panel in a table cell.</p>',
  318. cellId: 'basic-cell',
  319. cellCls: 'custom-cls'
  320. },{
  321. html: '<p>Plain panel</p>'
  322. },{
  323. title: 'Another Cell',
  324. html: '<p>Row spanning.</p><br /><p>Row spanning.</p><br /><p>Row spanning.</p><br /><p>Row spanning.</p>',
  325. width: 300,
  326. rowspan: 2
  327. },{
  328. html: 'Plain cell spanning two columns',
  329. colspan: 2
  330. },{
  331. title: 'More Column Spanning',
  332. html: '<p>Spanning three columns.</p>',
  333. colspan: 3
  334. },{
  335. title: 'Spanning All Columns',
  336. html: '<p>Spanning all columns.</p>',
  337. colspan: 4
  338. }]
  339. };
  340. /*
  341. * ================ VBoxLayout config =======================
  342. */
  343. var vbox = {
  344. id: 'vbox-panel',
  345. title: 'vBox Layout',
  346. layout: {
  347. type: 'vbox',
  348. pack: 'start',
  349. align: 'stretch'
  350. },
  351. defaults: {
  352. frame: true
  353. },
  354. items: [{
  355. title: 'Panel 1',
  356. flex: 1,
  357. html: 'flex : 1'
  358. }, {
  359. title: 'Panel 2',
  360. height: 100,
  361. html: 'height: 100'
  362. }, {
  363. title: 'Panel 3',
  364. flex: 2,
  365. html: 'flex : 2'
  366. }]
  367. };
  368. /*
  369. * ================ HBoxLayout config =======================
  370. */
  371. var hbox = {
  372. id: 'hbox-panel',
  373. title: 'hBox Layout',
  374. layout: {
  375. type: 'hbox',
  376. pack: 'start',
  377. align: 'stretch'
  378. },
  379. defaults: {
  380. frame: true
  381. },
  382. items: [{
  383. title: 'Panel 1',
  384. flex: 1,
  385. html: 'flex : 1'
  386. }, {
  387. title: 'Panel 2',
  388. width: 100,
  389. html: 'width : 100'
  390. }, {
  391. title: 'Panel 3',
  392. flex: 2,
  393. html: 'flex : 2'
  394. }]
  395. };