X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Flaunchpad%2Fsrc%2FlaunchpadFleetStore.js;h=69255a4500f626b834a3b42af5b3da912f8a1aca;hb=ab68734c52fb6d413e8241466c4517bd7af2477f;hp=520eebecdaede8135309d0e17964cb8f20a308f0;hpb=5887e136dc63a909acba0e529dacf383df9061d7;p=osm%2FUI.git diff --git a/skyquake/plugins/launchpad/src/launchpadFleetStore.js b/skyquake/plugins/launchpad/src/launchpadFleetStore.js index 520eebecd..69255a450 100644 --- a/skyquake/plugins/launchpad/src/launchpadFleetStore.js +++ b/skyquake/plugins/launchpad/src/launchpadFleetStore.js @@ -17,7 +17,9 @@ * */ import Alt from './alt'; - +import _filter from 'lodash/filter'; +import _extend from 'lodash/extend'; +import _debounce from 'lodash/debounce'; var FleetSource = require('./launchpadFleetSource.js'); var FleetActions = require('./launchpadFleetActions.js'); import CardActions from './launchpad_card/launchpadCardActions.js'; @@ -29,8 +31,6 @@ import {LaunchpadSettings} from './settings.js'; var FleetStore; -var _ = require('underscore'); -// _.debounce(function(){}); function FleetStoreConstructor() { var self = this; this.fleets = []; @@ -134,7 +134,7 @@ FleetStoreConstructor.prototype.openNSRSocketSuccess = function(connection) { let deletingNSRs = []; if (self.nsrs) { - deletingNSRs = _.filter(self.nsrs, function(nsr) { + deletingNSRs = _filter(self.nsrs, function(nsr) { return nsr.deleting == true; }); }; @@ -142,7 +142,7 @@ FleetStoreConstructor.prototype.openNSRSocketSuccess = function(connection) { deletingNSRs.forEach(function(deletingNSR) { data.nsrs.map(nsr => { if (nsr.id == deletingNSR.id) { - _.extend(nsr, deletingNSR); + _extend(nsr, deletingNSR); } }); }); @@ -191,7 +191,7 @@ FleetStoreConstructor.prototype.deleteNsrInstanceError = function(data) {}; FleetStoreConstructor.prototype.getNsrInstancesError = function(data) { console.log('ERROR', data) }; -FleetStoreConstructor.prototype.handleUpdateControlInput = _.debounce(function(data) { +FleetStoreConstructor.prototype.handleUpdateControlInput = _debounce(function(data) { var opt = data[0]; FleetStore.nsrControl(opt.operation, opt.url, data[1]) }, 500).bind(null); @@ -279,5 +279,5 @@ FleetStoreConstructor.prototype.getVDUConsoleLinkSuccess = function(data) { data['console-url'] && window.open(data['console-url']); } -FleetStore = Alt.createStore(FleetStoreConstructor); +FleetStore = Alt.createStore(FleetStoreConstructor, 'FleetStore'); module.exports = FleetStore;