21 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
0bda4843a7
*: Use privileged decorator for package actions
Tests:

- DONE: Check if package manager is busy works
  - DONE: Power app shows status in app/restart/shutdown pages
  - DONE: Upgrades app shows in app page and first boot wizard page
  - DONE: When attempting force upgrade, busy state results in a back-off
- DONE: An app's packages can be installed/uninstalled successfully
  - DONE: apt update is run before install
  - DONE: If network is not available during package install, error message is shown
- DONE: Filtering packages with configuration file prompts works. Tested with
  firewall 1.0.3 to 1.2.1.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:54:00 -04:00
Sunil Mohan Adapa
7870d43c33
power: Use privileged decorator for actions
Tests:

- Reboot works, the process works in the background showing apps page
- Shutdown works, the process works in the background showing apps page

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:52:47 -04:00
Sunil Mohan Adapa
a7eb5e8f0e
power: Use AppView for app page
Tests:

- Enable/disable button is not shown.

- Diagnostics menu item is not shown.

- If apt is busy a warning message is shown.

- Restart and Shutdown buttons are shown and work.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:29:07 -04:00
Sunil Mohan Adapa
900c0d30b9
*: Drop module level app property
module.app property usage is greatly reduced because setup() and force_upgrade()
method are now part of App class instead of at the module level. Remove the
remaining minor cases of usage and drop the property altogether.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-15 10:36:29 -04:00
Sunil Mohan Adapa
4dfa9436b1
power: cosmetic: Fix flake8 warnings
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-17 17:36:52 -04:00
Sunil Mohan Adapa
355b2be90e
package: Fix error log when checking if package manager is busy
Reuse the method in package.py that checks is package manager is busy without
printing and error log.

Tests performed:

- Try to install a package and wait at the apt confirmation prompt.

- Go to power index page /sys/power/ . It shows a warning that package manager
is busy. No error log is printed.

- Go to system restart page. It shows a warning that package manager is busy. No
error log is printed.

- Go to system poweroff page. It shows a warning that package manager is busy.
No error log is printed.

- Without package manager being busy, above warnings are not shown.

- Go to manual update package. It shows as updating if apt is busy, otherwise
shows the manual update button.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-17 17:36:49 -04:00
Sunil Mohan Adapa
9368504da5
*.py: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:38:55 +02:00
Sunil Mohan Adapa
b576a77c3d
app: Refactor all apps to use the Info component
- Remove the need to pass all the individual information elements to the AppView
  separately. This eliminates many issues with elements that were mistakenly not
  sent to AppView. Also reduces a lot of code duplication.

- Create App classes for power and sso for consistency.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-16 18:22:01 -05:00
Sunil Mohan Adapa
ece2dd5e57
power: Use app.html instead of simple_app.html
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-01 16:40:53 -05:00
Joseph Nuthalapati
4064d6e231
manual: Link to manual from each service
Closes #930

- Make targets to download wiki pages of each service

- Add post-processor script for DocBook file processing

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-03-22 19:49:14 -04:00
Sunil Mohan Adapa
79276f14df
Don't use async for method parameters
async is a reserved keyword in Python 3.7. It can no longer be used as method
parameter. Change the name so that we are ready for Python 3.7.

See: https://www.python.org/dev/peps/pep-0492/#deprecation-plans

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-24 19:14:13 +01:00
Sunil Mohan Adapa
8f0e2d6381
Rename Plinth to FreedomBox in module doc strings
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:25 -05:00
Sunil Mohan Adapa
dea4af17fb
Rename Plinth to FreedomBox in license headers
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:09 -05:00
Prachi
c8eb714562
Separate out the short description and app name
Signed-off-by: Prachi <prachi@swecha.net>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2017-08-21 11:17:08 +05:30
Johannes Keyser
4bd6929d69
power: warn if a package manager is running before shutdown/restart
- red colors for warning about running package manager

- red buttons to indicate danger if installation/upgrade runs
2017-07-22 10:07:33 -04:00
Sunil Mohan Adapa
ee7cc98fee
apps, system: Remove modules and merge into main
- Remove apps and system modules and merge their views into main views.

- Move main_menu from cfg into menu.py.

- Remove dependencies of other modules on apps and system modules.

- Update tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-05-05 22:31:45 -04:00
Sunil Mohan Adapa
18996b5c56
Import urlresolvers from django.urls
In Django 1.10, django.core.urlresolvers is available from
django.urls. Use it.
2016-08-11 18:03:00 -04:00
Sunil Mohan Adapa
a33f68f051
power: Use new setup mechanism 2016-02-13 13:51:44 +05:30
Sunil Mohan Adapa
a0da928dae power: Minor updates
- Change term 'reboot' to 'restart' as it is less techinical and more
  consistent with popular interaces on desktop/mobiles.

- Updated description for power module.

- Simplify the module title to just 'Power'.

- Update the use of elipses and angular quotes as angular quotes and
  elipses are both used to indicate that further user interface will be
  available after pressing the button.

- Remove suprious '\' in power_reboot.html.

- Notify to the user that web interface will not be available after
  reboot/shutdown.

- Redirect the user to application page after restart/shutdown.  If the
  page serve succeeds, they will have simply refresh/access it after
  restart/shutdown after waiting or powering on.
2015-11-27 11:40:09 +05:30
Joel Valleroy
a002ca300c Use POST for reboot/shutdown now 2015-11-26 17:05:34 -05:00
Joel Valleroy
eca36e6f96 add power module with reboot and shut down 2015-11-26 16:29:38 -05:00