|
@@ -21,18 +21,92 @@ $('#jstree_demo_div').on("open_node.jstree", function (e, data) {
|
|
|
|
|
|
$('#jstree_demo_div').on("select_node.jstree", function (e, data) {
|
|
|
console.log(data);
|
|
|
- if(data.node.data.nodeclass == "Object"){
|
|
|
- $('#instancename').val(data.node.text);
|
|
|
- $('#instancenamespace').val(data.node.data.namespace);
|
|
|
- $('#instancenodeclass').val(data.node.data.nodeclass);
|
|
|
+ var x = data.node.data.idx;
|
|
|
+ var nid = data.node.id;
|
|
|
+ var nc = data.node.data.nodeclass;
|
|
|
+ if(nc == "Object"){
|
|
|
+ var ul = 'http://127.0.0.1:3001/look/'+x+'/'+nid+'/'+nc+'/';
|
|
|
+ $.ajax({
|
|
|
+ url: ul+'name',
|
|
|
+ type: 'GET', // http method
|
|
|
+ success: function (resp, status, xhr) {
|
|
|
+ $('#instancename').val(resp.result);
|
|
|
+ },
|
|
|
+ error: function (jqXhr, textStatus, errorMessage) {
|
|
|
+ console.log('Error: ' + errorMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //$('#instancename').val(data.node.text);
|
|
|
+ $.ajax({
|
|
|
+ url: ul+'nsurl',
|
|
|
+ type: 'GET', // http method
|
|
|
+ success: function (resp, status, xhr) {
|
|
|
+ $('#instancenamespace').val(resp.result);
|
|
|
+ },
|
|
|
+ error: function (jqXhr, textStatus, errorMessage) {
|
|
|
+ console.log('Error: ' + errorMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#instancenodeclass').val(nc);
|
|
|
//$('#instancetypedefinition').val(data.node.data.);
|
|
|
$('#instancenodeidtype').val();
|
|
|
- $('#instancenodeid').val(data.node.id);
|
|
|
- $('#instanceeventnotifier').attr('placeholder','1 (EventNotifierSubscribeToEvents)');
|
|
|
+ $.ajax({
|
|
|
+ url: ul+'nodeidtype',
|
|
|
+ type: 'GET', // http method
|
|
|
+ success: function (resp, status, xhr) {
|
|
|
+ $('#instancenodeidtype').val(resp.result);
|
|
|
+ },
|
|
|
+ error: function (jqXhr, textStatus, errorMessage) {
|
|
|
+ console.log('Error: ' + errorMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#instancenodeid').val(nid);
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: ul+'eventnotifier',
|
|
|
+ type: 'GET', // http method
|
|
|
+ success: function (resp, status, xhr) {
|
|
|
+ var plc = "";
|
|
|
+ switch(resp.result){
|
|
|
+ case 0: plc = "0 (None)"; break;
|
|
|
+ case 1: plc = "1 (EventNotifierSubscribeToEvents)"; break;
|
|
|
+ case 4: plc = "4 (EventNotifierHistoryRead)"; break;
|
|
|
+ case 5: plc = "5 (EventNotifierSubscribeToEvents|EventNotifierHistoryRead)"; break;
|
|
|
+ case 8: plc = "8 (EventNotifierHistoryWrite)"; break;
|
|
|
+ case 9: plc = "9 (EventNotifierSubscribeToEvents|EventNotifierHistoryWrite)"; break;
|
|
|
+ case 12: plc = "12 (EventNotifierHistoryRead|EventNotifierHistoryWrite)"; break;
|
|
|
+ default: plc = "";
|
|
|
+ }
|
|
|
+ $('#instanceeventnotifier').attr('placeholder',plc);
|
|
|
+ },
|
|
|
+ error: function (jqXhr, textStatus, errorMessage) {
|
|
|
+ console.log('Error: ' + errorMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
$('#instancedisplayname1').val("");
|
|
|
- $('#instancedisplayname2').val(data.node.text);
|
|
|
- $('#instancebrowsename1').val(data.node.data.namespace);
|
|
|
- $('#instancebrowsename2').val(data.node.data.browsename);
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: ul+'displayname',
|
|
|
+ type: 'GET', // http method
|
|
|
+ success: function (resp, status, xhr) {
|
|
|
+ $('#instancedisplayname2').val(resp.result);
|
|
|
+ },
|
|
|
+ error: function (jqXhr, textStatus, errorMessage) {
|
|
|
+ console.log('Error: ' + errorMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //$('#instancedisplayname2').val(data.node.text);
|
|
|
+ $.ajax({
|
|
|
+ url: ul+'displayname',
|
|
|
+ type: 'GET', // http method
|
|
|
+ success: function (resp, status, xhr) {
|
|
|
+ $('#instancebrowsename2').val(resp.result);
|
|
|
+ },
|
|
|
+ error: function (jqXhr, textStatus, errorMessage) {
|
|
|
+ console.log('Error: ' + errorMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
console.log("obj enabled");
|
|
|
$('#objectattributesbutton').prop('disabled', false);
|
|
@@ -42,6 +116,17 @@ $('#jstree_demo_div').on("select_node.jstree", function (e, data) {
|
|
|
$('#methodattributesbutton').prop('disabled',true);
|
|
|
}
|
|
|
if(data.node.data.nodeclass == "Variable"){
|
|
|
+ /*$.ajax({
|
|
|
+ url: 'http://127.0.0.1:3001',
|
|
|
+ type: 'POST', // http method
|
|
|
+ data: { key_id: name }, // data to submit
|
|
|
+ success: function (data, status, xhr) {
|
|
|
+ $('p').append('status: ' + status + ', data: ' + data);
|
|
|
+ },
|
|
|
+ error: function (jqXhr, textStatus, errorMessage) {
|
|
|
+ $('p').append('Error: ' + errorMessage);
|
|
|
+ }
|
|
|
+ });*/
|
|
|
$('#variableattributesbutton').prop('disabled', false);
|
|
|
$('#collapseTwo').collapse('hide');
|
|
|
$('#objectattributesbutton').prop('disabled',true);
|
|
@@ -49,6 +134,17 @@ $('#jstree_demo_div').on("select_node.jstree", function (e, data) {
|
|
|
$('#methodattributesbutton').prop('disabled',true);
|
|
|
}
|
|
|
if(data.node.data.nodeclass == "Method"){
|
|
|
+ /*$.ajax({
|
|
|
+ url: 'http://127.0.0.1:3001',
|
|
|
+ type: 'POST', // http method
|
|
|
+ data: { key_id: name }, // data to submit
|
|
|
+ success: function (data, status, xhr) {
|
|
|
+ $('p').append('status: ' + status + ', data: ' + data);
|
|
|
+ },
|
|
|
+ error: function (jqXhr, textStatus, errorMessage) {
|
|
|
+ $('p').append('Error: ' + errorMessage);
|
|
|
+ }
|
|
|
+ });*/
|
|
|
$('#methodattributesbutton').prop('disabled',false);
|
|
|
$('#collapseTwo').collapse('hide');
|
|
|
$('#objectattributesbutton').prop('disabled',true);
|