55 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
7f4c5f7410
Make app names as module identifiers
- The last part of the module import path is the module name.  This also
  becomes the Django app name.  Apps names have to be unique.  Hence,
  there is no scope for two different modules with same name but
  different load path to exist in the project.

- Most uses of list of loaded modules are dealing with app names instead
  of full module load path.  This is due to the fact that Django deals
  with app names and not module paths.

- It is also somewhat clumsy to access a loaded module as we are
  re-importing every time to get access module.

- Simplify all of the above by using app names are module identifiers
  and maintaing an ordered dictionary of app names to loadded modules.

- Remove unused imports.

- Minor styling fixes.
2016-02-13 13:49:23 +05:30
Caly
15312fe595
Update messages for simplicity/consistency/grammer
- Closes #375 and #380.

- More use of configurable brand name.
2016-01-24 12:14:25 +05:30
Sunil Mohan Adapa
572e68dc36
Make remaining uses of brand name customizable 2016-01-24 00:50:14 +05:30
Sunil Mohan Adapa
4602c5bfce
Use translated brand name in templates
Using brand name directly from configuration means that it can't be
easily translated.  Instead use the translated brand name sent in my the
context processor.
2016-01-24 00:37:01 +05:30
cat-git
2f9b419f4f
networks: Fix grammer in two sentences
Minor changes to English grammar to make user messages more
readable/translatable.
2016-01-08 15:04:13 +05:30
Daniel Steglich
de2d2323d4 Merge pull request 338 from SunilMohanAdapa:
Refactoring of networks module.
2016-01-01 22:00:28 +00:00
Sunil Mohan Adapa
201837518f Update strings during edit/delete operations 2015-12-09 23:55:55 +05:30
Ruben Lubbes
161e374419 Improved base strings to avoid duplicates
Should not affect already translated strings.
2015-12-09 23:55:55 +05:30
Sunil Mohan Adapa
42d0198a2e networks: Refactor for simplicity and brevity
- Make connection adding/editing forms inherit from base.

- Make the forms responsible for extracting cleaned data.

- Use dictionaries for passing around settings values while
  adding/editing connections.
2015-12-09 17:56:11 +05:30
Sunil Mohan Adapa
ba5c7a772d networks: Refactor & fix extracting netmask
- Use host byte ordering instead of big-endian.
2015-12-09 17:55:03 +05:30
Sunil Mohan Adapa
da99a7cb9d networks: Minor indentation fixes 2015-12-09 12:21:38 +05:30
Sunil Mohan Adapa
d1b20ac113 networks: I18N for static IP configuration 2015-12-09 12:20:37 +05:30
Daniel Steglich
1a1faa8a1b Github issue 314: static IP configuration enhancement
* fixed IP configuration
  * set up a new ipv4settings object to avoid the need of reseting all the values
* extended Static IP configuration:
  * allow configuration of netmask (optional)
  * allow configuration of Gateway (optional)
  * allow configuartion of two DNS Servers (optional)
* extend DHCP configuration:
  * allow configuration of user specific DNS Server
  * DHCP provided DNS Servers will be ignored in that case
2015-12-09 10:28:53 +05:30
Sunil Mohan Adapa
a69f419c3c Make Django urlpatterns list of url()s
- Support for legacy pattern() mechanism will be removed in Django
  1.10.  Currently we see a warning for each Plinth module.
2015-12-05 09:33:23 -05:00
Sunil Mohan Adapa
cc858bbd6a Use pgi only when gi is not available
- Write a convenience utility to handle the import process.
2015-11-16 09:55:20 +05:30
Nik Nyby
608897b9ec Test on python 3.3 and 3.4 with travis
Python 3.2.x is deprecated, so I thought it would be
good to get tests running on some newer pythons. I've
switched from the python3-gi package to using 'pgi' from
pypi, because the apt-installed python3-gi was having trouble
importing.

