+ onInstanceSelectedUpdate = (instance: any) => {
+ this.selectedInstanceData = instance;
+ if (instance.name != "SELF") {
+ this.disableFlag = true;
+ let newInterfaces : InterfaceModel[] = [];
+ if (instance.interfaces instanceof Array) {
+ instance.interfaces.forEach(result => {
+ let interfaceObj = new InterfaceModel();
+ interfaceObj.type = result.type;
+ interfaceObj.uniqueId = result.uniqueId;
+ if (result.operations instanceof Array) {
+ interfaceObj.operations = result.operations;
+ } else if (!_.isEmpty(result.operations)) {
+ interfaceObj.operations = [];
+ Object.keys(result.operations).forEach(name => {
+ interfaceObj.operations.push(result.operations[name]);
+ });
+ }
+ newInterfaces.push(interfaceObj);
+ });
+ } else {
+ Object.keys(instance.interfaces).forEach(key => {
+ let obj = instance.interfaces[key];
+ let interfaceObj = new InterfaceModel();
+ interfaceObj.type = obj.type;
+ interfaceObj.uniqueId = obj.uniqueId;
+ if (obj.operations instanceof Array) {
+ interfaceObj.operations = obj.operations;
+ } else if (!_.isEmpty(obj.operations)) {
+ interfaceObj.operations = [];
+ Object.keys(obj.operations).forEach(name => {
+ interfaceObj.operations.push(obj.operations[name]);
+ });
+ }
+ newInterfaces.push(interfaceObj);
+ });
+ }
+ this.interfaces = newInterfaces.map((interf) => new UIInterfaceModel(interf));
+ } else {
+ //this.disableFlag = this.readonly;
+ this.interfaces = this.serviceInterfaces.map((interf) => new UIInterfaceModel(interf));
+ }
+ this.sortInterfaces();
+ }
+