mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Simple skelton for database stats view
This commit is contained in:
parent
91ca37c84b
commit
aa210efad6
@ -41,6 +41,12 @@ function inventreeDocReady() {
|
|||||||
|
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Callback to launch the 'Database Stats' window
|
||||||
|
$('#launch-stats').click(function() {
|
||||||
|
launchModalForm("/stats/", {
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function isFileTransfer(transfer) {
|
function isFileTransfer(transfer) {
|
||||||
|
@ -33,7 +33,8 @@ from django.conf.urls.static import static
|
|||||||
from django.views.generic.base import RedirectView
|
from django.views.generic.base import RedirectView
|
||||||
from rest_framework.documentation import include_docs_urls
|
from rest_framework.documentation import include_docs_urls
|
||||||
|
|
||||||
from .views import IndexView, SearchView, SettingsView, EditUserView, SetPasswordView
|
from .views import IndexView, SearchView, DatabaseStatsView
|
||||||
|
from .views import SettingsView, EditUserView, SetPasswordView
|
||||||
from .views import InfoView
|
from .views import InfoView
|
||||||
|
|
||||||
from users.urls import user_urls
|
from users.urls import user_urls
|
||||||
@ -97,6 +98,7 @@ urlpatterns = [
|
|||||||
|
|
||||||
url(r'^index/', IndexView.as_view(), name='index'),
|
url(r'^index/', IndexView.as_view(), name='index'),
|
||||||
url(r'^search/', SearchView.as_view(), name='search'),
|
url(r'^search/', SearchView.as_view(), name='search'),
|
||||||
|
url(r'^stats/', DatabaseStatsView.as_view(), name='stats'),
|
||||||
|
|
||||||
url(r'^api/', include(apipatterns)),
|
url(r'^api/', include(apipatterns)),
|
||||||
url(r'^api-doc/', include_docs_urls(title='InvenTree API')),
|
url(r'^api-doc/', include_docs_urls(title='InvenTree API')),
|
||||||
|
@ -8,6 +8,7 @@ as JSON objects and passing them to modal forms (using jQuery / bootstrap).
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
from django.http import JsonResponse, HttpResponseRedirect
|
from django.http import JsonResponse, HttpResponseRedirect
|
||||||
|
|
||||||
@ -537,3 +538,10 @@ class SettingsView(TemplateView):
|
|||||||
ctx['settings'] = InvenTreeSetting.objects.all().order_by('key')
|
ctx['settings'] = InvenTreeSetting.objects.all().order_by('key')
|
||||||
|
|
||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
|
|
||||||
|
class DatabaseStatsView(AjaxView):
|
||||||
|
""" View for displaying database statistics """
|
||||||
|
|
||||||
|
ajax_template_name = "stats.html"
|
||||||
|
ajax_form_title = _("Database Statistics")
|
5
InvenTree/templates/stats.html
Normal file
5
InvenTree/templates/stats.html
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{% load static %}
|
||||||
|
{% load inventree_extras %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
HELLO WORLD
|
Loading…
Reference in New Issue
Block a user