Commit Graph

495 Commits (d00e437b8d76bc32732643a92f0ea32fbe0b7901)
 

Author SHA1 Message Date
Alejandro Sirgo Rica d00e437b8d ogcp: add support for multi-disk partition and format
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.
2024-09-02 15:05:45 +02:00
Alejandro Sirgo Rica 78a26f947f templates: use Fetch image as text for the Cache image button
Use "Fetch image" as text for the button to access the view
where the user selects images to add to cache.
2024-09-02 15:05:31 +02:00
Alejandro Sirgo Rica 31766a3d07 ogcp: add support for multi-ip repositories
Add support for the new API REST for repository management where
the address is a list of ips instead of a single string.

Add dynamic address creation in /action/repo/update and
/action/repo/add forms through delete and add buttons in the form.

Update /image/restore and /cache/fetch to use repository_id.

Add additional repository form validations.
2024-08-30 13:34:55 +02:00
Alejandro Sirgo Rica bcd18241c7 ogcp: add disk restrictions in partition and format
Use common disk space across all the selected clients.

Show dynamic disk partition graph in the partition view.

Limit partition sizes dynamically in the form.

Move js code to handle the addition and removal of
partitions into the html file to debloat ogcp.js and keep
the functions local to the only file they manipulate.
2024-08-22 10:04:55 +02:00
Alejandro Sirgo Rica aab70b0222 views: remove accents in image name
Remove accents in image name string. Special characters are not
supported for image names.
2024-08-21 11:25:44 +02:00
Alejandro Sirgo Rica 37efed8d30 template: prevent backtrace in /client/list
Don't access client.speed if the field is not present.
2024-08-09 10:01:52 +02:00
Alejandro Sirgo Rica 4b105b96b5 templates: adjust capitalization in commands button
Use "Restore image" instead of "Restore Image" for consistency.
2024-08-09 10:01:52 +02:00
Alejandro Sirgo Rica 844bc1e7c6 ogcp: Add /action/cache/fetch endpoint
Add view to request the download of images into the client's cache.
2024-08-09 10:01:23 +02:00
Alejandro Sirgo Rica ace0c5bb46 views: enable multi-image deletion
Allow the deletion of multiple images in image/delete.
2024-08-06 12:40:33 +02:00
Alejandro Sirgo Rica 4c1a86249b views: fix image create backtrace
Fix backtrace caused by efd0b8ac
Don't access the field scopes in ImageCreateForm as it does not
exist.
2024-08-06 10:35:17 +02:00
Alejandro Sirgo Rica 8e16c31952 views: sort images based on alphabetical name order
Show images in alphabetical order in every views listing images.
The only exception is the dashboard as it shows them from newer
to older.
2024-08-06 09:24:44 +02:00
Alejandro Sirgo Rica 35cfb59f4c css: add iOS fonts to disclosure widget
Add Helvetica fonts to the fonts used to render the disclosure
widget in the sidebar.
2024-08-05 11:32:23 +02:00
Alejandro Sirgo Rica d1e9469326 js: enable center selection in Commands
Enable center checkboxes and implement selection of clients from
multiple rooms in the same center.
2024-08-05 10:43:28 +02:00
Alejandro Sirgo Rica 3e35997131 ogcp: add connected clients list view
Add view to show the connected clients with access to the client
details of each one. The view is accessible through the main
dashboard.
2024-08-05 10:03:12 +02:00
Alejandro Sirgo Rica 695b83d473 templates: link to images view from the dashboard
Add link to image count in dashboard to open images view.
2024-07-30 12:23:20 +02:00
Alejandro Sirgo Rica 87b8e34dab views: add missing checks for offline ogServer
check when the API REST responses are null and report that
ogServer might be offline.
2024-07-25 09:48:12 +02:00
Alejandro Sirgo Rica fce0ee94c6 templates: make client details template more compact
Make the form template update automatically after form definition
modifications. Use a loop to render the for fields.
2024-07-25 09:48:12 +02:00
Alejandro Sirgo Rica 52b61df025 js: use div instead of br in client pills
Improve html structure inside client pills so the values can be
obtained with jquery by matching the name field of the div.
2024-07-25 09:48:12 +02:00
Alejandro Sirgo Rica c5a8c82b35 js: add red highlight to slow client link speed in client pills
Add a red inner pill to the link speed value when the speed is
lower than 1Gb/s.
2024-07-25 09:48:12 +02:00
Alejandro Sirgo Rica 6628d93d86 views: restrict EFI part size to 500MiB or higher
Modern Windows systems require higher EFI partition sizes than
most other OS.
Validate partition & format form to ensure the EFI partition has
as size of 500MiB or higher.
2024-07-25 09:48:12 +02:00
Alejandro Sirgo Rica efd0b8acb3 ogcp: add image restrict functionality
Add center scope restriction using /image/restrict.

