summaryrefslogtreecommitdiffstats
path: root/LogReceiver/html/js/nd-functions.js
blob: e3ee7937842ee082163c8ba85bba8b10884529de (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
var abortBootDialog = function (m) {
  $("#nd_abort_boot_msg").html(m);
  $("#nd_abort_boot_dialog").dialog(
    { buttons: { "Show Log": function() {fbgui.showLog(); 
                   $(this).dialog("close");}, 
                 "Restart": function() {fbgui.restartSystem();
                   $(this).dialog("close"); },
                 "Shut Down": function() { fbgui.shutDownSystem(); 
                   $(this).dialog("close"); } 
               } ,
      minWidth: 450, 
      modal: true,
      resizable: false,
      draggable: false,
      open: function(event, ui) { $(".ui-dialog-titlebar-close").hide();}
    });
};

var chooseInterfaceDialog = function (i) {
  var cb = "<label> Choose your interface: </label>"+
           "<select>"+
           "  <option>eth0</option>"+ //should look like this: "  <option>"+ +"</option>"+
           "  <option>eth1</option>"+
           "  <option>eth2</option>"+
           "</select>";
  $("#nd_choose_interface_msg").html(cb);
  $("#nd_choose_interface_dialog").dialog(
    { buttons: { "Show Log": function() {fbgui.showLog(); 
                   $(this).dialog("close");}, 
                 "Restart": function() {fbgui.restartSystem();
                   $(this).dialog("close"); },
                 "Shut Down": function() { fbgui.shutDownSystem(); 
                   $(this).dialog("close"); },
                 "Continue": function() { fbgui.continueBoot(); 
                   $(this).dialog("close"); }
               } ,
      minWidth: 550, 
      modal: true,
      resizable: false,
      draggable: false,
      open: function(event, ui) { $(".ui-dialog-titlebar-close").hide();}
    });
}

var updateStatus = function (s){

};

var updateIfProgressBar = function (i, p){
  if (p >= 0 && p <= 100){
    $("#"+i+"_progress").progressbar({ value: p });
  }else{
  $("#"+i+"_progress").progressbar({ value: 0 });
  }
};

var updateIfStatus = function(i, s){
  $("#"+i+"_status").html(s);
};

var addInterface = function (i){
  $("#nd_progress_container").append(
    "<div class='interface'>"+
    "  Interface: " +i+
    "  <span id='"+i+"_status'>Start DHCP </span>" +
    "  <div id='"+i+"_progress' class='progressbar' "+
    "       style='height: 10px;'></div>"+
    "</div>"
  );
  $("#"+i+"_progress").progressbar({ value: 33 });
};