Go to file
Alejandro Sirgo Rica c1d08df31d ogcp: improve sidebar logic in Commands
Disable all checkboxes of scopes of level higher than room in the
$(window).on('pageshow', function) callback.

Set checkboxes as "indeterminate" when not every children is
selected but have some of its children selected.

[x] center
  [x] room1
      [x] client1
      [x] client1

[-] center
  [ ] room1
  [-] room2
      [ ] client1
      [x] client1

Send all selected sidebar fields as form fields. This requires
setting disabled to false and replacing indeterminate = true
to checked = true in the .on('submit', function) callback.

When a checkbox is clicked:
1. Find the room branch of the checked input.
[ ] center
  [ ] room1
  [ ] room2 <- root of the room branch
      [ ] client1 <-- clicked item

2. Uncheck all the checkboxes outside of the room branch.
3. Set all the children of the clicked item to the same value
   as the clicked item.
4. Set the parent checked or indeterminate values.
5. Save checkbox status.
2024-07-22 15:57:51 +02:00
ogcp ogcp: improve sidebar logic in Commands 2024-07-22 15:57:51 +02:00
.gitignore Add gitignore 2020-08-28 10:18:43 +02:00
COPYING Add README.md and COPYING files 2021-05-21 11:18:08 +02:00
README.md Add README.md and COPYING files 2021-05-21 11:18:08 +02:00
requirements.txt Add login 2021-03-05 11:47:27 +01:00
run_test.sh Add run_test.sh script 2020-10-27 10:38:56 +01:00

README.md

ogCP

ogCP (OpenGnsys Control Panel) is the new web interface, a modern alternative to the classical administration panel (WebConsole).

Installation

Steps to install ogCP on Ubuntu 18.04 LTS:

  • Clone the repository that is temporarily available at: https://github.com/javsanpar/ogCP
  • Edit ogcp/cfg/ogcp.json and include the API token and the IP address of the ogServer. In addition, we must define the user and the key we want for authentication in ogCP.
  • Create a python virtual environment.
    • Install venv with:
      apt-get install python3-venv
      
    • Create the folder where we will start the virtual environment.
    • Create the virtual environment with:
      python3 -m venv ./previous-folder
      
  • Activate the shell with the virtual environment with:
    source ./previous-folder/bin/activate
    
  • (Optional) If you want to expose ogCP to other machines, you must edit run_test.sh with:
    ...
    flask run --host=0.0.0.0
    
  • With the shell linked to the newly created python environment, navigate to the folder where you cloned ogCP and launch:
    ./run_test.sh
    
    When running run_test.sh for the first time some errors are expected, but they do not affect to the usability of ogCP.

License

ogCP is released under the GNU Affero Public License v3+

Authors

Soleta Networks