Add view in Images to update scope permissions.

Disable images in Commands for image update and restore if the
client belongs to a disabled center.

Consolidate template code to render scope selection checkboxes.
2024-07-25 09:48:12 +02:00
Alejandro Sirgo Rica 594d655d6b css: add fixed font to disclosure widget
Prevent inconsistent visuals in different browser configurations.
Make the disclosure widget always look the same.
2024-07-25 09:48:00 +02:00
Alejandro Sirgo Rica c1d08df31d ogcp: improve sidebar logic in Commands
Disable all checkboxes of scopes of level higher than room in the
$(window).on('pageshow', function) callback.

Set checkboxes as "indeterminate" when not every children is
selected but have some of its children selected.

[x] center
  [x] room1
      [x] client1
      [x] client1

[-] center
  [ ] room1
  [-] room2
      [ ] client1
      [x] client1

Send all selected sidebar fields as form fields. This requires
setting disabled to false and replacing indeterminate = true
to checked = true in the .on('submit', function) callback.

When a checkbox is clicked:
1. Find the room branch of the checked input.
[ ] center
  [ ] room1
  [ ] room2 <- root of the room branch
      [ ] client1 <-- clicked item

2. Uncheck all the checkboxes outside of the room branch.
3. Set all the children of the clicked item to the same value
   as the clicked item.
4. Set the parent checked or indeterminate values.
5. Save checkbox status.
2024-07-22 15:57:51 +02:00
Alejandro Sirgo Rica c3d2582aa6 views: add repository_id to image/update payload
Give ogServer context about the proper repository to process the
correct image.
2024-07-19 14:31:21 +02:00
Alejandro Sirgo Rica 33d4c31f46 views: exclude clients with no partition in image/restore
Clients cannot have an image restore when no partition configuration
is available.
Shown an error listing all the clients with no partitions.
2024-07-17 13:17:58 +02:00
Alejandro Sirgo Rica ea28a4baf1 css: use min-width instad of wifth for client pills
Some ogLive names can be large and a fixed size makes the text
overflow under other client pills.
Let the client pills grow if needed to fit its content.
2024-07-17 10:59:29 +02:00
Alejandro Sirgo Rica 78fd46ad4f ogcp: show oglive client groups by ip
Use the same visualization as the other parts of the web in the
table that groups clients by ogLive.
2024-07-17 10:57:44 +02:00
Alejandro Sirgo Rica cae11fb04e views: list default oglive in Set ogLive form
Show default oglive as "ogLive (live name)" as the last option
int the Set ogLive form.
The previous implementation defined the default oglive as the
most used when the default one is defined by /oglive/list.
2024-07-17 10:32:56 +02:00
Alejandro Sirgo Rica 314a173b6c ogcp: show cache contents in client details
Show cache contents in client details for a more complete view
of the client's state.
Move the cache inspector code to its own template for reusability.
2024-07-16 12:55:31 +02:00
Alejandro Sirgo Rica 5af2b3738b ogcp: enable modification of client ip
Add 'id' value to the /client/update payload.
Enable modification for the ip input field  in the client update
form.
2024-07-15 14:45:49 +02:00
Alejandro Sirgo Rica 0d2f38ac47 templates: hide part table in client details with no partitions
Remove <table> with partition information in client details form
when the selected client has no partition configuration.
2024-07-15 14:07:45 +02:00
Alejandro Sirgo Rica dc1c630464 templates: make ClientDetailsForm render more compact
Make the client form more compact so the user does not require
to scroll to view all the information.
Place each label and field in the same row of the form layout.
Disable the Maintenance and Remote fields as they have not
actual functionality.
2024-07-15 14:03:47 +02:00
Alejandro Sirgo Rica 1548b6338a ogcp: show checksum in image info
Improve potential image troubleshooting within ogCP.
Add checksum to the image info view.

