| 1 |
{% macro panel(base, v, csrf, what) %} |
| 2 |
<section class="panel" id="variables"> |
| 3 |
<h2>Variables</h2> |
| 4 |
<p class="small mute">{{ what }} Jobs get them in their environment under <code>FLOW_*</code> and the pipeline's own <code>env</code>; they are part of each job's receipt. Not for secrets: these are shown in full to everyone who can see this page.</p> |
| 5 |
{% if !v.inherited.is_empty() %} |
| 6 |
<h3>Inherited</h3> |
| 7 |
<div class="table"><table> |
| 8 |
<tr><th>Name</th><th>Value</th><th>From</th></tr> |
| 9 |
{% for i in v.inherited %}<tr{% if i.overridden %} class="mute"{% endif %}><td><code>{{ i.variable.name }}</code></td><td class="small"><code>{{ i.variable.value }}</code></td><td class="small">{{ i.from }}{% if i.overridden %} · <span title="A level below sets the same name">overridden</span>{% endif %}</td></tr>{% endfor %} |
| 10 |
</table></div> |
| 11 |
{% endif %} |
| 12 |
{% if v.own.is_empty() %}<p class="mute small">{% if v.inherited.is_empty() %}None.{% else %}None of its own.{% endif %}</p>{% else %} |
| 13 |
<div class="table"><table> |
| 14 |
<tr><th>Name</th><th>Value</th><th></th></tr> |
| 15 |
{% for o in v.own %}<tr><td><code>{{ o.variable.name }}</code></td><td class="small"><code>{{ o.variable.value }}</code></td> |
| 16 |
<td><form class="tiny" method="post" action="{{ base }}/variables"><input type="hidden" name="_csrf" value="{{ csrf }}"><input type="hidden" name="name" value="{{ o.variable.name }}"><button name="action" value="delete" class="danger-btn">remove</button></form></td></tr>{% endfor %} |
| 17 |
</table></div>{% endif %} |
| 18 |
<form class="card" method="post" action="{{ base }}/variables"> |
| 19 |
<input type="hidden" name="_csrf" value="{{ csrf }}"><input type="hidden" name="action" value="set"> |
| 20 |
<h3>Set a variable</h3> |
| 21 |
<label for="vname">Name</label><input type="text" id="vname" name="name" placeholder="RUSTFLAGS" required> |
| 22 |
<label for="vvalue">Value</label><textarea id="vvalue" name="value" rows="2"></textarea> |
| 23 |
<p class="small mute">An existing name takes the new value; a name set above is overridden here.</p> |
| 24 |
<button type="submit">SET</button> |
| 25 |
</form> |
| 26 |
</section> |
| 27 |
{% endmacro %} |