160 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
ed92a7e010
networks: Remove unused import to fix flake8 failure
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-01-25 15:56:12 -08:00
Fioddor Superconcentrado
ce87de1dfb
networks: Hide deactivate/remove buttons for primary connections
Helps: #1962.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-01-25 15:40:51 -08:00
Fioddor Superconcentrado
012a9a0fc7
networks: Prevent unintended changes to primary connection.
Helps: #1962

Shown an alarming warning in connection_show page (only) for the primary
connection. Captions 'Deactivate' and 'Delete' buttons, now explicitly
mention the primary connection and they are placed within the warning
box.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Primary connection is not the same as connection user is using]
[sunil: Reduce the importance of primary connection as it is just default route]
[sunil: Update primary connection message]
[sunil: Fix the use of exclamation icon for screen readers as per bootstrap]
[sunil: Don't place buttons inside the warning, as it is non-intuitive UI]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-01-25 15:40:48 -08:00
Fioddor Superconcentrado
6e747f281e
networks: Use radio buttons for network modes
Closes: #1974

BTW: Javascript IPV4/6 hide/show arrangements triggered on page load.
Otherwise page loads form fields inconsistently.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Fix the use of RadioSelect widget]
[sunil: Alter the wording of what each type means]
[sunil: Drop the help text for radio group as it is mostly repetitive]
[sunil: js: Make the entire jQuery code run on document ready]
[sunil: js: Revert unneeded double call to change methods, change() is enough]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-01-25 15:40:45 -08:00
Fioddor Superconcentrado
99935a9696
networks: Change connection type to a radio button
Close: #1821.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Correct the use of RadioSelect widget]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-01-25 15:40:41 -08:00
Fioddor Superconcentrado
213cf16f8d
networks: Separate the delete button and color it differently
Pull the delete button in the connection show page to the right to prevent
hitting it by accident.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Use a new consistent style compatible with bootstrap4]
[sunil: Styled the delete button with danger color]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-01-25 15:40:30 -08:00
Sunil Mohan Adapa
eeac81b8c6
networks: Use table for styling network connection list
- Split CSS into a separate file.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:48 +02:00
Sunil Mohan Adapa
4b10d525bd
networks: Use common styling for Wi-Fi network list
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:47 +02:00
Sunil Mohan Adapa
55880e8f0b
networks: Use common styling for showing network connection
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:47 +02:00
Sunil Mohan Adapa
9c6ca18045
ui: Consistently use the btn-toolbar class for all toolbars
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:37 +02:00
Sunil Mohan Adapa
f4a48f3e36
ui: css: Use rem as the primary unit
- When the base font size is changed, all the measure will scale appropriately.

- Bootstrap 4 has done the same.

- Keep using px for responsive lengths and some border widths that need not
scale.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:34 +02:00
achalaramu
00bc55f762
Migrate bootstrap 4 from bootstrap 3
Closes: #1818. The new navbar collapse handles items better without a scrollbar.

- Switch dependency to newer bootstrap4 library.

- Bootstrap 4 has 5 grid levels instead of 4. Adjust all classes accordingly to
retain current semantics.

- Update for newer markup for dropdowns.

- Replace use for labels with badges. Labels have been removed. Use
badge-secondary instead of label-default.

- Replace use of btn-xs with btn-sm. Size is roughly the same.

- Accommodate removal of form-horizontal.

- .hidden* and .visible* classes have been removed. Use alternate utilities.

- Replace use of table-condensed with table-sm.

- Update progress bar background styling. .progress-bar-* have been replaced
with bg-*.

- Drop support for IE9 and below. Bootstrap 4 does not support those browsers.

- Use the new simplified markup for navs, navbar and navbar-toggler. Accommodate
removal of .navbar-fixed-top.

- Update the JSXC page too.

- Update all values that are using rem units. The base font size is now 1rem =
16px instead of 1rem = 10px. This the default for bootstrap 4.

- A button inside a dropdown menu is natively supported by bootstrap 4. Remove
custom styling done earlier.

- Drop use of removed class thumbnail.

- Override colors for buttons and warnings to keep the old style.

- Use new markup for close buttons inside alerts.

- Use .collapse.show instead of .collapse.in as per bootstrap 4 styling.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:32 +02:00
Fioddor Superconcentrado
20f0b25ff5
networks: Apply translation to a tooltip.
Helps: #1938
It also corrects the transliteration of another tooltip.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-11-25 11:25:07 -05:00
Fioddor Superconcentrado
c88acb36d0
networks: css: Make button wider in network list
testing:
- Might this impact somewhere else (same form-button combination)?
- Yapf: not applicable.
- Flake8: without errors or warnings for changed files.
- (Unit) tests: run without errors.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Use min width instead of fixed width]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-20 11:57:21 -07:00
Fioddor Superconcentrado
ff9d0ace31
networks: i18n: Mark various strings for translation
Helps: #1938.

- Translate various states passed in by Network Manager:
  - Device state
  - Device state reason
  - Device type
  - Firewall zone
  - IPv4/IPv6 connection method
  - Wireless mode
