<commit_before><div id="content" class="span11">


      <div class="row-fluid">
          <div class="box span12">
          <div class="box-header" data-original-title>
            <h2><i class="halflings-icon hdd"></i><span class="break"></span>Instances</h2>
          </div>
          <div class="box-content">
            <table class="table table-striped table-hover table-bordered">
                  <thead>
                    <tr>
                      <th>Status</th>
                      <th>Instance</th>
                      <th>Ownership</th>
                      <th>Node</th>
                    </tr>
                  </thead>   
                  <tbody>
                  <tr ng-repeat="i in clusterMembership.instances">
                    <td ng-bind="i.status"></td>
                    <td><a href="{{ i.url }}">{{ i.name }} ({{ i.url }})</a></td>
                    <td ui-if="ownership(i) == pendingOwnership(i)">
                      {{ ownership(i) }}%
                    </td>
                    <td ui-if="ownership(i) > pendingOwnership(i)">
                      <img src="img/downarrow.png">{{ ownership(i) }}% (pending {{ pendingOwnership(i)}}%)
                    </td>
                    <td ui-if="ownership(i) < pendingOwnership(i)">
                      <img src="img/uparrow.png">{{ ownership(i) }}% (pending {{ pendingOwnership(i)}}%)
                    </td>
                    <td ng-bind="i.node"></td>
                  </tr>
                </tbody>
             </table>
          </div>
        </div>
      </div>
 
       <div  class="row-fluid">
          <div class="box span12">
          <div class="box-header" data-original-title>
            <h2><i class="halflings-icon hdd"></i><span class="break"></span>Staging Plan</h2>
          </div>
          <div class="box-content">
            <div class="row-fluid">
             <form class="form-horizontal" ng-submit="stageJoin()">
              <fieldset>
                <div class="control-group">
                  <label class="control-label" for="instanceURL">Add an instance at</label>
                  <div class="controls">
                    <input class="input-xlarge focused" id="instanceURL" type="text" placeholder="http://" ng-model="instanceToAdd">
                    <input class="btn-primary" type="submit" value="add">
                  </div>
                </div>            
              </fieldset>
            </form>
            </div>
            <table class="table table-striped table-hover table-bordered" ui-if="clusterMembershipPlan.plan.transitions > 0">
                  <thead>
                    <tr>
                      <th>Action</th>
                      <th>Instance</th>
                    </tr>
                  </thead>   
                  <tbody>
                  <tr ng-repeat="i in clusterMembershipPlan.plan.joins">
                    <td>Join</td>
                    <td><a href="{{ i }}">{{ findInstanceByURL(i).name }} ({{ i }})</a></td>
                  </tr>
                  <tr ng-repeat="i in clusterMembershipPlan.plan.leaves">
                    <td>Leave</td>
                    <td><a href="{{ i }}">{{ findInstanceByURL(i).name }} ({{ i }})</a></td>
                  </tr>
                  <tr ng-repeat="i in clusterMembershipPlan.plan.forced_removals">
                    <td>Force Remove</td>
                    <td><a href="{{ i }}">{{ findInstanceByURL(i).name }} ({{ i }})</a></td>
                  </tr>
                  <tr ng-repeat="i in clusterMembershipPlan.plan.replacements">
                    <td>Replace</td>
                    <td><a href="{{ i }}">{{ findInstanceByURL(i).name }} ({{ i }})</a></td>
                  </tr>
                  <tr ng-repeat="i in clusterMembershipPlan.plan.forced_replacements">
                    <td>Force Replace</td>
                    <td><a href="{{ i }}">{{ findInstanceByURL(i).name }} ({{ i }})</a></td>
                  </tr>
                </tbody>
             </table>
             <div class="row-fluid">
               <div class="pull-right">
                 <button class="btn3d btn-large btn-danger" ng-click="discardPlan()">Discard</button>
                 <button class="btn3d btn-large btn-success" ng-click="commitPlan()">Commit</button>
               </div>
            </div>

          </div>
      </div>
      
    </div>  
