From 14eeee3fbc0a839d918149765d2134d05cd14601 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 18 Oct 2022 17:18:32 +0200 Subject: [proxy] upon Haketilo launch automatically open Haketilo landing page in user's default web browser * The landing page instructs user to configure browser's proxy settings. * It is now possible to choose the IP address to listen on via command line parameter. * The browser launching behavior can be switched off via command line parameter. --- .../proxy/web_ui/templates/base.html.jinja | 97 ++--------------- .../web_ui/templates/hkt_mitm_it_base.html.jinja | 116 +++++++++++++++++++++ .../proxy/web_ui/templates/import.html.jinja | 2 +- .../proxy/web_ui/templates/index.html.jinja | 2 +- .../web_ui/templates/items/item_view.html.jinja | 2 +- .../web_ui/templates/items/libraries.html.jinja | 2 +- .../web_ui/templates/items/packages.html.jinja | 2 +- .../proxy/web_ui/templates/landing.html.jinja | 49 +++++++++ .../prompts/auto_install_error.html.jinja | 2 +- .../prompts/package_suggestion.html.jinja | 2 +- .../proxy/web_ui/templates/repos/add.html.jinja | 2 +- .../proxy/web_ui/templates/repos/index.html.jinja | 2 +- .../web_ui/templates/repos/show_single.html.jinja | 2 +- .../proxy/web_ui/templates/rules/add.html.jinja | 2 +- .../proxy/web_ui/templates/rules/index.html.jinja | 2 +- .../web_ui/templates/rules/show_single.html.jinja | 2 +- 16 files changed, 184 insertions(+), 104 deletions(-) create mode 100644 src/hydrilla/proxy/web_ui/templates/hkt_mitm_it_base.html.jinja create mode 100644 src/hydrilla/proxy/web_ui/templates/landing.html.jinja (limited to 'src/hydrilla/proxy/web_ui/templates') diff --git a/src/hydrilla/proxy/web_ui/templates/base.html.jinja b/src/hydrilla/proxy/web_ui/templates/base.html.jinja index e4760bf..f89b39a 100644 --- a/src/hydrilla/proxy/web_ui/templates/base.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/base.html.jinja @@ -17,11 +17,9 @@ You can choose to use either of these licenses or both. I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. --#} +#} -{% set settings = get_settings() %} - {% macro button_row(buttons_data, common_fields={}) %}
{% for classes, text, extra_fields in buttons_data %} @@ -223,96 +221,13 @@ code in a proprietary work, I am not going to enforce this in court. .hide { display: none !important; } - - ul#nav { - -moz-user-select: none; - user-select: none; - display: flex; - justify-content: stretch; - white-space: nowrap; - background-color: #e0e0e0; - margin: 0; - padding: 0; - border-bottom: 2px solid #444; - overflow-x: scroll; - } - - li.nav-entry, li.nav-separator { - list-style-type: none; - } - - li.nav-entry { - background-color: #70af70; - font-size: 115%; - cursor: pointer; - text-align: center; - flex: 1 1 0; - } - - li.nav-separator { - flex: 0 0 2px; - background-color: inherit; - } - - li.big-separator { - flex: 4 0 2px; - } - - li.nav-entry:hover { - box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19); - } - - ul#nav > li.nav-active { - background-color: #65A065; - color: #222; - box-shadow: none; - cursor: default; - } - - ul#nav > li > :only-child { - display: block; - padding: 10px; - } - {% endblock %} + {% endblock style %} - {% endblock %} + {% endblock head %} - {% set active_endpoint = get_current_endpoint() %} - {% - set navigation_bar = [ - ('home', _('web_ui.base.nav.home'), false), - ('rules.rules', _('web_ui.base.nav.rules'), false), - ('items.packages', _('web_ui.base.nav.packages'), false), - ('items.libraries', _('web_ui.base.nav.libraries'), true), - ('repos.repos', _('web_ui.base.nav.repos'), false), - ('import.items_import', _('web_ui.base.nav.import'), false) - ] - %} - -
{% block main required %}{% endblock %}
+ {% block body %} +
{% block main required %}{% endblock %}
+ {% endblock body %} diff --git a/src/hydrilla/proxy/web_ui/templates/hkt_mitm_it_base.html.jinja b/src/hydrilla/proxy/web_ui/templates/hkt_mitm_it_base.html.jinja new file mode 100644 index 0000000..6a6de99 --- /dev/null +++ b/src/hydrilla/proxy/web_ui/templates/hkt_mitm_it_base.html.jinja @@ -0,0 +1,116 @@ +{# +SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0 + +Proxy web UI base page template of htk.mitm.it meta-site. + +This file is part of Hydrilla&Haketilo. + +Copyright (C) 2022 Wojtek Kosior + +Dual licensed under +* GNU General Public License v3.0 or later and +* Creative Commons Attribution Share Alike 4.0 International. + +You can choose to use either of these licenses or both. + + +I, Wojtek Kosior, thereby promise not to sue for violation of this +file's licenses. Although I request that you do not make use of this +code in a proprietary work, I am not going to enforce this in court. +#} +{% extends "base.html.jinja" %} + +{% set settings = get_settings() %} + +{% block style %} + {{ super() }} + ul#nav { + -moz-user-select: none; + user-select: none; + display: flex; + justify-content: stretch; + white-space: nowrap; + background-color: #e0e0e0; + margin: 0; + padding: 0; + border-bottom: 2px solid #444; + overflow-x: scroll; + } + + li.nav-entry, li.nav-separator { + list-style-type: none; + } + + li.nav-entry { + background-color: #70af70; + font-size: 115%; + cursor: pointer; + text-align: center; + flex: 1 1 0; + } + + li.nav-separator { + flex: 0 0 2px; + background-color: inherit; + } + + li.big-separator { + flex: 4 0 2px; + } + + li.nav-entry:hover { + box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19); + } + + ul#nav > li.nav-active { + background-color: #65A065; + color: #222; + box-shadow: none; + cursor: default; + } + + ul#nav > li > :only-child { + display: block; + padding: 10px; + } +{% endblock style %} + +{% block body %} + {% set active_endpoint = get_current_endpoint() %} + {% + set navigation_bar = [ + ('home.home', _('web_ui.base.nav.home'), false), + ('rules.rules', _('web_ui.base.nav.rules'), false), + ('items.packages', _('web_ui.base.nav.packages'), false), + ('items.libraries', _('web_ui.base.nav.libraries'), true), + ('repos.repos', _('web_ui.base.nav.repos'), false), + ('import.items_import', _('web_ui.base.nav.import'), false) + ] + %} + + + {{ super() }} +{% endblock body %} diff --git a/src/hydrilla/proxy/web_ui/templates/import.html.jinja b/src/hydrilla/proxy/web_ui/templates/import.html.jinja index 7636b77..6ec9947 100644 --- a/src/hydrilla/proxy/web_ui/templates/import.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/import.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %} {{ _('web_ui.import.title') }} {% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/index.html.jinja b/src/hydrilla/proxy/web_ui/templates/index.html.jinja index e42f5e9..010c2ed 100644 --- a/src/hydrilla/proxy/web_ui/templates/index.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/index.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %} {{ _('web_ui.home.title') }} {% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja index e517f3b..ccfa6b9 100644 --- a/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% macro version_with_repo(info) -%} {{ info.info.version_string }} diff --git a/src/hydrilla/proxy/web_ui/templates/items/libraries.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/libraries.html.jinja index 0a72b64..0996b8b 100644 --- a/src/hydrilla/proxy/web_ui/templates/items/libraries.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/items/libraries.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %} {{ _('web_ui.libraries.title') }} {% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/items/packages.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/packages.html.jinja index bc6b5bb..b79d594 100644 --- a/src/hydrilla/proxy/web_ui/templates/items/packages.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/items/packages.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %} {{ _('web_ui.packages.title') }} {% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/landing.html.jinja b/src/hydrilla/proxy/web_ui/templates/landing.html.jinja new file mode 100644 index 0000000..6314cfd --- /dev/null +++ b/src/hydrilla/proxy/web_ui/templates/landing.html.jinja @@ -0,0 +1,49 @@ +{# +SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0 + +Proxy web UI landing page. + +This file is part of Hydrilla&Haketilo. + +Copyright (C) 2022 Wojtek Kosior + +Dual licensed under +* GNU General Public License v3.0 or later and +* Creative Commons Attribution Share Alike 4.0 International. + +You can choose to use either of these licenses or both. + + +I, Wojtek Kosior, thereby promise not to sue for violation of this +file's licenses. Although I request that you do not make use of this +code in a proprietary work, I am not going to enforce this in court. +#} +{% extends "base.html.jinja" %} + +{% block title %} {{ _('web_ui.landing.title') }} {% endblock %} + +{% block main %} +

+ {{ _('web_ui.landing.heading.haketilo_is_running') }} +

+ +

+ {{ _('web_ui.landing.web_ui.landing.what_to_do_1') }} +

+ + {{ label(_('web_ui.landing.host_label')) }} + +

+ {{ listen_host }} +

+ + {{ label(_('web_ui.landing.port_label')) }} + +

+ {{ listen_port }} +

+ + +{% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/prompts/auto_install_error.html.jinja b/src/hydrilla/proxy/web_ui/templates/prompts/auto_install_error.html.jinja index f4f600c..a17e61d 100644 --- a/src/hydrilla/proxy/web_ui/templates/prompts/auto_install_error.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/prompts/auto_install_error.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %} {{ _('web_ui.prompts.auto_install_error.title') }} diff --git a/src/hydrilla/proxy/web_ui/templates/prompts/package_suggestion.html.jinja b/src/hydrilla/proxy/web_ui/templates/prompts/package_suggestion.html.jinja index ba06ae9..2df38b3 100644 --- a/src/hydrilla/proxy/web_ui/templates/prompts/package_suggestion.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/prompts/package_suggestion.html.jinja @@ -19,7 +19,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %} {{ _('web_ui.prompts.package_suggestion.title') }} diff --git a/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja b/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja index f635444..106af53 100644 --- a/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %} {{ _('web_ui.repos.add.title') }} {% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/repos/index.html.jinja b/src/hydrilla/proxy/web_ui/templates/repos/index.html.jinja index e670b59..4f09ae6 100644 --- a/src/hydrilla/proxy/web_ui/templates/repos/index.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/repos/index.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %}{{ _('web_ui.repos.title') }}{% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja b/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja index 04075c4..c4b7a9a 100644 --- a/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %} {{ _('web_ui.repos.single.title') }} {% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/rules/add.html.jinja b/src/hydrilla/proxy/web_ui/templates/rules/add.html.jinja index 430c5ca..6d21ccd 100644 --- a/src/hydrilla/proxy/web_ui/templates/rules/add.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/rules/add.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %} {{ _('web_ui.rules.add.title') }} {% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/rules/index.html.jinja b/src/hydrilla/proxy/web_ui/templates/rules/index.html.jinja index 799eaba..57cc8ad 100644 --- a/src/hydrilla/proxy/web_ui/templates/rules/index.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/rules/index.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %}{{ _('web_ui.rules.title') }}{% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/rules/show_single.html.jinja b/src/hydrilla/proxy/web_ui/templates/rules/show_single.html.jinja index 9bf2c75..95e8009 100644 --- a/src/hydrilla/proxy/web_ui/templates/rules/show_single.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/rules/show_single.html.jinja @@ -18,7 +18,7 @@ I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use of this code in a proprietary work, I am not going to enforce this in court. #} -{% extends "base.html.jinja" %} +{% extends "hkt_mitm_it_base.html.jinja" %} {% block title %} {{ _('web_ui.rules.single.title') }} {% endblock %} -- cgit v1.2.3