mirror of
https://github.com/viq/NewsBlur.git
synced 2025-04-13 09:38:09 +00:00
25 lines
771 B
Python
Executable file
25 lines
771 B
Python
Executable file
from django.views import View
|
|
from django.shortcuts import render
|
|
from apps.analyzer.models import MClassifierFeed, MClassifierAuthor, MClassifierTag, MClassifierTitle
|
|
|
|
|
|
class Classifiers(View):
|
|
|
|
def get(self, request):
|
|
data = {
|
|
'feeds': MClassifierFeed.objects.count(),
|
|
'authors': MClassifierAuthor.objects.count(),
|
|
'tags': MClassifierTag.objects.count(),
|
|
'titles': MClassifierTitle.objects.count(),
|
|
}
|
|
|
|
chart_name = "classifiers"
|
|
chart_type = "counter"
|
|
|
|
context = {
|
|
"data": data,
|
|
"chart_name": chart_name,
|
|
"chart_type": chart_type,
|
|
}
|
|
return render(request, 'monitor/prometheus_data.html', context, content_type="text/plain")
|
|
|