| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Color pills to represent their state, like scopes tree.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Use bold font for active nav items.
|
|
|
|
|
|
| |
Otherwise, nested scopes are not checked and mislead users.
When a scope is checked, we search all its children and check them too.
|
|
|
|
|
| |
This function stores checksum status if is checked to browser local
storage. Otherwise, it removes checksum from the storage.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise, users have to click clients checkboxes every time they
switch view.
This commit adds one hook to capture when clients checkboxes changes.
When they are checked, ogcp (front-end) stores them in browser's local
storage. When they are unchecked, ogcp removes them from local storage.
Every time users load a page with the scopes tree, ogcp checks local
storage to restore selected clients.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise, users have to expand the scopes tree every time they switch
view.
This commit adds two hooks to capture when an element of the tree is
shown or is hidden[1]. When they are shown, ogcp (front-end) stores them
in browser's local storage[2]. When they are hidden, ogcp removes them
from local storage.
Every time users load a page with the scopes tree, ogcp checks local
storage to restore the scopes tree state.
Store and remove functions use stopPropagation() to prevent ancestors of
clicked elements to also be stored or removed from local storage.[3]
1. https://getbootstrap.com/docs/4.1/components/collapse/#events
2. https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
3. https://javascript.info/bubbling-and-capturing
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes the javascript that adds/removes rows from the setup
form.
The AddPartition function now replaces the id `partitions-N-FIELDNAME`
using a regular expression. The hidden csrf input is also ignored to get
incremental numbers.
On deletion, all the ids are reassign from zero, in order, to get always
an ordered list with all numbers between the first and the last.
|
|
|
|
|
|
|
|
|
|
| |
The initial "Partition & Format" (aka setup) form only allows to modify
one partition at a time. This commit updates it to allow to modify the
whole disk partition schema in one go, without pop-ups and transitions.
This is a remake of the previous form using FieldList de WTForms and
javascript to duplicate / remove FieldList adapted to the attributes
available in WTForms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds new states: OPG for clients in ogLive, BSY for busy
clients, VDI for clients in OpenGnsys VDI and WOL_SENT for booting
clients.
It also removes state ON because do not exists.
ogCP currently uses the following colors:
* OPG -> Solid yellow
* BSY -> Solid red
* VDI -> Solid green
* WOL_SENT -> Solid brown
* OFF -> Hollow grey
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a javascript function to update the scope tree (on/off)
state.
This javacript function is called every second, does a call to the
new backend endpoint `/scopes/status` and updates the tree classes
depending on the current data.
The new `/scopes/status` endpoint just returns the scopes tree as json.
This patch also adds an icon in the tree leafs, a filled green circle
when the state is `on`, and a empty red circle when the state is `off`.
There's also a new javascript function to unfold all collapses in the
scope tree.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Being able to collapse the scopes tree allows to fit a bigger scopes
tree.
A new macro is introduced to generate the HTML code for the scope tree
in such a way that each non-leaf level (center, room) are collapsible.
macros.scopes_tree_collapse(scopes)
As of now, the state of the scope tree is not saved when changing nav
sections.
|
|
|
|
|
|
|
| |
This patch adds an example chart using chartjs to the dashboard to show
the disk usage.
https://www.chartjs.org/docs/latest/getting-started/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modify the base template to add the sidebar and command bar, implemented
just in the scopes view.
This patch also modifies the "actions/mode.html" template to be shown in
the scopes page. Any other action that should be inside the scopes
should do the same, add the scopes and clients to the template context
and use the "scopes.html" as base in those actions.
The notification has been also changed to use a toast notification
instead of the usual alert to avoid changing the layout on error.
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the css and js sources from the AdminLTE template to the
base template so it can be used in all templates.
There's also some flexbox bootstrap classes [1] to place the footer at
the bootom always, even when there's no content to fill the page.
[1] https://getbootstrap.com/docs/4.6/utilities/flex/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the open source AdminLTE bootstrap dashboard template to the static
folder, and some plugins that we'll use in the following changes to the
templates.
Plugins:
* jquery
* bootstrap
* font-awesome
https://adminlte.io/
|
|
|
|
|
|
|
|
| |
* Adds label for each action page.
* Adds a colored state for opengnsys connected clients
* Fix nav active item
* Rename some actions
* Adds DISK to partition and format form
|
|
|
|
| |
This is used for multiple bootstrap components such as dropdown menus.
|
|
This adds base.html and nav.html templates as well as its dependencies
on Bootstrap and jQuery.
|