mirror of
https://github.com/xingsu1021/pthelper.git
synced 2026-06-16 15:07:07 +08:00
24 lines
702 B
Python
24 lines
702 B
Python
from django.shortcuts import render
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
from django.views.generic import TemplateView
|
|
from sites.models import SiteInfo
|
|
|
|
# Create your views here.
|
|
class DashboardListView(LoginRequiredMixin, TemplateView):
|
|
"""
|
|
打开首页的控制台
|
|
"""
|
|
template_name = 'dashboard/dashboard.html'
|
|
|
|
def get_context_data(self, **kwargs):
|
|
|
|
#配置站点总数
|
|
sites_count = SiteInfo.objects.count()
|
|
|
|
context = {
|
|
'sites_num': sites_count,
|
|
# 'action': 'Asset list',
|
|
}
|
|
kwargs.update(context)
|
|
return super(DashboardListView, self).get_context_data(**kwargs)
|