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.

498 lines
12 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. ob_start();
  4. $UID = intval( $CUser->Data['id'] );
  5. $ACCESS = intval( $CUser->Data['access'] );
  6. if( $UID > 1 ){
  7. $Data['status']='na';
  8. $TY = intval( $_POST['TYP'] );
  9. $QS="SELECT * FROM system_props LIMIT 1";
  10. $RV = $DATABASE->Query( $QS );
  11. if( count( $RV ) ){
  12. $AP_DATA = $RV[0];
  13. if( $AP_DATA['hw_info'] == '' ) $AP_DATA['hw_info'] = 'MUST_DO_DETECTION';
  14. if( $AP_DATA['os_info'] == '' ) $AP_DATA['os_info'] = 'MUST_RESTART_SERVER';
  15. } else {
  16. $AP_DATA = array(
  17. 'anchor_lat'=>0,
  18. 'anchor_lon'=>0,
  19. 'anchor_alt'=>0,
  20. 'type'=>0,
  21. 'name'=>'INITIAL_SETUP_MODE',
  22. 'os_info'=>'MUST_RESTART_SERVER',
  23. 'hw_info'=>'MUST_DO_DETECTION'
  24. );
  25. };
  26. $QS="SELECT `site_id`, `version_string` FROM `servers` LIMIT 1";
  27. $RR = $DATABASE->Query( $QS );
  28. if( count( $RR ) ){
  29. $AP_DATA['site_id'] = intval( $RR[0]['site_id']);
  30. $AP_DATA['build'] = $RR[0]['version_string'];
  31. } else {
  32. $AP_DATA['site_id'] = 1;
  33. $AP_DATA['build'] = 'undefined-build';
  34. };
  35. switch( $TY ){
  36. case 0:{
  37. $Data['status']='ok';
  38. $QS = "SELECT `identity` FROM `servers` LIMIT 1";
  39. $TT = $DATABASE->Query( $QS );
  40. if( count( $TT ) ){
  41. $IDT = $TT[0]['identity'];
  42. } else {
  43. $IDT = "----No-Identity-Set---";
  44. };
  45. $Data['content']=<<<DATA_BOUNDARY
  46. [{
  47. xtype: 'spacer',
  48. height: 10
  49. },{
  50. xtype: 'panel',
  51. frame: false,
  52. border: true,
  53. bodyStyle: 'background-color: white;',
  54. html: '<center><img height=\"120px\" src=\"/style/assets/{$AP_DATA['oem_logo']}.png\"></center>',
  55. height: 130
  56. },{
  57. xtype: 'spacer',
  58. height: 10
  59. },{
  60. xtype: 'textfield',
  61. fieldLabel: "{$Labels->GetLabel( '_INSTANCE_ID_' )}",
  62. width: 300,
  63. value: '{$IDT}'
  64. },{
  65. xtype: 'spacer',
  66. height: 10
  67. },{
  68. xtype: 'button',
  69. text: "{$Labels->GetLabel( '_GEN_INSTANCE_ID_' )}",
  70. width: 550,
  71. handler: function(){
  72. doApplicationOperation( 3, 0 );
  73. }
  74. },{
  75. xtype: 'spacer',
  76. height: 10
  77. },{
  78. xtype: 'combo',
  79. fieldLabel: "{$Labels->GetLabel('_DEBUGGING_MODE_')}",
  80. editable: false,
  81. typeAhead: true,
  82. width: 300,
  83. triggerAction: 'all',
  84. lazyRender:true,
  85. mode: 'local',
  86. store: new Ext.data.ArrayStore({
  87. fields: ['sid', 'snam'],
  88. data: [[0,"{$Labels->GetLabel('__DISABLED__')}"], [1,"{$Labels->GetLabel('___ENABLED__')}"]]
  89. }),
  90. value: '{$AP_DATA['work_mode']}',
  91. valueField: 'sid',
  92. displayField: 'snam',
  93. listeners:{
  94. select: function( t, r, i ){
  95. doApplicationOperation( 1, i );
  96. }
  97. }
  98. },{
  99. xtype: 'spacer',
  100. height: 10
  101. },{
  102. xtype: 'combo',
  103. fieldLabel: "{$Labels->GetLabel('_USE_REMOTE_SERVER_')}",
  104. editable: false,
  105. typeAhead: true,
  106. width: 300,
  107. triggerAction: 'all',
  108. lazyRender:true,
  109. mode: 'local',
  110. store: new Ext.data.ArrayStore({
  111. fields: ['sid', 'snam'],
  112. data: [[0,"{$Labels->GetLabel('__DISABLED__')}"], [1,"{$Labels->GetLabel('___ENABLED__')}"]]
  113. }),
  114. value: '{$AP_DATA['use_remote_server']}',
  115. valueField: 'sid',
  116. displayField: 'snam',
  117. listeners:{
  118. select: function( t, r, i ){
  119. doApplicationOperation( 10, i );
  120. }
  121. }
  122. },{
  123. xtype: 'spacer',
  124. height: 10
  125. },{
  126. xtype: 'textfield',
  127. fieldLabel: "{$Labels->GetLabel('_REMOTE_SERVER_ADDRESS_')}",
  128. width: 300,
  129. value: '{$AP_DATA['remote_ip']}',
  130. listeners:{
  131. change: function( a, c, b ){
  132. doApplicationOperation( 8, c );
  133. }
  134. }
  135. },{
  136. xtype: 'spacer',
  137. height: 10
  138. },{
  139. xtype: 'numberfield',
  140. fieldLabel: "{$Labels->GetLabel('_REMOTE_SERVER_PORT_')}",
  141. width: 300,
  142. value: '{$AP_DATA['remote_port']}',
  143. listeners:{
  144. change: function( a, c, b ){
  145. doApplicationOperation( 9, c );
  146. }
  147. }
  148. },{
  149. xtype: 'spacer',
  150. height: 10
  151. },{
  152. xtype: 'textfield',
  153. fieldLabel: "{$Labels->GetLabel('_BACKUP_SERVER_ADDRESS_')}",
  154. width: 300,
  155. value: '{$AP_DATA['remote_backup_ip']}',
  156. listeners:{
  157. change: function( a, c, b ){
  158. doApplicationOperation( 12, c );
  159. }
  160. }
  161. },{
  162. xtype: 'spacer',
  163. height: 10
  164. },{
  165. xtype: 'numberfield',
  166. fieldLabel: "{$Labels->GetLabel('_BACKUP_SERVER_PORT_')}",
  167. width: 300,
  168. value: '{$AP_DATA['remote_backup_port']}',
  169. listeners:{
  170. change: function( a, c, b ){
  171. doApplicationOperation( 13, c );
  172. }
  173. }
  174. },{
  175. xtype: 'spacer',
  176. height: 10
  177. },{
  178. xtype: 'combo',
  179. fieldLabel: "{$Labels->GetLabel('_SKIP_LOCAL_REPORTS_')}",
  180. editable: false,
  181. typeAhead: true,
  182. width: 300,
  183. triggerAction: 'all',
  184. lazyRender:true,
  185. mode: 'local',
  186. store: new Ext.data.ArrayStore({
  187. fields: ['sid', 'snam'],
  188. data: [[0,"{$Labels->GetLabel('__DISABLED__')}"], [1,"{$Labels->GetLabel('___ENABLED__')}"]]
  189. }),
  190. value: '{$AP_DATA['skip_local_report']}',
  191. valueField: 'sid',
  192. displayField: 'snam',
  193. listeners:{
  194. select: function( t, r, i ){
  195. doApplicationOperation( 11, i );
  196. }
  197. }
  198. }]
  199. DATA_BOUNDARY;
  200. break;
  201. };
  202. case 1:{
  203. $Data['status']='ok';
  204. $Data['content']=<<<DATA_BOUNDARY
  205. [{
  206. columnWidth: 0.83,
  207. frame: false,
  208. border: false,
  209. title: false,
  210. items: [{
  211. xtype: 'panel',
  212. border: false,
  213. title: false,
  214. frame: false,
  215. id: 'sys_location_map',
  216. height: PanelH-170,
  217. html: '&nbsp;',
  218. listeners:{
  219. afterrender: function( t, state ){
  220. loadLocationEditor('sys_location_map');
  221. }
  222. }
  223. },{
  224. layout: 'table',
  225. title: "{$Labels->GetLabel('_SITE_PROP_LBL_')}",
  226. flex: 1,
  227. defaults: {
  228. bodyStyle:'padding:20px'
  229. },
  230. layoutConfig: {
  231. columns: 8,
  232. textAlign: 'center'
  233. },
  234. items:[{
  235. border: false,
  236. id: 'lab_123',
  237. html: "{$Labels->GetLabel('_SYS_ANCHORT_LBL_')} "+((MAP_IS_LOCAL)?'Pos X':"{$Labels->GetLabel('_LON_SHORT_LBL_')}")+':'
  238. },{
  239. xtype: 'numberfield',
  240. width: 100,
  241. decimalPrecision: 8,
  242. id: 'siteLon',
  243. value: SiteLon
  244. },{
  245. border: false,
  246. id: 'lab_124',
  247. html: ((MAP_IS_LOCAL)?'Pos Y':"{$Labels->GetLabel('_LAT_SHORT_LBL_')}")+':'
  248. },{
  249. xtype: 'numberfield',
  250. id: 'siteLat',
  251. decimalPrecision: 8,
  252. width: 100,
  253. value: SiteLat
  254. },{
  255. border: false,
  256. html: "{$Labels->GetLabel('_ALT_SHORT_LBL_')}:"
  257. },{
  258. xtype: 'numberfield',
  259. decimalPrecision: 2,
  260. width: 100,
  261. id: 'siteAlt',
  262. value: SiteAlt
  263. },{
  264. xtype: 'button',
  265. text: "{$Labels->GetLabel('_UPDATE_LBL_')}",
  266. handler: updateSiteAnchor
  267. },{
  268. xtype: 'panel',
  269. frame: false,
  270. border: false,
  271. rowspan: 2,
  272. html: ((MAP_IS_LOCAL)?'<img id="lab_125" height="64px" src="/style/assets/map_mode_decart.png">':'<img id="lab_125" height="64px" src="/style/assets/map_mode_wgs84.png">')
  273. },{
  274. border: false,
  275. html: "{$Labels->GetLabel('_MAP_TYP_LBL_')}:"
  276. },{
  277. xtype: 'combo',
  278. disabled: false,
  279. typeAhead: true,
  280. triggerAction: 'all',
  281. id: 'siteMap',
  282. lazyRender:true,
  283. colspan: 3,
  284. mode: 'local',
  285. store: mapListStore,
  286. value: MAP_ID,
  287. valueField: 'map_id',
  288. displayField: 'map_name',
  289. listeners:{
  290. select: function(){
  291. updateSiteMap();
  292. LoadNodesList();
  293. }
  294. }
  295. },{
  296. xtype: 'button',
  297. disabled: false,
  298. text: "{$Labels->GetLabel('_DELETE_')}",
  299. handler: function(){
  300. deleteCurrentMap();
  301. }
  302. },{
  303. xtype: 'button',
  304. id: 'add-c_map-btn',
  305. disabled: false,
  306. text: "{$Labels->GetLabel('_CREATE_NEW_LBL_')}",
  307. handler: function(){
  308. createNewMap();
  309. }
  310. }]
  311. }]
  312. },{
  313. frame: true,
  314. border: false,
  315. xtype: 'panel',
  316. flex: 1,
  317. height: PanelH,
  318. columnWidth: 0.17,
  319. layout: 'fit',
  320. id: 'prop_content',
  321. items:[{
  322. html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>"
  323. }]
  324. }]
  325. DATA_BOUNDARY;
  326. break;
  327. };
  328. case 4:{
  329. $Data['status']='ok';
  330. $Data['content']=<<<DATA_BOUNDARY
  331. [{
  332. xtype: 'spacer',
  333. height: 10
  334. },{
  335. xtype: 'combo',
  336. fieldLabel: "{$Labels->GetLabel('_MULTYDIS_ENA_')}",
  337. editable: false,
  338. typeAhead: true,
  339. width: 300,
  340. triggerAction: 'all',
  341. lazyRender:true,
  342. mode: 'local',
  343. disabled: true,
  344. store: new Ext.data.ArrayStore({
  345. fields: ['sid', 'snam'],
  346. data: [[0,"{$Labels->GetLabel('__DISABLED__')}"], [1,"{$Labels->GetLabel('___ENABLED__')}"]]
  347. }),
  348. value: '{$AP_DATA['skip_local_report']}',
  349. valueField: 'sid',
  350. displayField: 'snam',
  351. listeners:{
  352. select: function( t, r, i ){
  353. if( i ){
  354. showMultyLayoutEditor();
  355. };
  356. //doApplicationOperation( 11, i );
  357. }
  358. }
  359. },{
  360. xtype: 'spacer',
  361. height: 10
  362. },{
  363. xtype: 'panel',
  364. layout: 'fit',
  365. height: PanelH - 190,
  366. id: 'mui_editor',
  367. border: true,
  368. frame: false,
  369. disabled: true,
  370. items:[{
  371. xtype:'portal',
  372. region:'center',
  373. margins:'35 5 5 0',
  374. items:[{
  375. columnWidth:.33,
  376. style:'padding:10px 0 10px 10px',
  377. items:[/*{
  378. title: 'Grid in a Portlet',
  379. layout:'fit',
  380. rowspan: 2,
  381. tools: [{
  382. id:'gear',
  383. handler: function(){
  384. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  385. }
  386. },{
  387. id:'close',
  388. handler: function(e, target, panel){
  389. panel.ownerCt.remove(panel, true);
  390. }
  391. }],
  392. html: 'chucha'
  393. },{
  394. title: 'Another Panel 1',
  395. tools: [{
  396. id:'gear',
  397. handler: function(){
  398. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  399. }
  400. },{
  401. id:'close',
  402. handler: function(e, target, panel){
  403. panel.ownerCt.remove(panel, true);
  404. }
  405. }],
  406. html: 'chucha'
  407. }]
  408. },{
  409. columnWidth:.33,
  410. style:'padding:10px 0 10px 10px',
  411. items:[{
  412. title: 'Panel 2',
  413. tools: [{
  414. id:'gear',
  415. handler: function(){
  416. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  417. }
  418. },{
  419. id:'close',
  420. handler: function(e, target, panel){
  421. panel.ownerCt.remove(panel, true);
  422. }
  423. }],
  424. html: 'chucha'
  425. },{
  426. title: 'Another Panel 2',
  427. tools: [{
  428. id:'gear',
  429. handler: function(){
  430. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  431. }
  432. },{
  433. id:'close',
  434. handler: function(e, target, panel){
  435. panel.ownerCt.remove(panel, true);
  436. }
  437. }],
  438. html: 'chucha'
  439. }]
  440. },{
  441. columnWidth:.33,
  442. style:'padding:10px',
  443. items:[{
  444. title: 'Panel 3',
  445. tools: [{
  446. id:'gear',
  447. handler: function(){
  448. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  449. }
  450. },{
  451. id:'close',
  452. handler: function(e, target, panel){
  453. panel.ownerCt.remove(panel, true);
  454. }
  455. }],
  456. html: 'chucha'
  457. },{
  458. title: 'Another Panel 3',
  459. colspan: 2,
  460. tools: [{
  461. id:'gear',
  462. handler: function(){
  463. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  464. }
  465. },{
  466. id:'close',
  467. handler: function(e, target, panel){
  468. panel.ownerCt.remove(panel, true);
  469. }
  470. }],
  471. html: 'chucha'
  472. }*/]
  473. }]
  474. /*
  475. * Uncomment this block to test handling of the drop event. You could use this
  476. * to save portlet position state for example. The event arg e is the custom
  477. * event defined in Ext.ux.Portal.DropZone.
  478. */
  479. // ,listeners: {
  480. // 'drop': function(e){
  481. // Ext.Msg.alert('Portlet Dropped', e.panel.title + '<br />Column: ' +
  482. // e.columnIndex + '<br />Position: ' + e.position);
  483. // }
  484. // }
  485. }]
  486. }]
  487. DATA_BOUNDARY;
  488. break;
  489. };
  490. };
  491. $Data['messages'] = ob_get_clean();
  492. echo json_encode( $Data );
  493. } else {
  494. header('location: /');
  495. };
  496. ?>