mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-29 14:12:28 +02:00
Compare commits
21 Commits
42ee06470c
...
4210b2eabc
Author | SHA1 | Date | |
---|---|---|---|
|
4210b2eabc | ||
|
225e68647e | ||
|
7e2f864ebf | ||
|
f2384ba45b | ||
|
c5918b9b3c | ||
|
ffedc4103d | ||
|
0467b23a1a | ||
|
cda5ce739f | ||
|
e5c8426ea3 | ||
|
b2bd489ddc | ||
|
6397cf358a | ||
|
90fcc4a811 | ||
|
ec7472fe22 | ||
|
5148b1914d | ||
|
2e0716f5ae | ||
|
1fb091acb2 | ||
|
07c62ed32a | ||
|
660fe79d08 | ||
|
1dea92ed76 | ||
|
3f54d49d8b | ||
|
77da6928b2 |
@ -5,7 +5,7 @@
|
||||
[](https://pypi.org/project/allianceauth/)
|
||||
[](https://pypi.org/project/allianceauth/)
|
||||
[](https://gitlab.com/allianceauth/allianceauth/commits/master)
|
||||
[](http://allianceauth.readthedocs.io/?badge=latest)
|
||||
[](https://allianceauth.readthedocs.io/?badge=latest)
|
||||
[](https://gitlab.com/allianceauth/allianceauth/commits/master)
|
||||
[](https://discord.gg/fjnHAmk)
|
||||
|
||||
@ -14,7 +14,7 @@ An auth system for EVE Online to help in-game organizations manage online servic
|
||||
## Content
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Documentation](http://allianceauth.rtfd.io)
|
||||
- [Documentation](https://allianceauth.rtfd.io)
|
||||
- [Support](#support)
|
||||
- [Release Notes](https://gitlab.com/allianceauth/allianceauth/-/releases)
|
||||
- [Developer Team](#development-team)
|
||||
@ -38,7 +38,7 @@ Main features:
|
||||
|
||||
- English :flag_gb:, Chinese :flag_cn:, German :flag_de:, Spanish :flag_es:, Korean :flag_kr:, Russian :flag_ru:, Italian :flag_it:, French :flag_fr:, Japanese :flag_jp: and Ukrainian :flag_ua: Localization
|
||||
|
||||
For further details about AA - including an installation guide and a full list of included services and plugin apps - please see the [official documentation](http://allianceauth.rtfd.io).
|
||||
For further details about AA - including an installation guide and a full list of included services and plugin apps - please see the [official documentation](https://allianceauth.rtfd.io).
|
||||
|
||||
## Screenshot
|
||||
|
||||
|
@ -5,7 +5,7 @@ manage online service access.
|
||||
# This will make sure the app is always imported when
|
||||
# Django starts so that shared_task will use this app.
|
||||
|
||||
__version__ = '4.3.1'
|
||||
__version__ = '4.4.0'
|
||||
__title__ = 'Alliance Auth'
|
||||
__url__ = 'https://gitlab.com/allianceauth/allianceauth'
|
||||
NAME = f'{__title__} v{__version__}'
|
||||
|
@ -10,7 +10,7 @@ from . import (
|
||||
)
|
||||
|
||||
|
||||
_BASE_URL = 'http://evemaps.dotlan.net'
|
||||
_BASE_URL = 'https://evemaps.dotlan.net'
|
||||
|
||||
|
||||
def _build_url(category: str, name: str) -> str:
|
||||
|
@ -31,29 +31,29 @@ class TestDotlan(TestCase):
|
||||
def test_alliance_url(self):
|
||||
self.assertEqual(
|
||||
dotlan.alliance_url('Wayne Enterprices'),
|
||||
'http://evemaps.dotlan.net/alliance/Wayne_Enterprices'
|
||||
'https://evemaps.dotlan.net/alliance/Wayne_Enterprices'
|
||||
)
|
||||
|
||||
def test_corporation_url(self):
|
||||
self.assertEqual(
|
||||
dotlan.corporation_url('Wayne Technology'),
|
||||
'http://evemaps.dotlan.net/corp/Wayne_Technology'
|
||||
'https://evemaps.dotlan.net/corp/Wayne_Technology'
|
||||
)
|
||||
self.assertEqual(
|
||||
dotlan.corporation_url('Crédit Agricole'),
|
||||
'http://evemaps.dotlan.net/corp/Cr%C3%A9dit_Agricole'
|
||||
'https://evemaps.dotlan.net/corp/Cr%C3%A9dit_Agricole'
|
||||
)
|
||||
|
||||
def test_region_url(self):
|
||||
self.assertEqual(
|
||||
dotlan.region_url('Black Rise'),
|
||||
'http://evemaps.dotlan.net/map/Black_Rise'
|
||||
'https://evemaps.dotlan.net/map/Black_Rise'
|
||||
)
|
||||
|
||||
def test_solar_system_url(self):
|
||||
self.assertEqual(
|
||||
dotlan.solar_system_url('Jita'),
|
||||
'http://evemaps.dotlan.net/system/Jita'
|
||||
'https://evemaps.dotlan.net/system/Jita'
|
||||
)
|
||||
|
||||
|
||||
|
@ -49,7 +49,7 @@ class GroupsMenuItem(MenuItemHook):
|
||||
MenuItemHook.__init__(
|
||||
self,
|
||||
text=_("Groups"),
|
||||
classes="fa-solid fa-user",
|
||||
classes="fa-solid fa-users",
|
||||
url_name="groupmanagement:groups",
|
||||
order=25,
|
||||
navactive=[
|
||||
|
Binary file not shown.
@ -68,7 +68,7 @@ msgstr "Englisch"
|
||||
|
||||
#: allianceauth/authentication/models.py:72
|
||||
msgid "Czech"
|
||||
msgstr ""
|
||||
msgstr "Tschechisch"
|
||||
|
||||
#: allianceauth/authentication/models.py:73
|
||||
#: allianceauth/project_template/project_name/settings/base.py:101
|
||||
@ -108,7 +108,7 @@ msgstr "Russisch"
|
||||
#: allianceauth/authentication/models.py:80
|
||||
#: allianceauth/project_template/project_name/settings/base.py:107
|
||||
msgid "Dutch"
|
||||
msgstr ""
|
||||
msgstr "Niederländisch"
|
||||
|
||||
#: allianceauth/authentication/models.py:81
|
||||
#: allianceauth/project_template/project_name/settings/base.py:108
|
||||
@ -123,7 +123,7 @@ msgstr "Ukrainisch"
|
||||
#: allianceauth/authentication/models.py:83
|
||||
#: allianceauth/project_template/project_name/settings/base.py:111
|
||||
msgid "Simplified Chinese"
|
||||
msgstr ""
|
||||
msgstr "Vereinfachtes Chinesisch"
|
||||
|
||||
#: allianceauth/authentication/models.py:99
|
||||
#: allianceauth/menu/templates/menu/menu-user.html:42
|
||||
@ -1664,7 +1664,7 @@ msgstr "Anstehende Flotten"
|
||||
#: allianceauth/optimer/templates/optimer/management.html:44
|
||||
#: allianceauth/timerboard/templates/timerboard/view.html:62
|
||||
msgid "No upcoming timers."
|
||||
msgstr "Keine bevorstehenden Timer."
|
||||
msgstr "Keine anstehenden Timer."
|
||||
|
||||
#: allianceauth/optimer/templates/optimer/management.html:52
|
||||
msgid "Past Fleet Operations"
|
||||
@ -2804,12 +2804,12 @@ msgstr "Entankernd"
|
||||
|
||||
#: allianceauth/timerboard/models.py:58
|
||||
msgid "Abandoned"
|
||||
msgstr ""
|
||||
msgstr "Aufgegeben"
|
||||
|
||||
#: allianceauth/timerboard/templates/timerboard/dashboard.timers.html:7
|
||||
#: allianceauth/timerboard/templates/timerboard/view.html:53
|
||||
msgid "Upcoming Timers"
|
||||
msgstr "Bevorstehende Timefr"
|
||||
msgstr "Anstehende Timer"
|
||||
|
||||
#: allianceauth/timerboard/templates/timerboard/dashboard.timers.html:15
|
||||
msgid "Timer"
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-09-13 19:57+1000\n"
|
||||
"POT-Creation-Date: 2024-10-21 12:59+1000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -519,6 +519,7 @@ msgstr ""
|
||||
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkmodify.html:35
|
||||
#: allianceauth/groupmanagement/templates/groupmanagement/groups.html:35
|
||||
#: allianceauth/hrapplications/templates/hrapplications/view.html:41
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:30
|
||||
msgid "User"
|
||||
msgstr ""
|
||||
|
||||
@ -714,7 +715,6 @@ msgstr ""
|
||||
|
||||
#: allianceauth/groupmanagement/auth_hooks.py:51
|
||||
#: allianceauth/permissions_tool/templates/permissions_tool/overview.html:34
|
||||
#: allianceauth/templates/allianceauth/side-menu.html:15
|
||||
msgid "Groups"
|
||||
msgstr ""
|
||||
|
||||
@ -1856,6 +1856,48 @@ msgstr ""
|
||||
msgid "Deactivated IPSuite4 account."
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:6
|
||||
msgid "Mumble"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:10
|
||||
msgid "Mumble History"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:22
|
||||
msgid "Server Connection History"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:31
|
||||
msgid "Displayed Name"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:32
|
||||
msgid "Release"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:33
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:67
|
||||
msgid "Version"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:34
|
||||
msgid "Last Connect"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:35
|
||||
msgid "Last Disconnect"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:47
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:59
|
||||
msgid "Server Connection Breakdown"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:68
|
||||
msgid "Number"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_service_ctrl.html:28
|
||||
#: allianceauth/services/templates/services/service_password.html:26
|
||||
msgid "Set Password"
|
||||
@ -1865,6 +1907,10 @@ msgstr ""
|
||||
msgid "Connect"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_service_ctrl.html:52
|
||||
msgid "Mumble Connection History"
|
||||
msgstr ""
|
||||
|
||||
#: allianceauth/services/modules/openfire/auth_hooks.py:27
|
||||
msgid "Jabber"
|
||||
msgstr ""
|
||||
|
@ -1 +1,21 @@
|
||||
"""
|
||||
Example
|
||||
=======
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from allianceauth.notifications.models import Notification
|
||||
|
||||
|
||||
def notify_user_view(request):
|
||||
'''Simple view sending a notification to the user'''
|
||||
|
||||
Notification.objects.notify_user(
|
||||
user=request.user,
|
||||
title="Some title",
|
||||
message="Some message",
|
||||
level=Notification.Level.INFO,
|
||||
)
|
||||
|
||||
"""
|
||||
from .core import notify # noqa: F401
|
||||
|
@ -15,7 +15,7 @@ class OpForm(forms.Form):
|
||||
operation_name = forms.CharField(max_length=254, required=True, label=_("Operation Name"))
|
||||
type = forms.CharField(required=False, label=_("Operation Type"))
|
||||
fc = forms.CharField(max_length=254, required=True, label=_("Fleet Commander"))
|
||||
duration = forms.CharField(max_length=254, required=True, label=_("Duration"))
|
||||
duration = forms.CharField(max_length=25, required=True, label=_("Duration"))
|
||||
description = forms.CharField(
|
||||
widget=forms.Textarea(attrs={"rows": 10, "cols": 20, "input_type": "textarea"}),
|
||||
required=False,
|
||||
|
@ -0,0 +1,37 @@
|
||||
# Generated by Django 4.2.16 on 2024-10-07 13:39
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("mumble", "0012_mumble_client_info"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="mumbleuser",
|
||||
options={
|
||||
"permissions": (
|
||||
("access_mumble", "Can access the Mumble service"),
|
||||
(
|
||||
"view_connection_history",
|
||||
"Can access the connection history of the Mumble service",
|
||||
),
|
||||
)
|
||||
},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="mumbleuser",
|
||||
name="release",
|
||||
field=models.TextField(
|
||||
blank=True,
|
||||
editable=False,
|
||||
help_text="Client release. For official releases, this equals the version. For snapshots and git compiles, this will be something else.",
|
||||
max_length=254,
|
||||
null=True,
|
||||
verbose_name="Mumble Release",
|
||||
),
|
||||
),
|
||||
]
|
@ -90,7 +90,7 @@ class MumbleUser(AbstractServiceModel):
|
||||
blank=True,
|
||||
null=True,
|
||||
editable=False,
|
||||
help_text="The Mumble Release the user last authenticated with"
|
||||
help_text="Client release. For official releases, this equals the version. For snapshots and git compiles, this will be something else."
|
||||
)
|
||||
version = models.IntegerField(
|
||||
verbose_name="Mumble Version",
|
||||
@ -159,4 +159,5 @@ class MumbleUser(AbstractServiceModel):
|
||||
class Meta:
|
||||
permissions = (
|
||||
("access_mumble", "Can access the Mumble service"),
|
||||
("view_connection_history", "Can access the connection history of the Mumble service"),
|
||||
)
|
||||
|
@ -0,0 +1,205 @@
|
||||
{% extends "allianceauth/base-bs5.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block page_title %}
|
||||
{% translate "Mumble" %}
|
||||
{% endblock page_title %}
|
||||
|
||||
{% block header_nav_brand %}
|
||||
<a class="navbar-brand">{% trans "Mumble History" %} - {{ mumble_url }}</a>
|
||||
{% endblock header_nav_brand %}
|
||||
|
||||
{% block header_nav_collapse_left %}
|
||||
{% endblock header_nav_collapse_left %}
|
||||
|
||||
{% block header_nav_collapse_right %}
|
||||
{% endblock header_nav_collapse_right %}
|
||||
|
||||
{% block content %}
|
||||
<div class="card col-lg-12 mb-3">
|
||||
<div class="card-header">
|
||||
<span class="card-title">{% translate "Server Connection History" %}</span>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table w-100" id="table-mumble-connection-history">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-start">{% translate "User" %}</th>
|
||||
<th class="text-start">{% translate "Displayed Name" %}</th>
|
||||
<th class="text-start">{% translate "Release" %}</th>
|
||||
<th class="text-start">{% translate "Version" %}</th>
|
||||
<th class="text-end">{% translate "Last Connect" %}</th>
|
||||
<th class="text-end">{% translate "Last Disconnect" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="card-title">{% translate "Server Connection Breakdown" %}</span>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<canvas id="pieChart"></canvas> <!-- Canvas element for the pie chart -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="card-title">{% translate "Server Connection Breakdown" %}</span>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table w-100" id="table-mumble-connection-stats">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-start">{% translate "Version" %}</th>
|
||||
<th class="text-end">{% translate "Number" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block extra_javascript %}
|
||||
{% include "bundles/datatables-js-bs5.html" %}
|
||||
{% include "bundles/filterdropdown-js.html" %}
|
||||
{% include "bundles/chart-js.html" %}
|
||||
{% include "bundles/moment-js.html" with locale=True %}
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
const MUMBLESTATS_DATETIME_FORMAT = 'YYYY-MM-DD, HH:mm';
|
||||
|
||||
'use strict';
|
||||
|
||||
$("#table-mumble-connection-history").DataTable({
|
||||
ajax: {
|
||||
url: '{% url "mumble:connection_history_data" %}',
|
||||
dataSrc: 'connection_history_data',
|
||||
},
|
||||
columns: [
|
||||
{ data: 'user' },
|
||||
{ data: 'display_name' },
|
||||
{ data: 'release' },
|
||||
{ data: 'version' },
|
||||
{
|
||||
data: 'last_connect',
|
||||
render: (data) => {
|
||||
return moment(data).utc().format(MUMBLESTATS_DATETIME_FORMAT);
|
||||
},
|
||||
className: 'text-end',
|
||||
},
|
||||
{
|
||||
data: 'last_disconnect',
|
||||
render: (data) => {
|
||||
return moment(data).utc().format(MUMBLESTATS_DATETIME_FORMAT);
|
||||
},
|
||||
className: 'text-end',
|
||||
},
|
||||
],
|
||||
order: [[4, 'desc']],
|
||||
processing: true,
|
||||
stateSave: true,
|
||||
stateDuration: 0,
|
||||
filterDropDown: {
|
||||
columns: [
|
||||
{
|
||||
idx: 2,
|
||||
},
|
||||
{
|
||||
idx: 3,
|
||||
},
|
||||
],
|
||||
bootstrap: true,
|
||||
bootstrap_version: 5,
|
||||
},
|
||||
});
|
||||
|
||||
$("#table-mumble-connection-stats").DataTable({
|
||||
ajax: {
|
||||
url: '{% url "mumble:release_counts_data" %}',
|
||||
dataSrc: 'release_counts_data',
|
||||
},
|
||||
columns: [
|
||||
{ data: 'release' },
|
||||
{ data: 'user_count', className: 'text-end' },
|
||||
],
|
||||
order: [[1, 'desc']],
|
||||
processing: true,
|
||||
stateSave: true,
|
||||
stateDuration: 0,
|
||||
});
|
||||
|
||||
// Initialize empty Pie chart
|
||||
const ctx = document.getElementById('pieChart').getContext('2d');
|
||||
const pieChart = new Chart(ctx, {
|
||||
type: 'pie',
|
||||
data: {
|
||||
labels: [], // Initially empty
|
||||
datasets: [
|
||||
{
|
||||
label: 'Server Connection Breakdown',
|
||||
data: [], // Initially empty
|
||||
backgroundColor: [
|
||||
'rgba(255, 99, 132, 0.2)',
|
||||
'rgba(54, 162, 235, 0.2)',
|
||||
'rgba(255, 206, 86, 0.2)'
|
||||
],
|
||||
borderColor: [
|
||||
'rgba(255, 99, 132, 1)',
|
||||
'rgba(54, 162, 235, 1)',
|
||||
'rgba(255, 206, 86, 1)'
|
||||
],
|
||||
borderWidth: 1
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
plugins: {
|
||||
legend: {
|
||||
position: 'top'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// AJAX call to dynamically update the chart
|
||||
$.ajax({
|
||||
url: '{% url "mumble:release_pie_chart_data" %}', // Your Django view URL that returns chart data
|
||||
method: "GET",
|
||||
success: (data) => {
|
||||
// Replace chart data with the data from the AJAX response
|
||||
pieChart.data.labels = data.labels; // Set the new labels
|
||||
pieChart.data.datasets[0].data = data.values; // Set the new values
|
||||
|
||||
// Update the chart to reflect the new data
|
||||
pieChart.update();
|
||||
},
|
||||
error: (xhr, status, error) => {
|
||||
console.error('Error fetching pie chart data:', status, error);
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock extra_javascript %}
|
||||
|
||||
{% block extra_css %}
|
||||
{% include "bundles/datatables-css-bs5.html" %}
|
||||
{% endblock extra_css %}
|
@ -48,4 +48,9 @@
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if request.user.is_superuser %}
|
||||
<a class="btn btn-primary" type="button" id="btnMumbleConnectionHistory" href="{% url 'mumble:connection_history' %}" title="{% translate 'Mumble Connection History' %}">
|
||||
<i class="fa-solid fa-clock-rotate-left"></i> History
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
@ -10,6 +10,10 @@ module_urls = [
|
||||
path('deactivate/', views.DeleteMumbleView.as_view(), name='deactivate'),
|
||||
path('reset_password/', views.ResetPasswordMumbleView.as_view(), name='reset_password'),
|
||||
path('set_password/', views.SetPasswordMumbleView.as_view(), name='set_password'),
|
||||
path('connection_history/', views.connection_history, name="connection_history"),
|
||||
path('ajax/connection_history_data', views.connection_history_data, name="connection_history_data"),
|
||||
path('ajax/release_counts_data', views.release_counts_data, name="release_counts_data"),
|
||||
path('ajax/release_pie_chart_data', views.release_pie_chart_data, name="release_pie_chart_data"),
|
||||
]
|
||||
|
||||
urlpatterns = [
|
||||
|
@ -3,6 +3,11 @@ import logging
|
||||
from allianceauth.services.forms import ServicePasswordModelForm
|
||||
from allianceauth.services.abstract import BaseCreatePasswordServiceAccountView, BaseDeactivateServiceAccountView, \
|
||||
BaseResetPasswordServiceAccountView, BaseSetPasswordServiceAccountView
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.decorators import login_required, permission_required
|
||||
from django.db.models import Count
|
||||
from django.http import HttpResponse, JsonResponse
|
||||
from django.shortcuts import render
|
||||
|
||||
from .models import MumbleUser
|
||||
|
||||
@ -35,3 +40,51 @@ class ResetPasswordMumbleView(MumbleViewMixin, BaseResetPasswordServiceAccountVi
|
||||
|
||||
class SetPasswordMumbleView(MumbleViewMixin, BaseSetPasswordServiceAccountView):
|
||||
form_class = MumblePasswordForm
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required('mumble.view_connection_history')
|
||||
def connection_history(request) -> HttpResponse:
|
||||
|
||||
context = {
|
||||
"mumble_url": settings.MUMBLE_URL,
|
||||
}
|
||||
|
||||
return render(request, 'services/mumble/mumble_connection_history.html', context)
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required("mumble.view_connection_history")
|
||||
def connection_history_data(request) -> JsonResponse:
|
||||
connection_history_data = MumbleUser.objects.all(
|
||||
).values(
|
||||
'user',
|
||||
'display_name',
|
||||
'release',
|
||||
'version',
|
||||
'last_connect',
|
||||
'last_disconnect',
|
||||
)
|
||||
|
||||
return JsonResponse({"connection_history_data": list(connection_history_data)})
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required("mumble.view_connection_history")
|
||||
def release_counts_data(request) -> JsonResponse:
|
||||
release_counts_data = MumbleUser.objects.values('release').annotate(user_count=Count('user_id')).order_by('release')
|
||||
|
||||
return JsonResponse({
|
||||
"release_counts_data": list(release_counts_data),
|
||||
})
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required("mumble.view_connection_history")
|
||||
def release_pie_chart_data(request) -> JsonResponse:
|
||||
release_counts = MumbleUser.objects.values('release').annotate(user_count=Count('user_id')).order_by('release')
|
||||
|
||||
return JsonResponse({
|
||||
"labels": list(release_counts.values_list("release", flat=True)),
|
||||
"values": list(release_counts.values_list("user_count", flat=True)),
|
||||
})
|
||||
|
@ -10,11 +10,6 @@
|
||||
<i class="fa-solid fa-gauge-high fa-fw"></i> {% translate "Dashboard" %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="{% navactive request 'groupmanagement:groups' %}" href="{% url 'groupmanagement:groups' %}">
|
||||
<i class="fa-solid fa-users fa-fw"></i> {% translate "Groups" %}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% menu_items %}
|
||||
</ul>
|
||||
|
3
allianceauth/templates/bundles/chart-js.html
Normal file
3
allianceauth/templates/bundles/chart-js.html
Normal file
@ -0,0 +1,3 @@
|
||||
<!-- Start Chart.js js from cdnjs -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.min.js" integrity="sha512-CQBWl4fJHWbryGE+Pc7UAxWMUMNMWzWxF4SQo9CgkJIN1kx6djDQZjh3Y8SZ1d+6I+1zze6Z7kHXO7q3UyZAWw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<!-- End Chart.js js from cdnjs -->
|
@ -45,7 +45,7 @@ class BootstrapDarkThemeHook(ThemeHook):
|
||||
self,
|
||||
"Bootstrap Dark",
|
||||
"Powerful, extensible, and feature-packed frontend toolkit.",
|
||||
html_tags={"data-theme": "bootstrap-dark"},
|
||||
html_tags={"data-theme": "bootstrap-dark", "data-bs-theme":"dark"},
|
||||
css=CSS_STATICS,
|
||||
js=JS_STATICS,
|
||||
header_padding="3.5em"
|
||||
|
@ -1,7 +1,7 @@
|
||||
PROTOCOL=https://
|
||||
AUTH_SUBDOMAIN=%AUTH_SUBDOMAIN%
|
||||
DOMAIN=%DOMAIN%
|
||||
AA_DOCKER_TAG=registry.gitlab.com/allianceauth/allianceauth/auth:v4.3.1
|
||||
AA_DOCKER_TAG=registry.gitlab.com/allianceauth/allianceauth/auth:v4.4.0
|
||||
|
||||
# Nginx Proxy Manager
|
||||
PROXY_HTTP_PORT=80
|
||||
|
@ -1,5 +1,5 @@
|
||||
FROM python:3.11-slim
|
||||
ARG AUTH_VERSION=v4.3.1
|
||||
ARG AUTH_VERSION=v4.4.1
|
||||
ARG AUTH_PACKAGE=allianceauth==${AUTH_VERSION}
|
||||
ENV AUTH_USER=allianceauth
|
||||
ENV AUTH_GROUP=allianceauth
|
||||
|
Loading…
x
Reference in New Issue
Block a user