summaryrefslogtreecommitdiffstats
path: root/ogcp/forms/action_forms.py
Commit message (Collapse)AuthorAgeFilesLines
* ogcp: enable modification of client ipAlejandro Sirgo Rica2024-07-151-0/+1
| | | | | | Add 'id' value to the /client/update payload. Enable modification for the ip input field in the client update form.
* ogcp: show checksum in image infoAlejandro Sirgo Rica2024-07-121-0/+1
| | | | | | | Improve potential image troubleshooting within ogCP. Add checksum to the image info view. Show "Unknown" when no checksum is available.
* ogcp: make client name field mandatory in client formAlejandro Sirgo Rica2024-07-091-1/+2
| | | | | | Add InputRequired validator to the name field of the ClientDetailsForm. Validate name value in the POST function.
* ogcp: use csv as new format for import clientsAlejandro Sirgo Rica2024-07-091-1/+1
| | | | | | | | | | | 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
* forms: replace Ok with Submit in form submit buttonAlejandro Sirgo Rica2024-06-281-3/+3
| | | | Make the submit label more uniform across the forms.
* ogcp: add support to run scripts in clientsAlejandro Sirgo Rica2024-06-251-0/+9
| | | | | | | | Add view at /action/script/run to visualize the available scripts and run a single script file in the selected clients. Use shell/list to request the script list and shell/run API call to request the execution.
* ogcp: add move client to scopes managementAlejandro Sirgo Rica2024-06-171-0/+5
| | | | | | | | | | Add front end for the client/move REST API. Enable the move of multiple clients selected from the sidebar of Scopes Management. Show the target of the move operation as a list of paths in a dropdown widget in the form. Each path will be structured as: Server/Center/Room The path will also contain folders if they are present.
* forms: disable validation for dynamically populated select fieldsAlejandro Sirgo Rica2024-06-071-3/+3
| | | | | | | Disable form validation for dynamically populated select fields, otherwise, user hits bogus errors. This problem was introduced by COMMIT 43e3346.
* forms: add support for UNICAST image restoreAlejandro Sirgo Rica2024-06-051-1/+3
| | | | | | | | | | 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.
* forms: set default values to partition and formatAlejandro Sirgo Rica2024-06-041-3/+6
| | | | | | | | 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.
* forms: ensure ip and mac are not empty in client add formAlejandro Sirgo Rica2024-06-031-2/+4
| | | | | | Use the WTForms validator InputRequired to check the field and disable the submit button if either the IP or MAC fields have no contents.
* ogcp: add cache management pageAlejandro Sirgo Rica2024-05-301-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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, }
* make the boot OS form work over multiple clientsAlejandro Sirgo Rica2024-05-161-1/+0
| | | | | | | | | 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.
* remove Format field from partition setup formAlejandro Sirgo Rica2024-05-131-1/+0
| | | | | | | 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.
* Make partition id non editable in partition formAlejandro Sirgo Rica2024-05-121-2/+2
| | | | | | | 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.
* forms: remove EXFATOpenGnSys Support Team2024-05-071-1/+0
| | | | ogclient does not support this filesystem type, remove it.
* views: add update centerJavier Hernandez2024-02-091-0/+1
| | | | add view to update center data such as its name or comment.
* views: Add update roomJavier Hernandez2024-02-091-0/+1
| | | | Add view to modify room information such as name, gateway and netmask
* improve delete confirmationJavier Hernandez2024-02-051-4/+2
| | | | | | | | 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.)
* forms: Remove netiface from client's formJavier Hernandez2024-01-151-4/+0
| | | | | | | | | | 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.
* views: add room to folderJavier Hernandez2024-01-111-0/+1
| | | | Support adding a room to a folder
* views: Add computers to folderJavier Hernandez2024-01-111-0/+1
| | | | | | | | | | 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.
* views: Add delete folderJavier Hernandez2024-01-101-0/+1
| | | | | | | 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
* src: Add support for adding foldersJavier Hernandez2024-01-101-0/+7
| | | | | | Add support to create a folder able to contain multiple computers. Add support for adding a folder able to contain rooms
* templates: rename 'create' button to 'submit'Javier Hernandez2023-12-211-1/+1
| | | | | | | 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.
* views: add select repo in import clientsJavier Hernandez2023-12-131-0/+1
| | | | | | | | 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
* views: Add 'description' field to image detailsJavier Hernandez2023-12-121-0/+1
| | | | Add a 'description' field to the image-details form.
* Change Image-details' 'Datasize' unit to MiBJavier Hernandez2023-12-121-1/+1
| | | | | Change the Image details form to display the 'Datasize' field of the image in MiB instead of GiB
* views: add action to delete repoJavier Hernandez2023-12-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* src: add menu to manage reposJavier Hernandez2023-12-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | 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
* views: populate repositories in client formJavier Hernandez2023-11-291-2/+1
| | | | | Make, in add and edit clients forms, the field repository show the list with the actual repositories, not a harcoded value.
* image: rename and remove fieldsv1.1.3-4Javier Hernandez2023-11-271-3/+2
| | | | | | - remove field image 'id' - change size to display MiB instead of GiB - replace 'Modified' with 'Last update'
* client: Remove 'netmask' in formJavier Hernandez2023-11-271-1/+0
| | | | | Remove unnecessary field 'netmask' from forms used to create and update clients. Netmask is configured in rooms instead.
* src: Remove netdriver field in client formJavier Hernandez2023-11-231-2/+0
| | | | | | | | 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.
* views: add field 'gateway' in add-room formJavier Hernandez2023-11-141-0/+2
| | | | Add the possibility to configure a gateway in a room.
* ogcp: add backup boolean field in image updatev1.1.3Jose M. Guisado2023-07-071-0/+1
| | | | | | | | 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.
* Add Servers sectionJavier Sánchez Parra2022-09-271-1/+5
| | | | | | | In Servers section/view, users can add or delete ogServers from ogCP configuration file. Replaces Repositories views and recycle some of its code.
* Adapt Delete image to work with several ogServersJavier Sánchez Parra2022-09-271-0/+1
| | | | | This commit makes Delete image view to use ogServer field from imagesForm to send the deletion request to the correct ogServer.
* Adapt Delete center to work with several ogServersJavier Sánchez Parra2022-09-271-0/+1
| | | | | This commit makes Delete center view to use ogServer field from scopesForm to send the command to the correct ogServer.
* Adapt Add center to work with several ogServersJavier Sánchez Parra2022-09-271-0/+2
| | | | | | 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.
* Adapt Delete room to work with several ogServersJavier Sánchez Parra2022-09-271-0/+1
| | | | | This commit makes Delete room view to use ogServer field from scopesForm to send the command to the correct ogServer.
* Adapt Add room to work with several ogServersJavier Sánchez Parra2022-09-271-0/+1
| | | | | This commit makes Add room view to use ogServer field from scopesForm to send the command to the correct ogServer.
* Adapt Import Clients to work with several ogServersJavier Sánchez Parra2022-09-271-0/+1
| | | | | This commit makes Import Clients view to use ogServer field from scopesForm to send the command to the correct ogServer.
* Add current ogServer to scopesFormJavier Sánchez Parra2022-09-271-0/+1
| | | | | | | | | 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.
* Add "Delete Repository"Javier Sánchez Parra2022-07-041-0/+5
| | | | | In "Repositories" view, users select a repository from the list on the left and press "Delete repository".
* Create "Add Repository" form and viewJavier Sánchez Parra2022-07-041-0/+7
| | | | Creates "Add repository" form with the required inputs: name and IP.
* Rename field "OS" from "Create image"Javier Sánchez Parra2022-06-071-1/+1
| | | | | | Rename "OS" to "Partition" to improve clarity. This field represent which partition is used to create the image.
* Add repository field to "Create image" formJavier Sánchez Parra2022-05-241-0/+2
| | | | Let users choose which repository want to use to save the image.
* Add import clients actionJavier Sánchez Parra2022-04-191-1/+6
| | | | | | | | | | | 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; }
* Add Update image to commandsJavier Sánchez Parra2022-04-081-0/+8
| | | | | | | | 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.