Compare commits
No commits in common. "4b74f5d04b67961ca39932f6185fe3c17200a88f" and "f21987158bf17efb0617a2e6e1f21b1a65648a15" have entirely different histories.
4b74f5d04b
...
f21987158b
8 changed files with 82 additions and 217 deletions
|
@ -1,9 +1,6 @@
|
|||
Changelog
|
||||
=========
|
||||
|
||||
* :release:`0.15.0 <2023-07-23>
|
||||
* :feature:`10` add disk usage details for mail and web
|
||||
|
||||
* :release:`0.14.4 <2023-07-22>`
|
||||
* :bug:`-` add customer to disk space detail view
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# import celery_app to initialize it
|
||||
from gnuviechadmin.celery import app as celery_app # NOQA
|
||||
|
||||
__version__ = "0.15.0"
|
||||
__version__ = "0.14.4"
|
||||
|
|
|
@ -7,8 +7,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: gnuviechadmin hostingpackages\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-07-23 10:23+0200\n"
|
||||
"PO-Revision-Date: 2023-07-23 10:24+0200\n"
|
||||
"POT-Creation-Date: 2023-07-22 20:06+0200\n"
|
||||
"PO-Revision-Date: 2023-07-22 20:06+0200\n"
|
||||
"Last-Translator: Jan Dittberner <jan@dittberner.info>\n"
|
||||
"Language-Team: Jan Dittberner <jan@dittberner.info>\n"
|
||||
"Language: de\n"
|
||||
|
@ -167,100 +167,78 @@ msgstr "Kundenhostingpakete"
|
|||
msgid "{name} for {customer}"
|
||||
msgstr "{name} für {customer}"
|
||||
|
||||
#: hostingpackages/models.py:421 hostingpackages/models.py:448
|
||||
#: hostingpackages/models.py:513
|
||||
#: hostingpackages/models.py:419 hostingpackages/models.py:446
|
||||
#: hostingpackages/models.py:511
|
||||
msgid "hosting package"
|
||||
msgstr "Hostingpaket"
|
||||
|
||||
#: hostingpackages/models.py:426
|
||||
#: hostingpackages/models.py:424
|
||||
msgid "hosting domain"
|
||||
msgstr "Hostingdomain"
|
||||
|
||||
#: hostingpackages/models.py:453
|
||||
#: hostingpackages/models.py:451
|
||||
msgid "customer hosting option"
|
||||
msgstr "kundenspezifische Hostingoption"
|
||||
|
||||
#: hostingpackages/models.py:454
|
||||
#: hostingpackages/models.py:452
|
||||
msgid "customer hosting options"
|
||||
msgstr "kundenspezifische Hostingoptionen"
|
||||
|
||||
#: hostingpackages/models.py:466
|
||||
#: hostingpackages/models.py:464
|
||||
msgid "disk space option template"
|
||||
msgstr "Speicherplatzoptionsvorlage"
|
||||
|
||||
#: hostingpackages/models.py:468
|
||||
#: hostingpackages/models.py:466
|
||||
msgid "The disk space option template that this disk space option is based on"
|
||||
msgstr ""
|
||||
"Die Speicherplatzoptionsvorlage auf der diese Speicherplatzoption aufgebaut "
|
||||
"ist"
|
||||
|
||||
#: hostingpackages/models.py:483
|
||||
#: hostingpackages/models.py:481
|
||||
msgid "user database option template"
|
||||
msgstr "Nutzerdatenbankoptionsvorlage"
|
||||
|
||||
#: hostingpackages/models.py:485
|
||||
#: hostingpackages/models.py:483
|
||||
msgid "The user database option template that this database option is based on"
|
||||
msgstr ""
|
||||
"Die Nutzerdatenbankoptionsvorlage auf der diese Datenbankoption aufgebaut ist"
|
||||
|
||||
#: hostingpackages/models.py:500
|
||||
#: hostingpackages/models.py:498
|
||||
msgid "mailbox option template"
|
||||
msgstr "Postfachoptionsvorlage"
|
||||
|
||||
#: hostingpackages/models.py:501
|
||||
#: hostingpackages/models.py:499
|
||||
msgid "The mailbox option template that this mailbox option is based on"
|
||||
msgstr "Die Postfachoptionsvorlage auf der diese Postfachoption aufgebaut ist"
|
||||
|
||||
#: hostingpackages/models.py:514
|
||||
#: hostingpackages/models.py:512
|
||||
msgid "The hosting package"
|
||||
msgstr "Das Hostingpaket"
|
||||
|
||||
#: hostingpackages/models.py:518
|
||||
#: hostingpackages/models.py:516
|
||||
msgid "data source"
|
||||
msgstr "Datenquelle"
|
||||
|
||||
#: hostingpackages/models.py:520
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_detail.html:202
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:42
|
||||
msgid "Mailbox"
|
||||
msgstr "Postfach"
|
||||
#: hostingpackages/models.py:517
|
||||
msgid "disk"
|
||||
msgstr "Festplatte"
|
||||
|
||||
#: hostingpackages/models.py:521
|
||||
msgid "Website"
|
||||
msgstr "Webauftritt"
|
||||
#: hostingpackages/models.py:517
|
||||
msgid "mysql"
|
||||
msgstr "MySQL"
|
||||
|
||||
#: hostingpackages/models.py:522
|
||||
msgid "MariaDB database"
|
||||
msgstr "MariaDB-Datenbank"
|
||||
#: hostingpackages/models.py:517
|
||||
msgid "pgsql"
|
||||
msgstr "PostgreSQL"
|
||||
|
||||
#: hostingpackages/models.py:523
|
||||
msgid "PostgreSQL database"
|
||||
msgstr "PostgreSQL-Datenbank"
|
||||
|
||||
#: hostingpackages/models.py:526
|
||||
#: hostingpackages/models.py:519
|
||||
msgid "data item"
|
||||
msgstr "Dateneinheit"
|
||||
|
||||
#: hostingpackages/models.py:528
|
||||
#: hostingpackages/models.py:521
|
||||
msgid "space used in KiB"
|
||||
msgstr "genutzter Platz in KiB"
|
||||
|
||||
#: hostingpackages/models.py:532
|
||||
msgid "mail address"
|
||||
msgstr "E-Mailadresse"
|
||||
|
||||
#: hostingpackages/models.py:533
|
||||
msgid "Assigned mail address"
|
||||
msgstr "Zugeordnete E-Mailadresse"
|
||||
|
||||
#: hostingpackages/models.py:539
|
||||
msgid "website"
|
||||
msgstr "Webauftritt"
|
||||
|
||||
#: hostingpackages/models.py:540
|
||||
msgid "Assigned web site"
|
||||
msgstr "Zugeordneter Webauftritt"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/add_hosting_option.html:4
|
||||
#: hostingpackages/templates/hostingpackages/add_hosting_option.html:7
|
||||
#, python-format
|
||||
|
@ -288,19 +266,20 @@ msgstr "OS-Nutzer"
|
|||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_admin_list.html:14
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_detail.html:40
|
||||
#: hostingpackages/views.py:184
|
||||
#: hostingpackages/views.py:183
|
||||
msgid "Disk space"
|
||||
msgstr "Speicherplatz"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_admin_list.html:15
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_detail.html:54
|
||||
#: hostingpackages/views.py:191
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:48
|
||||
#: hostingpackages/views.py:190
|
||||
msgid "Mailboxes"
|
||||
msgstr "Postfächer"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_admin_list.html:16
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_detail.html:239
|
||||
#: hostingpackages/views.py:198
|
||||
#: hostingpackages/views.py:197
|
||||
msgid "Databases"
|
||||
msgstr "Datenbanken"
|
||||
|
||||
|
@ -376,7 +355,7 @@ msgstr ""
|
|||
"%(disk_space)s für Ihr Hostingpaket"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_detail.html:45
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:28
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:27
|
||||
#, python-format
|
||||
msgid "%(used_space)s of %(disk_space)s (%(space_level_percent)s%%)"
|
||||
msgstr "%(used_space)s von %(disk_space)s (%(space_level_percent)s%%)"
|
||||
|
@ -390,7 +369,7 @@ msgid "Details"
|
|||
msgstr "Details"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_detail.html:49
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:32
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:31
|
||||
#, python-format
|
||||
msgid ""
|
||||
"The package contributes %(package_space)s the difference comes from disk "
|
||||
|
@ -546,6 +525,10 @@ msgstr "Domain hinzufügen"
|
|||
msgid "E-Mail-Accounts"
|
||||
msgstr "E-Mail-Konten"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_detail.html:202
|
||||
msgid "Mailbox"
|
||||
msgstr "Postfach"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_detail.html:204
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_detail.html:216
|
||||
msgid "Active"
|
||||
|
@ -620,7 +603,7 @@ msgstr "Speicherplatznutzung Ihres Hostingpakets %(package)s"
|
|||
msgid "Disk usage of Hosting Package %(package)s of %(full_name)s"
|
||||
msgstr "Speicherplatznutzung des Hostingpakets %(package)s von %(full_name)s"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:17
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:16
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Disk usage of Hosting Package <a href=\"%(package_url)s\">%(package)s</a>"
|
||||
|
@ -628,7 +611,7 @@ msgstr ""
|
|||
"Speicherplatznutzung des Hostingpakets <a "
|
||||
"href=\"%(package_url)s\">%(package)s</a>"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:23
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:22
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You use %(used_space)s of the reserved disk space of %(disk_space)s for your "
|
||||
|
@ -637,43 +620,42 @@ msgstr ""
|
|||
"Sie nutzen %(used_space)s des reservierten Speicherplatzes von "
|
||||
"%(disk_space)s für Ihr Hostingpaket."
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:36
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:35
|
||||
msgid "Breakdown by usage"
|
||||
msgstr "Aufgliederung nach Nutzung"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:38
|
||||
msgid "Mailbox usage"
|
||||
msgstr "Postfachnutzung"
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:37
|
||||
msgid "Regular file system usage"
|
||||
msgstr "Reguläre Dateisystemnutzung"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:43
|
||||
msgid "Primary email address"
|
||||
msgstr "Primäre E-Mailadresse"
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:41
|
||||
msgid "Origin"
|
||||
msgstr "Quelle"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:44
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:64
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:83
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:102
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:42
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:61
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:78
|
||||
msgid "Used space"
|
||||
msgstr "Genutzter Speicherplatz"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:59
|
||||
msgid "Website usage"
|
||||
msgstr "Nutzung für Webauftritte"
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:47
|
||||
msgid "Website data"
|
||||
msgstr "Webseiten-Daten"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:63
|
||||
msgid "Website / Directory"
|
||||
msgstr "Webauftritt / Verzeichnis"
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:48
|
||||
msgid "Other"
|
||||
msgstr "Sonstiges"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:78
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:56
|
||||
msgid "MySQL/MariaDB database usage"
|
||||
msgstr "MySQL/MariaDB-Datenbanknutzung"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:82
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:101
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:60
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:77
|
||||
msgid "Database"
|
||||
msgstr "Datenbank"
|
||||
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:97
|
||||
#: hostingpackages/templates/hostingpackages/customerhostingpackage_disk_usage_details.html:73
|
||||
msgid "PostgreSQL database usage"
|
||||
msgstr "PostgreSQL-Datenbanknutzung"
|
||||
|
||||
|
@ -686,12 +668,12 @@ msgstr ""
|
|||
"Wählen Sie eine neue Option für das Hostingpaket %(package)s des Kunden "
|
||||
"%(full_name)s"
|
||||
|
||||
#: hostingpackages/views.py:63 hostingpackages/views.py:97
|
||||
#: hostingpackages/views.py:62 hostingpackages/views.py:96
|
||||
#, python-brace-format
|
||||
msgid "Started setup of new hosting package {name}."
|
||||
msgstr "Einrichtung des Hostingpakets {name} wurde gestartet."
|
||||
|
||||
#: hostingpackages/views.py:272
|
||||
#: hostingpackages/views.py:271
|
||||
#, python-brace-format
|
||||
msgid "Successfully added option {option} to hosting package {package}."
|
||||
msgstr "Option {option} erfolgreich zum Hostingpaket {package} hinzugefügt."
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
# Generated by Django 4.2.3 on 2023-07-23 07:24
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("managemails", "0004_auto_20150125_1825"),
|
||||
("websites", "0001_initial"),
|
||||
("hostingpackages", "0007_add_disk_usage_table"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="customerpackagediskusage",
|
||||
name="email_address",
|
||||
field=models.ForeignKey(
|
||||
help_text="Assigned mail address",
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="managemails.mailaddress",
|
||||
verbose_name="mail address",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="customerpackagediskusage",
|
||||
name="website",
|
||||
field=models.ForeignKey(
|
||||
help_text="Assigned web site",
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="websites.website",
|
||||
verbose_name="website",
|
||||
),
|
||||
),
|
||||
migrations.RunSQL(
|
||||
"DELETE FROM hostingpackages_customerpackagediskusage WHERE source='disk'"
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customerpackagediskusage",
|
||||
name="source",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("mail", "Mailbox"),
|
||||
("web", "Website"),
|
||||
("mysql", "MariaDB database"),
|
||||
("pgsql", "PostgreSQL database"),
|
||||
],
|
||||
verbose_name="data source",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -516,31 +516,12 @@ class CustomerPackageDiskUsage(TimeStampedModel):
|
|||
)
|
||||
source = models.CharField(
|
||||
verbose_name=_("data source"),
|
||||
choices=(
|
||||
("mail", _("Mailbox")),
|
||||
("web", _("Website")),
|
||||
("mysql", _("MariaDB database")),
|
||||
("pgsql", _("PostgreSQL database")),
|
||||
),
|
||||
choices=(("disk", _("disk")), ("mysql", _("mysql")), ("pgsql", _("pgsql"))),
|
||||
)
|
||||
item = models.CharField(verbose_name=_("data item"))
|
||||
used_kb = models.PositiveBigIntegerField(
|
||||
verbose_name=_("space used in KiB"), default=0
|
||||
)
|
||||
email_address = models.ForeignKey(
|
||||
"managemails.MailAddress",
|
||||
verbose_name=_("mail address"),
|
||||
help_text=_("Assigned mail address"),
|
||||
on_delete=models.CASCADE,
|
||||
null=True,
|
||||
)
|
||||
website = models.ForeignKey(
|
||||
"websites.Website",
|
||||
verbose_name=_("website"),
|
||||
help_text=_("Assigned web site"),
|
||||
on_delete=models.CASCADE,
|
||||
null=True,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
unique_together = ("package", "source", "item")
|
||||
|
|
|
@ -13,10 +13,9 @@
|
|||
{% endif %}
|
||||
{% endspaceless %}{% endblock title %}
|
||||
|
||||
{% block page_title %}
|
||||
{% blocktranslate with package=hostingpackage.name package_url=hostingpackage.get_absolute_url trimmed %}
|
||||
Disk usage of Hosting Package <a href="{{ package_url }}">{{ package }}</a>
|
||||
{% endblocktranslate %}{% endblock page_title %}
|
||||
{% block page_title %}{% blocktranslate with package=hostingpackage.name package_url=hostingpackage.get_absolute_url trimmed %}
|
||||
Disk usage of Hosting Package <a href="{{ package_url }}">{{ package }}</a>
|
||||
{% endblocktranslate %}{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
{% with used_space=hostingpackage.get_used_disk_space_sum|filesizeformat disk_space=hostingpackage.get_disk_space|filesizeformat package_space=hostingpackage.get_package_space|filesizeformat space_level=hostingpackage.space_level %}
|
||||
|
@ -34,82 +33,57 @@ The package contributes {{ package_space }} the difference comes from disk space
|
|||
{% endblocktranslate %}"></i>
|
||||
</p>
|
||||
<h2>{% trans "Breakdown by usage" %}</h2>
|
||||
{% if mail_usage %}
|
||||
<h3>{% trans "Mailbox usage" %}</h3>
|
||||
<table class="table table-condensed table-striped">
|
||||
{% if disk_usage %}
|
||||
<h3>{% trans "Regular file system usage" %}</h3>
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% translate "Mailbox" %}</th>
|
||||
<th>{% translate "Primary email address" %}</th>
|
||||
<th>{% translate "Origin" %}</th>
|
||||
<th class="text-end">{% translate "Used space" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for line in mail_usage %}
|
||||
{% for line in disk_usage %}
|
||||
<tr>
|
||||
<td>{{ line.item }}</td>
|
||||
<td>{% if line.email_address %}{{ line.email_address }}{% else %}-{% endif %}</td>
|
||||
<td>{% if line.item == "web" %}{% translate "Website data" %}{% elif line.item == "mail" %}
|
||||
{% translate "Mailboxes" %}{% elif line.item == "other" %}{% translate "Other" %}{% else %}
|
||||
{{ line.item }}{% endif %}</td>
|
||||
<td class="text-end">{{ line.size_in_bytes|filesizeformat }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% if web_usage %}
|
||||
<h3>{% trans "Website usage" %}</h3>
|
||||
<table class="table table-condensed table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% translate "Website / Directory" %}</th>
|
||||
<th class="text-end">{% translate "Used space" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for line in web_usage %}
|
||||
<tr>
|
||||
<td>{{ line.item }}</td>
|
||||
<td class="text-end">{{ line.size_in_bytes|filesizeformat }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% if mysql_usage %}
|
||||
<h3>{% trans "MySQL/MariaDB database usage" %}</h3>
|
||||
<table class="table table-condensed table-striped">
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% translate "Database" %}</th>
|
||||
<th class="text-end">{% translate "Used space" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for line in mysql_usage %}
|
||||
<tr>
|
||||
<td>{{ line.item }}</td>
|
||||
<td class="text-end">{{ line.size_in_bytes|filesizeformat }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% if pgsql_usage %}
|
||||
<h3>{% trans "PostgreSQL database usage" %}</h3>
|
||||
<table class="table table-condensed table-striped">
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% translate "Database" %}</th>
|
||||
<th class="text-end">{% translate "Used space" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for line in pgsql_usage %}
|
||||
<tr>
|
||||
<td>{{ line.item }}</td>
|
||||
<td class="text-end">{{ line.size_in_bytes|filesizeformat }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
|
|
@ -24,7 +24,6 @@ from rest_framework.views import APIView
|
|||
|
||||
from gvacommon.viewmixins import StaffOrSelfLoginRequiredMixin
|
||||
|
||||
from managemails.models import Mailbox
|
||||
from .forms import (
|
||||
AddDiskspaceOptionForm,
|
||||
AddMailboxOptionForm,
|
||||
|
@ -41,7 +40,7 @@ from .models import (
|
|||
)
|
||||
from .serializers import DiskUsageSerializer
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger("gnuviechadmin.hostingpackages")
|
||||
|
||||
|
||||
class CreateHostingPackage(PermissionRequiredMixin, CreateView):
|
||||
|
@ -291,7 +290,6 @@ class UploadCustomerPackageDiskUsage(APIView):
|
|||
def post(self, request: rest_framework.request.Request, format=None):
|
||||
if request.content_type != "application/json":
|
||||
return Response("Unacceptable", status=http.HTTPStatus.BAD_REQUEST)
|
||||
|
||||
for row in request.data:
|
||||
user = row["user"]
|
||||
for key in row:
|
||||
|
@ -312,22 +310,13 @@ class UploadCustomerPackageDiskUsage(APIView):
|
|||
item=item,
|
||||
)
|
||||
metric.used_kb = size
|
||||
|
||||
if key == "mail":
|
||||
try:
|
||||
ma_mb = package.mailboxes.get(username=item).mailaddressmailbox_set.first()
|
||||
if ma_mb:
|
||||
metric.email_address_id = ma_mb.mailaddress_id
|
||||
except Mailbox.DoesNotExist:
|
||||
logger.warning("mail box %s does not exist", item)
|
||||
|
||||
metric.save()
|
||||
except CustomerHostingPackage.DoesNotExist:
|
||||
logger.warning(
|
||||
"hosting package for user %s does not exist", user
|
||||
)
|
||||
|
||||
logger.info("usage data submitted by %s", request.user)
|
||||
logger.info("usage date submitted by %s", request.user)
|
||||
|
||||
return Response("Accepted", status=http.HTTPStatus.ACCEPTED)
|
||||
|
||||
|
@ -353,17 +342,13 @@ class CustomerHostingPackageDiskUsageDetails(StaffOrSelfLoginRequiredMixin, Deta
|
|||
def get_context_data(self, **kwargs):
|
||||
context_data = super().get_context_data(**kwargs)
|
||||
|
||||
mail_usage, web_usage, mysql_usage, pgsql_usage = [], [], [], []
|
||||
disk_usage, mysql_usage, pgsql_usage = [], [], []
|
||||
|
||||
for usage in self.get_object().customerpackagediskusage_set.order_by(
|
||||
"-used_kb"
|
||||
):
|
||||
if usage.used_kb <= 0:
|
||||
continue
|
||||
if usage.source == "mail":
|
||||
mail_usage.append(usage)
|
||||
elif usage.source == "web":
|
||||
web_usage.append(usage)
|
||||
if usage.source == "disk":
|
||||
disk_usage.append(usage)
|
||||
elif usage.source == "mysql":
|
||||
mysql_usage.append(usage)
|
||||
elif usage.source == "pgsql":
|
||||
|
@ -372,8 +357,7 @@ class CustomerHostingPackageDiskUsageDetails(StaffOrSelfLoginRequiredMixin, Deta
|
|||
context_data.update(
|
||||
{
|
||||
"customer": self.get_customer_object(),
|
||||
"mail_usage": mail_usage,
|
||||
"web_usage": web_usage,
|
||||
"disk_usage": disk_usage,
|
||||
"mysql_usage": mysql_usage,
|
||||
"pgsql_usage": pgsql_usage,
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "gva"
|
||||
version = "0.15.0"
|
||||
version = "0.14.4"
|
||||
description = "gnuviechadmin web interface"
|
||||
authors = ["Jan Dittberner <jan@dittberner.info>"]
|
||||
license = "AGPL-3+"
|
||||
|
|
Loading…
Reference in a new issue