github.com/hernad/nomad@v1.6.112/ui/app/components/policy-editor.hbs (about)

     1  {{!
     2    Copyright (c) HashiCorp, Inc.
     3    SPDX-License-Identifier: MPL-2.0
     4  ~}}
     5  
     6  <form class="edit-policy" autocomplete="off" {{on "submit" this.save}}>
     7  	{{#if @policy.isNew }}
     8  		<label>
     9  			<span>
    10  				Policy Name
    11  			</span>
    12  			<Input
    13  				data-test-policy-name-input
    14  				@type="text"
    15  				@value={{@policy.name}}
    16  				class="input"
    17          {{autofocus}}
    18  			/>
    19  		</label>
    20  	{{/if}}
    21  
    22  	<div class="boxed-section">
    23  		<div class="boxed-section-head">
    24  			Policy Definition
    25  		</div>
    26  		<div class="boxed-section-body is-full-bleed">
    27  
    28  			<div
    29  				class="policy-editor"
    30  				data-test-policy-editor
    31  				{{code-mirror
    32            screenReaderLabel="Policy definition"
    33            theme="hashi"
    34            mode="ruby"
    35            content=@policy.rules
    36            onUpdate=this.updatePolicyRules
    37            autofocus=(not @policy.isNew)
    38  					extraKeys=(hash Cmd-Enter=this.save)
    39  				}} />
    40  		</div>
    41  	</div>
    42  
    43  	<div>
    44  		<label>
    45  			<span>
    46  				Description (optional)
    47  			</span>
    48  			<Input
    49  				data-test-policy-description
    50  				@value={{@policy.description}}
    51  				class="input"
    52  			/>
    53  		</label>
    54  	</div>
    55  
    56  	<footer>
    57  		{{#if (can "update policy")}}
    58  			<button
    59  				class="button is-primary"
    60  				type="submit"
    61  			>
    62  				Save Policy
    63  			</button>
    64  		{{/if}}
    65  	</footer>
    66  </form>