Changeset 2068 for lliurex-mirror


Ignore:
Timestamp:
Jun 29, 2016, 7:04:52 PM (3 years ago)
Author:
kbut
Message:

add accordions menu

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

Legend:

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

    r2012 r2068  
    88  padding-bottom:25px;
    99}
     10
     11i.menu{
     12        float:right;
     13        background-image: url('images/mirror_not_configured.png');
     14        height: 30px;
     15        width: 30px;
     16}
     17#llxmirrorconfiguration{
     18        color:white;
     19}
     20
     21#llxmirrorconfiguration.llxmirrordisabled{
     22        background-color:black;
     23        transition: max-height 1s;
     24        max-height: 0px;
     25        overflow: hidden;
     26}
     27
     28#llxmirrorconfiguration.llxmirroractivate{
     29        background-color:black;
     30        transition: max-height 1s;
     31        max-height: 400px;
     32        overflow: hidden;
     33}
  • lliurex-mirror/trunk/fuentes/admin-center-lliurex-mirror.install/lliurex-mirror/src/js/lliurex-mirror.js

    r2045 r2068  
    11function LliurexMirror(){
    2   self.distros = ['llx16'];
    3   self.defaultdistro = 0;
    4   self.progresscolors = {'ok' : '#4caf50' , 'error' : 'red', 'working':'yellow','default':'black'};
    5   self.bars = {};
     2  this.distros = ['llx16'];
     3  this.defaultdistro = 0;
     4  this.progresscolors = {'ok' : '#4caf50' , 'error' : 'red', 'working':'yellow','default':'black'};
     5  this.bars = {};
     6  this.edit = null;
     7
    68}
    79
     
    911  var self = this;
    1012  var distro = self.distros[self.defaultdistro];
    11 
    1213  $(document).on("moduleLoaded",function(e,args){
    13     Utils.n4d('', 'VariablesManager', 'get_variable', ['LLIUREXMIRROR'], function(response){
     14    Utils.n4d('', 'VariablesManager', 'get_variable', ['LLIUREXMIRROR'], function get_variables(response){
    1415      self.mirrorinfo = response;
    15         progressoptions = {
    16                 color:self.progresscolors['ok'],
    17                 trailcolor:'#9f9f9f',
    18                 trailWidth:3,
    19                 strokeWidth: 3,
    20                 easing: 'easeInOut',
    21                 text: {value:''}
    22         };
    23     status_mirror = self.mirrorinfo[distro]['status_mirror'].toLowerCase();
    24     progressoptions['color'] = self.progresscolors.hasOwnProperty(status_mirror) ? self.progresscolors[status_mirror] : self.progresscolors['default']; 
    25     progressoptions['text']['value'] = distro;
    26     self.bars[distro] = new ProgressBar.Circle('#llxmirrorprogress', progressoptions);
    27     self.bar[distro].animate(1 - (100 - self.mirrorinfo[distro]['progress']) / 100 );
    28     self.showOrigin();
    29     self.showArchitecture();
    30     self.showMirrorSize();
     16      progressoptions = {
     17        color:self.progresscolors['ok'],
     18        trailcolor:'#9f9f9f',
     19        trailWidth:3,
     20        strokeWidth: 3,
     21        easing: 'easeInOut',
     22        text: {value:''}
     23      };
     24      status_mirror = self.mirrorinfo[distro]['status_mirror'].toLowerCase();
     25      progressoptions['color'] = self.progresscolors.hasOwnProperty(status_mirror) ? self.progresscolors[status_mirror] : self.progresscolors['default']; 
     26      progressoptions['text']['value'] = distro;
     27      self.bars[distro] = new ProgressBar.Circle('#llxmirrorprogress', progressoptions);
     28      self.bars[distro].animate(1 - (100 - self.mirrorinfo[distro]['progress']) / 100 );
     29      self.showOrigin();
     30      self.showArchitecture();
     31      self.showMirrorSize();
    3132    });
    3233  });
    33 }
     34  $("#llxmirrormenuarch").on('click',function modifyarch(e,args){
     35    var configuration = document.querySelectorAll('#llxmirrorconfiguration')[0];
     36    if (self.edit != "#llxmirrormenuarch" & self.edit != null){
     37      document.querySelector(self.edit).click();
     38      setTimeout(function() {document.querySelector("#llxmirrormenuarch").click();}, 1000);
     39    }
     40    else{
     41      if (configuration.classList.contains('llxmirroractivate')){
     42       configuration.classList = ['llxmirrordisabled'];
     43       self.edit = null;
     44      }
     45      else{
     46       configuration.classList = ['llxmirroractivate'];
     47       configuration.innerHTML = "<h1>Hola</h1>";
     48       self.edit = "#llxmirrormenuarch";
     49      }
     50    }
     51  });
     52
     53  $("#llxmirrormenuorig").on('click',function modifyarch(e,args){
     54    var configuration = document.querySelectorAll('#llxmirrorconfiguration')[0];
     55    if (self.edit != "#llxmirrormenuorig" & self.edit != null){
     56      document.querySelector(self.edit).click();
     57      setTimeout(function() {document.querySelector("#llxmirrormenuorig").click();}, 1000);
     58    }
     59    else{
     60      if (configuration.classList.contains('llxmirroractivate')){
     61       configuration.classList = ['llxmirrordisabled'];
     62       self.edit = null;
     63      }
     64      else{
     65       configuration.classList = ['llxmirroractivate'];
     66       configuration.innerHTML = "<h1 >Adios</h1>";
     67       self.edit = "#llxmirrormenuorig";
     68      }
     69    }
     70  });
     71};
    3472
    3573LliurexMirror.prototype.showOrigin = function showOrigin(){
     
    3876        var n4dmethod="get_mirror_orig";
    3977        var arglist=['llx16'];
    40         Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){
    41                 $("#llxmirrororig").text(response['msg']);
    42         });
     78        Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function getmirrororig(response){
     79    if(response != null && response['status'] == true)
     80      $("#llxmirrororig").text(response['msg']);
     81  });
    4382}
    4483
     
    4887        var n4dmethod="get_mirror_architecture";
    4988        var arglist=['llx16'];
    50         Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){
    51     listarchitectures = response['msg'];
    52     stringarchitectures = "";
    53     stringarchitectures += listarchitectures.indexOf('i386') > -1 ? "32Bits ":"";
    54     stringarchitectures += listarchitectures.indexOf('amd64') > -1 ? "64Bits":"";
    55                 $("#llxmirrorarchitecture").text();
    56         });
     89        Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function getmirrorarchitecture(response){
     90    if(response != null && response['status'] == true){
     91
     92      listarchitectures = response['msg'];
     93      stringarchitectures = "";
     94      stringarchitectures += listarchitectures.indexOf('i386') > -1 ? "32Bits ":"";
     95      stringarchitectures += listarchitectures.indexOf('amd64') > -1 ? "64Bits":"";
     96      $("#llxmirrorarchitecture").text();
     97    }
     98  });
    5799}
    58100
     
    62104  var n4dmethod="get_variable";
    63105  var arglist=['LLIUREXMIRROR'];
    64   Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){
     106  Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function getvariable(response){
    65107    mirrorinfo = response;
    66108    if ( ! mirrorinfo.hasOwnProperty('internal') ){
  • lliurex-mirror/trunk/fuentes/admin-center-lliurex-mirror.install/lliurex-mirror/src/main2.html

    r2041 r2068  
    1111                <div class="col-md-6 col-xs-12">
    1212                        <div class="panel panel-info">
    13                                 <div class="panel-heading"><h3 class="panel-title">Arquitectura</h3></div>
     13                                <div class="panel-heading"><h3 class="panel-title" i18n >Arquitectura</h3><i class="menu" id="llxmirrormenuarch"></i></div>
    1414                                <div class="panel-body" id="llxmirrorarchitecture">32Bits 64Bits</div>
    1515                        </div>
     
    1717                <div class="col-md-6 col-xs-12">
    1818                        <div class="panel panel-info">
    19                                 <div class="panel-heading"><h3 class="panel-title">Origen</h3></div>
     19                                <div class="panel-heading"><h3 class="panel-title" i18n >Origen</h3><i class="menu" id="llxmirrormenuorig"></i></div>
    2020                                <div class="panel-body" id="llxmirrororig">lliurex.net</div>
    2121                        </div>
    2222                </div>
     23        </div>
     24        <div class="row" >
     25        <div id="llxmirrorconfiguration" class='llxmirrordisable' >
     26               
     27               
     28        </div>
    2329        </div>
    2430        <div class="row text-right">
Note: See TracChangeset for help on using the changeset viewer.