Commit Graph

70 Commits (4c97b671aaa00049a2dee88038a918f82ced1c83)

Author SHA1 Message Date
Alejandro Sirgo Rica 4c97b671aa forms: add support for UNICAST image restore
Add UNICAST and UNICAST-DIRECT to the image restore form.
UNICAST-DIRECT will transfer the images through a samba share
and proceed with the restore process without using any cache
partition.
UNICAST will try to first copy the image to the cache partition
and generate the full.sum file. Then the restore process is
executed.
2024-06-05 09:36:46 +02:00
Alejandro Sirgo Rica 462e6fb0ad forms: set default values to partition and format
Add default values to the partition and format form component.
Prevent index None from showing in the form when the client has an
empty disk with no partitions. Now the form will be created with
an entry of index 1 in adition to  Type and Filesystem as Empty in
that case.
2024-06-04 17:14:08 +02:00
Alejandro Sirgo Rica 43e3346a4a forms: ensure ip and mac are not empty in client add form
Use the WTForms validator InputRequired to check the field
and disable the submit button if either the IP or MAC fields
have no contents.
2024-06-03 17:26:09 +02:00
Alejandro Sirgo Rica 9cb3a952b4 ogcp: add cache management page
Implement cache management through cache/list and cache/delete
API REST methods.
The view corresponds to the URL action/cache and contains three
main parts:
- Free cache available in the client's bubbles.
- Image selection form to request the deletion and view the
client with that image in cache.
- Cache details per client to see total, used and available cache.

The main usecase for the view is the removal of cache to make room
for new images in clients with slow connections. Checking clients
where available cache space is not enough to hold the new image and
then requesting removal of specific images.

The html template receives the following structures from the view:
storage_data[ip] = {'used': 223452345,
                    'total': 2345234523452}

client_images[ip] = [f'{image_name}.{image_checksum}', ...]

image_data[f'{image_name}.{image_checksum}'] = {
    clients: ['192.168.0.1', ...],
    size: 34534530850,
    name: image_name,
}
2024-05-30 15:50:32 +02:00
Alejandro Sirgo Rica 8e60e95df6 make the boot OS form work over multiple clients
Enable working over multiple clients even if their OS configuration
is different to greatly improve the user's workflow.
Group clients with the same configuration under the same checkbox
in the form.
Report clients excluded from the boot instruction due to not
matching OS configuration.
2024-05-16 12:17:21 +02:00
Alejandro Sirgo Rica 7299b157d7 remove Format field from partition setup form
Remove the 'Format' field from the Partition and Format form as
the default value will always be to format the partitions.
This will lead to less portantial codepaths to maintain and
support and less manual clicks in the web form.
2024-05-13 10:07:52 +02:00
Alejandro Sirgo Rica 6034ba2537 Make partition id non editable in partition form
Show the partition id as a non editable label in each partition
of the Partition and Format form.
Assign sequential partition id from top to down and recalculate
every partition id when a partition is removed.
2024-05-12 14:59:53 +02:00
OpenGnSys Support Team 6f488ae251 forms: remove EXFAT
ogclient does not support this filesystem type, remove it.
2024-05-07 11:10:05 +02:00
Javier Hernandez 6ec26d161e views: add update center
add view to update center data such as its name or comment.
2024-02-09 13:21:55 +01:00
Javier Hernandez a609ede7a8 views: Add update room
Add view to modify room information such as name, gateway and netmask
2024-02-09 13:17:29 +01:00
Javier Hernandez 6153ca426f improve delete confirmation
Make delete confirmations show information in a manner that is easier to
read. This includes delete confirmations for centers, room and folder.

Messages are now more clear. Also, content table shows the type of the
items (folder, room, etc.)
2024-02-05 11:48:35 +01:00
Javier Hernandez d075cdd003 forms: Remove netiface from client's form
Remove netiface selectable in clientsDetails form.

eth{0,1,2} is misleading, it does not represent the real device in the client.

And users we know always boot from the first device.

Hide this feature until there is a better design for this.
2024-01-15 10:23:05 +01:00
Javier Hernandez b542031193 views: add room to folder
Support adding a room to a folder
2024-01-11 13:36:23 +01:00
Javier Hernandez cba7a0c1c6 views: Add computers to folder
Add support for adding computers to a folder.

It uses a js script that when selecting a folder in the html form, it
will also select the parent of the folder. For instance, if the user
were to select a folder that is contained inside a room, the room would
also get selected. This allows the view to know which parent contains
the folder.
2024-01-11 13:36:19 +01:00
Javier Hernandez 2509cacc00 views: Add delete folder
Add functionality to allow the user to delete a folder.

Show a confirmation page to the user listing the content of the folder
that is about to delete
2024-01-10 11:31:15 +01:00
Javier Hernandez 695fcfe625 src: Add support for adding folders
Add support to create a folder able to contain multiple computers.

