Newer
Older
Stefano Alberto Russo
committed
{% load static %}
{% include "header.html" %}
Stefano Alberto Russo
committed
{% include "navigation.html" %}
Stefano Alberto Russo
committed
<div class="container">
<div class="dashboard">
<div class="span8 offset2">
<h1>Add software container</h1>
Stefano Alberto Russo
committed
<hr>
{% if not data.added %}
Stefano Alberto Russo
committed
Here you can add a new software container on the platform. You can add containers from image registries
as <a href="https://hub.docker.com/">Docker Hub </a>or by importing Git repositories, provided that they
are compatible with <a href="https://mybinder.readthedocs.io/en/latest/introduction.html">Binder</a> specifications.
<br/>
<br/>
{% if data.new_container_from == 'registry' %}
Stefano Alberto Russo
committed
<div style="font-size:1.1em; background:whitesmoke; display:inline-block; padding:2px 15px 2px 15px">New container from registry</div>
<div style="font-size:1.1em; background:white; display:inline-block; padding:2px 15px 2px 15px"><a href="?new_container_from=repository">New container from Git repository</a></div>
Stefano Alberto Russo
committed
<hr style="margin-top:0;">
<h4>Basics</h4>
Stefano Alberto Russo
committed
<form action="#" method="POST">
{% csrf_token %}
Stefano Alberto Russo
committed
<table class="dashboard" style="width:400px; margin-bottom:25px">
Stefano Alberto Russo
committed
<tr>
Stefano Alberto Russo
committed
<td><b>Name</b></td>
Stefano Alberto Russo
committed
<td>
<input type="text" name="container_name" value="" placeholder="" size="23" required />
</td>
</tr>
Stefano Alberto Russo
committed
<tr>
<td><b>Description</b></td>
<td>
<!-- ><input type="text" name="container_description" value="" placeholder="" size="23" required /> -->
<textarea name="container_description" rows="3" cols="22"></textarea>
Stefano Alberto Russo
committed
</td>
</tr>
Stefano Alberto Russo
committed
<tr>
<td><b>Registry</b></td><td>
<input type="text" name="container_registry" value="docker.io" size="23" required />
Stefano Alberto Russo
committed
</td>
</tr>
<tr>
Stefano Alberto Russo
committed
<td><b>Image name</b></td>
Stefano Alberto Russo
committed
<td>
Stefano Alberto Russo
committed
<input type="text" name="container_image_name" value="" placeholder="" size="23" required />
Stefano Alberto Russo
committed
</td>
</tr>
Stefano Alberto Russo
committed
<tr>
Stefano Alberto Russo
committed
<td><b>Image tag</b></td>
Stefano Alberto Russo
committed
<input type="text" name="container_image_tag" value="latest" size="23" required />
</td>
</tr>
</table>
Stefano Alberto Russo
committed
<h4>Interface </h4>
<table class="dashboard" style="width:400px; margin-bottom:25px">
<tr>
<td><b>Interface port</b></td>
<td><input type="text" name="container_interface_port" value="" placeholder="" size="5" /></td>
</tr>
<tr>
<td><b>Interface protocol</b></td>
Stefano Alberto Russo
committed
<td>
Stefano Alberto Russo
committed
{% if request.user.profile.is_power_user %}
<input type="text" value="http" name="container_interface_protocol" size="5" />
Stefano Alberto Russo
committed
{% else %}
<select name="container_interface_protocol" >
<option value="http" selected>http</option>
Stefano Alberto Russo
committed
<option value="https">https</option>
Stefano Alberto Russo
committed
</select>
{% endif %}
Stefano Alberto Russo
committed
</td>
</tr>
</table>
<a href="javascript:void(0);" id="show_button" onclick="toggle_visibility('advanced_div')">Advanced...</a>
Stefano Alberto Russo
committed
<div id="advanced_div" style="display:none; width:400px;">
<h4>Advanced <font size=-1>| <a href="javascript:void(0);" id="hide_button" onclick="toggle_visibility('advanced_div')" style="display:none">hide</a></font></h4>
Stefano Alberto Russo
committed
<table class="dashboard" style="width:400px; margin-bottom:25px">
<tr>
Stefano Alberto Russo
committed
<td><b>Image arch</b></td><td>
<input type="text" name="container_image_arch" value="" placeholder="" size="5" />
</td>
</tr>
Stefano Alberto Russo
committed
<tr>
Stefano Alberto Russo
committed
<td><b>Image OS</b></td><td>
<select name="container_image_os" >
<option value="linux" selected>linux</option>
</select>
Stefano Alberto Russo
committed
</td>
</tr>
Stefano Alberto Russo
committed
<tr>
<td><b>Image digest</b></td><td>
<input type="text" name="container_image_digest" value="" placeholder="sha256:..." size="15" />
</td>
</tr>
Stefano Alberto Russo
committed
<tr>
<td><b>Interface transport</b></td><td>
<select name="container_interface_transport" >
<option value="tcp/ip" selected>tcp/ip</option>
</select>
Stefano Alberto Russo
committed
</td>
</tr>
<tr>
<td colspan=2>
<b>Supports custom interface port</b>
<input type="checkbox" name="container_supports_custom_interface_port" value="True" />
Stefano Alberto Russo
committed
</td>
</tr>
<tr>
<td colspan=2>
<b>Supports interface auth</b>
<input type="checkbox" name="container_supports_interface_auth" value="True" />
Stefano Alberto Russo
committed
</td>
</tr>
<tr>
<td><b>Environment variables</b></td>
<td>
<textarea name="container_env_vars" rows="2" cols="22" placeholder='JSON format: {"VAR"="VALUE"}'></textarea>
</td>
</tr>
Stefano Alberto Russo
committed
</table>
Stefano Alberto Russo
committed
<table style="width:400px; border:0; background:#ffffff; margin-top:20px">
<tr><td align="center">
<input type="submit" value="Add">
</td></tr>
</table>
Stefano Alberto Russo
committed
<input type="hidden" name="new_container_from" value="registry">
Stefano Alberto Russo
committed
</form>
Stefano Alberto Russo
committed
{% else %}
Stefano Alberto Russo
committed
<div style="font-size:1.1em; background:white; display:inline-block; padding:2px 15px 2px 15px"><a href="?new_container_from=registry">New container from registry</a></div>
<div style="font-size:1.1em; background:whitesmoke; display:inline-block; padding:2px 15px 2px 15px">New container from Git repository</div>
Stefano Alberto Russo
committed
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<hr style="margin-top:0;">
<h4>Basics</h4>
<form action="#" method="POST">
{% csrf_token %}
<table class="dashboard" style="width:400px; margin-bottom:25px">
<tr>
<td><b>Name</b></td>
<td>
<input type="text" name="container_name" value="" placeholder="" size="23" required />
</td>
</tr>
<tr>
<td><b>Description</b></td>
<td>
<!-- ><input type="text" name="container_description" value="" placeholder="" size="23" required /> -->
<textarea name="container_description" rows="3" cols="22"></textarea>
</td>
</tr>
<tr>
<td><b>Repository URL</b></td><td>
<input type="text" name="repository_url" size="23" required />
</td>
</tr>
<tr>
<td><b>Repository tag</b></td>
<td>
<input type="text" name="repository_tag" placeholder="Tag or hash, optional" value="" size="23" />
</td>
</tr>
</table>
<table style="width:400px; border:0; background:#ffffff; margin-top:20px">
<tr><td align="center">
<input type="submit" value="Add">
</td></tr>
</table>
<input type="hidden" name="new_container_from" value="repository">
</form>
{% endif %}
Stefano Alberto Russo
committed
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
{% else %}
Stefano Alberto Russo
committed
Ok, software container added. Go to <a href="/software">software</a>.
Stefano Alberto Russo
committed
{% endif %}
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
</div>
</div>
</div>
{% include "footer.html" %}
<script>
function toggle_visibility(id) {
var x = document.getElementById(id);
var y = document.getElementById('show_button');
var z = document.getElementById('hide_button');
if (x.style.display === "none") {
x.style.display = "block";
y.style.display = "none"
z.style.display= "inline"
} else {
x.style.display = "none";
y.style.display= "inline"
z.style.display = "none"
}
}
</script>