Statistics
| Branch: | Tag: | Revision:

one / src / sunstone / public / app / tabs / oneflow-templates-tab / utils / role-tab / html.hbs @ ffd792ca

History | View | Annotate | Download (10.3 KB)

1
{{! -------------------------------------------------------------------------- }}
2
{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems                }}
3
{{!                                                                            }}
4
{{! Licensed under the Apache License, Version 2.0 (the "License"); you may    }}
5
{{! not use this file except in compliance with the License. You may obtain    }}
6
{{! a copy of the License at                                                   }}
7
{{!                                                                            }}
8
{{! http://www.apache.org/licenses/LICENSE-2.0                                 }}
9
{{!                                                                            }}
10
{{! Unless required by applicable law or agreed to in writing, software        }}
11
{{! distributed under the License is distributed on an "AS IS" BASIS,          }}
12
{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   }}
13
{{! See the License for the specific language governing permissions and        }}
14
{{! limitations under the License.                                             }}
15
{{! -------------------------------------------------------------------------- }}
16

    
17
<div class="row">
18
  <div class="service_template_param service_role st_man medium-6 columns">
19
    <label for="name">{{tr "Role Name"}}
20
      <span class="tip">{{tr "Name of the role"}}</span>
21
    </label>
22
    <input type="text" id="role_name" name="name" required pattern="^\w+$"/>
23
    <small class="form-error">{{tr "Can only contain alphanumeric and underscore characters"}}</small>
24
  </div>
25
  <div class="service_template_param service_role medium-2 columns end">
26
    <label for="cardinality">{{tr "VMs"}}
27
      <span class="tip">{{tr "Number of VMs to instantiate with this role"}}</span>
28
    </label>
29
    <input type="text" id="cardinality" name="cardinality" value="1"/>
30
  </div>
31
</div>
32
<div class="row">
33
  <div class="service_template_param service_role small-12 columns">
34
    <label for="vm_template">{{tr "VM template"}}
35
      <span class="tip">{{tr "Template associated to this role"}}</span>
36
    </label>
37
    {{{templatesTableHTML}}}
38
    <div id="vm_template">
39
    </div>
40
  </div>
41
</div>
42
<div class="row">
43
  <div class="service_template_param service_role medium-6 columns">
44
    <table class="networks_role dataTable">
45
      <thead>
46
        <tr>
47
          <th colspan="2">
48
            <i class="fa fa-lg fa-fw fa-globe off-color"/>{{tr "Network Interfaces"}}
49
          </th>
50
        </tr>
51
      </thead>
52
      <tbody class="networks_role_body">
53
      </tbody>
54
    </table>
55
  </div>
56
  <div class="service_template_param service_role medium-6 columns">
57
    <table class="parent_roles dataTable">
58
      <thead>
59
        <tr>
60
          <th colspan="2">
61
            {{tr "Parent roles"}}
62
          </th>
63
        </tr>
64
      </thead>
65
      <tbody class="parent_roles_body">
66
      </tbody>
67
    </table>
68
  </div>
69
</div>
70
<br>
71
<div class="row">
72
  <div class="large-12 columns elasticity_accordion">
73
    {{#advancedSection (tr "Role Elasticity") }}
74
    <div class="row">
75
      <div class="medium-4 columns">
76
        <label for="min_vms">{{tr "Min VMs"}}
77
          <span class="tip">{{tr "Minimum number of VMs for elasticity adjustments"}}</span>
78
        </label>
79
        <input type="text" id="min_vms" name="min_vms" value="" />
80
      </div>
81
      <div class="medium-4 columns">
82
        <label for="max_vms">{{tr "Max VMs"}}
83
          <span class="tip">{{tr "Maximum number of VMs for elasticity adjustments"}}</span>
84
        </label>
85
        <input type="text" id="max_vms" name="max_vms" value="" />
86
      </div>
87
      <div class="service_template_param service_role medium-4 columns">
88
        <label for="cooldown">{{tr "Cooldown"}}
89
          <span class="tip">{{tr "Cooldown time after an elasticity operation (secs)"}}</span>
90
        </label>
91
        <input type="text" id="cooldown" name="cooldown" value="" />
92
      </div>
93
    </div>
94
    <div class="row">
95
      <div class="large-12 columns">
96
        <table id="elasticity_policies_table" class="policies_table dataTable">
97
          <thead style="background:#dfdfdf">
98
            <tr>
99
              <th colspan="8" style="font-size: 16px !important">
100
                {{tr "Elasticity policies"}}
101
              </th>
102
            </tr>
103
          </thead>
104
          <thead>
105
            <tr>
106
              <th class="has-tip" title="{{tr "Type of adjustment."}}
107
                {{tr "CHANGE: Add/substract the given number of VMs."}}
108
                {{tr "CARDINALITY: Set the cardinality to the given number."}}
109
                {{tr "PERCENTAGE_CHANGE: Add/substract the given percentage to the current cardinality."}}
110
                " style="width:14%">{{tr "Type"}}
111
              </th>
112
              <th class="has-tip" title="{{tr "Positive or negative adjustment. Its meaning depends on 'type'"}}
113
                {{tr "CHANGE: -2, will substract 2 VMs from the role"}}
114
                {{tr "CARDINALITY: 8, will set carditanilty to 8"}}
115
                {{tr "PERCENTAGE_CHANGE: 20, will increment cardinality by 20%"}}" style="width:12%">{{tr "Adjust"}}
116
              </th>
117
              <th class="has-tip" title="{{tr "Optional parameter for PERCENTAGE_CHANGE adjustment type."}}
118
                {{tr " If present, the policy will change the cardinality by at least the number of VMs set in this attribute."}}" style="width:9%">{{tr "Min"}}
119
              </th>
120
              <th class="has-tip" title="{{tr "Expression to trigger the elasticity"}}
121
                {{tr "Example: ATT < 20"}}" style="width:30%">{{tr "Expression"}}
122
              </th>
123
              <th class="has-tip" title="{{tr "Number of periods that the expression must be true before the elasticity is triggered"}}" style="width:8%">#
124
              </th>
125
              <th class="has-tip" title="{{tr "Duration, in seconds, of each period in '# Periods'"}}" style="width:9%">{{tr "Period"}}
126
              </th>
127
              <th class="has-tip" title="{{tr "Cooldown period duration after a scale operation, in seconds"}}" style="width:15%">{{tr "Cooldown"}}
128
              </th>
129
              <th style="width:3%"></th>
130
            </tr>
131
          </thead>
132
          <tbody id="elasticity_policies_tbody">
133
          </tbody>
134
          <tfoot>
135
            <tr>
136
              <td colspan="8">
137
                <a type="button" class="button small radius secondary small-12" id="tf_btn_elas_policies"><i class="fa fa-plus"></i> {{tr "Add another policy"}}</a>
138
              </td>
139
            </tr>
140
          </tfoot>
141
        </table>
142
      </div>
143
    </div>
144
    <br>
145
    <div class="row">
146
      <div class="large-12 columns">
147
        <table id="scheduled_policies_table" class="policies_table dataTable">
148
          <thead style="background:#dfdfdf">
149
            <tr>
150
              <th colspan="6" style="font-size: 16px !important">
151
                {{tr "Scheduled policies"}}
152
              </th>
153
            </tr>
154
          </thead>
155
          <thead>
156
            <tr>
157
              <th class="has-tip" title="{{tr "Type of adjustment."}}
158
                {{tr "CHANGE: Add/substract the given number of VMs."}}
159
                {{tr "CARDINALITY: Set the cardinality to the given number."}}
160
                {{tr "PERCENTAGE_CHANGE: Add/substract the given percentage to the current cardinality."}}" style="width:14%">{{tr "Type"}}
161
              </th>
162
              <th class="has-tip" title="{{tr "Positive or negative adjustment. Its meaning depends on 'type'"}}
163
                {{tr "CHANGE: -2, will substract 2 VMs from the role"}}
164
                {{tr "CARDINALITY: 8, will set carditanilty to 8"}}
165
                {{tr "PERCENTAGE_CHANGE: 20, will increment cardinality by 20%"}}" style="width:12%">{{tr "Adjust"}}
166
              </th>
167
              <th class="has-tip" title="{{tr "Optional parameter for PERCENTAGE_CHANGE adjustment type. If present, the policy will change the cardinality by at least the number of VMs set in this attribute."}}" style="width:9%">{{tr "Min"}}
168
              </th>
169
              <th class="has-tip" title="{{tr "Recurrence: Time for recurring adjustements. Time is specified with the Unix cron syntax"}}
170
              {{tr "Start time: Exact time for the adjustement"}}" style="width:28%">{{tr "Time format"}}
171
              </th>
172
              <th class="has-tip" title="{{tr "Time expression depends on the the time formar selected"}}
173
                {{tr "Recurrence: Time for recurring adjustements. Time is specified with the Unix cron syntax"}}
174
                {{tr "Start time: Exact time for the adjustement"}}" style="width:33%">{{tr "Time expression"}}
175
              </th>
176
              <th style="width:3%"></th>
177
            </tr>
178
          </thead>
179
          <tbody id="scheduled_policies_tbody">
180
          </tbody>
181
          <tfoot>
182
            <tr>
183
              <td colspan="6">
184
                <a type="button" class="button small radius secondary small-12" id="tf_btn_sche_policies"><i class="fa fa-plus"></i> {{tr "Add another policy"}}</a>
185
              </td>
186
            </tr>
187
          </tfoot>
188
        </table>
189
      </div>
190
    </div>
191
    {{/advancedSection}}
192
  </div>
193
</div>
194
<br>
195
<div class="row">
196
  <div class="large-12 columns advanced_role_accordion">
197
    {{#advancedSection (tr "Advanced Role Parameters") }}
198
    <div class="row">
199
      <div class="service_template_param service_role medium-6 columns">
200
        <label for="shutdown_action_role">{{tr "Shutdown action"}}
201
          <span class="tip">{{tr "VM shutdown action: 'shutdown' or 'shutdown-hard'. If it is not set, the one set for the Service will be used"}}</span>
202
        </label>
203
        <select name="shutdown_action_role">
204
          <option value=""></option>
205
          <option value="shutdown">{{tr "Shutdown"}}</option>
206
          <option value="shutdown-hard">{{tr "Shutdown hard"}}</option>
207
        </select>
208
      </div>
209
      <div class="medium-6 columns">
210
      </div>
211
    </div>
212
    <div class="row">
213
      <div class="service_template_param st_man large-12 columns">
214
        <label  for="vm_template_contents">{{tr "VM Template Content"}}
215
          <span class="tip">{{tr "This information will be merged with the original Virtual Machine template. Configuration attributes and network interfaces will be replaced by those provided by the user when the template is instantiated"}}</span>
216
        </label>
217
        <textarea type="text" class="vm_template_contents" name="vm_template_contents"/>
218
      </div>
219
    </div>
220
    {{/advancedSection}}
221
  </div>
222
</div>