Add support for adding a folder able to contain rooms
2024-01-10 11:31:08 +01:00
Javier Hernandez 52c5555f65 templates: rename 'create' button to 'submit'
In client_details template, rename 'create' button to 'submit'.

This template is used by both client-add and client-edit commands; it
would not make sense to have a 'Create' button in client-edit.
2023-12-21 11:54:01 +01:00
Javier Hernandez 609ff0e19e views: add select repo in import clients
Add, in import clients menu, a selector to select the repo to be
associated with the clients about to import

modify OG_CLIENT_DEFAULT_BOOT variable to be 'oglive'; 'pxe' is not a
valid boot mode, and ogserver would return an error
2023-12-13 11:39:08 +01:00
Javier Hernandez 0f5ba31c09 views: Add 'description' field to image details
Add a 'description' field to the image-details form.
2023-12-12 11:42:43 +01:00
Javier Hernandez 84bcdb3cae Change Image-details' 'Datasize' unit to MiB
Change the Image details form to display the 'Datasize' field of the
image in MiB instead of GiB
2023-12-12 11:00:19 +01:00
Javier Hernandez 152337b6bd views: add action to delete repo
allow the user to delete a repo by selecting one and pressing the delete
button. Previous to deletion, show the user a confirmation page (a form)
with the details of the repo to delete

the confirmation form is constructed with the fields of Repoform.
RepoForm is also used in template used to create a repo. To make both
templates work with RepoForm, RepoForm's field 'create' has been renamed to
'submit'

ogcp.js: add a function to make that, when the user selects a
repository, the server in which it is contained is automatically
checked. We need it checked so that action_repo_delete can know the
server to which it has to send the delete request. Use data-server in
repos_details.html to make this work

Validate, in action_delete_repo, that user has only selected one repo to
delete. In order to do that, action_delete_repo view needs to be able to
get a list of all selected repos. This is only possible if <input>
elements that are associated with repos info contain a different name
attribute per repo. In this case, template repos.html has been modified
to use name={repo name}-{repo_id}.  After this, parse_elements() will
work and parse a set containing all selected repos.

modify html input associated to repos server in order to follow same
convention as in other templates. For example, images uses image-server;
scopes, scope-server.
2023-12-05 10:21:09 +01:00
Javier Hernandez 2858436341 src: add menu to manage repos
The menu includes a list of the repos of each server. The user can
select a server or a repo to make changes.

As of now, the only action possible is to add a repo to selected
server.

The work contained in this commit can be structured in:

1. Add the repos menu:
- Add a 'repos' button in the menus bar (base.html).
- Add repos.html template to create the management repos menu.
- In ogcp.js, add function to store in browser's local storage which
  elements of the sidebar are uncollapsed. This saves the sidebar state
  after a page refresh.
- Add manage_repos() in views.py

2. Allow to add a repo:
- Add template with form to add a repo (repos_details.html)
- Create RepoForm(FlaskForm) in action_forms.py
- Add repo_add_get() and repo_add_post() in views.py
2023-12-01 17:20:08 +01:00
Javier Hernandez 4a70bc174c views: populate repositories in client form
Make, in add and edit clients forms, the field repository show the list
with the actual repositories, not a harcoded value.
2023-11-29 10:43:02 +01:00
Javier Hernandez ad41a0dfbe image: rename and remove fields
- remove field image 'id'
- change size to display MiB instead of GiB
- replace 'Modified' with 'Last update'
2023-11-27 09:45:16 +01:00
Javier Hernandez 4f565255af client: Remove 'netmask' in form
Remove unnecessary field 'netmask' from forms used to create and update
clients. Netmask is configured in rooms instead.
2023-11-27 09:44:47 +01:00
Javier Hernandez 3a0cdbda5a src: Remove netdriver field in client form
Remove netdriver field from forms used to add or update a client.
At the time of creating (or updating) a client, ogCP uses a hardcoded
value for this field of the payload.

This field is not used by oglive in any way, remove it.
2023-11-23 10:21:22 +01:00
Javier Hernandez 739ac075dc views: add field 'gateway' in add-room form
Add the possibility to configure a gateway in a room.
2023-11-14 15:44:14 +01:00
Jose M. Guisado db68dcea46 ogcp: add backup boolean field in image update
User can use this boolean field to specify if an backup copy needs to be
created before updating an image.

This only applies when sending a request to a client (ogClient)
supporting this parameter.
2023-07-07 13:22:23 +02:00
Javier Sánchez Parra 3459de36f3 Add Servers section
In Servers section/view, users can add or delete ogServers from ogCP
configuration file.

