- Timestamp:
- 06/02/16 12:35:30 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/okbmanagerhubber.js
r13862 r13871 22 22 var vm = $scope; 23 23 var hubber = $.connection.okbManagerHub; 24 vm.currentData = {'name' : '', 'data' : null} 24 $("#success-alert").hide(); 25 26 vm.currentData = {'name' : '','type': '' , 'data' : null} 25 27 26 28 vm.init = function () { … … 29 31 $.connection.hub.qs = { 'userid': uid }; 30 32 //Connection string set to identify the unique session ID for the user 31 $.connection.hub.start().done(function () { 32 // hubber.server.requestInfo();//initial data request 33 }); 34 hubber.client.processData = function (filters) { 35 33 $.connection.hub.start().done(); 34 hubber.client.deleteComplete = function (text) { 35 vm.notify(text); 36 $scope.$apply(); 36 37 }; 38 hubber.client.saveComplete = function (text) { 39 vm.notify(text); 40 $scope.$apply(); 41 } 42 hubber.client.refreshData = function ( name, json) { 43 vm.initData(JSON.parse(json), name); 44 vm.selectDataCat(name); 45 $scope.$apply(); 46 } 37 47 38 48 } … … 41 51 switch (name) { 42 52 case "platforms": 43 vm.platforms = {'selected' : null, 'arr' : coll} 53 vm.platforms = { 'selected': null, 'new': { 'Id': -1 }, 'arr': coll } 54 vm.platforms.selected = vm.platforms.new; 44 55 break; 45 56 case "algoclass": 46 vm.algoclass = { 'selected': null, 'arr': coll } 57 vm.algoclass = { 'selected': null, 'new': { 'Id': -1 }, 'arr': coll } 58 vm.algoclass.selected = vm.algoclass.new; 47 59 break; 48 60 case "algos": 49 vm.algos = { 'selected': null, 'arr': coll } 61 vm.algos = { 'selected': null, 'new': { 'Id': -1 }, 'arr': coll } 62 vm.algos.selected = vm.algos.new; 50 63 break; 51 64 case "probclass": 52 vm.probclass = { 'selected': null, 'arr': coll } 65 vm.probclass = { 'selected': null, 'new': { 'Id': -1 }, 'arr': coll } 66 vm.probclass.selected = vm.probclass.new; 53 67 break; 54 68 case "problems": 55 vm.problems = { 'selected': null, 'arr': coll } 69 vm.problems = { 'selected': null, 'new': { 'Id': -1 }, 'arr': coll } 70 vm.problems.selected = vm.problems.new; 56 71 break; 57 72 … … 63 78 case "platforms": 64 79 vm.currentData.name = "Platforms"; 80 vm.currentData.type = "ND"; 65 81 vm.currentData.data = vm.platforms; 66 82 break; 67 83 case "algoclass": 68 84 vm.currentData.name = "Algorithm classes"; 85 vm.currentData.type = "ND"; 69 86 vm.currentData.data = vm.algoclass; 70 87 break; 71 88 case "algos": 72 89 vm.currentData.name = "Algorithms"; 90 vm.currentData.type = "ALG"; 73 91 vm.currentData.data = vm.algos; 74 92 break; 75 93 case "probclass": 76 94 vm.currentData.name = "Problem classes"; 95 vm.currentData.type = "ND"; 77 96 vm.currentData.data = vm.probclass; 78 97 break; 79 98 case "problems": 80 99 vm.currentData.name = "Problems"; 100 vm.currentData.type = "PROB" 81 101 vm.currentData.data = vm.problems; 82 102 break; … … 84 104 } 85 105 } 106 vm.selectDataMember = function (index) { 107 if (index === null) 108 vm.currentData.data.selected = vm.currentData.data.new; 109 else { 110 vm.currentData.data.selected = vm.currentData.data.arr[index]; 111 } 112 } 113 vm.saveCurrent = function () { 114 hubber.server.save(JSON.stringify(vm.currentData.data.selected), vm.currentData.name); 115 } 116 vm.deleteCurrent = function () { 117 hubber.server.delete(vm.currentData.data.selected.Id, vm.currentData.name); 118 } 119 vm.notify = function (text) { 120 $("#succText").html(text); 121 $("#success-alert").alert(); 122 $("#success-alert").fadeTo(2000, 500).slideUp(500, function () { 123 $("#success-alert").hide(); 124 }); 125 } 86 126 });
Note: See TracChangeset
for help on using the changeset viewer.