Commit Graph

173 Commits (1120b31e3838f3c7806df83cdeaab6a02b95eca6)
 

Author SHA1 Message Date
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
Javier Sánchez Parra b0fb32d767 Extend scopes html
Otherwise, this actions pages lose the scopes tree and the scopes
buttons.
2022-03-03 12:25:31 +01:00
Javier Sánchez Parra 4005b019ee Extend scopes or commands in client details
Both "Add client" and "Client details" views use client_details.html
template. With this commit, "Add client" extends scopes.html and "Client
details" extend commands.hmlt.
2022-03-03 11:41:16 +01:00
Javier Sánchez Parra 3db3659499 Use pill style in confirmation pages
Draw selected clients from confirmation pages like selected clients from
scopes and commands pages.
2022-03-03 11:41:16 +01:00
Javier Sánchez Parra dc8759d2b9 Narrow client removal to scopes and commands pages
Otherwise, undesired removal of selected clients pills occurs.
2022-03-03 11:41:16 +01:00
Javier Sánchez Parra 30b3ef90b1 Add clients info to session's confirmation page
Show the number of clients and their IPs.
2022-03-03 11:41:09 +01:00
Javier Sánchez Parra 3271a4a08d Extend commands html
Otherwise, this actions pages lose the scopes tree and the commands
buttons.
2022-03-02 17:29:41 +01:00
Javier Sánchez Parra ed967216aa Show client state on pills
Color pills to represent their state, like scopes tree.
2022-02-25 13:53:47 +01:00
Javier Sánchez Parra 500d92007f Replace "." with "_" in HTML scopes IDs
Otherwise, scopes with dots 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-02-25 13:44:06 +01:00
Javier Sánchez Parra 23d9799e09 Limit max number of clients drawn in commands
Print large number of clients (hundreds) does not make sense, it is
unreadable.
2022-02-24 17:05:29 +01:00
Javier Sánchez Parra af4b07cecf Wrap selected clients list
Otherwise, the list overflows the screen when users select many clients.
2022-02-24 17:05:12 +01:00
Javier Sánchez Parra 42ba24c9f9 Refactor selected clients drawing in commands
Refactor duplicated code as a jinja macro.
2022-02-24 17:05:12 +01:00
Javier Sánchez Parra cc008a0e62 Remove unused code in image creation template
Remove code to draw selected clients. Image creation template do not use
it because only operates one client.
2022-02-24 17:05:12 +01:00
Jose M. Guisado ee2e7a86dd Improve software inventory command
Extend commands.html template to keep scope tree, and action buttons
state.

When in the software inventory view, there exists two options: 'update'
or 'view'. Do not print raw json response from ogserver about the software
inventory/profile.

When vieweing the software list, print a html table using the new
template: software_list.html.

Do not print blank pages with plain text html error codes when something
goes wrong. Instead, print an error message after redirecting to the
commands view.
2022-02-23 11:42:25 +01:00
Javier Sánchez Parra a940fb185b Remove "Tasks" and "Schedule" from the navbar
Remove them until we add their functionality.
2022-02-23 10:47:08 +01:00
Javier Sánchez Parra 886e6c7b67 Show selected clients in container block
On scopes and commands views, draw clients as users selects them in the
scopes tree.

Trigger client drawing on two events:

1."change" event, occurs when the user clicks a client checkbox. This
  event is standard [1].

2. "show-client" event, fires when ogcp get selected clients from
   localStorage and when an user checks a parent checkbox. This event is
   custom.

Dot characters (".") in clients names are replaced by underscore("_")
when used as id to avoid errors.

1. https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event
2022-02-23 10:47:08 +01:00
Jose M. Guisado 1d68e2619a Show error messages in action_image_restore
If something goes wrong, the application shows an error message after
redirecting to the commands view.

Do not show blank pages with plain text error codes.
2022-02-23 10:07:45 +01:00
Jose M. Guisado 5de191964a Show error message for invalid setup form
Do not show plain text '400 Bad Request'. Instead, show error message
and return to commands view.
2022-02-23 10:01:53 +01:00
Jose M. Guisado c5cb75eea3 Move 'Update' button up in hardware view 2022-02-23 09:58:30 +01:00
Jose M. Guisado ca00bd5e89 Redirect to commands view after hardware POST 2022-02-23 09:58:10 +01:00
Jose M. Guisado a326119937 Hardware inventory template extends from command.html
Extending from command.html is required for action views to mantain
the scope context on the left side column.

Enables setting dropdown button and action button as active when loading
the hardware inventory view.
2022-02-22 17:01:27 +01:00