Skip to content

Commit 9f8aa35

Browse files
authored
Merge pull request #538 from Terralego/new_debug_panel
New debug panel
2 parents ae69101 + a4cd376 commit 9f8aa35

File tree

14 files changed

+86
-18
lines changed

14 files changed

+86
-18
lines changed

conf/nginx.dev.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ server {
1414

1515
client_max_body_size 200M;
1616

17-
location ~ ^/(api|config|static_dj|media|base-layers|env.json) {
17+
location ~ ^/(api|config|static_dj|media|base-layers|debug|__debug__|env.json) {
1818
proxy_pass http://django;
1919
proxy_set_header X-Real-IP $remote_addr;
2020
proxy_set_header X-Forwarded-Proto $scheme;

docs/source/others/changelog.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
Changelog
33
==========
44

5+
2024.02.3 (2024-02-02)
6+
---------------------------
7+
8+
**Breaking changes**
9+
10+
- To access new debug panel, you should add 'debug' exception in nginx configuration file.
11+
12+
**Improvements:**
13+
14+
- Split Config dashboard debug entries in another /debug/ panel.
15+
16+
517
2024.02.2 (2024-02-01)
618
---------------------------
719

install/conf/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ server {
4646
gzip_min_length 256;
4747
gzip_comp_level 4;
4848
client_max_body_size 100M;
49-
location ~ ^/(api|config|base-layers|env.json) {
49+
location ~ ^/(api|config|debug|base-layers|env.json) {
5050
proxy_pass http://django;
5151
proxy_set_header X-Real-IP $remote_addr;
5252
proxy_set_header X-Forwarded-Proto $scheme;

project/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024.02.2
1+
2024.02.3

project/accounts/admin.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
from django.utils.translation import gettext_lazy as _
44

55
from project.accounts.models import FunctionalPermission, PermanentAccessToken, User
6+
from project.admin import config_site
7+
8+
admin.site.index_title = f'{config.INSTANCE_TITLE}: {_("Debug panel")}'
9+
admin.site.site_header = f'{config.INSTANCE_TITLE}: {_("Debug panel")}'
10+
admin.site.index_title = _(f"Welcome to {config.INSTANCE_TITLE} debug interface.")
611

7-
admin.site.site_header = f"{config.INSTANCE_TITLE}"
8-
admin.site.index_title = _("Configuration panel / Debug")
912
admin.site.register(User)
1013

1114

@@ -25,9 +28,11 @@ def has_change_permission(self, request, obj=None):
2528
return False
2629

2730

28-
@admin.register(PermanentAccessToken)
2931
class PermanentAccessTokenAdmin(admin.ModelAdmin):
3032
list_display = ("id", "user", "created_at", "updated_at")
3133
list_filter = ("user", "created_at", "updated_at")
3234
search_fields = ("user__email", "token")
3335
readonly_fields = ("token",)
36+
37+
38+
config_site.register(PermanentAccessToken, PermanentAccessTokenAdmin)

project/admin.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from constance import config
2+
from django.contrib.admin import AdminSite
3+
from django.utils.translation import gettext as _
4+
5+
6+
class ConfigSite(AdminSite):
7+
site_header = _(f"{config.INSTANCE_TITLE}: {_('Configuration')}")
8+
site_title = _(f"{config.INSTANCE_TITLE}: {_('Configuration')}")
9+
index_title = _(f"Welcome to {config.INSTANCE_TITLE} configuration interface.")
10+
11+
12+
config_site = ConfigSite(name="config_site")

project/fixtures/initial.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@
154154
"fields": {
155155
"name": "Default",
156156
"active": true,
157-
"title": "Configuration TerraVisu",
157+
"title": "",
158158
"title_color": "#DDDDDD",
159159
"title_visible": true,
160160
"logo": "",
161161
"logo_color": "#CCCCCC",
162162
"logo_max_width": 400,
163163
"logo_max_height": 100,
164-
"logo_visible": true,
164+
"logo_visible": false,
165165
"favicon": "",
166166
"env_name": "",
167167
"env_color": "#E74C3C",

project/locales/en/LC_MESSAGES/django.po

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2024-02-01 15:13+0000\n"
11+
"POT-Creation-Date: 2024-02-02 09:32+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -18,7 +18,8 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
2020

21-
msgid "Configuration panel / Debug"
21+
#, python-brace-format
22+
msgid "Welcome to {config.INSTANCE_TITLE} debug interface."
2223
msgstr ""
2324

2425
msgid "Accounts"
@@ -92,6 +93,13 @@ msgstr ""
9293
msgid "OIDC connect"
9394
msgstr ""
9495

96+
msgid "{config.INSTANCE_TITLE}: {_('Configuration')}"
97+
msgstr ""
98+
99+
#, python-brace-format
100+
msgid "Welcome to {config.INSTANCE_TITLE} configuration interface."
101+
msgstr ""
102+
95103
msgid "Instance customization"
96104
msgstr ""
97105

project/locales/fr/LC_MESSAGES/django.po

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2024-02-01 15:13+0000\n"
11+
"POT-Creation-Date: 2024-02-02 09:32+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -18,11 +18,12 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
2020

21-
msgid "Configuration panel / Debug"
22-
msgstr "Panneau de configuration / Debug"
21+
#, python-brace-format
22+
msgid "Welcome to {config.INSTANCE_TITLE} debug interface."
23+
msgstr "Bienvenue sur l'interface de debug de {config.INSTANCE_TITLE}."
2324

2425
msgid "Accounts"
25-
msgstr ""
26+
msgstr "Comptes"
2627

2728
msgid "Is able to create, delete, update users"
2829
msgstr "Peut créer, supprimer, mettre à jour des utilisateurs"
@@ -94,6 +95,13 @@ msgstr "Mot de passe oublié ?"
9495
msgid "OIDC connect"
9596
msgstr "Connexion via OIDC"
9697

98+
msgid "{config.INSTANCE_TITLE}: {_('Configuration')}"
99+
msgstr "{config.INSTANCE_TITLE} : {_('Configuration')}"
100+
101+
#, python-brace-format
102+
msgid "Welcome to {config.INSTANCE_TITLE} configuration interface."
103+
msgstr "Bienvenue sur l'interface de configuration de {config.INSTANCE_TITLE}."
104+
97105
msgid "Instance customization"
98106
msgstr "Personnalisation de l'instance"
99107

project/settings/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
{
9494
"BACKEND": "django.template.backends.django.DjangoTemplates",
9595
"DIRS": [
96+
PROJECT_DIR / "project" / "templates",
9697
PROJECT_DIR / "var" / "conf" / "templates",
9798
],
9899
"APP_DIRS": True,

0 commit comments

Comments
 (0)