From 62e287c96de5cf8e8d54ad202df9c91f19ffb607 Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Fri, 7 Oct 2022 19:55:53 -0700 Subject: [PATCH] Remove redundant help text, table columns and parameters from the Web UI (#898) - Remove the Size option from the Drives page, since we offer custom sizes with Drive profiles now in the Create Image form - Fetch size from drive props data structure rather than the web form - Remove a range of redundant / obvious help text to reduce UI clutter and emphasize the important help text - Remove the Size column from the CD-ROM drives table since it's always N/A - Merge the two Logging related sections, and the two Create Image related sections (semantically associated) --- python/web/src/templates/drives.html | 6 ----- python/web/src/templates/index.html | 37 ++++------------------------ python/web/src/web.py | 7 ++++-- python/web/src/web_utils.py | 1 + 4 files changed, 11 insertions(+), 40 deletions(-) diff --git a/python/web/src/templates/drives.html b/python/web/src/templates/drives.html index a980b9e8..28f2ab7b 100644 --- a/python/web/src/templates/drives.html +++ b/python/web/src/templates/drives.html @@ -27,8 +27,6 @@
- - {{ _("B") }} .{{ hd.file_type }} @@ -47,7 +45,6 @@ {{ _("Name") }} - {{ _("Size (MiB)") }} {{ _("Description") }} {{ _("Action") }} @@ -60,7 +57,6 @@ {{ cd.name }} {% endif %} - {{ cd.size_mb }} {{ cd.description }} @@ -106,8 +102,6 @@ - - {{ _("B") }} .{{ rm.file_type }} diff --git a/python/web/src/templates/index.html b/python/web/src/templates/index.html index 62a6b0a2..c58d30e2 100644 --- a/python/web/src/templates/index.html +++ b/python/web/src/templates/index.html @@ -6,7 +6,6 @@ {{ _("Current RaSCSI Configuration") }} @@ -175,7 +174,6 @@
  • {{ _("Manage image files in the active RaSCSI image directory: %(directory)s with a scan depth of %(scan_depth)s.", directory=env["image_dir"], scan_depth=scan_depth) }}
  • {{ _("Select a valid SCSI ID and LUN to attach to. Unless you know what you're doing, always use LUN 0.", url="https://en.wikipedia.org/wiki/Logical_unit_number") }}
  • -
  • {{ _("If RaSCSI was unable to detect the media type associated with the image, you get to choose the type from the dropdown.") }}
  • {{ _("Recognized image file types:") }} {% set comma = joiner(", ") %} @@ -342,18 +340,14 @@ {{ _("Attach Peripheral Device") }}
      -
    • {{ _("Before using a networking device, it is recommended to run easyinstall.sh from the command line to configure your Raspberry Pi.") }}
    • -
        {% if bridge_configured %}
      • {{ _("The rascsi_bridge network bridge is active and ready to be used by an emulated network adapter!") }}
      • {% else %}
      • {{ _("Please configure the rascsi_bridge network bridge before attaching an emulated network adapter!") }}
      • {% endif %} -
      • {{ _("If you have a DHCP setup, choose only the interface you have configured the bridge with. You can ignore the inet field when attaching.") }}
      • {{ _("To browse the modern web, install a vintage web proxy such as Macproxy.", url="https://github.com/akuker/RASCSI/wiki/Vintage-Web-Proxy#macproxy") }}
      • -
    • {{ _("Read more about supported device types on the wiki.", url="https://github.com/akuker/RASCSI/wiki/Supported-Device-Types") }}
    @@ -495,7 +489,6 @@ {{ _("Download File from the Web") }}
      -
    • {{ _("Choose the desination directory and download a file from the Web to your Raspberry Pi.") }}
    • {{ _("Install Netatalk to use the AFP File Server.", url="https://github.com/akuker/RASCSI/wiki/AFP-File-Sharing") }}
    @@ -597,17 +590,6 @@
  • -
    - -
    - - {{ _("Create Named Drive") }} - - -

    {{ _("Create a named disk image that mimics real-life drives") }}


    @@ -617,10 +599,11 @@ {{ _("Logging") }} +
    @@ -644,19 +627,9 @@
    +
    -
    - -
    - - {{ _("Server Log Level") }} - - -
    - +
    +

    @@ -699,7 +673,6 @@ {{ _("Raspberry Pi Operations") }} diff --git a/python/web/src/web.py b/python/web/src/web.py index 18ae9c9b..4c0dd3be 100644 --- a/python/web/src/web.py +++ b/python/web/src/web.py @@ -358,7 +358,6 @@ def drive_create(): Creates the image and properties file pair """ drive_name = request.form.get("drive_name") - size = request.form.get("size") file_name = request.form.get("file_name") properties = get_properties_by_drive_name( @@ -367,7 +366,11 @@ def drive_create(): ) # Creating the image file - process = file_cmd.create_new_image(file_name, properties["file_type"], size) + process = file_cmd.create_new_image( + file_name, + properties["file_type"], + properties["size"], + ) if not process["status"]: return response(error=True, message=process["msg"]) diff --git a/python/web/src/web_utils.py b/python/web/src/web_utils.py index 5412a9eb..c09e7441 100644 --- a/python/web/src/web_utils.py +++ b/python/web/src/web_utils.py @@ -217,6 +217,7 @@ def get_properties_by_drive_name(drives, drive_name): "product": drive_props["product"], "revision": drive_props["revision"], "block_size": drive_props["block_size"], + "size": drive_props["size"], } def auth_active(group):