Commit Graph

546 Commits (159f4c56a51344341a0d108629bef751595a095e)
 

Author SHA1 Message Date
Alejandro Sirgo Rica 159f4c56a5 views: process view after selection validation
Access selection values after selection validation to prevent
the access of null values. Prevent backtrace with no sidebar
elements selected.
2025-01-30 10:30:19 +01:00
Alejandro Sirgo Rica ea9310f97a templates: disable boot OS components when no system is available
Hide the OS table and the "Boot" button when no OS is found.
2025-01-29 10:56:09 +01:00
Alejandro Sirgo Rica dd4b7ad229 views: add client search to scopes
Add a view to search clients by IP or MAC.

Adapt parse_scopes_from_tree() to include the path of the scope
in the tree.
2025-01-22 13:11:39 +01:00
Alejandro Sirgo Rica 655ffbc0bb views: add missing @login_required restrictions
Add checks for logged user in folder/add and folder/update
endpoints.
2024-12-17 16:04:23 +01:00
Alejandro Sirgo Rica f75a72b1cf views: remove col value from the dashboard template arguments
Remove "col" argments from the render_template() invocation and
set a good default value in the html template.
2024-12-17 16:04:23 +01:00
Alejandro Sirgo Rica 05cba727e0 views: refactor http error handling
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.
2024-12-17 16:04:09 +01:00
Alejandro Sirgo Rica fd8da5de26 views: select the most used repo in Set repository view
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]}
2024-12-13 13:39:09 +01:00
Alejandro Sirgo Rica c7c28d6e92 templates: use "edit" instead of "update" in menus
Use "Edit" instead of "Update" for every menu except Update image
in Commands view.

Use "Command" instad of "Cmd" for shell run menu in Commands view.
2024-12-12 17:38:01 +01:00
Alejandro Sirgo Rica a58587dc80 views: improve request error reporting
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')
2024-12-11 16:35:17 +01:00
Alejandro Sirgo Rica 17644e584e views: cleanup action_setup_modify()
Check form.validate() for errors at the begining of the view
handler for an early return in case of error.
2024-12-11 16:33:43 +01:00
Alejandro Sirgo Rica edd44da64c ogcp: add Lives category to the main navbar
Add Lives view and show the lives installed in each server in the
sidebar.

Add view to set a new default live image in the Lives view.
2024-12-04 16:36:04 +01:00
Alejandro Sirgo Rica f02c899e3e views: select default live when it is the most used live
Select the default live entry instead of the entry of the live
that corresponds to the default live in the "Set ogLive" view.
2024-11-29 09:21:25 +01:00
Alejandro Sirgo Rica a241ce1bcd ogcp: update copyright headers 2024-11-28 16:52:06 +01:00
Alejandro Sirgo Rica a353cbcaa1 views: show correct live when the most used live is default
Use the correct livedir when the most used live is "ogLive"
2024-11-28 16:35:55 +01:00
Alejandro Sirgo Rica 76fe1b775a views: add direct cmd execution view
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.
2024-11-27 14:45:34 +01:00
Alejandro Sirgo Rica 92ab31650c log: show the end of the log and make it scrollable
Show the latest lines of the log first as they contain the
information relevant to the latest operations.

