Tentative Web UI for the Printer device.#676
Conversation
uweseimet
left a comment
There was a problem hiding this comment.
0 is not a valid timeout value. The printer devices expects the timeout to be positive, otherwise it reports an error.
|
Please take notice of #677. |
|
I just noticed one more thing :). It would be nice if the ui was taking the supported parameters from the meta data returned by the protobuf interface. It should not hard-code input fields for "timeout" etc., but should dynamically create as many input fields as needed by the respective device. It then might use the values for the default parameters as placeholders, or might pre-fill the fields with the default values. |
|
@uweseimet I love the idea of the UI dynamically adjusting the available options based on metadata. It should be doable to a degree in the current Web UI framework, although jinja2 template capabilities may be a limiting factor. At a glance, it seems like the ATTACH 'cmd' and 'timeout' parameters aren't exposed yet, however. Or am I looking at it incorrectly: |
|
@rdmark Indeed, I missed adding the parameters. They are now present (in the current feature branch). |
… key value pairs of parameters to be passed to the protobuf interface, rather than hard coded ones. Also renames the RaCtlCmds.attach_image() class method to attach_device().
|
@bzeiss For your attention, I'm proposing a small change to RaCtlCmds.attach_image():
The benefit of doing this is that a client can now pass any arbitrary parameter to the protobuf interface, which makes it easy to adapt when new capabilities are added to the rascsi backend. Please let me know what you think! |
|
@rdmark When reading your latest comment I'm not sure whether you are going to add (or cannot because of framework limitations) dynamic parameter support. |
|
@rdmark yes, sounds like a good idea given that the list of things you attach to a scsi id isn't always a disk image. I like the idea. |
|
@uweseimet Yes, I'm addressing this one step at a time. :) The first step, to make the underlying interface more flexible, has now been addressed. |
|
@rdmark Sounds good! Since the web ui is part of each RaSCSI release dynamic parameter handling is useful, but not as import as it is for my app. The app can be connected to any RaSCSI version, so the only way to suggest valid parameters is to always get the respective information from rascsi. |
… a dict, which contains the supported parameters and their default values. Leverage this data in the web ui to derive the form fields from the capabilities of rascsi.
|
@uweseimet This is true, the Web UI can make certain assumptions about backend capabilities and get away with it. At the same, it reduces maintenance overhead and potential for bugs by doing what you suggest. I've updated the PR with code that dynamically creates the UI for Support type devices now, so when f.e. the PowerView display adapter gets implemented, we should get the Web UI for free, so to speak. I decided to leave the Network device UI as-is for now, since using the dynamic option would take away some convenience functionality for picking IP and address mask. @bzeiss Please note that the data structure returned from RaCtlCmds.get_device_types() will change as well, with the latest code. Rather than a list of strings, it is now a dictionary with device acronym and supported parameter pairs. |
|
@uweseimet I was thinking: What do you say about having the server report default_parameters for network interfaces as |
|
@rdmark Yes, "interfaces=X:ip=Y:mask=Z" may be better. Currently this is "interfaces=X:Y:Z", isn't it? We can keep the old syntax for some time, but should remove it later in favor of the new syntax. |
No description provided.