  <table id="main">
    <tr id="node_title_row" {{bind-attr style="Pcs.node_page"}}><td id="page_header" colspan=3>
	NODES
      </td>
    </tr>
    <tr id="node_header_row" {{bind-attr style="Pcs.node_page"}}>
      <td id="remove_add" class="borderbottom">
	<div>
	  <input type="checkbox" onchange="checkBoxToggle($(this), true);">
	</div>
	<div id="no_coro_support">
    <div class="x sprites"></div>
    <div class="link" onclick="nodesRemove.dialog.create(); return false;">&nbsp;Remove&nbsp;&nbsp;&nbsp;&nbsp;</div>
    <div class="plus sprites"></div>
    <div class="link" onclick="nodeAdd.dialog.create(); return false;">&nbsp;Add</div>
	</div>
      </td>
      <td class="borderbottom">&nbsp;</td>
      <td id="tab_name" width="85">
	<div style="float: left">&nbsp;Edit Node&nbsp;</div><div class="check sprites"></div>
      </td>
    </tr>
    <tr id="node_list_row" {{bind-attr style="Pcs.node_page"}}>
      <td id="node_list" class="node_list">
	<table cellpadding=0 cellspacing=0 style="float:left;">
	  {{#each Pcs.nodesController}}
	    <tr {{bind-attr onmouseover="onmouseover"}} {{bind-attr onmouseout="onmouseout"}} {{bind-attr class="trclass"}} {{bind-attr nodeID="name"}} onclick='Pcs.nodesController.load_node(this);'>
	    <td class="node_list_check">
	      {{view Ember.Checkbox checkedBinding="checked" onclick="checked" class="node_list_check"}}
	    </td>
	    <td class="node_list_sprite">
	      <div class="check sprites"></div>
	    </td>
	    <td class="node_name" {{bind-attr style="node_name_style"}}>
		 {{name}}
	    </td>
	    <td>
	      <div {{bind-attr style="showArrow"}} class="arrow sprites"></div>
	    </td>
	  </tr>
        {{/each}}
	</table>
      </td>
      <td id="node_info" colspan=2>
        <div id="node_info_div" style="opacity: 0;">
          <div id="test">
            <div id="node_info_header">
              <div id="node_info_header_title" class="node_info_header_title">Edit Node&nbsp;</div>
              <div id="node_info_header_title_name">
                {{Pcs.nodesController.cur_node.name}}
              </div>
            </div>

            <div id="node_sub_info">
              <table>
                <tr>
                  <td rowspan=2>
                    <input disabled style="margin-right: 50px;" type="text" {{bind-attr value="Pcs.nodesController.cur_node.name"}} size="35" class="text_field">
                  </td>
                  <td><div style="margin-right: 8px;" class="check sprites"></div></td>
                  <td>
                    {{#if Pcs.nodesController.cur_node.pacemaker}}
                    {{#unless Pcs.nodesController.cur_node.pacemaker_standby}}
                    {{#if Pcs.nodesController.cur_node.pacemaker_maintenance}}
                    <div id="pacemaker_online_status" class="status-standby">
                      Pacemaker Maintanence
                    </div>
                    {{else}}
                    <div id="pacemaker_online_status" class="status">
                      Pacemaker Connected
                    </div>
                    {{/if}}
                    {{else}}
                    <div id="pacemaker_online_status" class="status">
                      Pacemaker Connected
                    </div>
                    {{/unless}}
                    {{else}}
                    {{#if Pcs.nodesController.cur_node.pacemaker_standby}}
                    <div id="pacemaker_online_status" class="status-standby">
                      Pacemaker Standby
                    </div>
                    {{else}}
                    {{#if Pcs.nodesController.cur_node.pacemaker_maintenance}}
                    <div id="pacemaker_online_status" class="status-standby">
                      Pacemaker Maintanence
                    </div>
                    {{else}}
                    <div id="pacemaker_online_status" class="status-offline">
                      Pacemaker Not Connected
                    </div>
                    {{/if}}
                    {{/if}}
                    {{/if}}
                  </td>
                </tr>
                <tr>
                  <td><div style="margin-right: 8px;" class="check sprites"></div></td>
                  <td>
                    {{#if Pcs.nodesController.cur_node.corosync}}
                    <div id="corosync_online_status" class="status">
                      Corosync Connected
                    </div>
                    {{else}}
                    <div id="corosync_online_status" class="status-offline">
                      Corosync Not Connected
                    </div>
                    {{/if}}
                  </td>
                </tr>
              </table>
            </div>

            <div id="node_options_buttons">
              <div id="node_start" class="link" title="Start cluster services on the node">
                <div class="restart sprites" style="float: left"></div>
                &nbsp;Start
              </div>
              <div id="node_stop" class="link" title="Stop cluster services on the node">
                <div class="cancel sprites" style="float: left"></div>
                &nbsp;Stop
              </div>
              <div id="node_restart" class="link" title="Reboot the node">
                <div class="restart sprites" style="float: left"></div>
                &nbsp;Node Restart
              </div>
              <div id="node_unstandby" class="link" {{bind-attr style="Pcs.nodesController.cur_node.unstandby_style"}}>
                <div class="unstandby sprites" style="float: left"></div>
                &nbsp;Unstandby
              </div>
              <div id="node_standby" class="link" {{bind-attr style="Pcs.nodesController.cur_node.standby_style"}}>
                <div class="standby sprites" style="float: left"></div>
                &nbsp;Standby
              </div>
              {{#if Pcs.nodesController.cur_node.is_in_maintenance}}
              <div id="node_unmaintenance" class="link" onclick="fade_in_out('#node_unmaintenance');node_unmaintenance(Pcs.nodesController.cur_node.get('name'));">
                <div class="unstandby sprites" style="float: left"></div>
                &nbsp;Unmaintenance
              </div>
              {{else}}
              <div id="node_maintenance" class="link" onclick="fade_in_out('#node_maintenance');node_maintenance(Pcs.nodesController.cur_node.get('name'));">
                <div class="standby sprites" style="float: left"></div>
                &nbsp;Maintenance
              </div>
              {{/if}}
              <div class="configure sprites" style="float: left"></div>
              <div class="link"><a href="#/fencedevices" onclick="select_menu('FENCE DEVICES');return true;">Configure Fencing</a></div>
            </div>

            <div id="node_details">
              {{#unless Pcs.nodesController.cur_node.status_unknown}}
              <table><tr>
                <td><div class="reg">Node ID:</div></td>
                <td><div class="bold">{{Pcs.nodesController.cur_node.node_id}}</div></td>
                <td><div class="reg"> Uptime:</div></td>
                <td><div class="bold" id="uptime">{{Pcs.nodesController.cur_node.uptime}}</div></td>
              </tr>
              </table>
              {{/unless}}
            </div>

            <table style="float:left;margin-top:25px">
              <tr><td class="datatable_header">Cluster Daemons</td></tr>
              <tr><td>
                <div id="clusterdaemons">
                  <table class="datatable">
                    <tr><th>NAME</th><th>STATUS</th></tr>
                    <tr><td>pacemaker</td><td><div style="float:left;margin-right:6px;" class="check sprites"></div>
                      {{#if Pcs.nodesController.cur_node.pacemaker_daemon}}
                      <span id="pacemaker_status" style="float:left" class="status">Running ({{Pcs.nodesController.cur_node.pacemaker_startup}})</span>
                      {{else}}
                      {{#if Pcs.nodesController.cur_node.pcsd}}
                      <span id="pacemaker_status" style="float:left" class="status-offline">Stopped ({{Pcs.nodesController.cur_node.pacemaker_startup}})</span>
                      {{else}}
                      <span id="pacemaker_status" style="float:left" class="status-unknown">Unknown ({{Pcs.nodesController.cur_node.pacemaker_startup}})</span>
                      {{/if}}
                      {{/if}}
                    </td></tr>
                    <tr><td>corosync</td><td><div style="float:left;margin-right:6px;" class="check sprites"></div>
                      {{#if Pcs.nodesController.cur_node.corosync_daemon}}
                      <span id="corosync_status" style="float:left" class="status">Running ({{Pcs.nodesController.cur_node.corosync_startup}})</span>
                      {{else}}
                      {{#if Pcs.nodesController.cur_node.pcsd}}
                      <span id="corosync_status" style="float:left" class="status-offline">Stopped ({{Pcs.nodesController.cur_node.corosync_startup}})</span>
                      {{else}}
                      <span id="corosync_status" style="float:left" class="status-unknown">Unknown ({{Pcs.nodesController.cur_node.corosync_startup}})</span>
                      {{/if}}
                      {{/if}}
                    </td></tr>
                    {{#if Pcs.is_sbd_enabled_or_running }}
                    <tr><td>sbd</td><td><div style="float:left;margin-right:6px;" class="check sprites"></div>
                      {{{Pcs.nodesController.cur_node.sbd_status_str}}}
                    </td></tr>
                    {{/if}}
                    <tr><td>pcsd</td><td><div style="float:left;margin-right:6px;" class="check sprites"></div>
                      {{#if Pcs.nodesController.cur_node.pcsd}}
                      <span id="pcsd_status" style="float:left" class="status">Running ({{Pcs.nodesController.cur_node.pcsd_startup}})</span>
                      {{else}}
                      {{#if Pcs.nodesController.cur_node.authorized}}
                      <span id="pcsd_status" style="float:left" class="status-offline">Stopped ({{Pcs.nodesController.cur_node.pcsd_startup}})</span>
                      {{else}}
                      <span id="pcsd_status" style="float:left" class="status-offline">Running (not Authorized) ({{Pcs.nodesController.cur_node.pcsd_startup}})</span>
                      {{/if}}
                      {{/if}}
                    </td></tr>
                  </table>
                </div>
              </td>
              </tr>
            </table>
            <table style="clear:left;float:left;margin-top:25px;">
              <tr><td class="datatable_header">Running Resources</td></tr>
              <tr><td>
                <div id="resources_running">
                  <table class="datatable">
                    <tr><th>NAME</th></tr>
                    {{#if Pcs.nodesController.cur_node.running_resources}}
                    {{#each res in Pcs.nodesController.cur_node.running_resources}}
                    <tr><td>
                      {{#unless res.stonith}}
                      {{#link-to 'Resources.index' res}}{{res.name}} ({{res.res_type}}){{/link-to}}
                      {{/unless}}
                    </td></tr>
                    {{/each}}
                    {{else}}
                    <tr><td style="color: gray;">NONE</td></tr>
                    {{/if}}
                  </table>
                </div>
              </td>
              </tr>
            </table>
            <table style="clear:left;float:left;margin-top:25px;">
              <tr><td class="datatable_header">Resource Location Preferences</td></tr>
              <tr><td>
                <div id="locationdep">
                  <table class="datatable">
                    <tr><th>NAME</th><th>Score</th></tr>
                    {{#if Pcs.nodesController.cur_node.location_constraints}}
                    {{#each Pcs.nodesController.cur_node.location_constraints}}
                    <tr><td>{{rsc}}</td><td>{{score}}</td><td></td></tr>
                    {{/each}}
                    {{else}}
                    <tr><td style="color: gray;">NONE</td><td></td></tr>
                    {{/if}}
                  </table>
                </div>
              </td>
              </tr>
            </table>
            <table style="clear:left;float:left;margin-top:25px;">
              <tr><td onclick="show_hide_constraints(this)" class="datatable_header hover-pointer">Node Attributes ({{#if Pcs.nodesController.cur_node_attr.length}}{{Pcs.nodesController.cur_node_attr.length}}{{else}}0{{/if}})<span style="" class="downarrow sprites" id="node_attributes"></span><span style="display: none;" class="rightarrow sprites"></span></td></tr>
              <tr><td>
                  <table class="datatable">
                    <tr><th>Attribute</th><th>Value</th><th>Remove</th></tr>
                    {{#each attr in Pcs.nodesController.cur_node_attr}}
                    <tr><td>{{attr.name}}</td>
                      <td>{{attr.value}}</td>
                      <td {{bind-attr node_attr_key=attr.name}} {{bind-attr node_attr_parent=attr.parent}} style="text-align:center">
                        <a onclick="remove_node_attr($(this).parent());return false;" href="#" class="remove">X</a>
                      </td>
                    </tr>
                    {{else}}
                    <tr><td style="color: gray;">NONE</td><td></td><td></td></tr>
                    {{/each}}
                    <tr id="new_node_attr_col">
                      <td><input type="text" name="new_node_attr_key" size="20"></td>
                      <td><input type="text" name="new_node_attr_value" size="20"></td>
                      <td><button type="button" onclick="add_node_attr('#new_node_attr_col');" name="add">Add</button></td>
                    </tr>
                  </table>
              </td>
              </tr>
            </table>
            <table style="clear:left;float:left;margin-top:25px;">
              <tr><td onclick="show_hide_constraints(this)" class="datatable_header hover-pointer">Fence Levels ({{#if Pcs.nodesController.cur_node_fence_levels.length}}{{Pcs.nodesController.cur_node_fence_levels.length}}{{else}}0{{/if}})<span style="" class="downarrow sprites" id="fence_levels"></span><span style="display: none;" class="rightarrow sprites"></span></td></tr>
              <tr><td>
                  <table class="datatable">
                    <tr><th>Level</th><th>Fence Devices</th><th>Remove</th></tr>
                    {{#each Pcs.nodesController.cur_node_fence_levels}}
                    <tr>
                      <td>{{this.level}}</td>
                      <td>{{this.devices}}</td>
                      <td {{bind-attr fence_level="this.level" fence_devices="this.devices"}}  style="text-align:center">
                        <a onclick="add_remove_fence_level($(this).parent(),true);return false;" href="#" class="remove">X</a>
                      </td>
                    </tr>
                    {{/each}}
                    {{#unless Pcs.nodesController.cur_node_fence_levels}}
                    <tr><td style="color: gray;">NONE</td><td></td><td></td></tr>
                    {{/unless}}
                    <tr id="new_fence_level_col">
                      <td><input type="text" name="new_level_level" size="2"></td>
                      <td><select name="new_level_value">
                        <option></option>
                        {{#each Pcs.resourcesContainer.fence_list}}
                        <option {{bind-attr value="this.id"}}>{{this.id}}</option>
                        {{/each }}
                      </select></td>
                      <td><button type="button" onclick="add_remove_fence_level($(this).parent());" name="add">Add</button></td>
                    </tr>
                  </table>
              </td>
              </tr>
            </table>
            {{#if Pcs.nodesController.utilization_support}}
            <table style="clear:left; float:left; margin-top: 25px;"><tr><td>
            {{utilization-table
                entity=Pcs.nodesController.cur_node
                utilization=Pcs.nodesController.cur_node.utilization
                table_id="node_utilization_attributes"
            }}
            </td></tr></table>
            {{/if}}
    </div>
    </div>
    </td>
    </tr>
<%= erb :_configure %>
<%= erb :_acls %>
<% @myView = "stonith" %>
<%= erb :_resource %>
<% @myView = "resource" %>
<%= erb :_resource %>
</table>
<%= erb :_dialogs %>
<div id="add_node" style="display: none;">
  <form>
    <table id="add_node_selector">
      <tr>
        <td>Node Name:</td>
        <td><input type=text name=new_nodename></td>
      </tr>
      
      <tr>
        <td>Node Addresses:</td>
        <td class="link-expander">
          <a href="#" onclick="nodeAdd.dialog.toggleLinks();return false;">(+)</a>
        </td>
      </tr>
      
      <tbody class="node-links" style="display:none">
        <tr>
          <td
            rowspan="8"
            style="max-width: 8em; vertical-align: top; padding-top: 0.5em; padding-right: 0.2em"
          >
              Please specify the count of links that is compatible with this
              cluster
          </td>
          <td><input type=text name="links[]"></td>
        </tr>
        <tr><td><input type=text name="links[]"></td></tr>
        <tr><td><input type=text name="links[]"></td></tr>
        <tr><td><input type=text name="links[]"></td></tr>
        <tr><td><input type=text name="links[]"></td></tr>
        <tr><td><input type=text name="links[]"></td></tr>
        <tr><td><input type=text name="links[]"></td></tr>
        <tr><td><input type=text name="links[]"></td></tr>
      </tbody>
      
      <tr>
        <td>Start the Node:</td>
        <td><input type="checkbox" name="auto_start" value="1" checked></td>
      </tr>
      
      <tbody class="sbd-features" style="display:none">
        <tr>
          <td>SBD watchdog:</td>
          <td>
            <input type="text" name="watchdog" placeholder="/dev/watchdog" />
          </td>
        </tr>
        <tr class="add_node_sbd_device">
          <td>
            SBD device(s):
          </td>
          <td>
            <input type="text" name="devices[]" />
            <a href="#" onclick="add_sbd_device_textbox(); return false;">(+)</a>
          </td>
        </tr>
        <tr>
          <td>Do not validate watchdog:</td>
          <td>
            <input type="checkbox" name="no-watchdog-validation" value="1" >
          </td>
        </tr>
      </tbody>
      
    </table>
    <table class="msg-box" style="width:100%"><tr><td/></tr></table>
  </form>
</div>
