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.

494 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. items: [{
  210. xtype: 'panel',
  211. id: 'sys_location_map',
  212. height: PanelH-170,
  213. html: '&nbsp;',
  214. listeners:{
  215. afterrender: function( t, state ){
  216. loadLocationEditor('sys_location_map');
  217. }
  218. }
  219. },{
  220. layout: 'table',
  221. title: "{$Labels->GetLabel('_SITE_PROP_LBL_')}",
  222. flex: 1,
  223. defaults: {
  224. bodyStyle:'padding:20px'
  225. },
  226. layoutConfig: {
  227. columns: 8,
  228. textAlign: 'center'
  229. },
  230. items:[{
  231. border: false,
  232. id: 'lab_123',
  233. html: "{$Labels->GetLabel('_SYS_ANCHORT_LBL_')} "+((MAP_IS_LOCAL)?'Pos X':"{$Labels->GetLabel('_LON_SHORT_LBL_')}")+':'
  234. },{
  235. xtype: 'numberfield',
  236. width: 100,
  237. decimalPrecision: 8,
  238. id: 'siteLon',
  239. value: SiteLon
  240. },{
  241. border: false,
  242. id: 'lab_124',
  243. html: ((MAP_IS_LOCAL)?'Pos Y':"{$Labels->GetLabel('_LAT_SHORT_LBL_')}")+':'
  244. },{
  245. xtype: 'numberfield',
  246. id: 'siteLat',
  247. decimalPrecision: 8,
  248. width: 100,
  249. value: SiteLat
  250. },{
  251. border: false,
  252. html: "{$Labels->GetLabel('_ALT_SHORT_LBL_')}:"
  253. },{
  254. xtype: 'numberfield',
  255. decimalPrecision: 2,
  256. width: 100,
  257. id: 'siteAlt',
  258. value: SiteAlt
  259. },{
  260. xtype: 'button',
  261. text: "{$Labels->GetLabel('_UPDATE_LBL_')}",
  262. handler: updateSiteAnchor
  263. },{
  264. xtype: 'panel',
  265. frame: false,
  266. border: false,
  267. rowspan: 2,
  268. 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">')
  269. },{
  270. border: false,
  271. html: "{$Labels->GetLabel('_MAP_TYP_LBL_')}:"
  272. },{
  273. xtype: 'combo',
  274. disabled: false,
  275. typeAhead: true,
  276. triggerAction: 'all',
  277. id: 'siteMap',
  278. lazyRender:true,
  279. colspan: 3,
  280. mode: 'local',
  281. store: mapListStore,
  282. value: MAP_ID,
  283. valueField: 'map_id',
  284. displayField: 'map_name',
  285. listeners:{
  286. select: function(){
  287. updateSiteMap();
  288. LoadNodesList();
  289. }
  290. }
  291. },{
  292. xtype: 'button',
  293. disabled: false,
  294. text: "{$Labels->GetLabel('_DELETE_')}",
  295. handler: function(){
  296. deleteCurrentMap();
  297. }
  298. },{
  299. xtype: 'button',
  300. id: 'add-c_map-btn',
  301. disabled: false,
  302. text: "{$Labels->GetLabel('_CREATE_NEW_LBL_')}",
  303. handler: function(){
  304. createNewMap();
  305. }
  306. }]
  307. }]
  308. },{
  309. frame: true,
  310. border: false,
  311. xtype: 'panel',
  312. flex: 1,
  313. height: PanelH,
  314. columnWidth: 0.17,
  315. layout: 'fit',
  316. id: 'prop_content',
  317. items:[{
  318. html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>"
  319. }]
  320. }]
  321. DATA_BOUNDARY;
  322. break;
  323. };
  324. case 4:{
  325. $Data['status']='ok';
  326. $Data['content']=<<<DATA_BOUNDARY
  327. [{
  328. xtype: 'spacer',
  329. height: 10
  330. },{
  331. xtype: 'combo',
  332. fieldLabel: "{$Labels->GetLabel('_MULTYDIS_ENA_')}",
  333. editable: false,
  334. typeAhead: true,
  335. width: 300,
  336. triggerAction: 'all',
  337. lazyRender:true,
  338. mode: 'local',
  339. disabled: true,
  340. store: new Ext.data.ArrayStore({
  341. fields: ['sid', 'snam'],
  342. data: [[0,"{$Labels->GetLabel('__DISABLED__')}"], [1,"{$Labels->GetLabel('___ENABLED__')}"]]
  343. }),
  344. value: '{$AP_DATA['skip_local_report']}',
  345. valueField: 'sid',
  346. displayField: 'snam',
  347. listeners:{
  348. select: function( t, r, i ){
  349. if( i ){
  350. showMultyLayoutEditor();
  351. };
  352. //doApplicationOperation( 11, i );
  353. }
  354. }
  355. },{
  356. xtype: 'spacer',
  357. height: 10
  358. },{
  359. xtype: 'panel',
  360. layout: 'fit',
  361. height: PanelH - 190,
  362. id: 'mui_editor',
  363. border: true,
  364. frame: false,
  365. disabled: true,
  366. items:[{
  367. xtype:'portal',
  368. region:'center',
  369. margins:'35 5 5 0',
  370. items:[{
  371. columnWidth:.33,
  372. style:'padding:10px 0 10px 10px',
  373. items:[/*{
  374. title: 'Grid in a Portlet',
  375. layout:'fit',
  376. rowspan: 2,
  377. tools: [{
  378. id:'gear',
  379. handler: function(){
  380. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  381. }
  382. },{
  383. id:'close',
  384. handler: function(e, target, panel){
  385. panel.ownerCt.remove(panel, true);
  386. }
  387. }],
  388. html: 'chucha'
  389. },{
  390. title: 'Another Panel 1',
  391. tools: [{
  392. id:'gear',
  393. handler: function(){
  394. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  395. }
  396. },{
  397. id:'close',
  398. handler: function(e, target, panel){
  399. panel.ownerCt.remove(panel, true);
  400. }
  401. }],
  402. html: 'chucha'
  403. }]
  404. },{
  405. columnWidth:.33,
  406. style:'padding:10px 0 10px 10px',
  407. items:[{
  408. title: 'Panel 2',
  409. tools: [{
  410. id:'gear',
  411. handler: function(){
  412. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  413. }
  414. },{
  415. id:'close',
  416. handler: function(e, target, panel){
  417. panel.ownerCt.remove(panel, true);
  418. }
  419. }],
  420. html: 'chucha'
  421. },{
  422. title: 'Another Panel 2',
  423. tools: [{
  424. id:'gear',
  425. handler: function(){
  426. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  427. }
  428. },{
  429. id:'close',
  430. handler: function(e, target, panel){
  431. panel.ownerCt.remove(panel, true);
  432. }
  433. }],
  434. html: 'chucha'
  435. }]
  436. },{
  437. columnWidth:.33,
  438. style:'padding:10px',
  439. items:[{
  440. title: 'Panel 3',
  441. tools: [{
  442. id:'gear',
  443. handler: function(){
  444. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  445. }
  446. },{
  447. id:'close',
  448. handler: function(e, target, panel){
  449. panel.ownerCt.remove(panel, true);
  450. }
  451. }],
  452. html: 'chucha'
  453. },{
  454. title: 'Another Panel 3',
  455. colspan: 2,
  456. tools: [{
  457. id:'gear',
  458. handler: function(){
  459. Ext.Msg.alert('Message', 'The Settings tool was clicked.');
  460. }
  461. },{
  462. id:'close',
  463. handler: function(e, target, panel){
  464. panel.ownerCt.remove(panel, true);
  465. }
  466. }],
  467. html: 'chucha'
  468. }*/]
  469. }]
  470. /*
  471. * Uncomment this block to test handling of the drop event. You could use this
  472. * to save portlet position state for example. The event arg e is the custom
  473. * event defined in Ext.ux.Portal.DropZone.
  474. */
  475. // ,listeners: {
  476. // 'drop': function(e){
  477. // Ext.Msg.alert('Portlet Dropped', e.panel.title + '<br />Column: ' +
  478. // e.columnIndex + '<br />Position: ' + e.position);
  479. // }
  480. // }
  481. }]
  482. }]
  483. DATA_BOUNDARY;
  484. break;
  485. };
  486. };
  487. $Data['messages'] = ob_get_clean();
  488. echo json_encode( $Data );
  489. } else {
  490. header('location: /');
  491. };
  492. ?>