- forms.py: Move zones list to network.py, reuse in views.py.

Testing:
- Yapf applied.
- Flake8 without errors or warnings for changed files.
- (Unit) tests run without errors.
- Screnshots attached to #1938.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Add strings for many more states]
[sunil: Don't allow None to be selected as firewall zone]
[sunil: Drop forced_literals.py as it reduces modularity of the code]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-20 11:57:12 -07:00
Fioddor Superconcentrado
67edecb8ab
networks: i18n: Mark string for translation on delete page
Helps: #1938.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Don't split the string into two, mark it in full]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-20 11:57:08 -07:00
Fioddor Superconcentrado
633f54b75c
diagnostics: Lazy format all diagnostic test strings properly
Helps: #1938.

Fixed application of available translations in daemon.py and apache,
diagnostics, networks, firewall and users modules.

diagnostics:
- __init__.py: return the app name along its results.
- diagnostics.html: display the app name instead of its id.
- diagnostics_results.html:
  - mark for translation,
  - apply class to results <td> HTML tag.

main.css: center-align the results.

Locale files excluded. Will be regenerated automatically and translations to be
done via Weblate.

original testing (rebased later):
- Yapf applied.
- Flake8 without errors or warnings for changed files.
- (Unit) tests run without errors.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Translate 'None' app name]
[sunil: Don't translate tests strings second time in template]
[sunil: Tweak the center rule]
[sunil: Don't split a translation string]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-13 15:43:44 -07:00
Sunil Mohan Adapa
f58b5f8962
networks: Expose API to get/set network meta info
- API can be consumed by other apps.

- Consistently, get/set store keys and default values without repeated code.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-09-04 16:32:37 +03:00
Sunil Mohan Adapa
699266fdc1
help, networks: Clarify i18n different contexts for "Manual"
The word "Manual" means 'user guide' in case of help and 'not automatically' in
case of networking app.

After change, POT file is produced as follows:

msgctxt "User guide"
msgid "Manual"
msgstr ""

msgctxt "Not automatically"
msgid "Manual"
msgstr ""

Closes: #1922.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-08-22 10:52:32 +05:30
Joseph Nuthalapati
d92ca09e19
framework: Remove module init() functions
Fixes #1906

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-08-03 18:06:48 -04:00
James Valleroy
41dc3b4f96
networks: Correct wording of internet connection form
Change "overtime" to "over time", also matches the other choice in the
form.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-29 09:47:09 -07:00
James Valleroy
994a7a1d4b
networks: Remove firewall zone warning
Mention that interface is automatically assigned to external zone.

Test:
- Re-assigned host0 interface to public zone. Disabled firewalld to
still access interface. Firewall zone is shown as "external" with the
note about automatic assignment.

Closes: #1858.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-28 22:25:25 -07:00
Sunil Mohan Adapa
b6478b6888
cockpit: Promote for advanced storage/firewalld/networking ops
- Talk about cockpit in networking, firewall and storage apps for advanced
operations. Make it a separate section instead of just description update to
provider higher emphasis.

- Update cockpit description too.

Closes: #1809.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-27 14:29:39 -04:00
Sunil Mohan Adapa
a3218b2d79
networks: Make styling more specific to avoid interference
Tests performed:

- Visit networks page, observe that activate/de-activatge buttons have similar
width of 7em (as per inspector).

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-29 09:43:51 +03:00
Allan Nordhøy
a0f6b0ea4a
networks: Update label wording in topology form: Choose → Specify
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-24 15:03:06 -07:00
Sunil Mohan Adapa
2238352e45
networks: If topology wizard is skipped, skip router wizard too
If the user chooses to skip the network topology wizard, then there is no need
to show the router configuration wizard step. Skip it.

We may want to skip other wizard step too. However, those can be dealt later.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-06 14:20:03 -08:00
Sunil Mohan Adapa
ba6f461ece
networks: Don't show router wizard if not behind a router
If during the first wizard, the user selects that they are not behind a router,
then don't show the router configuration wizard.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-06 14:20:00 -08:00
Sunil Mohan Adapa
8a93b5191f
networks: Show router wizard before Internet connection type wizard
After user selects that they are behind the router, we need to show the router
configuration wizard step. Only after this should be show the Internet
connection type step.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-06 14:19:57 -08:00
Nektarios Katakis
06664e1489
networks: Update main networks page Internet connectivity section
Closes: #1555

Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use the term 'network topology' consistently]
[sunil: s/Router/router in template]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-06 14:19:53 -08:00
Nektarios Katakis
2a00b186ea
networks: Save networks topology type to DB
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use the term 'network topology' consistently]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-06 14:19:50 -08:00
Nektarios Katakis
5fd3e95bdf
networks: First boot step for network topology wizard
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use the term 'network topology' consistently]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-06 14:19:47 -08:00
Nektarios Katakis
4dd1035cf3
networks: First boot view for network topology wizard
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use the term 'network topology' consistently]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-06 14:19:44 -08:00
Nektarios Katakis
e0e0a5dd60
networks: Add page for network topology form
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use the term 'network topology' consistently]
[sunil: Properly title case the <h1> title]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-06 14:19:41 -08:00
Nektarios Katakis
3b8308b0cf
networks: Add form for network topology
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use the term 'network topology' consistently]
[sunil: Minor grammer fix, and spacing for i18n]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-06 14:19:34 -08:00
Sunil Mohan Adapa
a2710f1ede
networks: Rename polkit JS authority rules file
Add a comment explaining when .pkla file is used and when the .rules file is
used.