Show the logs inside an scrollable widget.
2024-11-12 10:37:31 +01:00
Alejandro Sirgo Rica 9c7a687d56 views: select the most used oglive in action/oglive
Set the most used oglive as the first element of the <select>
form component containing the list of available oglives.
2024-10-25 13:10:01 +02:00
Alejandro Sirgo Rica 270089983a js: fix sidebar client selection
Fix the JQuery selector to properly filter checboxes in the sidebar
2024-10-11 13:19:57 +02:00
Alejandro Sirgo Rica 66b663e051 views: update Boot OS to consume the new GET /session
Add code to handle the consumption of the new GET /session payload
from ogServer and ignore partitions with 'unknown' content.
2024-10-11 12:07:20 +02:00
Alejandro Sirgo Rica bcffdff135 views.py: prevent backtrace with unregistered client
Add check to skip unregistered clients in get_server_data_from_scopes
to prevent KeyError exception.
2024-10-10 11:48:29 +02:00
Alejandro Sirgo Rica 75cd6d9883 tempates: fix System log layout to prevent overflow
Restrict the <pre> component where the logs are contained to
prevent text overflow from happening.
2024-10-08 09:47:35 +02:00
Alejandro Sirgo Rica 6af4330016 ogcp: add view to identify clients setup diferences before restore
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.
2024-10-02 10:14:04 +02:00
Alejandro Sirgo Rica d6a896628f views: rename reference partitions variable in /image/restore
Rename part_choices variable to reference_patitioning to improve
readability and intent in the code that checks the uniformity of
the client's partitions.
2024-09-26 14:49:18 +02:00
Alejandro Sirgo Rica 6feffeab5d views: ignore unsuported part types in /image/restore checks
Evaluate only the viable partitions for a restore operation
during checks for partition uniformity.
2024-09-26 14:45:04 +02:00
Alejandro Sirgo Rica 6fecb9d34b views: report clients without cache in fetch and restore
Report clients without cache partition inthe decks of the target
clients with enough cache to fit the target image.
2024-09-26 13:21:13 +02:00
Alejandro Sirgo Rica 39371747db ogcp: improve cache report wording
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.
2024-09-26 13:21:13 +02:00
Alejandro Sirgo Rica c1d9018e21 templates: show real sizes in cache inspector
Use real free and available cache in cache_inspector.html
2024-09-26 13:21:02 +02:00
Alejandro Sirgo Rica 77a60b717a views: check if image fits in cache before /cache/fetch
Check if the image fits in cache before a /cache/fetch request.
Report the clients unable to store the image.
2024-09-26 10:21:19 +02:00
Alejandro Sirgo Rica 340b7fde54 views: improve checks for space available in cache
Use the new "free_cache" field in GET /cache/list to check
against the real available space to check if an image fits in
cache.
2024-09-26 10:19:37 +02:00
Alejandro Sirgo Rica ec209480ea templates: add free partition size in client details
Add column with available space in partitions only in the client
details views.
2024-09-25 17:01:48 +02:00
Alejandro Sirgo Rica 9bf161fc7a templates: reduce size of client list title
Reduce the size of the tittle message containing "Selected clients"
in the bock showing the client pills.
2024-09-17 13:18:57 +02:00
Alejandro Sirgo Rica 19295f8158 templates: disable sidebar in images and repos
Disable sidebar interaction in Images and Repos views.
2024-09-16 17:32:41 +02:00
Alejandro Sirgo Rica f03077edb7 js: add ogStorage to prevent localStorage key collission
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.
2024-09-16 17:29:14 +02:00
Alejandro Sirgo Rica 7296372e9c js: remove outdated local storage data
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.
2024-09-16 17:11:30 +02:00
Alejandro Sirgo Rica 053519beae templates: save checkbox state in images and repos
Store the checked checkboxes of the sidebar in Images and Repos.
Autoselect the correct server after updating the checkboxes.
2024-09-16 13:57:31 +02:00
Alejandro Sirgo Rica 2ca2215ed6 js: restrict the checkbox filter to the sidebar
Prevent accidental processing of checkboxes outside the sidebar.
2024-09-16 13:46:28 +02:00
Alejandro Sirgo Rica db2869088f js: remove unused function unfoldAll
Remove dead code.
2024-09-16 13:09:44 +02:00
Alejandro Sirgo Rica 233156b19a js: consolidate sidebar collapse persistence logic
Consolidate all the sidebar collapse persistence logic.
Implement a single function to handle all the views.
2024-09-16 12:34:32 +02:00
Alejandro Sirgo Rica f85c61df99 templates: fix initial repos disclosure widget status
Show the proper state of the disclosure widget when a repo starts
as collapsed.
2024-09-16 12:18:29 +02:00
Alejandro Sirgo Rica 65d2d75ddb templates: improve client report in image create view
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.
2024-09-16 12:05:04 +02:00
Alejandro Sirgo Rica 696a81fd11 templates: add name and status to client list
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.
2024-09-11 12:24:44 +02:00
Alejandro Sirgo Rica 6b33268b5c ogcp: add view to assign repo to clients
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.
2024-09-10 15:11:11 +02:00
Alejandro Sirgo Rica a1b164b106 templates: add efi data to /client/info
Show EFI info obtained through GET /efi.
2024-09-10 15:11:11 +02:00
Alejandro Sirgo Rica fd4da7d3ed views: set repo address limit to 128
Allow up to 128 IP addresses for repositories.
2024-09-10 12:20:29 +02:00
Alejandro Sirgo Rica 6e1d266daf views: sort repositories by name
Show repositories sorted in an alphanumeric fashion inside the
sidebar of /images and the respective child views.

Sort repositories in the sidebar of /repos.
2024-09-04 15:36:09 +02:00
Alejandro Sirgo Rica 23b49f0a6a templates: add image name to title in image/config
Add image name to the title in the view image/config.
2024-09-04 10:50:52 +02:00
Alejandro Sirgo Rica 3f06fe23aa templates: remove sidebar from client/list
Remove sidebar from the client/list view.
2024-09-03 16:26:42 +02:00
Alejandro Sirgo Rica 7613cd8017 ogcp: add server ip configuration
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.
2024-09-03 16:26:22 +02:00
Alejandro Sirgo Rica c1ac88e47c templates: fix ip card list spacing
Remove unwanted witespace caused by tabs and spaces.
Add margin to the ip card style to define an explicit spacing.
2024-09-03 09:52:26 +02:00
Alejandro Sirgo Rica 15f5af00e7 templates: show excluded clients from partition operation
Show the list of IPs of the clients withut the selected disk to
partition in the partition and format form.
2024-09-03 09:42:23 +02:00