-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from zediious/gameservers-charts
Gameservers charts
- Loading branch information
Showing
12 changed files
with
200 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from django import forms | ||
|
||
from raptorWeb.gameservers.models import Server | ||
|
||
class StatisticFilterForm(forms.Form): | ||
start = forms.DateTimeField( | ||
required=False, | ||
widget=forms.DateTimeInput(attrs={'type': 'datetime-local'})) | ||
|
||
end = forms.DateTimeField( | ||
required=False, | ||
widget=forms.DateTimeInput(attrs={'type': 'datetime-local'})) | ||
|
||
server = forms.ModelChoiceField( | ||
queryset=Server.objects.filter(archived=False), | ||
empty_label="Choose a Server") | ||
|
||
class StatisticFilterFormFireFox(forms.Form): | ||
""" | ||
Firefox does not support the datetime-local HTML5 widget | ||
and as such needs to be supplied with only a date widget. | ||
""" | ||
start = forms.DateTimeField( | ||
required=False, | ||
widget=forms.DateTimeInput(attrs={'type': 'date'})) | ||
|
||
end = forms.DateTimeField( | ||
required=False, | ||
widget=forms.DateTimeInput(attrs={'type': 'date'})) | ||
|
||
server = forms.ModelChoiceField( | ||
queryset=Server.objects.filter(archived=False), | ||
to_field_name='modpack_name', | ||
empty_label="Choose a Server") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
<div class="d-flex justify-content-center"> | ||
<div id="gameservers_chart_rendered"> | ||
{{ chart|safe }} | ||
</div> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
raptorWeb/templates/gameservers/player_statistics_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% load django_bootstrap5 %} | ||
|
||
<form class="form p-3" | ||
hx-get="{% url 'gameservers:player_statistics_chart'%}" | ||
hx-target='#fetched_chart' | ||
hx-swap='innerHTML' | ||
> | ||
|
||
{% csrf_token %} | ||
{{ form.captcha }} | ||
{% bootstrap_form stat_filter_form %} | ||
{% bootstrap_button button_type="submit" content="Filter" %} | ||
|
||
</form> | ||
|
||
<div id="fetched_chart"> | ||
</div> |
6 changes: 6 additions & 0 deletions
6
raptorWeb/templates/raptormc/panel/gameservers_statistics.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div id="filter_form" | ||
hx-get="{% url 'gameservers:statistic_filter'%}" | ||
hx-trigger='load' | ||
hx-target='#filter_form' | ||
hx-swap='innerHTML'> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% load static %} | ||
|
||
<aside class="main-sidebar elevation-4 {{ jazzmin_ui.sidebar_classes }}" id="jazzy-sidebar"> | ||
<a href="{% url 'admin:index' %}" class="brand-link {{ jazzmin_ui.brand_classes }}" id="jazzy-logo"> | ||
<img src="{% static jazzmin_settings.site_logo %}" alt="{{ jazzmin_settings.site_header }} Logo" class="{{ jazzmin_settings.site_logo_classes }} brand-image elevation-3" style="opacity: .8"> | ||
<span class="brand-text font-weight-light">{{ jazzmin_settings.site_brand }}</span> | ||
</a> | ||
|
||
<div class="sidebar"> | ||
<div class="user-panel mt-3 pb-3 mb-3 d-flex"> | ||
</div> | ||
|
||
<nav class="mt-2"> | ||
<ul class="nav nav-pills nav-sidebar flex-column {{ jazzmin_ui.sidebar_list_classes }}" data-widget="treeview" role="menu" data-collapsible="false"> | ||
|
||
<li class="nav-item"> | ||
<a href="{% url 'admin:index' %}" class="nav-link"> | ||
<i class="nav-icon fas fa-th-large"></i> | ||
<p>Dashboard</p> | ||
</a> | ||
</li> | ||
|
||
</ul> | ||
</nav> | ||
</div> | ||
</aside> |