Changeset 2138
- Timestamp:
- Jul 10, 2016, 11:57:37 PM (5 years ago)
- Location:
- lliurex-mirror/trunk/fuentes/admin-center-lliurex-mirror.install/lliurex-mirror/src
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-mirror/trunk/fuentes/admin-center-lliurex-mirror.install/lliurex-mirror/src/css/lliurex-mirror.css
r2118 r2138 11 11 i.menu{ 12 12 float:right; 13 background-image: url('images/mirror_not_configured.png'); 14 height: 30px; 15 width: 30px; 13 background-image: url('images/mirror_not_configured1.png'); 14 background-repeat: no-repeat; 15 height: 25px; 16 width: 15px; 16 17 } 17 18 … … 39 40 visibility: hidden; 40 41 } 42 43 #lliurex-mirror h3.panel-title{ 44 display: inline-block; 45 } -
lliurex-mirror/trunk/fuentes/admin-center-lliurex-mirror.install/lliurex-mirror/src/js/lliurex-mirror.js
r2136 r2138 36 36 37 37 $("#llxmirrorupdate").on('click',function modifyarch(e,args){ 38 var credentials=[sessionStorage.username , sessionStorage.password]; 39 var n4dclass="MirrorManager"; 40 var n4dmethod="update"; 41 var arglist=[self.distros[self.defaultdistro]]; 42 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function updatemirror(response){ 43 if(response['status']){ 44 self.intervalupdate = setInterval(function(){ 45 console.log('pasa'); 46 Utils.n4d(credentials,n4dclass,'is_alive',[],function check_alive(response){ 47 console.log(response); 48 if (response['status']){ 49 self.bars[self.distros[self.defaultdistro]].path.setAttribute('color',self.progresscolors['working']); 50 Utils.n4d('', n4dclass, 'get_percentage', arglist, function getpercentage(response){ 51 self.bars[self.distros[self.defaultdistro]].animate(1 - (100 - response['msg']) / 100 ); 52 }); 53 } 54 else{ 55 if(response['msg'] == 0){ 56 self.bars[self.distros[self.defaultdistro]].path.setArchitecture('color',self.progresscolors['ok']); 57 } 58 else{ 59 self.bars[self.distros[self.defaultdistro]].path.setArchitecture('color',self.progresscolors['error']); 60 } 61 clearInterval(self.intervalupdate); 62 } 63 }); 64 } 65 ,1000); 66 } 67 else{ 68 a = 1; 69 } 70 }); 38 self.updateMirror(self); 71 39 }); 72 40 }; … … 322 290 } 323 291 292 LliurexMirror.prototype.updateMirror = function updateMirror(self){ 293 294 var credentials=[sessionStorage.username , sessionStorage.password]; 295 var n4dclass="MirrorManager"; 296 var n4dmethod="update"; 297 var arglist=[self.distros[self.defaultdistro]]; 298 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function updatemirror(response){ 299 if(response['status']){ 300 var updatebutton = document.querySelector('#llxmirrorupdate'); 301 updatebutton.classList.remove('btn-success'); 302 updatebutton.classList.add('btn-danger'); 303 updatebutton.innerHTML = 'Cancel'; 304 updatebutton.removeEventListener('click',self.updateMirror); 305 updatebutton.addEventListener('click',self.stopUpdate); 306 self.intervalupdate = setInterval(function(){ 307 Utils.n4d(credentials,n4dclass,'is_alive',[],function check_alive(response){ 308 if (response['status']){ 309 self.bars[self.distros[self.defaultdistro]].path.setAttribute('stroke',self.progresscolors['working']); 310 Utils.n4d('', n4dclass, 'get_percentage', arglist, function getpercentage(response){ 311 self.bars[self.distros[self.defaultdistro]].animate(1 - (100 - response['msg']) / 100 ); 312 }); 313 } 314 else{ 315 if(response['msg'] == 0){ 316 self.bars[self.distros[self.defaultdistro]].path.setAttribute('stroke',self.progresscolors['ok']); 317 } 318 else{ 319 self.bars[self.distros[self.defaultdistro]].path.setAttribute('stroke',self.progresscolors['error']); 320 } 321 updatebutton.classList.add('btn-success'); 322 updatebutton.classList.remove('btn-danger'); 323 updatebutton.innerHTML = 'Update'; 324 clearInterval(self.intervalupdate); 325 } 326 }); 327 } 328 ,5000); 329 } 330 else{ 331 a = 1; 332 } 333 }); 334 } 335 336 337 LliurexMirror.prototype.stopUpdate = function stopUpdate(self){ 338 var credentials=[sessionStorage.username , sessionStorage.password]; 339 var n4dclass="MirrorManager"; 340 var n4dmethod="stop_update"; 341 var arglist=[self.distros[self.defaultdistro]]; 342 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function stopupdate(response){ 343 344 }); 345 } 346 347 324 348 var llxmirror = new LliurexMirror(); 325 349 llxmirror.bindEvents();
Note: See TracChangeset
for help on using the changeset viewer.