<commit_before>{{title "Client " (or this.model.name this.model.shortId)}}
<ClientSubnav @client={{this.model}} />
<section class="section">
  {{#if this.eligibilityError}}
    <div data-test-eligibility-error class="columns">
      <div class="column">
        <div class="notification is-danger">
          <h3 data-test-title class="title is-4">Eligibility Error</h3>
          <p data-test-message>{{this.eligibilityError}}</p>
        </div>
      </div>
      <div class="column is-centered is-minimum">
        <button data-test-dismiss class="button is-danger" onclick={{action (mut this.eligibilityError) ""}} type="button">Okay</button>
      </div>
    </div>
  {{/if}}
  {{#if this.stopDrainError}}
    <div data-test-stop-drain-error class="columns">
      <div class="column">
        <div class="notification is-danger">
          <h3 data-test-title class="title is-4">Stop Drain Error</h3>
          <p data-test-message>{{this.stopDrainError}}</p>
        </div>
      </div>
      <div class="column is-centered is-minimum">
        <button data-test-dismiss class="button is-danger" onclick={{action (mut this.stopDrainError) ""}} type="button">Okay</button>
      </div>
    </div>
  {{/if}}
  {{#if this.drainError}}
    <div data-test-drain-error class="columns">
      <div class="column">
        <div class="notification is-danger">
          <h3 data-test-title class="title is-4">Drain Error</h3>
          <p data-test-message>{{this.drainError}}</p>
        </div>
      </div>
      <div class="column is-centered is-minimum">
        <button data-test-dismiss class="button is-danger" onclick={{action (mut this.drainError) ""}} type="button">Okay</button>
      </div>
    </div>
  {{/if}}
  {{#if this.showDrainStoppedNotification}}
    <div class="notification is-info">
      <div data-test-drain-stopped-notification class="columns">
        <div class="column">
          <h3 data-test-title class="title is-4">Drain Stopped</h3>
          <p data-test-message>The drain has been stopped and the node has been set to ineligible.</p>
        </div>
        <div class="column is-centered is-minimum">
          <button data-test-dismiss class="button is-info" onclick={{action (mut this.showDrainStoppedNotification) false}} type="button">Okay</button>
        </div>
      </div>
    </div>
  {{/if}}
  {{#if this.showDrainUpdateNotification}}
    <div class="notification is-info">
      <div data-test-drain-updated-notification class="columns">
        <div class="column">
          <h3 data-test-title class="title is-4">Drain Updated</h3>
          <p data-test-message>The new drain specification has been applied.</p>
        </div>
        <div class="column is-centered is-minimum">
          <button data-test-dismiss class="button is-info" onclick={{action (mut this.showDrainUpdateNotification) false}} type="button">Okay</button>
        </div>
      </div>
    </div>
  {{/if}}
  {{#if this.showDrainNotification}}
    <div class="notification is-info">
      <div data-test-drain-complete-notification class="columns">
        <div class="column">
          <h3 data-test-title class="title is-4">Drain Complete</h3>
          <p data-test-message>Allocations have been drained and the node has been set to ineligible.</p>
        </div>
        <div class="column is-centered is-minimum">
          <button data-test-dimiss class="button is-info" onclick={{action (mut this.showDrainNotification) false}} type="button">Okay</button>
        </div>
      </div>
    </div>
  {{/if}}
  <div class="toolbar">
    <div class="toolbar-item is-top-aligned is-minimum">
      <span class="title">
        <span data-test-node-status="{{this.model.compositeStatus}}" class="node-status-light {{this.model.compositeStatus}}">
          {{x-icon this.model.compositeStatusIcon}}
        </span>
      </span>
    </div>
    <div class="toolbar-item">
      <h1 data-test-title class="title with-subheading">
        {{or this.model.name this.model.shortId}}
      </h1>
      <p>
        <label class="is-interactive">
          <Toggle
            data-test-eligibility-toggle
            @isActive={{this.model.isEligible}}
            @isDisabled={{or this.setEligibility.isRunning this.model.isDraining (cannot "write client")}}
            @onToggle={{perform this.setEligibility (not this.model.isEligible)}}>
            Eligible
          </Toggle>
          <span class="tooltip" aria-label="Only eligible clients can receive allocations">
            {{x-icon "info-circle-outline" class="is-faded"}}
          </span>
        </label>
        <span data-test-node-id class="tag is-hollow is-small no-text-transform">
          {{this.model.id}}
          <CopyButton @clipboardText={{this.model.id}} />
        </span>
      </p>
    </div>
    <div class="toolbar-item is-right-aligned is-top-aligned">
      {{#if this.model.isDraining}}
        <TwoStepButton
          data-test-drain-stop
          @idleText="Stop Drain"
          @cancelText="Cancel"
          @confirmText="Yes, Stop"
          @confirmationMessage="Are you sure you want to stop this drain?"
          @awaitingConfirmation={{this.stopDrain.isRunning}}
          @onConfirm={{perform this.stopDrain}} />
      {{/if}}
    </div>
    <div class="toolbar-item is-right-aligned is-top-aligned">
      <DrainPopover
        @client={{this.model}}
        @isDisabled={{cannot "write client"}}
        @onDrain={{action "drainNotify"}}
        @onError={{action "setDrainError"}} />
    </div>
  </div>

  <div class="boxed-section is-small">
    <div class="boxed-section-body inline-definitions">
      <span class="label">Client Details</span>
      <span class="pair" data-test-status-definition>
        <span class="term">Status</span>
        <span class="status-text node-{{this.model.status}}">{{this.model.status}}</span>
      </span>
      <span class="pair" data-test-address-definition>
        <span class="term">Address</span>
        {{this.model.httpAddr}}
      </span>
      <span class="pair" data-test-datacenter-definition>
        <span class="term">Datacenter</span>
        {{this.model.datacenter}}
      </span>
      <span class="pair" data-test-driver-health>
        <span class="term">Drivers</span>
        {{#if this.model.unhealthyDrivers.length}}
          {{x-icon "warning" class="is-text is-warning"}}
          {{this.model.unhealthyDrivers.length}} of {{this.model.detectedDrivers.length}} {{pluralize "driver" this.model.detectedDrivers.length}} unhealthy
        {{else}}
          All healthy
        {{/if}}
      </span>
    </div>
  </div>

  {{#if this.model.drainStrategy}}
    <div data-test-drain-details class="boxed-section is-info">
      <div class="boxed-section-head">
        <div class="boxed-section-row">Drain Strategy</div>
        <div class="boxed-section-row">
          <div class="inline-definitions is-small">
            {{#unless this.model.drainStrategy.hasNoDeadline}}
              <span class="pair">
                <span class="term">Duration</span>
                {{#if this.model.drainStrategy.isForced}}
                  <span data-test-duration>--</span>
                {{else}}
                  <span data-test-duration class="tooltip" aria-label={{format-duration this.model.drainStrategy.deadline}}>
                    {{format-duration this.model.drainStrategy.deadline}}
                  </span>
                {{/if}}<commit_msg>Display class in client details<commit_after>{{title "Client " (or this.model.name this.model.shortId)}}
<ClientSubnav @client={{this.model}} />
<section class="section">
  {{#if this.eligibilityError}}
    <div data-test-eligibility-error class="columns">
      <div class="column">
        <div class="notification is-danger">
          <h3 data-test-title class="title is-4">Eligibility Error</h3>
          <p data-test-message>{{this.eligibilityError}}</p>
        </div>
      </div>
      <div class="column is-centered is-minimum">
        <button data-test-dismiss class="button is-danger" onclick={{action (mut this.eligibilityError) ""}} type="button">Okay</button>
      </div>
    </div>
  {{/if}}
  {{#if this.stopDrainError}}
    <div data-test-stop-drain-error class="columns">
      <div class="column">
        <div class="notification is-danger">
          <h3 data-test-title class="title is-4">Stop Drain Error</h3>
          <p data-test-message>{{this.stopDrainError}}</p>
        </div>
      </div>
      <div class="column is-centered is-minimum">
        <button data-test-dismiss class="button is-danger" onclick={{action (mut this.stopDrainError) ""}} type="button">Okay</button>
      </div>
    </div>
  {{/if}}
  {{#if this.drainError}}
    <div data-test-drain-error class="columns">
      <div class="column">
        <div class="notification is-danger">
          <h3 data-test-title class="title is-4">Drain Error</h3>
          <p data-test-message>{{this.drainError}}</p>
        </div>
      </div>
      <div class="column is-centered is-minimum">
        <button data-test-dismiss class="button is-danger" onclick={{action (mut this.drainError) ""}} type="button">Okay</button>
      </div>
    </div>
  {{/if}}
  {{#if this.showDrainStoppedNotification}}
    <div class="notification is-info">
      <div data-test-drain-stopped-notification class="columns">
        <div class="column">
          <h3 data-test-title class="title is-4">Drain Stopped</h3>
          <p data-test-message>The drain has been stopped and the node has been set to ineligible.</p>
        </div>
        <div class="column is-centered is-minimum">
          <button data-test-dismiss class="button is-info" onclick={{action (mut this.showDrainStoppedNotification) false}} type="button">Okay</button>
        </div>
      </div>
    </div>
  {{/if}}
  {{#if this.showDrainUpdateNotification}}
    <div class="notification is-info">
      <div data-test-drain-updated-notification class="columns">
        <div class="column">
          <h3 data-test-title class="title is-4">Drain Updated</h3>
          <p data-test-message>The new drain specification has been applied.</p>
        </div>
        <div class="column is-centered is-minimum">
          <button data-test-dismiss class="button is-info" onclick={{action (mut this.showDrainUpdateNotification) false}} type="button">Okay</button>
        </div>
      </div>
    </div>
  {{/if}}
  {{#if this.showDrainNotification}}
    <div class="notification is-info">
      <div data-test-drain-complete-notification class="columns">
        <div class="column">
          <h3 data-test-title class="title is-4">Drain Complete</h3>
          <p data-test-message>Allocations have been drained and the node has been set to ineligible.</p>
        </div>
        <div class="column is-centered is-minimum">
          <button data-test-dimiss class="button is-info" onclick={{action (mut this.showDrainNotification) false}} type="button">Okay</button>
        </div>
      </div>
    </div>
  {{/if}}
  <div class="toolbar">
    <div class="toolbar-item is-top-aligned is-minimum">
      <span class="title">
        <span data-test-node-status="{{this.model.compositeStatus}}" class="node-status-light {{this.model.compositeStatus}}">
          {{x-icon this.model.compositeStatusIcon}}
        </span>
      </span>
    </div>
    <div class="toolbar-item">
      <h1 data-test-title class="title with-subheading">
        {{or this.model.name this.model.shortId}}
      </h1>
      <p>
        <label class="is-interactive">
          <Toggle
            data-test-eligibility-toggle
            @isActive={{this.model.isEligible}}
            @isDisabled={{or this.setEligibility.isRunning this.model.isDraining (cannot "write client")}}
            @onToggle={{perform this.setEligibility (not this.model.isEligible)}}>
            Eligible
          </Toggle>
          <span class="tooltip" aria-label="Only eligible clients can receive allocations">
            {{x-icon "info-circle-outline" class="is-faded"}}
          </span>
        </label>
        <span data-test-node-id class="tag is-hollow is-small no-text-transform">
          {{this.model.id}}
          <CopyButton @clipboardText={{this.model.id}} />
        </span>
      </p>
    </div>
    <div class="toolbar-item is-right-aligned is-top-aligned">
      {{#if this.model.isDraining}}
        <TwoStepButton
          data-test-drain-stop
          @idleText="Stop Drain"
          @cancelText="Cancel"
          @confirmText="Yes, Stop"
          @confirmationMessage="Are you sure you want to stop this drain?"
          @awaitingConfirmation={{this.stopDrain.isRunning}}
          @onConfirm={{perform this.stopDrain}} />
      {{/if}}
    </div>
    <div class="toolbar-item is-right-aligned is-top-aligned">
      <DrainPopover
        @client={{this.model}}
        @isDisabled={{cannot "write client"}}
        @onDrain={{action "drainNotify"}}
        @onError={{action "setDrainError"}} />
    </div>
  </div>

  <div class="boxed-section is-small">
    <div class="boxed-section-body inline-definitions">
      <span class="label">Client Details</span>
      <span class="pair" data-test-status-definition>
        <span class="term">Status</span>
        <span class="status-text node-{{this.model.status}}">{{this.model.status}}</span>
      </span>
      <span class="pair" data-test-address-definition>
        <span class="term">Address</span>
        {{this.model.httpAddr}}
      </span>
      <span class="pair" data-test-datacenter-definition>
        <span class="term">Datacenter</span>
        {{this.model.datacenter}}
      </span>
      {{#if this.model.nodeClass}}
        <span class="pair" data-test-node-class>
          <span class="term">Class</span>
          {{this.model.nodeClass}}
        </span>
      {{/if}}
      <span class="pair" data-test-driver-health>
        <span class="term">Drivers</span>
        {{#if this.model.unhealthyDrivers.length}}
          {{x-icon "warning" class="is-text is-warning"}}
          {{this.model.unhealthyDrivers.length}} of {{this.model.detectedDrivers.length}} {{pluralize "driver" this.model.detectedDrivers.length}} unhealthy
        {{else}}
          All healthy
        {{/if}}
      </span>
    </div>
  </div>

  {{#if this.model.drainStrategy}}
    <div data-test-drain-details class="boxed-section is-info">
      <div class="boxed-section-head">
        <div class="boxed-section-row">Drain Strategy</div>
        <div class="boxed-section-row">
          <div class="inline-definitions is-small">
            {{#unless this.model.drainStrategy.hasNoDeadline}}
              <span class="pair">
                <span class="term">Duration</span>
                {{#if this.model.drainStrategy.isForced}}
                  <span data-test-duration>--</span>
                {{else}}
                  <span data-test-duration class="tooltip" aria-label={{format-duration this.model.drainStrategy.deadline}}>
                    {{format-duration this.model.drainStrategy.deadline}}
                  </span>
                {{/if}}
{'fraction_non_alphanumeric': 0.16396372542529952, 'fraction_numerical': 0.002647779175216787, 'mean_word_length': 2.570787047979201, 'pattern_counts': {'":': 0, '<': 311, '<?xml version=': 0, '>': 311, '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': '2389404', 'n_tokens_mistral': 4698, 'n_tokens_neox': 4607, 'n_words': 917}