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