mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-21 23:29:39 +00:00
Inline attaching of removable media in the device list (#421)
* Clean up constant name * Inline removable media insertion * Add missing code * Revert mistaken change
This commit is contained in:
parent
59e9d8584c
commit
088e7951f1
@ -57,7 +57,36 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<td style="text-align:center">{{ device.device_type }}</td>
|
<td style="text-align:center">{{ device.device_type }}</td>
|
||||||
<td style="text-align:center">{{ device.status }}</td>
|
<td style="text-align:center">{{ device.status }}</td>
|
||||||
<td style="text-align:left">{{ device.file }}</td>
|
<td style="text-align:left">
|
||||||
|
{% if "No Media" in device.status %}
|
||||||
|
<form action="/scsi/attach" method="post">
|
||||||
|
<input name="scsi_id" type="hidden" value="{{ device.id }}">
|
||||||
|
<input name="unit" type="hidden" value="{{ device.unit }}">
|
||||||
|
<input name="type" type="hidden" value="{{ device.device_type }}">
|
||||||
|
<input name="file_size" type="hidden" value="{{ device.size }}">
|
||||||
|
<select type="select" name="file_name">
|
||||||
|
{% for f in files %}
|
||||||
|
{% if device.device_type == "SCCD" %}
|
||||||
|
{% if f["name"].lower().endswith(cdrom_file_suffix) %}
|
||||||
|
<option value="{{ f["name"] }}">{{ f["name"].replace(base_dir, '') }}</option>
|
||||||
|
{% endif %}
|
||||||
|
{% elif device.device_type == "SCRM" %}
|
||||||
|
{% if f["name"].lower().endswith(removable_file_suffix) %}
|
||||||
|
<option value="{{ f["name"] }}">{{ f["name"].replace(base_dir, '') }}</option>
|
||||||
|
{% endif %}
|
||||||
|
{% elif device.device_type == "SCMO" %}
|
||||||
|
{% if f["name"].lower().endswith(mo_file_suffix) %}
|
||||||
|
<option value="{{ f["name"] }}">{{ f["name"].replace(base_dir, '') }}</option>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<input type="submit" value="Attach">
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
{{ device.file }}
|
||||||
|
</td>
|
||||||
|
{% endif %}
|
||||||
{% if device.vendor == "RaSCSI" %}
|
{% if device.vendor == "RaSCSI" %}
|
||||||
<td style="text-align:center">{{ device.product }}</td>
|
<td style="text-align:center">{{ device.product }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -134,6 +134,9 @@ def index():
|
|||||||
device_types=device_types["device_types"],
|
device_types=device_types["device_types"],
|
||||||
free_disk=int(disk["free"] / 1024 / 1024),
|
free_disk=int(disk["free"] / 1024 / 1024),
|
||||||
valid_file_suffix=valid_file_suffix,
|
valid_file_suffix=valid_file_suffix,
|
||||||
|
cdrom_file_suffix=tuple(server_info["sccd"]),
|
||||||
|
removable_file_suffix=tuple(server_info["scrm"]),
|
||||||
|
mo_file_suffix=tuple(server_info["scmo"]),
|
||||||
archive_file_suffix=ARCHIVE_FILE_SUFFIX,
|
archive_file_suffix=ARCHIVE_FILE_SUFFIX,
|
||||||
REMOVABLE_DEVICE_TYPES=REMOVABLE_DEVICE_TYPES,
|
REMOVABLE_DEVICE_TYPES=REMOVABLE_DEVICE_TYPES,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user