summaryrefslogtreecommitdiffstats
path: root/ogcp/templates
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* dashboard: Show all servers, online or offlineJavier Hernandez2024-01-291-2/+10
| | | | | | | Show in dashboard the list of all servers, regardless if they are online or offline. If they are offline, uptime appears as 'offline' Modify dashboard template to make it work with offline servers
* templates: Add versioning to avoid browser caching ogcp.js errorsJavier Hernandez2024-01-191-1/+1
| | | | | | | | | Add version parameter to ogcp.js url. This is so that, if ogcp.js is modified, the browser is able to see that that file has been changed and that it has to load the new version instead of acquiring it from cache. We have experienced stranged errors, related to browsers caching old javascript files, leading to python flask backend backtraces
* templates: stilistic change in mode templateJavier Hernandez2024-01-191-4/+4
| | | | Remove warning header and show selected clients above boot-mode tables
* templates: fix wrong navigation detailsJavier Hernandez2024-01-181-2/+2
| | | | Fix wrong navigation details in template select_client.
* views: add an action to view repo details1.1.3-11Javier Hernandez2024-01-162-0/+15
| | | | | Add an action to allow the user to view details (name and ip) of a particular repo.
* views: Add computers to folderJavier Hernandez2024-01-111-6/+8
| | | | | | | | | | 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-103-0/+37
| | | | | | | 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-102-0/+30
| | | | | | Add support to create a folder able to contain multiple computers. Add support for adding a folder able to contain rooms
* templates: Make stilistic changes in dashboardJavier Hernandez2024-01-031-50/+15
| | | | | | | | | - Remove a table with redundant info; it was displaying server's stats, which was already in another table - Add last update info at the top of the page - Make page more robust by checking if ogLive images are available. Before this patch, page shows a traceback if the ogLive list are not available.
* Warn if clients have different boot modesJavier Hernandez2023-12-221-0/+26
| | | | | | Show user, when attempting to change the bootmode of more than one client with different boot modes, a warning and a table with said bootmodes.
* Remove id from client's bubblesJavier Hernandez2023-12-211-1/+1
| | | | | | | | Remove id from client's bubbles in the following commands: Power (Poweroff, Poweron, Reboot); Setup (Set boot mode, Set ogLive); Client (Start session) To make the string replacement, a custom jinja filter has been created
* 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.
* templates: Show username in top navbarv1.1.3-9Javier Hernandez2023-12-181-0/+5
| | | | Show the username of the user currently logged-in in the top navbar.
* Add scope-management for non-admin usersJavier Hernandez2023-12-152-1/+5
| | | | | Add scope-management menu with limited commands for non-admin users; commands allowed are add/edit/edit/delete/import client(s)
* Group images by reposJavier Hernandez2023-12-141-10/+20
| | | | | Make the sidebar from the images menu display the list of repos grouped by repos
* base: Increase column size for sidebarv1.1.3-8Javier Hernandez2023-12-121-1/+1
| | | | Make the sidebar wider to improve readability of its content
* ogcp.js: Fix bug when adding a new partitionJavier Hernandez2023-12-111-1/+1
| | | | | | | | | | | | | | | | | Fix a bug that made the 'add a new partition' button unusable if all partitions (rows) were deleted. The reason for this bug was that the AddPartition() function would add a new partition by cloning an already present html row element. This would fail if no more rows were present in the table. The solution implemented checks, previous to delete a partition, if it is the last partition. If it is, then, instead of removing the whole row, it just empties it. Html button element needs to contain 'type="button"' attribute for this to work. Otherwise, default action for the button is submit and it would redirect after clicking.
* templates: add missing delete/update repository templatesv1.1.3-7OpenGnSys Support Team2023-12-112-0/+34
| | | | | | | Add missing templates. Fixes: 15dd4c2a8f69 ('views: add action to update repo') Fixes: 152337b6bdb8 ('views: add action to delete repo')
* views: change repo add view to follow conventionv1.1.3-6Javier Hernandez2023-12-052-3/+3
| | | | | | | | | combine repo_add_get and repo_add_post into one, action_repo_add. This is to follow convention across all the views and to clarify that it is an action. rename repos_details template to repos_add. Now it is clear the purpose of each action template; there is one for each: add, delete and update
* views: add action to update repoJavier Hernandez2023-12-051-0/+2
| | | | | allow the user to update a repo by selecting one and pressing the update button.
* views: add action to delete repoJavier Hernandez2023-12-052-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.