summaryrefslogtreecommitdiffstats
path: root/ogcp/templates
Commit message (Collapse)AuthorAgeFilesLines
* templates: fix no image message in manage cache viewAlejandro Sirgo Rica2024-06-281-1/+1
| | | | | The template conditional must show the table when form.images has more than zero elements.
* templates: improve user sidebar styleAlejandro Sirgo Rica2024-06-281-3/+4
| | | | | Use Bootstrap list-group class and adjust content alignment with a flex container.
* templates: fix user form alignmentAlejandro Sirgo Rica2024-06-272-2/+3
| | | | Add class="mx-5" to allign the form with the header of the page.
* ogcp: improve page heading styleAlejandro Sirgo Rica2024-06-2747-62/+62
| | | | Make headings take less space and have a dashed line under them.
* ogcp: add user permission mechanismAlejandro Sirgo Rica2024-06-2710-131/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new user permission system to control the allowed operations accessible from each account. Add a permission matrix editable through the user/add and user/edit views. The permission matrix has client, center, room, folder, image and repository as permission targets and add, update and delete as permission types. Restrict each view based on the user permissions, hide all actions from not autheticated users. permissions defined in the class UserForm. Serialize each user permissions into ogcp.json as: { ... "USERS" [ { "USER": "admin" ... "PERMISSIONS": { "CLIENT": { "ADD": true, "UPDATE": true, "DELETE": true, }, ... <- same structure for "CENTER", "ROOM", "FOLDER", "IMAGE" and "REPOSITORY" } }, ... ], ... } Grant all the permissions to old user configuration to not disrupt their workflow. The administrator will need to assign the permissions for each user. Ignore scope and permission restrictions for admin users. Save permissions and scopes even if the user is admin to account for the case of a temporal admin promotion without losing the previous configuration. Use template inheritance for add_user.html and edit_user.html to prevent big code duplication with the new HTML code to render the permission matrix. Make user administration an admin only feature. Define methods get_permission and target_is_disabled to improve readability in template conditionals that disable features based on user permissions.
* templates: rename Edit client to Update clientAlejandro Sirgo Rica2024-06-251-1/+1
| | | | | Rename Client/Edit client menu in scopes management view to keep the same naming pattern as the other menu elements.
* ogcp: add support to view script outputAlejandro Sirgo Rica2024-06-252-0/+76
| | | | | | | | | | Add view at /action/script/output to visualize the result of /shell/run for multiple clients. Use shell/output to request the execution data of the selected clients. Each client element has execution timestamip (UTC), client ip, cmd, return code and stdout of the executed command.
* ogcp: add support to run scripts in clientsAlejandro Sirgo Rica2024-06-252-0/+34
| | | | | | | | 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.
* templates: make opengnsys buttom redirect to dashboardAlejandro Sirgo Rica2024-06-251-1/+1
| | | | | | Add functionality to the "Opengnsys" text in the top navbar. Comform to the general design priciple of executing a redirecting after clicking the main logo.
* templates: rename Start session to Boot OSAlejandro Sirgo Rica2024-06-201-1/+1
| | | | | Use a better name for the form action used to boot an operating system in the clients.
* templates: show client details at the end of the client optionsAlejandro Sirgo Rica2024-06-201-2/+2
| | | | | Move "Client details" to the last option of the "Client" dropdown in the Commands page.
* views: make password optional in user/editAlejandro Sirgo Rica2024-06-191-2/+2
| | | | | | | | | Add the option to leave the password fields empty in the form. When the passwords are not set the user keeps the old password configuration. Define a EditUserForm based on UserForm in forms/auth.py to remove the InputRequired validator in the password fields. Update the html template to make the password fields optional.
* templates: remove servers view in main navbarAlejandro Sirgo Rica2024-06-181-3/+0
| | | | | Remove the Servers button from the main navbar but keep the multiserver related code.
* css: offset the sidebar to acommodate all disclosure widgetsAlejandro Sirgo Rica2024-06-181-1/+1
| | | | | Add a left padding to show the disclosure widget associated to a server item. Prevent the positioning of out of screen components.
* js: show correct initial disclosure widget stateAlejandro Sirgo Rica2024-06-171-1/+1
| | | | | Add the class "collapsed" to the html elements defined as not shown in the local storage for the images list sidebar.
* ogcp: add room details view to scopes managementAlejandro Sirgo Rica2024-06-172-0/+20
| | | | | | Add a readonly view for the room data. Mark all the form fields as readonly and set the hidden attribute to the submit field.
* ogcp: add center details view to scopes managementAlejandro Sirgo Rica2024-06-172-0/+20
| | | | | | Add a readonly view for the center data. Mark all the form fields as readonly and set the hidden attribute to the submit field.
* ogcp: add move client to scopes managementAlejandro Sirgo Rica2024-06-172-0/+27
| | | | | | | | | | 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.
* templates: remove console.log statement in mode.htmlAlejandro Sirgo Rica2024-06-171-1/+0
| | | | Remove print statement generating noise in the browser logs
* templates: show oglive in client pillsAlejandro Sirgo Rica2024-06-171-0/+19
| | | | | | Add oglive to each client pill in action/oglive using js. This makes easier to have a global perspective of the client's configuration.
* forms: use checkboxes for scope selection in UserFormAlejandro Sirgo Rica2024-06-142-9/+80
| | | | | | | Enable selection of multiple scopes in user/add and user/edit for restricted users. Replace quick form creation with an inline form definition in add_user.html and edit_user.html
* templates: remove dead code from edit_user.htmlAlejandro Sirgo Rica2024-06-141-8/+0
| | | | | Remove the <script> block as the function digestUserFormPassword no longer exists.
* js: allow selection of multiple clients in scopes sidebarAlejandro Sirgo Rica2024-06-141-1/+1
| | | | | | | | | | | Allow the selection of multiple client checkboxes if they belong to the same room. Each checkbox input in the DOM has a "data-parent-room" attribute whose value is the value of the "name" attribute of its parent room scope component. To check if a checkbox is a client and a sibling of the one being checked we check if "data-parent-room" is available for both nodes and if they have the same value.
* ogcp: add disclosure widget to sidebarAlejandro Sirgo Rica2024-06-142-3/+2
| | | | | | | | | | | | Add cache buster to soleta.css in base.html to have control over cache expirity. Bump soleta.css version to ensure browser does not used older (cached) version. Add CSS rules to show a disclosure widget in the sidebar. Show center checkboxes as disabled in the commands view sidebar for visual consistency. Add class "collapsed" to the proper HTML components to keep a proper state on page reload.
* src: revisit sidebar context storage approachAlejandro Sirgo Rica2024-06-142-5/+6
| | | | | | | | | | | Maintain selections made in scope sidebar after clicking an action (ie. client add, room delete, etc.) Use ids instead of names as the name html property is the same for every room and center. Call keepSelectedClients() in macros.html for both Scope Management and Commands instead of only in Commands. Add a "context" value to the checkbox id to separate scope and commands values in local storage.
* templates: add missing center_update.htmlAlejandro Sirgo Rica2024-06-131-0/+18
| | | | | Add html template for the route /action/center/update. Finish the work started in commit 6ec26d16.
* templates: fix error report with multiple messagesAlejandro Sirgo Rica2024-06-131-2/+4
| | | | | | | | | Fix the definition of javascript code to generate a correct message window for multiple error messages. The error is cause by a redefinition of 'let bgclass' in multiple lines when the html template receives multiple error messages. Each iteration to generate the code for the error messages tries to redefine the variable bgclass and it causes the js to fail.
* templates: show boot mode in client pillsAlejandro Sirgo Rica2024-06-071-0/+18
| | | | | | Add boot mode to each client pill in action/mode using js. This makes easier to have a global perspective of the client's configuration.
* templates: show image file table only if clients have a cacheAlejandro Sirgo Rica2024-06-071-0/+6
| | | | | Hide form table when the client's cache is empty and inform the user about the selected clients not having images in cache.
* templates: show Delete Image only as adminAlejandro Sirgo Rica2024-06-071-0/+2
| | | | | Hide the Delete Image in user mode using template conditionals. A non admin account should not have access to image deletion.
* templates: use the correct storage units1.1.3-20Alejandro Sirgo Rica2024-05-303-12/+12
| | | | | | | Use base 2 storage units in html templates as that's the correct representation for the values shown in the web. Remove units such as "Gbytes" and "MB" for their binary byte unit counterparts.
* ogcp: add cache management pageAlejandro Sirgo Rica2024-05-302-0/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+32
| | | | | | | | | 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.
* js: only add MAC to client pills1.1.3-19Alejandro Sirgo Rica2024-05-131-1/+1
| | | | | | Ignore any room, center or folder as they don't have a MAC address. Trying to get the MAC of an scope element without one leads to a JS exception.
* js: remove console.log statementAlejandro Sirgo Rica2024-05-131-1/+1
| | | | Remove print statement generating noise in the browser logs.
* remove Format field from partition setup formAlejandro Sirgo Rica2024-05-131-2/+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.
* js: prevent js exception in pages without pill controlAlejandro Sirgo Rica2024-05-131-1/+1
| | | | | Add check to test if a pill control has been found and don't try to add mac data to non existent client pill controls.
* Make partition id non editable in partition formAlejandro Sirgo Rica2024-05-122-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.
* js: fix id update in partition form deletionAlejandro Sirgo Rica2024-05-101-1/+1
| | | | | | | Update all the name and id fields of the elements in the partition form after a delete operation. Inconsistent ids make form.validate() to always return False, this causes all the form validation code to be skipped.
* views: add update centerJavier Hernandez2024-02-091-0/+2
| | | | add view to update center data such as its name or comment.
* views: Add update roomJavier Hernandez2024-02-092-0/+21
| | | | Add view to modify room information such as name, gateway and netmask
* views: Add edit-folder1.1.3-15Javier Hernandez2024-02-052-0/+21
| | | | Add view to modify folder information such as name
* templates: remove Server: and Repo: in list imagesOpenGnSys Support Team2024-02-051-2/+1
| | | | | | | Although ogcp support for multiple server, the plan is to only support for one server in this version. Remove Server: context information and Repo: in list images
* views: preselect pxe boot mode in add clientJavier Hernandez2024-02-051-0/+19
| | | | | | | | preselect 'pxe' (if available) at adding a new client. use a dedicated template for adding a client and remove irrelevant partition table; client has yet to set its partition, so everytime, the table would load empty.
* improve delete confirmationJavier Hernandez2024-02-053-35/+43
| | | | | | | | 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.)
* Make list_images show only selected imagesJavier Hernandez2024-02-021-12/+7
| | | | | | | | | | | Make list images command show only information of the images the user has selected in the sidebar. Improve readability of the information. Show size and data size attributes rounded Warn the user if no images have been selected in sidebar
* improve delete confirmation pageJavier Hernandez2024-02-013-7/+85
| | | | | | | | | | In delete-center, delete-room and delete-folder confirmation pages, show the ancestors of the items about to delete. Likewise, show the items it contains. For example, if user is about to delete a room, confirmation page will display in which center it is contained and the clients and folder it has inside
* Add list images actionJavier Hernandez2024-01-302-0/+43
| | | | | Add list images action that shows a list of all the images in each server and their properties
* templates: show folder iconJavier Hernandez2024-01-301-0/+3
| | | | | | Add icons to differentiate folders. Use &#x1F4C1; which represents folder using emojis.
* views: Preselect most used ogliveJavier Hernandez2024-01-291-0/+25
| | | | | | | | When setting up oglive, preselect oglive that is most used by selected clients. If only one client is selected, preselect that of the client. In the unusual scenario where a client is set with an oglive that is not in the ogserver's list of available oglives, preselect default.