Web UI for ARGUS server
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.

712 lines
19 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
6 years ago
​
6 years ago
​
​
​
​
​
​
​
6 years ago
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var selectedSite = <?=$SiteID;?>;
  3. var SettingsLidar3D = null;
  4. var SelectedNodeID = 0;
  5. function loadSettingsLidar3D( NodeID, Master ){
  6. SelectedNodeID = NodeID;
  7. Ext.Ajax.request({
  8. url: '/lib/controller/getSettingsLidsr3D.php',
  9. params: {
  10. NID: NodeID,
  11. MST: ((Master)?1:0),
  12. UID: <?=$UserID;?>,
  13. SID: '<?=$Session;?>',
  14. },
  15. success: function( response, opts ){
  16. // If the response is JSON, you have to decode it
  17. var data = Ext.decode(response.responseText);
  18. Ext.getCmp('setting_master_ip').setValue( data.ip_address );
  19. Ext.getCmp('setting_master_port').setValue( data.port );
  20. Ext.getCmp('setting_slave_ip').setValue( data.aux_ip_address );
  21. Ext.getCmp('setting_slave_port').setValue( data.aux_port );
  22. Ext.getCmp('setting_lat').setValue( data.lat );
  23. Ext.getCmp('setting_lon').setValue( data.lon );
  24. Ext.getCmp('setting_alt').setValue( data.alt );
  25. Ext.getCmp('setting_roll').setValue( data.roll );
  26. Ext.getCmp('setting_pitch').setValue( data.pitch );
  27. Ext.getCmp('setting_yaw').setValue( data.yaw );
  28. },
  29. failure: function( response, opts ) {
  30. //Ext.fly('some_div').update('Fail!');
  31. }/*,
  32. callback: function(options,success,response){
  33. // use this if you need to perform your own success/failure checking
  34. }*/
  35. });
  36. };
  37. function SaveSettingsLidar3D( ){
  38. if( SelectedNodeID == 0 ) return;
  39. t1 = Ext.getCmp('setting_master_ip').getValue();
  40. t2 = Ext.getCmp('setting_master_port').getValue();
  41. t3 = Ext.getCmp('setting_slave_ip').getValue();
  42. t4 = Ext.getCmp('setting_slave_port').getValue();
  43. t5 = Ext.getCmp('setting_lat').getValue();
  44. t6 = Ext.getCmp('setting_lon').getValue();
  45. t7 = Ext.getCmp('setting_alt').getValue();
  46. t8 = Ext.getCmp('setting_roll').getValue();
  47. t9 = Ext.getCmp('setting_pitch').getValue();
  48. t10 = Ext.getCmp('setting_yaw').getValue();
  49. Ext.Ajax.request({
  50. url: '/lib/controller/setSettingsLidsr3D.php',
  51. params: {
  52. NID: SelectedNodeID,
  53. UID: <?=$UserID;?>,
  54. SID: '<?=$Session;?>',
  55. MIP: t1,
  56. MPP: t2,
  57. SIP: t3,
  58. SPP: t4,
  59. LAT: t5,
  60. LON: t6,
  61. ALT: t7,
  62. ROL: t8,
  63. PCH: t9,
  64. YAW: t10
  65. },
  66. success: function( response, opts ){
  67. // If the response is JSON, you have to decode it
  68. var data = Ext.decode(response.responseText);
  69. if( data.success == true ) {
  70. Ext.Msg.show({
  71. title:'Info Message',
  72. msg: 'Settings are sucessfully saved.',
  73. buttons: Ext.Msg.OK,//YESNOCANCEL,
  74. fn: function(){
  75. SettingsLidar3D.hide();
  76. },
  77. //animEl: 'elId',
  78. icon: Ext.MessageBox.INFO //QUESTION
  79. });
  80. } else {
  81. Ext.Msg.show({
  82. title:'Error Message',
  83. msg: data['error'],
  84. buttons: Ext.Msg.OK,//YESNOCANCEL,
  85. fn: function(){
  86. SettingsLidar3D.hide();
  87. },
  88. //animEl: 'elId',
  89. icon: Ext.MessageBox.ERROR //QUESTION
  90. });
  91. };
  92. },
  93. failure: function( response, opts ) {
  94. //Ext.fly('some_div').update('Fail!');
  95. }/*,
  96. callback: function(options,success,response){
  97. // use this if you need to perform your own success/failure checking
  98. }*/
  99. });
  100. };
  101. function editSettingsLidar3D( NodeID, Master ){
  102. if( SettingsLidar3D == null ){
  103. SettingsLidar3D = new Ext.Window({
  104. modal: true,
  105. title: '<?=$Labels->GetLabel("_EDIT_LRF3D_SETTINGS_");?>',
  106. width: 773,
  107. height: 600,
  108. layout: 'fit',
  109. closeAction: 'hide',
  110. listeners:{
  111. beforehide : function(){
  112. Ext.getCmp('connectstarterbutton').toggle( false, false );
  113. }
  114. },
  115. items:[{
  116. layout: 'table',
  117. border: false,
  118. defaults: {
  119. // applied to each contained panel
  120. bodyStyle:'padding-top:10px;padding-left:20px;padding-right:20px;padding-bottom:10px;'
  121. },
  122. layoutConfig: {
  123. // The total column count must be specified here
  124. columns: 4
  125. },
  126. items: [{
  127. border: false,
  128. html: 'Master IP Address:'
  129. },{
  130. xtype: 'textfield',
  131. id: 'setting_master_ip',
  132. width: '70%'
  133. },{
  134. border: false,
  135. html: 'Port:'
  136. },{
  137. xtype: 'textfield',
  138. id: 'setting_master_port',
  139. width: '30%'
  140. },{
  141. border: false,
  142. html: 'Slave IP Address:'
  143. },{
  144. xtype: 'textfield',
  145. id: 'setting_slave_ip',
  146. width: '70%'
  147. },{
  148. border: false,
  149. html: 'Port:'
  150. },{
  151. xtype: 'textfield',
  152. id: 'setting_slave_port',
  153. width: '30%'
  154. },{
  155. border: false,
  156. html: 'Position Lat/Lon/Alt:'
  157. },{
  158. xtype: 'textfield',
  159. id: 'setting_lat',
  160. width: '30%'
  161. },{
  162. xtype: 'textfield',
  163. id: 'setting_lon',
  164. width: '30%'
  165. },{
  166. xtype: 'textfield',
  167. id: 'setting_alt',
  168. width: '30%'
  169. },{
  170. border: false,
  171. html: 'Orientation Roll/Pitch/Yaw:'
  172. },{
  173. xtype: 'textfield',
  174. id: 'setting_roll',
  175. width: '30%'
  176. },{
  177. xtype: 'textfield',
  178. id: 'setting_pitch',
  179. width: '30%'
  180. },{
  181. xtype: 'textfield',
  182. id: 'setting_yaw',
  183. width: '30%'
  184. }]
  185. }],
  186. bbar: [{
  187. text: '<?=$Labels->GetLabel("_CANCEL_");?>',
  188. handler: function(){
  189. SettingsLidar3D.hide();
  190. }
  191. },{
  192. text: '<?=$Labels->GetLabel("_SAVE_");?>',
  193. handler: SaveSettingsLidar3D
  194. }]
  195. });
  196. };
  197. SettingsLidar3D.show();
  198. loadSettingsLidar3D( NodeID, Master );
  199. };
  200. function reloadNetworkData(){
  201. Ext.Ajax.request({
  202. url: '/lib/controller/getNetwork.php',
  203. params: {
  204. NID: <?=$SiteID;?>,
  205. UID: <?=$UserID;?>,
  206. SID: '<?=$Session;?>',
  207. },
  208. success: function( response, opts ){
  209. // If the response is JSON, you have to decode it
  210. var data = Ext.decode(response.responseText);
  211. netwodkData.nodes = new vis.DataSet( data.nodes );
  212. netwodkData.edges = new vis.DataSet( data.edges );
  213. networkObj.setData( netwodkData );
  214. networkObj.redraw();
  215. },
  216. failure: function( response, opts ) {
  217. //Ext.fly('some_div').update('Fail!');
  218. }/*,
  219. callback: function(options,success,response){
  220. // use this if you need to perform your own success/failure checking
  221. }*/
  222. });
  223. };
  224. function createNode( STYPE ){
  225. Ext.Ajax.request({
  226. url: '/lib/controller/addNetworkNode.php',
  227. params: {
  228. NID: <?=$SiteID;?>,
  229. UID: <?=$UserID;?>,
  230. SID: '<?=$Session;?>',
  231. TYPE: STYPE
  232. },
  233. success: function( response, opts ){
  234. // If the response is JSON, you have to decode it
  235. reloadNetworkData( <?=$SiteID;?> );
  236. },
  237. failure: function( response, opts ) {
  238. //Ext.fly('some_div').update('Fail!');
  239. }/*,
  240. callback: function(options,success,response){
  241. // use this if you need to perform your own success/failure checking
  242. }*/
  243. });
  244. };
  245. function loadNodeSockets( NID, store ){
  246. Ext.Ajax.request({
  247. url: '/lib/controller/listNodeSockets.php',
  248. params: {
  249. NID: <?=$SiteID;?>,
  250. UID: <?=$UserID;?>,
  251. SID: '<?=$Session;?>',
  252. DID: NID
  253. },
  254. success: function( response, opts ){
  255. var data = Ext.decode( response.responseText );
  256. if( data['success'] == true ){
  257. store.loadData( data, false );
  258. } else {
  259. Ext.Msg.show({
  260. title:'Error Message',
  261. msg: data['error'],
  262. buttons: Ext.Msg.OK,//YESNOCANCEL,
  263. //fn: processResult,
  264. //animEl: 'elId',
  265. icon: Ext.MessageBox.ERROR //QUESTION
  266. });
  267. };
  268. //Ext.getCmp('zigzag').getEl().unmask();
  269. },
  270. failure: function( response, opts ) {
  271. //Ext.fly('some_div').update('Fail!');
  272. }/*,
  273. callback: function(options,success,response){
  274. // use this if you need to perform your own success/failure checking
  275. }*/
  276. });
  277. };
  278. function createConnection( SID, EID, CTY ){
  279. if( addConnectionDialog == null ){
  280. addConnectionDialog = new Ext.Window({
  281. modal: true,
  282. title: '<?=$Labels->GetLabel("_ADD_CONNECTION_");?>',
  283. width: 773,
  284. height: 600,
  285. layout: 'hbox',
  286. closeAction: 'hide',
  287. listeners:{
  288. beforehide : function(){
  289. Ext.getCmp('connectstarterbutton').toggle( false, false );
  290. }
  291. },
  292. items:[{
  293. xtype: 'grid',
  294. width: 380,
  295. height: 400,
  296. ds: A_socketsListStore,
  297. cm: socketListColModel,
  298. sm: A_socketSelModel
  299. },{
  300. xtype: 'grid',
  301. width: 380,
  302. height: 400,
  303. ds: B_socketsListStore,
  304. cm: socketListColModel,
  305. sm: B_socketSelModel
  306. }],
  307. bbar: [{
  308. text: '<?=$Labels->GetLabel("_CANCEL_");?>',
  309. handler: function(){
  310. addConnectionDialog.hide();
  311. }
  312. },{
  313. id: 'con_to_src',
  314. text: '<?=$Labels->GetLabel("_ADD_");?>',
  315. disabled: true,
  316. handler: function(){
  317. if( selected_A_socket != null && selected_B_socket != null ){
  318. Ext.Ajax.request({
  319. url: '/lib/controller/addConnection.php',
  320. params: {
  321. NID: <?=$SiteID;?>,
  322. SNID: SID,
  323. SOSID: selected_A_socket.id,
  324. ENID: EID,
  325. SOEID: selected_B_socket.id,
  326. UID: <?=$UserID;?>,
  327. SID: '<?=$Session;?>'
  328. },
  329. success: function( response, opts ){
  330. var data = Ext.decode(response.responseText);
  331. if( data.status ){
  332. //reloadNetworkData( NID );
  333. netwodkData.edges.add( data.edge );
  334. } else {
  335. startCreateConnection();
  336. //alert( data.message );
  337. };
  338. Ext.getCmp('connectstarterbutton').toggle( false, false );
  339. },
  340. failure: function( response, opts ) {
  341. //Ext.fly('some_div').update('Fail!');
  342. }/*,
  343. callback: function(options,success,response){
  344. // use this if you need to perform your own success/failure checking
  345. }*/
  346. });
  347. };
  348. }
  349. }]
  350. });
  351. };
  352. loadNodeSockets( SID, A_socketsListStore );
  353. loadNodeSockets( EID, B_socketsListStore );
  354. addConnectionDialog.show();
  355. };
  356. function loadNodeProperties( NodeID ){
  357. //alert( 'Node: ' + NodeID );
  358. Ext.Ajax.request({
  359. url: '/lib/controller/getNetworkNodeProps.php',
  360. params: {
  361. NID: <?=$SiteID;?>,
  362. UID: <?=$UserID;?>,
  363. SID: '<?=$Session;?>',
  364. NODE: NodeID
  365. },
  366. success: function( response, opts ){
  367. // If the response is JSON, you have to decode it
  368. var data = Ext.decode(response.responseText);
  369. var tPanel = Ext.getCmp('prop_content');
  370. tPanel.remove(0);
  371. tPanel.add( data );
  372. tPanel.doLayout();
  373. },
  374. failure: function( response, opts ) {
  375. //Ext.fly('some_div').update('Fail!');
  376. }/*,
  377. callback: function(options,success,response){
  378. // use this if you need to perform your own success/failure checking
  379. }*/
  380. });
  381. };
  382. function loadServerProperties( NodeID ){
  383. Ext.Ajax.request({
  384. url: '/lib/controller/getNetworkServerProps.php',
  385. params: {
  386. NID: <?=$SiteID;?>,
  387. UID: <?=$UserID;?>,
  388. SID: '<?=$Session;?>',
  389. NODE: NodeID
  390. },
  391. success: function( response, opts ){
  392. var data = Ext.decode(response.responseText);
  393. var tPanel = Ext.getCmp('prop_content');
  394. tPanel.remove(0);
  395. tPanel.add( data );
  396. tPanel.doLayout();
  397. },
  398. failure: function( response, opts ) {
  399. //Ext.fly('some_div').update('Fail!');
  400. }/*,
  401. callback: function(options,success,response){
  402. // use this if you need to perform your own success/failure checking
  403. }*/
  404. });
  405. };
  406. function loadSystemEditor(){
  407. if( tlInterval!= null ){
  408. window.clearInterval( tlInterval );
  409. tlInterval = null;
  410. timelineObj = null;
  411. };
  412. var tPanel = Ext.getCmp('main_portal');
  413. tPanel.removeAll( true );
  414. Ext.getCmp('main_content').setTitle( 'System Map' );
  415. tPanel.add({
  416. columnWidth: 0.83,
  417. frame: false,
  418. border: false,
  419. items: [{
  420. xtype: 'panel',
  421. layout: 'fit',
  422. layoutConfig: {
  423. align : 'stretch',
  424. pack : 'start'
  425. //padding:'5',
  426. //align:'middle'
  427. },
  428. height: PanelH-5,
  429. flex: 1,
  430. frame: false,
  431. border: false,
  432. items:{
  433. id: 'sys_map'
  434. },
  435. tbar: [{
  436. xtype: 'splitbutton',
  437. text: 'Add Laser Sensor',
  438. split: true,
  439. enableToggle : undefined,
  440. menu : {
  441. items: [{
  442. text:'ALS',
  443. icon: '/style/assets/!cid_ii_jvmzuzrq10.png',
  444. handler: function(){
  445. createNode( 1 );
  446. }
  447. },{
  448. text:'LFS',
  449. icon: '/style/assets/!cid_ii_jvmzuzpt0.png',
  450. handler: function(){
  451. createNode( 2 );
  452. }
  453. },{
  454. text:'PLS-200',
  455. icon: '/style/assets/!cid_ii_jvmzuzql4.png',
  456. handler: function(){
  457. createNode( 3 );
  458. }
  459. },{
  460. text:'PLS-360',
  461. icon: '/style/assets/!cid_ii_jvmzuzr87.png',
  462. handler: function(){
  463. createNode( 4 );
  464. }
  465. },{
  466. text:'3DLIDAR',
  467. icon: '/style/assets/unnamed34.png',
  468. handler: function(){
  469. createNode( 5 );
  470. }
  471. }]
  472. }
  473. },{
  474. xtype: 'splitbutton',
  475. text: 'Add Additional Equipment',
  476. split: true,
  477. enableToggle : true,
  478. menu : {
  479. items: [{
  480. text:'Static Analog Camera',
  481. icon: '/style/assets/11_node.png'
  482. },{
  483. text:'PTZ Analog Camera',
  484. icon: '/style/assets/12_node.png'
  485. },{
  486. text:'Static IP Camera',
  487. icon: '/style/assets/11_node.png',
  488. handler: function(){
  489. SelectedCamPTZ = false;
  490. addIpCam();
  491. }
  492. },{
  493. text:'PTZ IP Camera',
  494. icon: '/style/assets/12_node.png',
  495. handler: function(){
  496. SelectedCamPTZ = true;
  497. addIpCam();
  498. }
  499. },{
  500. text:'DVR/Video Server/Streamer',
  501. icon: '/style/assets/videoServer.png',
  502. handler: function(){
  503. addMediaServer();
  504. }
  505. },{
  506. text:'Network Video Recorder',
  507. icon: '/style/assets/15_node.png'
  508. },{
  509. text:'Ethernet to UART transeiver',
  510. icon: '/style/assets/eth2uart.png',
  511. handler: function(){
  512. addEthernet2Uart();
  513. }
  514. },{
  515. text:'DC to Ethernet (ADAM)',
  516. icon: '/style/assets/adam-1.png',
  517. }]
  518. }
  519. },{
  520. xtype: 'button',
  521. id: 'connectstarterbutton',
  522. text: 'Add Connection',
  523. enableToggle : undefined,
  524. handler: function(){
  525. if( InConnectEditMode ){
  526. Ext.getCmp('connectstarterbutton').toggle( false, false );
  527. InConnectEditMode = false;
  528. stopCreateConnection();
  529. } else {
  530. Ext.getCmp('connectstarterbutton').toggle( true, true );
  531. InConnectEditMode = true;
  532. startCreateConnection();
  533. };
  534. }
  535. },{
  536. xtype: 'button',
  537. id: 'deletecomponentbutton',
  538. text: 'Remove Component',
  539. enableToggle: true,
  540. handler: function(){
  541. if( InComponentRemoveMode ){
  542. Ext.getCmp('deletecomponentbutton').toggle( false, false );
  543. InComponentRemoveMode = false;
  544. } else {
  545. Ext.getCmp('deletecomponentbutton').toggle( true, true );
  546. InComponentRemoveMode = true;
  547. };
  548. }
  549. }]
  550. }]
  551. });
  552. tPanel.add({
  553. title: 'Properties',
  554. xtype: 'panel',
  555. flex: 1,
  556. height: 700,
  557. //width: 210,
  558. columnWidth: 0.17,
  559. layout: 'fit',
  560. //frame: true,
  561. id: 'prop_content',
  562. // border: true
  563. items:{
  564. html: 'Select Item From Map'
  565. }
  566. });
  567. tPanel.doLayout();
  568. Ext.Ajax.request({
  569. url: '/lib/controller/getNetwork.php',
  570. params: {
  571. NID: selectedSite,
  572. UID: <?=$UserID;?>,
  573. SID: '<?=$Session;?>'
  574. },
  575. success: function( response, opts ){
  576. // If the response is JSON, you have to decode it
  577. var data = Ext.decode(response.responseText);
  578. netwodkData.nodes = new vis.DataSet( data.nodes );
  579. netwodkData.edges = new vis.DataSet( data.edges );
  580. var container = document.getElementById(Ext.getCmp('sys_map').body.id);
  581. networkObj = new vis.Network(container, netwodkData, networkOpts );
  582. networkObj.on("click", function (params) {
  583. //if(!connectionAddMode){
  584. if( !InComponentRemoveMode ){
  585. if( params.nodes.length > 0 ){
  586. if( netwodkData.nodes.get(params.nodes[0]).role == 'server' ){
  587. loadServerProperties( params.nodes[0] );
  588. } else {
  589. loadNodeProperties( params.nodes[0] );
  590. };
  591. } else if( params.edges.length > 0 ){
  592. selectedConnection = netwodkData.edges.get(params.edges[0]);
  593. loadLinkProperties( params.edges[0], selectedConnection.from, selectedConnection.to );
  594. };
  595. } else {
  596. if( params.nodes.length > 0 ){
  597. if( netwodkData.nodes.get(params.nodes[0]).role == 'server' ){
  598. Ext.Msg.show({
  599. title:'Remove Server Component!',
  600. msg: 'You can not remove Server component!',
  601. buttons: Ext.Msg.OK,
  602. icon: Ext.MessageBox.INFO
  603. });
  604. } else {
  605. Ext.Msg.show({
  606. title:'Remove Component?',
  607. msg: 'You are about to remove.<br/>Are you sure to do so?',
  608. buttons: Ext.Msg.YESNOCANCEL,
  609. fn: function( result ){
  610. if( result=='yes' ){
  611. Ext.Ajax.request({
  612. url: '/lib/controller/removeNode.php',
  613. params: {
  614. SAID: <?=$SiteID;?>,
  615. NID: params.nodes[0],
  616. UID: <?=$UserID;?>,
  617. SID: '<?=$Session;?>'
  618. },
  619. success: function( response, opts ){
  620. var data = Ext.decode(response.responseText);
  621. if( data.sucess == false ){
  622. Ext.Msg.show({
  623. title:'Request Failure!',
  624. msg: data.error,
  625. buttons: Ext.Msg.OK,
  626. icon: Ext.MessageBox.INFO
  627. });
  628. } else {
  629. stopCreateConnection();
  630. InComponentRemoveMode = false;
  631. loadSystemEditor();
  632. };
  633. },
  634. failure: function( response, opts ) {
  635. Ext.Msg.show({
  636. title:'Request Failure!',
  637. msg: 'Ajax Request failed!',
  638. buttons: Ext.Msg.OK,
  639. icon: Ext.MessageBox.INFO
  640. });
  641. }
  642. });
  643. };
  644. },
  645. //animEl: 'elId',
  646. icon: Ext.MessageBox.QUESTION
  647. });
  648. };
  649. };
  650. };
  651. //};
  652. });
  653. /*
  654. networkObj.on("doubleClick", function (params) {
  655. //if(!connectionAddMode){
  656. if( !InComponentRemoveMode ){
  657. if( params.nodes.length > 0 ){
  658. loadNodeProperties( params.nodes[0] );
  659. } else if( params.edges.length > 0 ){
  660. selectedConnection = netwodkData.edges.get(params.edges[0]);
  661. loadLinkProperties( params.edges[0], selectedConnection.from, selectedConnection.to );
  662. };
  663. } else {
  664. alert( 'Remove' );
  665. };
  666. //};
  667. });
  668. */
  669. /*
  670. networkObj.on("dragStart", function (params) {
  671. if( connectionAddMode ){
  672. var tID = this.getNodeAt(params.pointer.DOM);
  673. if( tID != undefined ){
  674. newConnectionStart = tID;
  675. };
  676. };
  677. });
  678. networkObj.on("dragEnd", function (params) {
  679. if( connectionAddMode ){
  680. var tID = this.getNodeAt(params.pointer.DOM);
  681. if( tID != undefined ){
  682. newConnectionEnd = tID;
  683. //selectedConnection = netwodkData.edges[netwodkData.edges.length];
  684. //selectedConnection.color = {
  685. // color: '#ff0000',
  686. // opacity: 0.3,
  687. // highlight: 'blue'
  688. //};
  689. //networkObj.addEdgeMode(0);
  690. createConnection( newConnectionStart, newConnectionEnd );
  691. connectionAddMode = false;
  692. };
  693. };
  694. });
  695. */
  696. },
  697. failure: function( response, opts ) {
  698. //Ext.fly('some_div').update('Fail!');
  699. }
  700. });
  701. };