mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -06:00
Fix export of system data & include plugins
This commit is contained in:
parent
149c80a10e
commit
bf17485290
@ -2,6 +2,7 @@ import json
|
|||||||
import platform
|
import platform
|
||||||
|
|
||||||
from django import __version__ as DJANGO_VERSION
|
from django import __version__ as DJANGO_VERSION
|
||||||
|
from django.apps import apps
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.contrib.auth.mixins import UserPassesTestMixin
|
from django.contrib.auth.mixins import UserPassesTestMixin
|
||||||
@ -630,9 +631,11 @@ class SystemView(UserPassesTestMixin, View):
|
|||||||
|
|
||||||
# Raw data export
|
# Raw data export
|
||||||
if 'export' in request.GET:
|
if 'export' in request.GET:
|
||||||
|
stats['netbox_release'] = stats['netbox_release'].asdict()
|
||||||
params = [param.name for param in PARAMS]
|
params = [param.name for param in PARAMS]
|
||||||
data = {
|
data = {
|
||||||
**stats,
|
**stats,
|
||||||
|
'plugins': settings.PLUGINS,
|
||||||
'config': {
|
'config': {
|
||||||
k: getattr(config, k) for k in sorted(params)
|
k: getattr(config, k) for k in sorted(params)
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
import yaml
|
import yaml
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import asdict, dataclass, field
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
|
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
@ -42,6 +42,9 @@ class ReleaseInfo:
|
|||||||
def name(self):
|
def name(self):
|
||||||
return f"NetBox {self.edition} v{self.full_version}"
|
return f"NetBox {self.edition} v{self.full_version}"
|
||||||
|
|
||||||
|
def asdict(self):
|
||||||
|
return asdict(self)
|
||||||
|
|
||||||
|
|
||||||
def load_release_data():
|
def load_release_data():
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user