Replaces Repositories views and recycle some of its code.
2022-09-27 09:48:36 +02:00
Javier Sánchez Parra 083caf00c6 Adapt Delete image to work with several ogServers
This commit makes Delete image view to use ogServer field from
imagesForm to send the deletion request to the correct ogServer.
2022-09-27 09:48:36 +02:00
Javier Sánchez Parra 873bee30aa Adapt Delete center to work with several ogServers
This commit makes Delete center view to use ogServer field from
scopesForm to send the command to the correct ogServer.
2022-09-27 09:48:35 +02:00
Javier Sánchez Parra 9ca010a981 Adapt Add center to work with several ogServers
This commit adds a new select input with all available ogServers to "Add
center" view. The ogCP creates the center in the ogServer selected by
the user.
2022-09-27 09:48:35 +02:00
Javier Sánchez Parra 3d42c2c66c Adapt Delete room to work with several ogServers
This commit makes Delete room view to use ogServer field from scopesForm
to send the command to the correct ogServer.
2022-09-27 09:48:35 +02:00
Javier Sánchez Parra bf4192a5d4 Adapt Add room to work with several ogServers
This commit makes Add room view to use ogServer field from
scopesForm to send the command to the correct ogServer.
2022-09-27 09:48:35 +02:00
Javier Sánchez Parra 0db56d5eee Adapt Import Clients to work with several ogServers
This commit makes Import Clients view to use ogServer field from
scopesForm to send the command to the correct ogServer.
2022-09-27 09:48:35 +02:00
Javier Sánchez Parra 229ad311be Add current ogServer to scopesForm
With this commit when users select a scope, the ogServer to
which it belongs is also sent. Then when processing the form we obtain
this ogServer and we can send it the pertinent requests.

This commit also makes action "Add client" to use the ogServer sent in
the form.
2022-09-27 09:48:35 +02:00
Javier Sánchez Parra 9e386e5454 Add "Delete Repository"
In "Repositories" view, users select a repository from the list on the
left and press "Delete repository".
2022-07-04 15:34:03 +02:00
Javier Sánchez Parra c068bd2144 Create "Add Repository" form and view
Creates "Add repository" form with the required inputs: name and IP.
2022-07-04 15:34:02 +02:00
Javier Sánchez Parra 6b07e83f03 Rename field "OS" from "Create image"
Rename "OS" to "Partition" to improve clarity.

This field represent which partition is used to create the image.
2022-06-07 16:16:13 +02:00
Javier Sánchez Parra d9d3d2ad5f Add repository field to "Create image" form
Let users choose which repository want to use to save the image.
2022-05-24 09:28:51 +02:00
Javier Sánchez Parra 09884080c3 Add import clients action
Add import clients form with required inputs: room and dhcpd.conf.

This permits users to rapidly add large amounts of clients to a room
using dhcpd.conf's syntax. Users can copy full dhcpd.conf files to the
text area and the parser only matches lines with the following format as
clients:

host dummy {hardware ethernet 12:34:56:78:90:ab; fixed-address 192.168.1.55; }
2022-04-19 16:03:41 +02:00
Javier Sánchez Parra fcbaf7d66d Add Update image to commands
Allows updating the image file for an existing image.

This action is related to /image/create in ogServer API. If ogServer
receives an POST /image/create without the parameter "description", it
does not create a new image and only updates.
2022-04-08 08:03:32 +02:00
Javier Sánchez Parra 52a06822b2 Ask for reference when partitioning several clients
Allow the user to choose a computer as reference to display the
partition scheme form.
2022-04-01 15:07:05 +02:00
Jose M. Guisado 31b1e92077 Add confirmation page when deleting image
User can confirm when deleting an image by double checking the
information displayed on this page.

Adds a new optional field in GenericForm: 'ids'. Used when dealing with
ids instead of ips.
2022-01-27 16:51:35 +01:00
Javier Sánchez Parra e11125ef9e Rename MSDOS to MBR
This commit rename partition table type MSDOS to MBR in the front-end.

At the back-end ogCP still uses MSDOS string because ogClient scripts
(aka cloning engine) expects it.
2022-01-20 09:25:18 +01:00
Javier Sánchez Parra 73963a0273 Ask twice to delete clients
This commit adds an extra view to ensure users do not clients
accidentally.

It also includes Spanish translation of the new strings.
2022-01-19 15:36:58 +01:00
Javier Sánchez Parra 09498a8887 Use lazy translation in classes
From flask babel documentation:
---
Additionally if you want to use constant strings somewhere in your
application and define them outside of a request, you can use a lazy
strings. Lazy strings will not be evaluated until they are actually
used. To use such a lazy string, use the lazy_gettext() function.
---

_() and _l() functions are aliases of gettext() and lazy_gettext()
respectively. Both functions belong to flask babel library.
2022-01-13 11:36:46 +01:00
Javier Sánchez Parra e07c8afcce Add set ogLive to commands
This action is related to /oglive in ogServer's API. Allows changing the
ogLive for a set of given clients, previously selected in the /commands
view.
2021-12-16 17:17:07 +01:00
Javier Sánchez Parra c493d24349 Set tiptorrent as unique restore image method
Soleta Networks only offers support of tiptorrent for restore image
transferences.
2021-10-20 11:54:28 +02:00
Javier Sánchez Parra da9b2ea9c2 Add image details action
This action is used to visualize the specific details of an image, as
its ID, name, size, etc.
2021-09-03 14:51:15 +02:00