Changeset 1640:c35299928c59

Show
Ignore:
Timestamp:
06/03/08 09:57:58 (3 months ago)
Author:
sandholm@…
Branch:
default
Message:

hadoop ui src update

Location:
src/grid/hadoop/gwt/src/com/hp/hpl/tycoon/ui/thundercloud
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • src/grid/hadoop/gwt/src/com/hp/hpl/tycoon/ui/thundercloud/client/ManageView.java

    r1604 r1640  
    4444  
    4545  ConfigView config;  
     46  MasterView master; 
    4647  Grid grid; 
    4748  Button createButton; 
     
    7576              config.setValue("time", Long.toString(time)); 
    7677              tycoon.command("asynch create 1"); 
     78              master.startCreation(); 
    7779          }  
    7880          if (sender == restartButton) { 
     
    112114      } 
    113115  } 
    114   public ManageView(ConfigView config, Tycoon tycoon) { 
     116  public ManageView(ConfigView config, MasterView master, Tycoon tycoon) { 
    115117      this.config = config; 
    116118      this.tycoon = tycoon; 
     119      this.master = master; 
    117120      grid = new Grid(5,2); 
    118121      panel.add(grid); 
     
    143146      //serverUrl = serverUrl.substring(0,stop); 
    144147      createButton = new Button("<img src=\"" + serverUrl +"/create.png\"/>&nbsp;Create", this); 
    145       createButton.setHeight("25px"); 
     148      createButton.setHeight("27px"); 
     149      createButton.setWidth("90px"); 
    146150      restartButton = new Button("<img src=\"" + serverUrl +"/restart.png\"/>&nbsp;Restart", this); 
    147       restartButton.setHeight("25px"); 
     151      restartButton.setHeight("27px"); 
     152      restartButton.setWidth("90px"); 
    148153      cleanButton = new Button("<img src=\"" + serverUrl +"/clean.png\"/>&nbsp;Clean", this); 
    149       cleanButton.setHeight("25px"); 
     154      cleanButton.setHeight("27px"); 
     155      cleanButton.setWidth("90px"); 
    150156      terminateButton = new Button("<img src=\"" + serverUrl +"/delete.png\"/>&nbsp;Terminate", this); 
    151       terminateButton.setHeight("25px"); 
     157      terminateButton.setHeight("27px"); 
     158      terminateButton.setWidth("90px"); 
    152159 
    153160      updateNodeButton = new Button("<img src=\"" + serverUrl +"/refresh.png\"/>", this); 
     
    168175      memoryPanel.setText(0,1, "Memory (GiB):"); 
    169176      spendingPanel.setWidget(0,0,updateSpendingButton); 
    170       spendingPanel.setText(0,1,"Spending Rate ($/day):"); 
     177      spendingPanel.setText(0,1,"Spending ($/day):"); 
    171178 
    172179      grid.setWidget(0,0,nodePanel); 
     
    201208      spendingSlider.getSlider().setValue(0.1); 
    202209      grid.setWidget(3,1,spendingSlider); 
    203       HorizontalPanel buttonPanel = new HorizontalPanel(); 
    204       buttonPanel.add(createButton); 
    205       buttonPanel.add(restartButton); 
    206       buttonPanel.add(cleanButton); 
    207       buttonPanel.add(terminateButton); 
    208       grid.setWidget(4,0,buttonPanel); 
     210      HorizontalPanel buttonPanel1 = new HorizontalPanel(); 
     211      buttonPanel1.add(createButton); 
     212      buttonPanel1.add(restartButton); 
     213      grid.setWidget(4,0,buttonPanel1); 
     214      HorizontalPanel buttonPanel2 = new HorizontalPanel(); 
     215      buttonPanel2.add(cleanButton); 
     216      buttonPanel2.add(terminateButton); 
     217      grid.setWidget(4,1,buttonPanel2); 
    209218      return panel; 
    210219  } 
  • src/grid/hadoop/gwt/src/com/hp/hpl/tycoon/ui/thundercloud/client/MasterView.java

    r1604 r1640  
    4040  Tycoon tycoon; 
    4141  String status = "down"; 
     42  long progress = 0; 
     43  long tick = 0; 
     44  long progressTick = 0; 
     45  String budget = ""; 
     46  String expires = ""; 
    4247 
    4348  public MasterView(Tycoon tycoon) { 
    4449      this.tycoon = tycoon; 
     50      this.progress = 0; 
     51      this.tick = 0; 
     52      this.progressTick = -1; 
    4553  } 
    4654 
    4755  public void run() { 
    48      tycoon.masterStatus(); 
     56     if (tick % 3 == 0) { 
     57         tycoon.masterStatus(); 
     58     }  
     59     if (this.progress < 95 && this.progressTick > 0) { 
     60         this.progress = (this.tick - this.progressTick)/2; 
     61         updateStatus(); 
     62     } 
     63     tick += 10; 
    4964  } 
    5065 
     
    5368      this.frame.setContent(new HTML("<center><img src=\"status_down.png\"/></center>" + 
    5469                                     "<br><b>Budget:</b><br>" + 
     70                                     "<br><b>Creation Progress:</b> " + Long.toString(this.progress) + "%<br>" + 
    5571                                     "<br><b>Expires:</b>"));  
    5672      run(); 
    57       scheduleRepeating(30000); 
     73      scheduleRepeating(10000); 
     74  } 
     75 
     76  public void startCreation() { 
     77      this.progress = 0; 
     78      this.progressTick = this.tick; 
    5879  } 
    5980 
     
    6182      String[] stat = new_status.split("\n"); 
    6283      //if (!stat[0].equals(this.status)) { 
    63       this.frame.setContent(new HTML("<center><img src=\"status_" + stat[0] + ".png\"/></center>" + 
    64                                      "<br><b>Budget:</b> $" + stat[1] + "<br>" + 
    65                                      "<br><b>Expires:</b> " + stat[2]));  
    6684      //} 
    6785      if (stat[0].equals("up") && !this.status.equals("up")) { 
    6886          tycoon.getMaster(); 
     87          this.progress = 100; 
     88          this.tick = 0; 
     89          this.progressTick = -1; 
    6990      } 
    70       this.status = new_status; 
     91      this.status = stat[0]; 
     92      this.budget = stat[1]; 
     93      this.expires = stat[2]; 
     94      updateStatus(); 
     95  } 
     96  public void updateStatus() { 
     97      this.frame.setContent(new HTML("<center><img src=\"status_" + this.status + ".png\"/></center>" + 
     98                                     "<br><b>Budget:</b> $" + this.budget + "<br>" + 
     99                                     "<br><b>Creation Progress:</b> " + Long.toString(this.progress) + "%<br>" + 
     100                                     "<br><b>Expires:</b> " + this.expires));  
    71101  } 
    72102} 
  • src/grid/hadoop/gwt/src/com/hp/hpl/tycoon/ui/thundercloud/client/index.java

    r1604 r1640  
    117117    masterView = new MasterView(tycoon); 
    118118    statusView = new StatusView(tycoon,statusLabel); 
    119     manageView = new ManageView(configView, tycoon); 
     119    manageView = new ManageView(configView, masterView, tycoon); 
    120120    hadoopFSView = new HadoopFSView(configView, tycoon); 
    121121    hadoopJobView = new HadoopJobView(tycoon); 
     
    220220      image.minimize(); 
    221221 
    222       GInternalFrame master = new DefaultGInternalFrame("Cluster v0010"); 
     222      GInternalFrame master = new DefaultGInternalFrame("Cluster v0025"); 
    223223      frames[5] = master; 
    224224      desktop.addFrame(master); 
  • src/grid/hadoop/gwt/src/com/hp/hpl/tycoon/ui/thundercloud/public/slider/HorizontalSlider.css

    r1564 r1640  
    44 
    55.sph-Slider { 
    6         width: 500px; 
     6        width: 200px; 
    77        height: 16px; 
    88        border:none;