pgi required python 3.3+ (see: https://pypi.python.org/pypi/pgi),
so I've removed python 3.2 from the test matrix. Let me know if
we're using python 3.2 anywhere, but as far as I know plinth is
run on python 3.4.3 with debian sid on the freedombox image.
2015-11-16 08:44:01 +05:30
Sunil Mohan Adapa
01d50c7ae8 Fix i18n of template expressions 2015-11-14 11:42:32 +05:30
Sunil Mohan Adapa
3df1a88824 Switch to Django i18n for code strings
Django i18n layer is on top of gettext and provide may crucial features
such as per-request locales, lazy translations etc.
2015-11-13 22:08:43 +05:30
Sunil Mohan Adapa
02cd89b60d Internationalize strings in template files 2015-11-13 22:02:17 +05:30
Sunil Mohan Adapa
11bf585025 networks: Show network diagram
- As discussed in the first boot redesign proposal.

- Images are taken from Tango icon set, GNOME icons or created.

- Responsive, works for very small widths also.

- First cut, special cases of network connectivity are not handled.
2015-10-28 20:02:56 -04:00
Sunil Mohan Adapa
96b98fae9f networks: Handle unavailability of device 2015-10-28 20:02:56 -04:00
Sunil Mohan Adapa
2ef22ec1b4 Require library version for GObject introspection
Specify the version of a library before importing it using GObject
introspection.  Mainly to avoid warnings with recent version of
pygobject.  Closes #247.
2015-10-17 21:13:35 -04:00
fonfon
81e09a1280 networks: increased column size; added TODO 2015-10-14 12:54:21 +00:00
Sunil Mohan Adapa
7170d3db38 networks: Ability to enable/disable without JS
- Avoid using a drop down menu.

- Separate out the status indicator and activate/deactivate button.

- Closes #173.
2015-10-14 12:51:34 +00:00
Sunil Mohan Adapa
fc19b0fd3d networks: Refactor code for showing connection
- Fix showing configured IP address in edit form.

- Combine the retrival functions and organize them according to where
  the information is being retrived from connection/device/active
  connection/access point.

- Add more fields to show such as ether speed, default ipv4/ipv6
  connection, wifi mode, etc.

- Re-format the page.  Separate ipv4/ipv6 sections. Separate device
  information and connection information sections.

- Take the action buttons to the top.

- Make the activate/deactivate button work with new POST only CSRF
  requirement.

- Update Firewall zone description messages.

- Show all IP addresses of the device.
2015-10-11 16:28:55 +05:30
Sunil Mohan Adapa
682e5d7c2d networks: Prefill proper Wi-Fi device in add form
Add access points found on a particular Wi-Fi device only to that device
as it is not gauranteed that other Wi-Fi devices will be able to find
them.  For example, an access point operating in 5 GHz frequency will
only be found and used by Wi-Fi devices capable for 5 GHz communication.
2015-10-11 16:28:55 +05:30
Daniel Steglich
408aa8910a wi-fi network connection: Fixed error message when entering the form
- When selecting an existing WiFi on the "scan" page, the user will be redirected to the "WiFi add" form.
  This form did not contain a WiFi capable Interface as default selection, for this reason the user get a
  invalid form message when entering the form.
2015-10-11 16:28:55 +05:30
Daniel Steglich
f49def2d39 Add network connection: Show current IP address when editing a connection
- Added some generic network helper functions to global network helper class
  to get some information from a device by it's name. This is used when editing
  a connection (no ip was shown before).

- ToDo:
  This is only a workaround because we want to get the information from the connection but not from the device
  which belongs to the connection. If multiple connections are setup on the same device, this workaround will not
  work anymore.
2015-10-11 16:28:55 +05:30
Daniel Steglich
c3e5753b52 Network Status pages: added status pages
- implemented network status page which supports:
 * show IP address and netmask
 * show MAC address
 * show device name
 * show firewall zone name
 * show DNS server information
 * show default gateway
 * show wifi information
 * shows if connection is shared or not and if connection is the default connection

- when clicking on a cennection on the overview page go to the status page, not to the
  editing page

- ToDo: if connection is disabled and re-enabled again, no information are visible anymore (Bug)
2015-10-11 16:28:55 +05:30
Sean Alexandre
d14f077608 network: CSRF check for (de)activating connections
Fixes issue #127
Network manager: fix CSRF when activating/deactivating network connections
https://github.com/freedombox/Plinth/issues/127
2015-09-19 20:03:20 +05:30
Sunil Mohan Adapa
c2e85a872e networks: Implement diagnostics
- Since DNS server is started now by setting ipv4 'shared' method on a
  network connection, DNS tests are done here.
2015-08-29 06:22:01 -04:00
Sunil Mohan Adapa
ef156dab91 networks: Minor styling and comments update
- Add comment about PPP peers possibly not responding to echo requests.
2015-08-22 21:14:21 +05:30
Sunil Mohan Adapa
f93de11c6a networks: Handle unknown connections gracefully
When trying to edit connection of unknown type show an error and return
to connections list instead of trying to filling in some fields and
doing badly.
2015-08-22 21:14:21 +05:30
Sunil Mohan Adapa
958c249dfb networks: Retrieve password while editing PPPoE
- Retrieve password using connection.get_secrets() instead of
  settings_pppoe.get_password().

- Make sure IPv4 settings are not accessed during PPPoE editing.
2015-08-22 21:10:56 +05:30
Sunil Mohan Adapa
4f75f44769 networks: Fix showing password during PPPoE edit
- Javascript was missing for the template altogether.  Added one similar
  to create case.

- Minor refactoring to existing javascript.

- Consistent styling for display label and field id.
2015-08-22 20:22:08 +05:30
Daniel Steglich
5eda78a318 Fixed regression on editing Ethernet connections
During implementation of PPPoE based connections I added Username and
Password fields. This fileds are only required when editing a PPPoE
connection.
2015-08-22 13:03:00 +05:30
Daniel Steglich
d79437d2a2 show / hide password box
Added a selectbox to change the input box type from password to text.
2015-08-22 13:03:00 +05:30
Daniel Steglich
286caf8917 Added a new network connection type to handle PPPoE connections
* Added a new choice to main selectbox for adding Network Connections (network.py)
* Added a new form which asks for name, interface, firewall zone, username and password (forms.py, urls.py)
* Added new helper functions to create PPPoE based connection object (network.py)
2015-08-22 13:03:00 +05:30
Sunil Mohan Adapa
acf3a919f6 networks: Improvements to interface binding
- Fetch network interfaces list at the time of form creation instead of
  during definition.

- Add help text to interfaces list choice field.

- Don't write an explict check for requiring interface
  selection. required=True, which is default, takes care of that.

- Internationalize the empty selection text.

- Update the empty selection text.

- Re-order interface parameter in the same order of priority/appearance.
2015-07-27 22:03:02 +05:30
Daniel Steglich
378d6b8d84 networks: Always bind connections to a device 2015-07-27 22:03:02 +05:30
fonfon
824a9091c1 use django-stronghold for authentication handling (instead of @login_required) 2015-07-01 00:01:02 +05:30
Bob Girard
d64ce6cc01 Bundle tests with applications
- For each application, add ./tests directory and __init__.py file
  within it.

- Modify test controllers (coverage.py, runtests.py) to find the new
  test directories for testing and coverage analysis.

- Move existing application-specific test modules (test_pagekite.py) to
  the newly created directories.
2015-06-26 12:05:48 +05:30
Sunil Mohan Adapa
ef17bd8306 networks: Use libnm instead of python-networkmanager 2015-05-05 16:00:25 +05:30
Sunil Mohan Adapa
0cb8b4a5fc network: Cleanup, minor fixes and refactoring
- Make network-manager package get installed when accessing the index page of
  networks.  Also freedombox-setup shold actually pull network-manager package
  as dependency and use it for configuring the initial networks.

- Remove the /connect page and re-use the /add_wifi page for that purpose.

- Fix add connection page titles.

- Handle the case when network-manager returned empty string for SSID.

- Don't explictly URL encode the Wi-Fi SSID when adding a new Wi-Fi network.
  Django automatically handles this in 'url' tag and decodes before url
  routing.  Relax the regex that matches SSID as part of the URL to handle all
  possible SSIDs.
2015-04-06 22:21:29 +05:30
Sunil Mohan Adapa
fc6b59d59b network: Untabify and minor refactoring 2015-04-06 22:21:29 +05:30
Sunil Mohan Adapa
bc4ac58f2e network: Use uuids for identifying connections
- Name for a network connection is not unique.  UUIDs are much less likely to
  change compared to name of the connection.  No necessity to perform URL
  encoding too.

- Move UI error message strings to view module instead of the network module
  for proper separation.

- Minor refactoring.
2015-04-06 22:21:29 +05:30
James Valleroy
ed4e6eddc1 Update dependency list and pep8 fixes. 2015-04-06 22:21:29 +05:30
James Valleroy
40bbad4484 Add wifi mode to connect page also. 2015-04-06 22:21:29 +05:30
James Valleroy
2441caf647 Add AP and adhoc wifi modes, and shared IPv4 addressing mode. 2015-04-06 22:21:29 +05:30
James Valleroy
8d9b388375 Fix network tests, add form help and validator. 2015-04-06 22:21:29 +05:30