Changeset 2041


Ignore:
Timestamp:
Jun 28, 2016, 2:32:45 PM (3 years ago)
Author:
kbut
Message:

wip

Location:
lliurex-mirror/trunk/fuentes/admin-center-lliurex-mirror.install/lliurex-mirror/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lliurex-mirror/trunk/fuentes/admin-center-lliurex-mirror.install/lliurex-mirror/src/js/lliurex-mirror.js

    r2026 r2041  
    391391
    392392  $(document).on("moduleLoaded",function(e,args){
     393    Utils.n4d('', 'VariablesManager', 'get_variable', ['LLIUREXMIRROR'], function(response){
     394      self.mirrorinfo = response;
    393395        progressoptions = {
    394396                color:'#4caf50',
     
    399401                text: {value:'llx16'}
    400402        };
     403    if (self.mirrorinfo['internal']['status_mirror'].toLowerCase() != 'ok'){
     404      progressoptions['color'] = "red";
     405    }
    401406    self.bar = new ProgressBar.Circle('#llxmirrorprogress', progressoptions);
    402407    self.bar.animate(0.4);
    403408    self.showOrigin();
    404409    self.showArchitecture();
     410    self.showMirrorSize();
     411    });
    405412  });
    406413}
     
    422429        var arglist=['llx16'];
    423430        Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){
    424                 $("#llxmirrorarchitecture").text(response['msg']);
     431    listarchitectures = response['msg'];
     432    stringarchitectures = "";
     433    stringarchitectures += listarchitectures.indexOf('i386') > -1 ? "32Bits ":"";
     434    stringarchitectures += listarchitectures.indexOf('amd64') > -1 ? "64Bits":"";
     435                $("#llxmirrorarchitecture").text();
    425436        });
    426437}
     438
     439LliurexMirror.prototype.showMirrorSize = function showMirrorSize(){
     440  var credentials=[sessionStorage.username , sessionStorage.password];
     441  var n4dclass="VariablesManager";
     442  var n4dmethod="get_variable";
     443  var arglist=['LLIUREXMIRROR'];
     444  Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){
     445    mirrorinfo = response;
     446    if ( ! mirrorinfo.hasOwnProperty('internal') ){
     447      return ;
     448    }
     449    if ( mirrorinfo['internal'].hasOwnProperty('mirror_size')){
     450      $("#llxmirrorsize").text(mirrorinfo['internal']['mirror_size'] + "Gb");
     451    }
     452    else{
     453      $("#llxmirrorsize").text("0 Gb");
     454    }
     455  });
     456}
     457
    427458
    428459
  • lliurex-mirror/trunk/fuentes/admin-center-lliurex-mirror.install/lliurex-mirror/src/main2.html

    r2026 r2041  
    22        <div class="row text-center">
    33                <div class="col-xs-4 "></div>
    4                 <div class="col-xs-4 text-center panel" id="llxmirrorprogress"></div>
     4                <div class="col-xs-4 text-center panel">
     5                        <div id="llxmirrorprogress"></div>
     6                        <div id="llxmirrorsize"></div>
     7                </div>
    58                <div class="col-xs-4"></div>
    69        </div>
Note: See TracChangeset for help on using the changeset viewer.