This commit is contained in:
Bob 2020-09-30 20:29:10 +08:00
parent 7c25ed8b69
commit 4fd60cc84d
10 changed files with 284 additions and 33 deletions

View File

@ -37,55 +37,43 @@
</li> </li>
{# <li class="open">#} {# <li class="open">#}
<li class=""> <li class="">
<a href="javascript:;"> <a href="{% url 'monitor-timeliness-monitoring' %}">
<i class="fa fa-map-marker"></i> <i class="fa fa-map-marker"></i>
<span class="title">发布时效性监测</span> <span class="title">时效性监测</span>
<span class="arrow "></span> {# <span class="arrow "></span>#}
</a> </a>
<ul class="sub-menu"> {# <ul class="sub-menu">#}
<li> {# <li>#}
<a class="" href="">新媒体详情监测</a> {# <a class="" href="">新媒体详情监测</a>#}
</li> {# </li>#}
<li> {# <li>#}
<a class="" href="">页面详情</a> {# <a class="" href="">页面详情</a>#}
</li> {# </li>#}
</ul> {# </ul>#}
</li> </li>
<li class=""> <li class="">
<a href=""> <a href="{% url 'monitor-error-monitoring' %}">
<i class="fa fa-bar-chart"></i> <i class="fa fa-bar-chart"></i>
<span class="title">错别字监测</span> <span class="title">错别字监测</span>
</a> </a>
</li> </li>
<li class=""> <li class="">
<a href="javascript:;"> <a href="{% url 'monitor-sensitive-word-monitoring' %}">
<i class="fa fa-folder-open"></i> <i class="fa fa-folder-open"></i>
<span class="title">敏感信息监测</span> <span class="title">敏感词监测</span>
<span class="arrow "></span>
</a> </a>
<ul class="sub-menu">
<li>
<a class="" href="">会议详情</a>
</li>
</ul>
</li> </li>
<li class=""> <li class="">
<a href=""> <a href="{% url 'monitor-comment-on-interactive-monitoring' %}">
<i class="fa fa-th"></i> <i class="fa fa-th"></i>
<span class="title">评论互动监测</span> <span class="title">评论互动监测</span>
</a> </a>
</li> </li>
<li class=""> <li class="">
<a href="javascript:;"> <a href="{% url 'monitor-monitoring-report' %}">
<i class="fa fa-suitcase"></i> <i class="fa fa-suitcase"></i>
<span class="title">监测报告</span> <span class="title">监测报告</span>
<span class="arrow "></span>
</a> </a>
<ul class="sub-menu">
<li>
<a class="" href="">详情</a>
</li>
</ul>
</li> </li>
<li class=""> <li class="">
<a href="javascript:;"> <a href="javascript:;">

View File

@ -4,8 +4,8 @@ from django.urls import path
from dashboard import views from dashboard import views
urlpatterns = [ urlpatterns = [
path('', views.index, name='dashboard-index'), path('index/', views.index, name='dashboard-index'),
path('login/', views.user_login, name='dashboard-login'), path('', views.user_login, name='dashboard-login'),
path('refresh_captcha/', views.refresh_captcha, name='refresh-captcha'), path('refresh_captcha/', views.refresh_captcha, name='refresh-captcha'),
path('logout/', views.user_logout, name='dashboard-logout'), path('logout/', views.user_logout, name='dashboard-logout'),
path('register/', views.register, name='dashboard-register'), path('register/', views.register, name='dashboard-register'),

View File

@ -58,7 +58,7 @@ def user_login(request):
expiration__gt=datetime.datetime.now()).delete() expiration__gt=datetime.datetime.now()).delete()
except CaptchaStore.DoesNotExist: except CaptchaStore.DoesNotExist:
messages.error(request, '验证码错误') messages.error(request, '验证码错误')
return HttpResponseRedirect('/login/') return HttpResponseRedirect('/')
print(username, password) print(username, password)
if username is not None and password is not None: if username is not None and password is not None:
try: try:
@ -67,7 +67,7 @@ def user_login(request):
if user is not None: if user is not None:
if user.check_password(password): if user.check_password(password):
login(request, user) login(request, user)
return HttpResponseRedirect('/') return HttpResponseRedirect('/index/')
else: else:
messages.error(request, '无效的账号') messages.error(request, '无效的账号')
else: else:
@ -164,7 +164,7 @@ def register(request):
userprofile = Userprofile(name=name, image=image, user_id=user.id, organization_id=o, sex=sex, status=0) userprofile = Userprofile(name=name, image=image, user_id=user.id, organization_id=o, sex=sex, status=0)
userprofile.save() userprofile.save()
messages.success(request, '注册成功,请登录') messages.success(request, '注册成功,请登录')
return HttpResponseRedirect('/login/') return HttpResponseRedirect('/')
return render(request, 'dashboard/register.html', return render(request, 'dashboard/register.html',
{'hash_key': hash_key, 'image_url': image_url, 'organization': organization}) {'hash_key': hash_key, 'image_url': image_url, 'organization': organization})

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,203 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block content %}
<body class=" ">
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
</section>
<div class="panel">
<div class="panel-body">
<div class="list-group col-md-2 ">
<a href="#" class="list-group-item active" style="text-align: center">
<h4 class="list-group-item-heading">新媒体数量</h4>
<p class="list-group-item-text">288</p>
<p class="list-group-item-text">本周新增</p>
<p class="list-group-item-text">本月新增</p>
</a>
</div>
<div class="list-group col-md-2 ">
<a href="#" class="list-group-item active" style="text-align: center">
<h4 class="list-group-item-heading">内容更新次数</h4>
<p class="list-group-item-text">288</p>
<p class="list-group-item-text">本周新增次数</p>
<p class="list-group-item-text">本月新增次数</p>
</a>
</div>
<div class="list-group col-md-2 ">
<a href="#" class="list-group-item active" style="text-align: center">
<h4 class="list-group-item-heading">评论数量</h4>
<p class="list-group-item-text">288</p>
<p class="list-group-item-text">本周新增</p>
<p class="list-group-item-text">本月新增</p>
</a>
</div>
<div class="list-group col-md-2 ">
<a href="#" class="list-group-item active" style="text-align: center">
<h4 class="list-group-item-heading">错别字</h4>
<p class="list-group-item-text">288</p>
<p class="list-group-item-text">本周新增</p>
<p class="list-group-item-text">本月新增</p>
</a>
</div>
<div class="list-group col-md-2 ">
<a href="#" class="list-group-item active" style="text-align: center">
<h4 class="list-group-item-heading">敏感词</h4>
<p class="list-group-item-text">288</p>
<p class="list-group-item-text">本周新增</p>
<p class="list-group-item-text">本月新增</p>
</a>
</div>
<div class="list-group col-md-2 ">
<a href="#" class="list-group-item active list-group-item-success" style="text-align: center">
<h4 class="list-group-item-heading">新媒体数量</h4>
<p class="list-group-item-text">288</p>
<p class="list-group-item-text">本周新增</p>
<p class="list-group-item-text">本月新增</p>
</a>
</div>
</div>
<div class="panel-body">
<div id="main" style="width: 100%;height:400px;"></div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<ul class="nav nav-pills">
<li role="presentation" class="active"><a
href="">微信</a></li>
<li role="presentation"><a
href="">头条</a></li>
<li role="presentation"><a href="">微博</a>
</li>
<li role="presentation"><a href="">抖音</a>
</li>
<li role="presentation"><a href="">其他</a>
</li>
</ul>
</div>
<table class="table table-hover" style="font-size: 14px">
<thead>
<tr>
<th style="text-align: center">公众号</th>
<th style="text-align: center">最近更新时间</th>
<th style="text-align: center">连续未更新天数</th>
<th style="text-align: center">评论次数</th>
<th style="text-align: center">评论回复次数</th>
<th style="text-align: center">错别字个数</th>
<th style="text-align: center">敏感词个数</th>
<th style="text-align: center">非法外链接</th>
</tr>
</thead>
<tbody>
<tr>
<td style="vertical-align: middle;text-align: center">{{ r.code }}</td>
<td style="vertical-align: middle;text-align: center"><img src="{{ r.image.url }}"
style="width: 40px;height: 40px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ r.count }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.count_jc }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.comment }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.reply }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>
</body>
{% endblock %}
{% block add_js %}
<script src="{% static 'js/echarts.min.js' %}" type="text/javascript"></script>
<script src="{% static 'js/chart-sparkline.js' %}" type="text/javascript"></script>
<script type="text/javascript">
// 基于准备好的dom初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
// 指定图表的配置项和数据
option = {
title: {
text: '更新次数/天'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['微信', '微博', '头条', '抖音', '其他']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
},
yAxis: {
type: 'value'
},
series: [
{
name: '微信',
type: 'line',
stack: '总量',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '微博',
type: 'line',
stack: '总量',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: '头条',
type: 'line',
stack: '总量',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: '抖音',
type: 'line',
stack: '总量',
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: '其他',
type: 'line',
stack: '总量',
data: [820, 932, 901, 934, 1290, 1330, 1320]
}
]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
</script>
{% endblock %}

View File

@ -9,4 +9,14 @@ urlpatterns = [
path('new/media/public/opinion/toutiao/',views.new_media_public_opinion_toutiao,name='monitor-new-media-public-opinion-toutiao'), path('new/media/public/opinion/toutiao/',views.new_media_public_opinion_toutiao,name='monitor-new-media-public-opinion-toutiao'),
path('new/media/public/opinion/douyin/',views.new_media_public_opinion_douyin,name='monitor-new-media-public-opinion-douyin'), path('new/media/public/opinion/douyin/',views.new_media_public_opinion_douyin,name='monitor-new-media-public-opinion-douyin'),
path('new/media/public/opinion/qita/',views.new_media_public_opinion_qita,name='monitor-new-media-public-opinion-qita'), path('new/media/public/opinion/qita/',views.new_media_public_opinion_qita,name='monitor-new-media-public-opinion-qita'),
#时效性监测
path('timeliness/monitoring/',views.timeliness_monitoring,name='monitor-timeliness-monitoring'),
#错别字监测
path('error/monitoring/',views.error_monitoring,name='monitor-error-monitoring'),
#敏感词监测
path('sensitive/word/monitoring/',views.sensitive_word_monitoring,name='monitor-sensitive-word-monitoring'),
#评论互动监测
path('comment/on/interactive/monitoring/',views.comment_on_interactive_monitoring,name='monitor-comment-on-interactive-monitoring'),
#监测报告
path('monitoring/report/',views.monitoring_report,name='monitor-monitoring-report')
] ]

View File

@ -100,3 +100,13 @@ def new_media_public_opinion_qita(request):
o['day'] = q.day o['day'] = q.day
res.append(o) res.append(o)
return render(request, 'monitor/new-media-public-opinion-qita.html', {'res':res,'qita':qita,'group':group}) return render(request, 'monitor/new-media-public-opinion-qita.html', {'res':res,'qita':qita,'group':group})
def timeliness_monitoring(request):
return render(request,'monitor/timeliness-monitoring.html')
def error_monitoring(request):
return render(request, 'monitor/error-monitoring.html')
def sensitive_word_monitoring(request):
return render(request,'monitor/sensitive-word-monitoring.html')
def comment_on_interactive_monitoring(request):
return render(request,'monitor/comment-on-interactive-monitoring.html')
def monitoring_report(request):
return render(request,'monitor/monitoring-report.html')