Throw ServerError in get(), post(), delete() server methods
in case of connection error or status code with an error.
Log the cause of the error to show it in the web.
Add a function wrapper into every endpoint to handle the
error redirection needed for the ServerError exception.
The wrapper is defined by adding @handle_server_errors('XXX')
on top of the function declaration, where XXX is the name
of the function (endpoint) to be invoked by the redirection.
This change removes the need of specific checks after every
request and cleanups the endpoint code.
Fix the endpoint of the main views to work with an unavailable
ogserver.
Preselect the most used repository among the selected clients
for the view Commands -> Setup -> Set repository
Change get_clients_oglive() into def get_client_list_by_key()
to obtain a dictionary with the list of ips of the clients with
the same value in the field of the client payload passed as key.
For example for the key 'repo_id' it would return a dictionary
{repo_id: [ips of the clients with that repo_id]}
Add specific error messages for each http status code in the
function ogserver_error(). Pass the request object to obtain the
status code.
Standarize the error handling code for every get(), delete() and
post() as:
r = server.get('/scopes')
if not r:
return ogserver_down('scopes')
if r.status_code != requests.codes.ok:
return ogserver_error(r, 'scopes')
Reorganize "Run" section of Commands view as follows:
Commands
└── Run
├── Script: run script from folder
├── Cmd: direct command execution
└── Display output: results of last execution
Adapt API REST call to the new interface. Remove strange legacy
;|\n\r terminator. Remove "echo" field and add "inline" field.
Add view to provide information before a restore operation where
the selected clients have a not uniform partition setup.
Show the view if only clients with not partition valid for a
restore operation are selected.
Rename part_choices variable to reference_patitioning to improve
readability and intent in the code that checks the uniformity of
the client's partitions.
Use "Cache size" instead of "Disk size" in cache inspector.
Inform that the missing space when the image does not fit in cache
is additional space on top of the available space.
Define ogStorage class to manage the localStorage operations.
The new keys are constructed with the following structure:
"group-context-id"
Where group is either "show" for the collapsed items in the
sidebar, or "check" for the selected checkboxes of the sidebar.
Add sotrage versioning to delete obsolete localStorage when a
new design for the storage is included in ogCP.
Remove the invalid keys from local storage when the page loads.
Creating and deleting elements from the sidebar accumulates
dead entries in the local storage.
Remove the line reporting the IP of the selected client. No other
view does that and that information is already available in the
client pills.
Add client pills widget.
Add a client name column to the client list view accessed through
the Dashboard.
Add status column to the client list.
Move client status leyend into a separate file.
Show the client status leyend in client list.
Fix the 0 link speed conditional.
Reuse the data returned by get_scopes() to reduce the number of
requests.
Add /action/repo/set in Commands to assign a repository to
multiple clients.
The view includes the actual repo assigned in the client pills
and shows a table with the clients grouped by repo when multiple
repos are assigned among the selected clients.
Show repositories sorted in an alphanumeric fashion inside the
sidebar of /images and the respective child views.
Sort repositories in the sidebar of /repos.
Enable server view in the main toolbar.
Hide Add server and Delete server buttons.
Add Update server button.
Add server/update view to edit the server addresses.
Add support for selecting different disks in the disk inspector.
Add disk_inspector.html as a template to show the disk contents of
a client. The view can define the variable readonly_disk_inspector
to make the view non editable.
Use disk_inspector.html in the following views:
- client details
- partition and format
Update code to obtain the partitions of a client to better fit the
requirements of disk_inspector.html
Remove code to setup the SetupForm as the contents of the disks
are now dynamically loaded through javascript.