2021-03-26 13:28:03 -05:00
|
|
|
from django.views import View
|
2021-04-27 07:56:02 -05:00
|
|
|
from django.shortcuts import render
|
2021-03-26 13:28:03 -05:00
|
|
|
from apps.analyzer.models import MClassifierFeed, MClassifierAuthor, MClassifierTag, MClassifierTitle
|
|
|
|
|
|
|
|
|
|
|
|
class Classifiers(View):
|
|
|
|
|
|
|
|
def get(self, request):
|
2021-04-27 07:56:02 -05:00
|
|
|
data = {
|
2021-03-26 13:28:03 -05:00
|
|
|
'feeds': MClassifierFeed.objects.count(),
|
|
|
|
'authors': MClassifierAuthor.objects.count(),
|
|
|
|
'tags': MClassifierTag.objects.count(),
|
|
|
|
'titles': MClassifierTitle.objects.count(),
|
2021-04-27 07:56:02 -05:00
|
|
|
}
|
|
|
|
|
2021-04-30 13:48:48 -05:00
|
|
|
chart_name = "classifiers"
|
2021-05-03 07:56:47 -05:00
|
|
|
chart_type = "counter"
|
2021-04-30 13:48:48 -05:00
|
|
|
|
|
|
|
context = {
|
|
|
|
"data": data,
|
|
|
|
"chart_name": chart_name,
|
|
|
|
"chart_type": chart_type,
|
|
|
|
}
|
2021-05-03 07:56:47 -05:00
|
|
|
return render(request, 'monitor/prometheus_data.html', context, content_type="text/plain")
|
2021-03-26 13:28:03 -05:00
|
|
|
|