Commit Graph

543 Commits (655ffbc0bb78ea53259a5e792160c7818614ad8e)
 

Author SHA1 Message Date
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 b74820a84c Improve MAC formatting
Add ":" separator between each byte in hexadecimal and transform chars
to uppercase.
2022-05-18 11:35:35 +02:00
Javier Sánchez Parra d9fe4dfa41 Add color legend of the client states
Add an explanatory list of the colors used to represent the different
client states.
2022-05-17 11:05:14 +02:00
Javier Sánchez Parra 4c6e3a90f1 Show last command result for clients in ogLive
If the last command sent to a client/s finishes with errors, their icons
in the scopes tree change to a yellow circle with an times sign inside.
2022-05-13 11:34:44 +02:00
Javier Sánchez Parra 08cae4b6ca Add link speed to pills
If the clients API response include link speed information, show it in
clients' pills.
2022-05-11 17:37:00 +02:00
Javier Sánchez Parra ce651453c4 Add MAC to pills
Retrieve and cache MACs one by one as users select clients.
2022-05-06 09:55:58 +02:00
Javier Sánchez Parra 72c10e1529 Add 'Delete user' to Users section
Creates "Delete user" form. The user to be deleted is selected from the
sidebar in Users section.
2022-04-27 17:34:36 +02:00
Javier Sánchez Parra eb8ddd236a Add 'Edit user' to Users section
Creates "Edit user" form with the following inputs: password, password
confirmation, role (administrator or regular), allowed scopes. It does
no allow to change/edit the username.
2022-04-27 17:34:26 +02:00
Javier Sánchez Parra 661254b76e Add 'Add user' to Users section
Creates "Add user" form with the following inputs: username, password,
password confirmation, role (administrator or regular), allowed scopes.
2022-04-27 17:27:50 +02:00
Javier Sánchez Parra d8bac16a98 Add Users section
In Users section/view, administrator accounts can manage all task
related to users. For example: add, delete and edit users.
2022-04-27 17:26:40 +02:00
Javier Sánchez Parra 57da4f4efa Add user role administrator
ogCP now have to types of users, regular and administrator users.

ogCP configuration file defines users roles with the boolean field
"ADMIN".
2022-04-27 17:24:08 +02:00
Javier Sánchez Parra c7b0024d24 Add password hashing
The front-end now hashes passwords before sending them to the back-end.
It uses SHA-512.

This commit adds a hidden input which sends the password hash to not
interfere with browsers' save password functionality.

Also change passwords of the template configuration file for their
hashed/digested versions.
2022-04-22 13:02:30 +02:00
Javier Sánchez Parra 1f9a3d3b41 Rename "submit" to "submit_btn"
Otherwise, wtforms use "submit" as id of the <input> tag, shadowing
javascript function ".submit()".
2022-04-22 09:11:48 +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 87270dc8df Increase toast auto hide delay to 30 seconds 2022-04-12 11:04:07 +02:00
Javier Sánchez Parra 974b74649a Handle ogServer connection error on login
On connection error show a (toast) message warning the user. Otherwise,
users see Werkzeug debug page.
2022-04-11 17:37:26 +02:00
Javier Sánchez Parra 37bb49d703 Rearrange image dropdown 2022-04-08 09:06:28 +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 d2fef8e85d Move search_image() outside action_image_restore() 2022-04-08 08:03:10 +02:00
Javier Sánchez Parra 4c9c3b48db Add indeterminate checkboxes to scopes tree
Each checkbox may have child checkboxes. If all those children are
checked, it be checked. If none are checked, it is unchecked. If some of
them are checked, then it’s in an indeterminate state (in this case
symbolically meaning “partially” checked).
2022-04-08 08:03:10 +02:00
Javier Sánchez Parra 1120b31e38 Simplify scope identifiers
Old id format example: id_1-1_2-4_3-2

New id format example: scope-1-4-2

It represents the node and its ancestors' position with respect to
theirs siblings. The rightmost value is the current node position.

Commit f70d90ba32 introduces the old format.
2022-04-08 08:03:10 +02:00
Javier Sánchez Parra e5087d2cfd Move toasts messages to the bottom right
Also, increase its duration from 5 to 10 seconds.
2022-04-08 08:01:48 +02:00
Javier Sánchez Parra 1869ad6eb4 Submit disk form on change of dropdown list
Also remove send button as it not necessary anymore.
2022-04-04 10:13:04 +02:00
Javier Sánchez Parra f86eaffefe Add form for disk selection
Disk selection uses "scopesForm" to submit the change, but setup/show
view receives new parameters not provided by this form.

Commit 17757baa4727 adds those parameters.

This commit gives disk selection its own form with all the required
parameters.
2022-04-04 09:28:49 +02:00
Javier Sánchez Parra 69b127a4f7 Move setup's disk selector
Move disk selector from the bottom of the page to the first table,
nearby "Partition Table Type" and "Total Disk Size".
2022-04-04 09:28:41 +02:00
Javier Sánchez Parra a2a5e4ed78 Submit IPs when scopes tree is read only
Otherwise, users can not switch between actions without going back to
the parent view.