Tests performed:

- Install policykit-1 version 0.105. Something like apt install
policykit-1=0.105-26 libpolkit-agent-1-0=0.105-26 libpolkit-gobject-1-0=0.105-26

  - View list of network connections.

  - Add a network connection.

  - View a network connection's details page.

  - Delete a network connection.

- Add Debian experimental to /etc/apt/sources.list. apt update. Then install
policykit-1 version 0.116. apt install -t experimental policykit-1.

  - Repeat all above tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 15:46:48 +02:00
Sunil Mohan Adapa
cfc3b1924f
networks: Rename views modules as 'views'
Tests performed:

- Visit networks main view to list network connections.

- Add an Ethernet connection, view it and delete it.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 13:08:18 +02:00
Sunil Mohan Adapa
b5f6821fd7
networks: Fixes for networks wizards
- Make first wizard steps for router configuration and Internet connection type
private. Since they run after the admin user page, the steps can run for logged
in users.

- Add option to the Internet connection type wizard, to let the user say that
they don't know the type. This allows them to have a stress-free first setup
experience. The option can act as if they have don't have public IP address at
all. This is an extension of the proposed user experience.

- Implement class based views for simplicity.

- Update various IDs for consistency (even though other IDs in the networks
module don't conform).

- Iron out inconsistent terminology. Setup vs Configuration, Help vs. Wizard,
etc.

Tests performed:

- Run first boot wizard from the beginning. Notice that both the wizard steps
appear properly after the user login step (without permission denied problems).
When not logged in, accessing the wizard steps with URL should redirect to login
page.

- During first boot wizard, select 'Skip this step' in both the steps after
selecting non-default options. Values set should be default options as confirmed
from networks page.

- During first boot wizard, select non-default values, the values should be set
properly as confirmed from networks page.

- From the networks page select each value of the wizard. The option should get
saved properly.

- In case of Internet connection type, when the wizard values changes, the
networks page should reflect the value properly. This should also show properly
after skipping the step during first boot.

- During first boot, the default value for Internet connection type should be 'I
don't know' and router configuration should be 'Not configured'.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
2020-02-27 20:07:59 +00:00
Sunil Mohan Adapa
3e8ce0c6bd
networks: Minor changes to router/internet configuration forms
- Cosmetic styling fixes. Having doc string as suggested by Python doc string
guidelines.

- 'connected to the Internet' seems much more popular phrase than 'connected on
the Internet' judging by web search results.

- Stylize as 'Internet' for consistency although 'internet' is correct too.

- Add space at the end of main radio button option text as translators seems to
understand it incorrectly. See current Spanish translation.

- Recommend 'DMZ' for router configuration.

- Remove incorrect title casing port forwarding text.

- Internationalize some strings.

- Update the default value for router configuration to 'not_configured'.

- Update the default value for Internet connection type to None so that nothing
is selected by default. We could consider introducing a fourth option
'not_configured'.

- Update the ID of first boot wizard step for Internet connectivity.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:44 -05:00
Sunil Mohan Adapa
1ba55e793f
networks: Fix i18n for wizard forms
- Using Markup on format_lazy objects seems to convert negate their lazy
behavior.

- Extend the format_lazy() utility method to handle markup.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:41 -05:00
Nektarios Katakis
9fda18b859
networks: Show internet connectivity string in main page
Closes: #1558

Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:38 -05:00
Nektarios Katakis
5e6d6d1cd1
networks: Refactor connections list template
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use SPDX license identifier]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:34 -05:00
Nektarios Katakis
a8cd9c0b4a
networks: Save to kvstore internet connectivity type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:31 -05:00
Nektarios Katakis
a95e59460e
networks: Add first boot step for internet connection type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:28 -05:00
Nektarios Katakis
eb016bc686
networks: All first step wizard form for internet connection type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use SPDX license identifier]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:24 -05:00
Nektarios Katakis
4ad2d7b2cf
networks: Link internet connection help page with networks page.
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:21 -05:00
Nektarios Katakis
bcd4c52851
networks: Add network view and url for internet connection help page
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use SPDX license identifier]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:18 -05:00
Nektarios Katakis
8134371bbb
networks: Add form for internet connection type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:15 -05:00
Sunil Mohan Adapa
a2f897e33d
*.js: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:40:43 +02:00
Sunil Mohan Adapa
365c29ba1a
*: Update remaining misc files to use SPDX license identifier
None of the files are installed into /etc/. They will unconditionally override
older versions of themselves. They are not likely to cause any configuration
file prompts.

Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:40:32 +02:00
Sunil Mohan Adapa
e89e2b4a2a
*.html: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:39:19 +02:00