Show "Unknown" when no checksum is available.
2024-07-12 09:16:28 +02:00
Alejandro Sirgo Rica b5cb42006e ogcp: add checksum to images in Manage cache
Ease detection of potential problems with images in cache.
Show checksum under each image in the form.
2024-07-12 09:11:28 +02:00
Alejandro Sirgo Rica 514201e6a1 templates: force CSS update to show oglive indicator
Increase CSS version to update CSS file in browser cache.
2024-07-11 10:54:38 +02:00
Alejandro Sirgo Rica 6ce7dd7625 templates: force OS selection in Boot OS form
Prevent backtrace when not OS is selected before the form submit.
Add 'required' attribute to the <input> elements of each OS option
in the Boot OS form.
2024-07-09 16:42:08 +02:00
Alejandro Sirgo Rica 471cb78676 views: fix user scope filtering
Create a copy of the array with scope references before the
iteration and modification of the scopes dictionary.
Prevent skipping values after deleting an element during the
scope iteration.
2024-07-09 09:52:21 +02:00
Alejandro Sirgo Rica 5cbb4a7562 views: skip cache space checks if already contains the image
Skip checks of image_fits_in_cache() if the image data contains
not 'size' or 'checksum' information.

Skip checks for the clients with the image already in cache.
2024-07-09 09:52:21 +02:00
Alejandro Sirgo Rica a88e5fed7d ogcp: select images of selected partition in image/update
Select the image field value containing the restored image of the
partition selected by the user.

Create a dictionary where the key is the value= of the partition
field and the value is the id of the image restored in the
partition. Add each dictionary entry only only if the corresponding
image exists in the repository.
Pass the dictionary to the HTML template and convert it to JS.
2024-07-09 09:52:21 +02:00
Alejandro Sirgo Rica f85f0771cd ogcp: show an indicator in each sidebar branch with live children
Add visual indicator to the disclosure widget when its branch has
any clients in live mode.
Ease the search of systems in ogLive in need of being booted or
turned off.

Add id= to the HTML component containing the disclosure widget.
Set the id to the value scope_type-scope_name for type='server' and
scope_type-scope_id for the rest.

Add the CSS class 'live-report' to the HTML components with live
children. Assign the class field in the js function updateScopes.
2024-07-09 09:52:21 +02:00
Alejandro Sirgo Rica d582beef47 ogcp: fix client pill status report
Prevent cases where the client pills would stay locked reporting a
specific system.

Remove pill-* classes instead of text-* classes in function
updatePillStatus().

This fixes out-of-sync state representation between sidebar and main
section.
2024-07-09 09:52:21 +02:00
Alejandro Sirgo Rica bb59eb8a54 views: add auxiliar function is_valid_ip()
Move ip validation logic to a separate function to make the code
more expressive and reusable.
2024-07-09 09:52:21 +02:00
Alejandro Sirgo Rica e532e9a0c8 ogcp: make client name field mandatory in client form
Add InputRequired validator to the name field of the
ClientDetailsForm.
Validate name value in the POST function.
2024-07-09 09:52:21 +02:00
Alejandro Sirgo Rica 5111733b93 ogcp: use csv as new format for import clients
Replace dhcpd format with the simpler csv format to configure
the list of clients to import in /action/clients/import.
Replace regex parsing with a simpler manual parsing.
Improve error report.

Example configuration:
client_name1,94:c6:91:a6:25:1a,10.141.10.100
client_name2,94:c6:91:a6:25:1b,10.141.10.101
2024-07-09 09:52:07 +02:00
Alejandro Sirgo Rica c333b3ee56 views: check invalid values in prettify_mac()
Return without modification if the MAC is not valid.
2024-07-04 13:06:01 +02:00
Alejandro Sirgo Rica 320df7ec0c views: validate MAC address after POST
Check if the provided MAC address is valid in every form where
the use has to provide one. Show an error message when the format
is incorrect.
2024-07-03 15:51:31 +02:00
Alejandro Sirgo Rica b510d625b2 views: show MAC as lowercase with colon separators
Define a function to format the MAC string for every view in the
web. Example of formatted MAC address: aa:bb:cc:dd:ee:aa

Show MAC address in client pills in that same format.
2024-07-03 15:48:24 +02:00
Alejandro Sirgo Rica 9ea8a74c63 views: normalize every MAC address during POST processing
Use aabbccddeeaa as MAC format in every payload.

List of accepted MAC formats:
aabbccddeeaa
aa:bb:cc:dd:ee:aa
aa-bb-cc-dd-ee-aa
aa.bb.cc.dd.ee.aa
2024-07-03 14:25:34 +02:00
Alejandro Sirgo Rica 84365a0db2 templates: fix commands button layout
Fix <div> structure to enable proper flow layout when the web
size changes and the command buttons need to reposition.
2024-07-03 12:52:09 +02:00
Alejandro Sirgo Rica 14d6784958 templates: preserve formatting in script output
Use <pre> instead of <samp> to display command output, as <pre>
preserves the new lines and the format of its inner text.
2024-07-01 09:29:41 +02:00