Skip to content

Commit 7310394

Browse files
authored
Merge pull request #267 from N5GEH/242-dashboard-visualization-grafana-url
chore(projects): dashboard navigation and model change
2 parents ca1b031 + 897d814 commit 7310394

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ repos:
2424
"--force-scope",
2525
"--verbose",
2626
"--scopes",
27-
"entirety,entities,users,subscriptions,smartdatamodels,devices,semantics"
27+
"entirety,entities,users,subscriptions,smartdatamodels,devices,semantic,projects"
2828
]

app/Entirety/projects/forms.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def __init__(self, user, *args, **kwargs):
3131

3232
self.fields["logo"].required = False
3333
self.fields["webpage_url"].required = False
34+
self.fields["dashboard_url"].required = False
3435

3536
self.fields["viewers"] = forms.ModelMultipleChoiceField(
3637
queryset=(
@@ -124,6 +125,7 @@ class Meta:
124125
"description",
125126
"fiware_service",
126127
"webpage_url",
128+
"dashboard_url",
127129
"logo",
128130
"owner",
129131
]
@@ -163,4 +165,11 @@ class Meta:
163165
"title": "Project logo",
164166
}
165167
),
168+
"dashboard_url": forms.URLInput(
169+
attrs={
170+
"data-bs-toggle": "tooltip",
171+
"data-bs-placement": "left",
172+
"title": "Project dashboard url",
173+
}
174+
),
166175
}

app/Entirety/projects/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Project(models.Model):
1515
fiware_service = models.CharField(max_length=64, null=True)
1616
fiware_service_path = models.CharField(max_length=1, default="/", null=True)
1717
webpage_url = models.URLField(max_length=200, null=True)
18+
dashboard_url = models.URLField(max_length=200, null=True)
1819
logo = ResizedImageField(
1920
size=[160, 150], crop=["middle", "center"], upload_to="images/", null=True
2021
)

app/Entirety/projects/templates/projects/detail.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,10 @@
3131
<strong>Webpage Url:</strong> {{ project.webpage_url }}
3232
</div>
3333
</div>
34+
<div class="row">
35+
<div class="col mb-3">
36+
<strong>Dashboard Url:</strong> {{ project.dashboard_url }}
37+
</div>
38+
</div>
3439
</div>
3540
{% endblock %}

app/Entirety/templates/sidebar.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@
6666
</a>
6767
</li>
6868
{% endif %}
69+
{% if project.dashboard_url %}
70+
<li class="nav-item border-bottom d-inline-flex">
71+
<a href="{{ project.dashboard_url }}" class="nav-link btn-sidebar py-md-2"
72+
data-bs-toggle="tooltip" data-bs-placement="right" data-bs-custom-class="d-md-none"
73+
title="Dashboard" target="_blank" rel="noopener noreferrer">
74+
<i class="bi bi-diagram-3"></i>
75+
<span class="d-none d-md-inline-flex">Dashboard</span>
76+
</a>
77+
</li>
78+
{% endif %}
6979
{% endif %}
7080
{% endif %}
7181

0 commit comments

Comments
 (0)