</div>



 <commit_msg>In the Staging Plan UI, show Discard & Commit buttons only when they can be used (i.e. there *is* a staging plan)<commit_after><div id="content" class="span11">


      <div class="row-fluid">
          <div class="box span12">
          <div class="box-header" data-original-title>
            <h2><i class="halflings-icon hdd"></i><span class="break"></span>Instances</h2>
          </div>
          <div class="box-content">
            <table class="table table-striped table-hover table-bordered">
                  <thead>
                    <tr>
                      <th>Status</th>
                      <th>Instance</th>
                      <th>Ownership</th>
                      <th>Node</th>
                    </tr>
                  </thead>   
                  <tbody>
                  <tr ng-repeat="i in clusterMembership.instances">
                    <td ng-bind="i.status"></td>
                    <td><a href="{{ i.url }}">{{ i.name }} ({{ i.url }})</a></td>
                    <td ui-if="ownership(i) == pendingOwnership(i)">
                      {{ ownership(i) }}%
                    </td>
                    <td ui-if="ownership(i) > pendingOwnership(i)">
                      <img src="img/downarrow.png">{{ ownership(i) }}% (pending {{ pendingOwnership(i)}}%)
                    </td>
                    <td ui-if="ownership(i) < pendingOwnership(i)">
                      <img src="img/uparrow.png">{{ ownership(i) }}% (pending {{ pendingOwnership(i)}}%)
                    </td>
                    <td ng-bind="i.node"></td>
                  </tr>
                </tbody>
             </table>
          </div>
        </div>
      </div>
 
       <div  class="row-fluid">
          <div class="box span12">
          <div class="box-header" data-original-title>
            <h2><i class="halflings-icon hdd"></i><span class="break"></span>Staging Plan</h2>
          </div>
          <div class="box-content">
            <div class="row-fluid">
             <form class="form-horizontal" ng-submit="stageJoin()">
              <fieldset>
                <div class="control-group">
                  <label class="control-label" for="instanceURL">Add an instance at</label>
                  <div class="controls">
                    <input class="input-xlarge focused" id="instanceURL" type="text" placeholder="http://" ng-model="instanceToAdd">
                    <input class="btn-primary" type="submit" value="add">
                  </div>
                </div>            
              </fieldset>
            </form>
            </div>
            <table class="table table-striped table-hover table-bordered" ui-if="clusterMembershipPlan.plan.transitions > 0">
                  <thead>
                    <tr>
                      <th>Action</th>
                      <th>Instance</th>
                    </tr>
                  </thead>   
                  <tbody>
                  <tr ng-repeat="i in clusterMembershipPlan.plan.joins">
                    <td>Join</td>
                    <td><a href="{{ i }}">{{ findInstanceByURL(i).name }} ({{ i }})</a></td>
                  </tr>
                  <tr ng-repeat="i in clusterMembershipPlan.plan.leaves">
                    <td>Leave</td>
                    <td><a href="{{ i }}">{{ findInstanceByURL(i).name }} ({{ i }})</a></td>
                  </tr>
                  <tr ng-repeat="i in clusterMembershipPlan.plan.forced_removals">
                    <td>Force Remove</td>
                    <td><a href="{{ i }}">{{ findInstanceByURL(i).name }} ({{ i }})</a></td>
                  </tr>
                  <tr ng-repeat="i in clusterMembershipPlan.plan.replacements">
                    <td>Replace</td>
                    <td><a href="{{ i }}">{{ findInstanceByURL(i).name }} ({{ i }})</a></td>
                  </tr>
                  <tr ng-repeat="i in clusterMembershipPlan.plan.forced_replacements">
                    <td>Force Replace</td>
                    <td><a href="{{ i }}">{{ findInstanceByURL(i).name }} ({{ i }})</a></td>
                  </tr>
                </tbody>
             </table>
             <div class="row-fluid">
               <div class="pull-right">
                 <button ui-if="clusterMembershipPlan.plan.transitions > 0" class="btn3d btn-large btn-danger" ng-click="discardPlan()">Discard</button>
                 <button ui-if="clusterMembershipPlan.plan.transitions > 0" class="btn3d btn-large btn-success" ng-click="commitPlan()">Commit</button>
               </div>
            </div>

          </div>
      </div>
      
    </div>  
</div>



 
{'fraction_non_alphanumeric': 0.16736401673640167, 'fraction_numerical': 0.0030830213609337152, 'mean_word_length': 1.313550687722873, 'pattern_counts': {'":': 0, '<': 281, '<?xml version=': 0, '>': 285, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '128401', 'n_tokens_mistral': 2644, 'n_tokens_neox': 2463, 'n_words': 466}