From 088e7951f139971b07810cc574f214dc85990cb2 Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Mon, 8 Nov 2021 18:55:04 -0800 Subject: [PATCH] Inline attaching of removable media in the device list (#421) * Clean up constant name * Inline removable media insertion * Add missing code * Revert mistaken change --- src/web/templates/index.html | 31 ++++++++++++++++++++++++++++++- src/web/web.py | 3 +++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/web/templates/index.html b/src/web/templates/index.html index daafe8ce..4dd8470c 100644 --- a/src/web/templates/index.html +++ b/src/web/templates/index.html @@ -57,7 +57,36 @@ {% endif %} {{ device.device_type }} {{ device.status }} - {{ device.file }} + + {% if "No Media" in device.status %} +
+ + + + + + +
+ {% else %} + {{ device.file }} + + {% endif %} {% if device.vendor == "RaSCSI" %} {{ device.product }} {% else %} diff --git a/src/web/web.py b/src/web/web.py index 965f36b0..aa0f4d35 100644 --- a/src/web/web.py +++ b/src/web/web.py @@ -134,6 +134,9 @@ def index(): device_types=device_types["device_types"], free_disk=int(disk["free"] / 1024 / 1024), 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, REMOVABLE_DEVICE_TYPES=REMOVABLE_DEVICE_TYPES, )