mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -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
|
||||
|
||||
from django import __version__ as DJANGO_VERSION
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.mixins import UserPassesTestMixin
|
||||
@ -630,9 +631,11 @@ class SystemView(UserPassesTestMixin, View):
|
||||
|
||||
# Raw data export
|
||||
if 'export' in request.GET:
|
||||
stats['netbox_release'] = stats['netbox_release'].asdict()
|
||||
params = [param.name for param in PARAMS]
|
||||
data = {
|
||||
**stats,
|
||||
'plugins': settings.PLUGINS,
|
||||
'config': {
|
||||
k: getattr(config, k) for k in sorted(params)
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
import os
|
||||
import yaml
|
||||
from dataclasses import dataclass, field
|
||||
from dataclasses import asdict, dataclass, field
|
||||
from typing import List, Union
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
@ -42,6 +42,9 @@ class ReleaseInfo:
|
||||
def name(self):
|
||||
return f"NetBox {self.edition} v{self.full_version}"
|
||||
|
||||
def asdict(self):
|
||||
return asdict(self)
|
||||
|
||||
|
||||
def load_release_data():
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user