RASCSI/python/web/src/templates/drives.html
Daniel Markstedt 90ace5fd53
Introduce utility method to look up drive props by drive name. (#888)
* Introduce utility method to look up drive props by drive name.

* Make /drive/create endpoint fetch file ending from properties data structure; update tests
2022-10-06 14:04:41 -07:00

128 lines
4.5 KiB
HTML

{% extends "base.html" %}
{% block content %}
<h2>{{ _("Disclaimer") }}</h2>
<p>{{ _("These device profiles are provided as-is with no guarantee to work equally to the actual physical device they are named after. You may need to provide appropirate device drivers and/or configuration parameters for them to function properly. If you would like to see data modified, or have additional devices to add to the list, please raise an issue ticket at <a href=\"%(url)s\">GitHub</a>.", url="https://github.com/akuker/RASCSI/issues") }}</p>
<h2>{{ _("Hard Disk Drives") }}</h2>
<table cellpadding="3" border="black">
<tbody>
<tr>
<td><b>{{ _("Name") }}</b></td>
<td><b>{{ _("Size (MiB)") }}</b></td>
<td><b>{{ _("Description") }}</b></td>
<td><b>{{ _("Ref.") }}</b></td>
<td><b>{{ _("Action") }}</b></td>
</tr>
{% for hd in drive_properties['hd_conf']|sort(attribute='name') %}
<tr>
<td style="text-align:center">{{ hd.name }}</td>
<td style="text-align:center">{{ hd.size_mb }}</td>
<td style="text-align:left">{{ hd.description }}</td>
<td style="text-align:left">
{% if hd.url != "" %}
<a href="{{ hd.url }}">{{ _("Link") }}</a>
{% else %}
-
{% endif %}
</td>
<td style="text-align:left">
<form action="/drive/create" method="post">
<input type="hidden" name="drive_name" value="{{ hd.name }}">
{{ _("Size:") }} <input type="number" name="size" min="512" max="274877906944" step="512" value="{{ hd.size }}">{{ _("B") }}
<label for="file_name">{{ _("Save as:") }}</label>
<input type="text" name="file_name" value="{{ hd.secure_name }}" required />.{{ hd.file_type }}
<input type="submit" value="{{ _("Create") }}" />
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<hr/>
<h2>{{ _("CD/DVD Drives") }}</h2>
<p><em>{{ _("This will create a properties file for the given CD-ROM or DVD image. No new image file will be created.") }}</em></p>
<table cellpadding="3" border="black">
<tbody>
<tr>
<td><b>{{ _("Name") }}</b></td>
<td><b>{{ _("Size (MiB)") }}</b></td>
<td><b>{{ _("Description") }}</b></td>
<td><b>{{ _("Ref.") }}</b></td>
<td><b>{{ _("Action") }}</b></td>
</tr>
{% for cd in drive_properties['cd_conf']|sort(attribute='name') %}
<tr>
<td style="text-align:center">{{ cd.name }}</td>
<td style="text-align:center">{{ cd.size_mb }}</td>
<td style="text-align:left">{{ cd.description }}</td>
<td style="text-align:left">
{% if cd.url != "" %}
<a href="{{ cd.url }}">{{ _("Link") }}</a>
{% else %}
-
{% endif %}
</td>
<td style="text-align:left">
<form action="/drive/cdrom" method="post">
<input type="hidden" name="drive_name" value="{{ cd.name }}">
<label for="file_name">{{ _("Create for:") }}</label>
<select type="select" name="file_name">
{% for file in files|sort(attribute='name') %}
{% if file["name"].lower().endswith(cdrom_file_suffix) %}
<option value="{{ file["name"] }}">{{ file["name"].replace(base_dir, '') }}</option>
{% endif %}
{% endfor %}
</select>
<input type="submit" value="{{ _("Create") }}" />
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<hr/>
<h2>{{ _("Removable Disk Drives") }}</h2>
<table cellpadding="3" border="black">
<tbody>
<tr>
<td><b>{{ _("Name") }}</b></td>
<td><b>{{ _("Size (MiB)") }}</b></td>
<td><b>{{ _("Description") }}</b></td>
<td><b>{{ _("Ref.") }}</b></td>
<td><b>{{ _("Action") }}</b></td>
</tr>
{% for rm in drive_properties['rm_conf']|sort(attribute='name') %}
<tr>
<td style="text-align:center">{{ rm.name }}</td>
<td style="text-align:center">{{ rm.size_mb }}</td>
<td style="text-align:left">{{ rm.description }}</td>
<td style="text-align:left">
{% if rm.url != "" %}
<a href="{{ rm.url }}">{{ _("Link") }}</a>
{% else %}
-
{% endif %}
</td>
<td style="text-align:left">
<form action="/drive/create" method="post">
<input type="hidden" name="drive_name" value="{{ rm.name }}">
{{ _("Size:") }} <input type="number" name="size" min="512" max="274877906944" step="512" value="{{ rm.size }}">{{ _("B") }}
<label for="file_name">{{ _("Save as:") }}</label>
<input type="text" name="file_name" value="{{ rm.secure_name }}" required />.{{ rm.file_type }}
<input type="submit" value="{{ _("Create") }}" />
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<p><small>{{ _("%(disk_space)s MiB disk space remaining on the Pi", disk_space=env["free_disk_space"]) }}</small></p>
<p><a href="/">{{ _("Go to Home") }}</a></p>
{% endblock content %}