mirror of
https://github.com/akuker/RASCSI.git
synced 2026-04-19 20:16:52 +00:00
Introduce info.html template and use it to render detailed info (#863)
new: - new templates to render structured info contents in - get_diskinfo() class method that calls disktype and returns the results - /diskinfo endpoint in the Flask app that renders the results from get_diskinfo() changed: - /logs/show and /scsi/info endpoints in the Flask app render in templates - Now using the "RaSCSI Reloaded Control Page" header to function as the link back to the homepage (instead of the github project) which is in line with how most webapps work - Removed the center style for "Attached!" to allow the ? button to be placed on the same line - Remove individual device info, and introduced show all device info in a template
This commit is contained in:
@@ -176,17 +176,14 @@ def test_show_device_info(http_client, create_test_image, detach_devices):
|
||||
|
||||
response = http_client.post(
|
||||
"/scsi/info",
|
||||
data={
|
||||
"scsi_id": SCSI_ID,
|
||||
},
|
||||
)
|
||||
|
||||
response_data = response.json()
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response_data["status"] == STATUS_SUCCESS
|
||||
assert "device_info" in response_data["data"]
|
||||
assert response_data["data"]["device_info"]["file"] == f"{IMAGES_DIR}/{test_image}"
|
||||
assert "devices" in response_data["data"]
|
||||
assert response_data["data"]["devices"][0]["file"] == test_image
|
||||
|
||||
# Cleanup
|
||||
detach_devices()
|
||||
|
||||
@@ -315,3 +315,20 @@ def test_download_url_to_iso(
|
||||
# Cleanup
|
||||
detach_devices()
|
||||
delete_file(iso_file_name)
|
||||
|
||||
|
||||
# route("/files/diskinfo", methods=["POST"])
|
||||
def test_show_diskinfo(http_client, create_test_image):
|
||||
test_image = create_test_image()
|
||||
|
||||
response = http_client.post(
|
||||
"/files/diskinfo",
|
||||
data={
|
||||
"file_name": test_image,
|
||||
},
|
||||
)
|
||||
|
||||
response_data = response.json()
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Regular file" in response_data["data"]["diskinfo"]
|
||||
|
||||
@@ -61,12 +61,15 @@ def test_show_logs(http_client):
|
||||
"/logs/show",
|
||||
data={
|
||||
"lines": 100,
|
||||
"scope": "",
|
||||
"scope": "rascsi",
|
||||
},
|
||||
)
|
||||
|
||||
response_data = response.json()
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.headers["content-type"] == "text/plain"
|
||||
assert response_data["data"]["lines"] == "100"
|
||||
assert response_data["data"]["scope"] == "rascsi"
|
||||
|
||||
|
||||
# route("/config/save", methods=["POST"])
|
||||
|
||||
Reference in New Issue
Block a user