This makes "scopesForm" work again in all views and not only in
scopes.html and commands.html.

Commit feed135554 introduces this regression.
2022-04-01 15:07:05 +02:00
Javier Sánchez Parra 02836444a9 Fix typo in scopes template
Otherwise, scopes' actions do not set the scopes tree read only.

Commit feed135554 introduces this typo.
2022-04-01 15:07:05 +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
Javier Sánchez Parra bb39f67a46 Change get_client_setup to receive a string
get_client_setup() takes an IP address that identify the client,
instead of passing an iterator with one single IP address, pass
directly such IP address.
2022-03-31 13:54:20 +02:00
Javier Sánchez Parra ce10f04b97 Remove unused variable db_partitions 2022-03-29 12:37:52 +02:00
Javier Sánchez Parra 1356145026 Add ogServer uptime to the dashboard
ogServer GET /stats returns ogServer uptime in seconds.

Transform seconds to days, hours and minutes and print them in the
dashboard.
2022-03-28 08:37:53 +02:00
Javier Sánchez Parra 6b617bd448 Check swap size is not zero
If the server do not have swap, show a warning.
2022-03-25 13:09:50 +01:00
Javier Sánchez Parra d4e7a9f05b Replace " " with "_" in HTML scopes IDs
Otherwise, scopes with whitespaces in their names breaks the javascript
code.

From
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id:

---
Note: Technically, in HTML5, the value for an id attribute may contain
any character, except whitespace characters. However, to avoid
inadvertent errors, only ASCII letters, digits, '_', and '-' should be
used and the value for an id attribute should start with a letter. For
example, . has a special meaning in CSS (it acts as a class selector).
Unless you are careful to escape it in the CSS, it won't be recognized
as part of the value of an id attribute. It is easy to forget to do
this, resulting in bugs in your code that could be hard to detect.
---
2022-03-25 12:08:39 +01:00
Javier Sánchez Parra 4f33ab1128 Add Catalan translations 2022-03-22 12:36:09 +01:00
Javier Sánchez Parra dcb79b1096 Update Spanish translations 2022-03-22 11:19:36 +01:00
Javier Sánchez Parra 62feecad1f Add missing gettext functions
Otherwise, this strings are not translatable.
2022-03-22 11:19:36 +01:00
Javier Sánchez Parra ee6880a9f2 Use lazy translation on intervals' strings
Constant strings outside of a request must use lazy strings. See
flask-babel documentation for more information.
2022-03-22 11:19:26 +01:00
Javier Sánchez Parra c8cf49bf6c Summarize dashboard information
* Rename "ogLives" to "ogLive images".

* Move "Number of images" table to take less space.

* Show storage data as "Storage size | Used (%) | Available (%)".

* Move "Latest images" an "ogLive images" to the bottom.
2022-03-17 11:43:47 +01:00
Javier Sánchez Parra 3283843d56 Add /stats data to the dashboard
Add certain statistics on memory and swap usage, as well as the uptime.
2022-03-16 17:33:34 +01:00
Javier Sánchez Parra 57ab7c11a9 Add back button to all actions
Add a back button to facilitate users to return to the previous page.
2022-03-14 17:24:23 +01:00
Javier Sánchez Parra feed135554 Disable scopes tree's checkboxes in action views
Now users can select clients only in scopes and command views, in any
other view we set the scopes tree read only.
2022-03-10 11:03:40 +01:00
Javier Sánchez Parra 406f578597 Highlight active navbar link
Change background color and round borders of active/current navbar
link to highlight it.
2022-03-09 17:08:33 +01:00
Javier Sánchez Parra 7dfeb3e44e Set pills width
Set the same width to all pills.
2022-03-09 17:08:33 +01:00
Javier Sánchez Parra d7b19c6aa0 Remove common css classes from pills status update
Some css classes are common to all pills statuses, so we do not need to
add or delete those classes on status change.

It also remove "badge-info" class because is never used.
2022-03-09 17:08:33 +01:00
Javier Sánchez Parra 6b3b37e2f3 Remove "form" from scopes views' headings 2022-03-09 17:06:42 +01:00
Javier Sánchez Parra 45d1d56ed9 Set scopes nav buttons as active
When loading any scopes view, its nav button becomes active.
2022-03-07 16:39:12 +01:00
Javier Sánchez Parra 2afbb1e208 Group scopes buttons into dropdowns
Group related actions in the "scopes" section inside a dropdown button.

Declutters the panel in which the buttons are displayed.
2022-03-07 16:39:12 +01:00
Javier Sánchez Parra 632bb3d578 Add separator and heading to selected clients 2022-03-07 16:39:12 +01:00
Javier Sánchez Parra cc533aa3cc Set commands nav buttons as active
When loading any command view, its nav button becomes active.
2022-03-04 11:04:22 +01:00
Javier Sánchez Parra 16ef1ae7ac Extend images html in "image details" template
Otherwise, "image details" page lose the images tree and buttons.
2022-03-03 12:35:48 +01:00