diff --git a/src/web/ractl_cmds.py b/src/web/ractl_cmds.py index f62c9881..487a6673 100644 --- a/src/web/ractl_cmds.py +++ b/src/web/ractl_cmds.py @@ -13,6 +13,7 @@ def get_server_info(): - list of str log_levels (the log levels RaSCSI supports) - str current_log_level - list of int reserved_ids + - 5 distinct lists of strs with file endings recognized by RaSCSI """ command = proto.PbCommand() command.operation = proto.PbOperation.SERVER_INFO @@ -26,12 +27,37 @@ def get_server_info(): log_levels = result.server_info.log_levels current_log_level = result.server_info.current_log_level reserved_ids = list(result.server_info.reserved_ids) + + # Creates lists of file endings recognized by RaSCSI + mappings = result.server_info.mapping_info.mapping + sahd = [] + schd = [] + scrm = [] + scmo = [] + sccd = [] + for m in mappings: + if mappings[m] == proto.PbDeviceType.SAHD: + sahd.append(m) + elif mappings[m] == proto.PbDeviceType.SCHD: + schd.append(m) + elif mappings[m] == proto.PbDeviceType.SCRM: + scrm.append(m) + elif mappings[m] == proto.PbDeviceType.SCMO: + scmo.append(m) + elif mappings[m] == proto.PbDeviceType.SCCD: + sccd.append(m) + return { "status": result.status, "version": version, "log_levels": log_levels, "current_log_level": current_log_level, - "reserved_ids": reserved_ids + "reserved_ids": reserved_ids, + "sahd": sahd, + "schd": schd, + "scrm": scrm, + "scmo": scmo, + "sccd": sccd, } diff --git a/src/web/settings.py b/src/web/settings.py index 2075ba7d..44f38669 100644 --- a/src/web/settings.py +++ b/src/web/settings.py @@ -6,15 +6,7 @@ home_dir = getcwd() DEFAULT_CONFIG = "default.json" MAX_FILE_SIZE = getenv("MAX_FILE_SIZE", 1024 * 1024 * 1024 * 4) # 4gb -HARDDRIVE_FILE_SUFFIX = ("hda", "hdn", "hdi", "nhd", "hdf", "hds") -SASI_FILE_SUFFIX = ("hdf",) -REMOVABLE_FILE_SUFFIX = ("hdr",) -CDROM_FILE_SUFFIX = ("iso",) -MO_FILE_SUFFIX = ("mos",) ARCHIVE_FILE_SUFFIX = ("zip",) -VALID_FILE_SUFFIX = HARDDRIVE_FILE_SUFFIX + SASI_FILE_SUFFIX + \ - REMOVABLE_FILE_SUFFIX + CDROM_FILE_SUFFIX + \ - MO_FILE_SUFFIX + ARCHIVE_FILE_SUFFIX # File containing canonical drive properties DRIVE_PROPERTIES_FILE = home_dir + "/drive_properties.json" diff --git a/src/web/templates/base.html b/src/web/templates/base.html index 8c95e7fd..751040cb 100644 --- a/src/web/templates/base.html +++ b/src/web/templates/base.html @@ -53,7 +53,7 @@ {% block content %}{% endblock %}
diff --git a/src/web/templates/index.html b/src/web/templates/index.html index ffcbeb5c..530277c3 100644 --- a/src/web/templates/index.html +++ b/src/web/templates/index.html @@ -355,8 +355,8 @@