mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-07 01:18:27 +08:00
MGT main report
This commit is contained in:
parent
3560ed92c1
commit
008793f46c
@ -16,17 +16,18 @@ import org.apache.mybatis.jpa.persistence.JpaBaseDomain;
|
||||
*/
|
||||
public interface ReportMapper extends IJpaBaseMapper<JpaBaseDomain> {
|
||||
|
||||
public List<Map<String,Object>> analysisDay(String reportDate);
|
||||
public Integer analysisDay(String reportParameter);
|
||||
public Integer analysisNewUsers(String reportParameter);
|
||||
public Integer analysisOnlineUsers(String reportParameter);
|
||||
public Integer analysisActiveUsers(String reportParameter);
|
||||
|
||||
public List<Map<String,Object>> analysisMonth(String reportDate);
|
||||
public List<Map<String,Object>> analysisDayHour(String reportParameter);
|
||||
|
||||
public List<Map<String,Object>> analysisYear(Integer reportYear);
|
||||
public List<Map<String,Object>> analysisMonth(String reportParameter);
|
||||
|
||||
public List<Map<String,Object>> analysisBrowser(Map<String,Object> reportDate);
|
||||
public List<Map<String,Object>> analysisBrowser(Map<String,Object> reportParameter);
|
||||
|
||||
public List<Map<String,Object>> analysisApp(Map<String,Object> reportDate);
|
||||
|
||||
public List<Map<String,Object>> analysisYears();
|
||||
public List<Map<String,Object>> analysisApp(Map<String,Object> reportParameter );
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -11,30 +11,39 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class ReportService extends JpaBaseService<JpaBaseDomain>{
|
||||
|
||||
public Integer analysisDay(String reportParameter) {
|
||||
return getMapper().analysisDay(reportParameter);
|
||||
};
|
||||
|
||||
public List<Map<String,Object>> analysisDay(String reportDate){
|
||||
return getMapper().analysisDay(reportDate);
|
||||
public Integer analysisNewUsers(String reportParameter) {
|
||||
return getMapper().analysisNewUsers(reportParameter);
|
||||
};
|
||||
|
||||
public Integer analysisOnlineUsers(String reportParameter) {
|
||||
return getMapper().analysisOnlineUsers(reportParameter);
|
||||
};
|
||||
|
||||
public Integer analysisActiveUsers(String reportParameter) {
|
||||
return getMapper().analysisActiveUsers(reportParameter);
|
||||
};
|
||||
|
||||
public List<Map<String,Object>> analysisDayHour(String reportParameter){
|
||||
return getMapper().analysisDayHour(reportParameter);
|
||||
}
|
||||
|
||||
public List<Map<String,Object>> analysisMonth(String reportDate){
|
||||
return getMapper().analysisMonth(reportDate);
|
||||
public List<Map<String,Object>> analysisMonth(String reportParameter){
|
||||
return getMapper().analysisMonth(reportParameter);
|
||||
}
|
||||
|
||||
public List<Map<String,Object>> analysisYear(Integer reportYear){
|
||||
return getMapper().analysisYear(reportYear);
|
||||
|
||||
public List<Map<String,Object>> analysisBrowser(Map<String,Object> reportParameter){
|
||||
return getMapper().analysisBrowser(reportParameter);
|
||||
}
|
||||
|
||||
public List<Map<String,Object>> analysisBrowser(Map<String,Object> reportDate){
|
||||
return getMapper().analysisBrowser(reportDate);
|
||||
public List<Map<String,Object>> analysisApp(Map<String,Object> reportParameter){
|
||||
return getMapper().analysisApp(reportParameter);
|
||||
}
|
||||
|
||||
public List<Map<String,Object>> analysisApp(Map<String,Object> reportDate){
|
||||
return getMapper().analysisApp(reportDate);
|
||||
}
|
||||
|
||||
public List<Map<String,Object>> analysisYears(){
|
||||
return getMapper().analysisYears();
|
||||
}
|
||||
|
||||
|
||||
public ReportService() {
|
||||
|
||||
@ -1,66 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.maxkey.dao.persistence.ReportMapper" >
|
||||
|
||||
<select id="analysisDay" parameterType="String" resultType="Map">
|
||||
<!-- DAY COUNT 一天访问量 -->
|
||||
<select id="analysisDay" parameterType="String" resultType="Integer">
|
||||
SELECT
|
||||
COUNT(ID) REPORTCOUNT, HOUR(LOGINTIME) REPORTHOUR
|
||||
FROM SECDB.LOGIN_HISTORY
|
||||
COUNT(ID) REPORTCOUNT
|
||||
FROM history_login
|
||||
WHERE
|
||||
DATE(LOGINTIME) = DATE(#{value})
|
||||
GROUP BY REPORTHOUR
|
||||
DATE(LOGINTIME) =curdate()
|
||||
</select>
|
||||
<!-- 本月新用户统计 -->
|
||||
<select id="analysisNewUsers" parameterType="String" resultType="Integer">
|
||||
SELECT COUNT(*) REPORTCOUNT FROM USERINFO
|
||||
WHERE
|
||||
last_day(CREATEDDATE) =last_day(curdate())
|
||||
</select>
|
||||
<!-- 在线用户统计 -->
|
||||
<select id="analysisOnlineUsers" parameterType="String" resultType="Integer">
|
||||
SELECT COUNT(*) REPORTCOUNT FROM USERINFO
|
||||
WHERE
|
||||
LASTLOGINTIME -LASTLOGOFFTIME
|
||||
</select>
|
||||
<!-- 30天活跃用户统计 -->
|
||||
<select id="analysisActiveUsers" parameterType="String" resultType="Integer">
|
||||
SELECT COUNT(*) REPORTCOUNT FROM USERINFO
|
||||
WHERE
|
||||
DATE(LASTLOGINTIME) >date_add(curdate(), interval - day(curdate()) -31 day)
|
||||
</select>
|
||||
|
||||
<!-- DAY HOUR COUNT 当天每小时 -->
|
||||
<select id="analysisDayHour" parameterType="String" resultType="Map">
|
||||
SELECT
|
||||
COUNT(ID) REPORTCOUNT, HOUR(LOGINTIME) REPORTSTRING
|
||||
FROM history_login
|
||||
WHERE
|
||||
DATE(LOGINTIME) =curdate()
|
||||
GROUP BY REPORTSTRING
|
||||
</select>
|
||||
<!-- 30 DAY COUNT 最近30天每天访问量-->
|
||||
<select id="analysisMonth" parameterType="String" resultType="Map">
|
||||
SELECT
|
||||
REPORTCOUNT,
|
||||
REPORTYEAR,
|
||||
REPORTMONTH,
|
||||
REPORTDAY
|
||||
FROM
|
||||
REPORT_LOGIN_DAY
|
||||
|
||||
COUNT(ID) REPORTCOUNT, DATE(LOGINTIME) REPORTSTRING
|
||||
FROM history_login
|
||||
WHERE
|
||||
REPORTYEAR=YEAR(#{value})
|
||||
AND REPORTMONTH=MONTH(#{value})
|
||||
|
||||
ORDER BY REPORTYEAR ,REPORTMONTH,REPORTDAY
|
||||
</select>
|
||||
|
||||
<select id="analysisYear" parameterType="Integer" resultType="Map">
|
||||
SELECT
|
||||
REPORTCOUNT,
|
||||
REPORTYEAR,
|
||||
REPORTMONTH
|
||||
FROM
|
||||
REPORT_LOGIN_MONTH
|
||||
WHERE
|
||||
REPORTYEAR=#{value}
|
||||
GROUP BY REPORTYEAR ,REPORTMONTH
|
||||
</select>
|
||||
|
||||
<select id="analysisYears" parameterType="Integer" resultType="Map">
|
||||
SELECT
|
||||
SUM(REPORTCOUNT) REPORTCOUNT,
|
||||
REPORTYEAR
|
||||
FROM
|
||||
REPORT_LOGIN_MONTH
|
||||
GROUP BY REPORTYEAR
|
||||
DATE(LOGINTIME) >date_add(curdate(), interval - day(curdate()) -31 day)
|
||||
GROUP BY REPORTSTRING
|
||||
</select>
|
||||
|
||||
<!-- 30天浏览器的访问统计 -->
|
||||
<select id="analysisBrowser" parameterType="Map" resultType="Map">
|
||||
SELECT COUNT(ID)REPORTCOUNT,BROWSER
|
||||
FROM LOGIN_HISTORY
|
||||
SELECT
|
||||
COUNT(ID) REPORTCOUNT, BROWSER REPORTSTRING
|
||||
FROM history_login
|
||||
WHERE
|
||||
LOGINTIME BETWEEN #{startDate} AND #{endDate}
|
||||
GROUP BY BROWSER ORDER BY REPORTCOUNT DESC
|
||||
DATE(LOGINTIME) >date_add(curdate(), interval - day(curdate()) -31 day)
|
||||
GROUP BY REPORTSTRING
|
||||
</select>
|
||||
|
||||
<!-- 30天应用单点登录的访问统计 -->
|
||||
<select id="analysisApp" parameterType="Map" resultType="Map">
|
||||
SELECT COUNT(ID) REPORTCOUNT,APPNAME
|
||||
FROM LOGIN_APPS_HISTORY
|
||||
FROM HISTORY_LOGIN_APPS
|
||||
WHERE
|
||||
LOGINTIME BETWEEN #{startDate} AND #{endDate}
|
||||
DATE(LOGINTIME) >date_add(curdate(), interval - day(curdate()) -31 day)
|
||||
GROUP BY APPNAME ORDER BY REPORTCOUNT DESC
|
||||
</select>
|
||||
|
||||
|
||||
@ -7,8 +7,6 @@ import org.maxkey.dao.service.AccountsService;
|
||||
import org.maxkey.dao.service.AppsService;
|
||||
import org.maxkey.dao.service.UserInfoService;
|
||||
import org.maxkey.domain.Accounts;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
import org.maxkey.domain.apps.Apps;
|
||||
import org.maxkey.web.WebContext;
|
||||
import org.maxkey.web.message.Message;
|
||||
import org.maxkey.web.message.MessageType;
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package org.maxkey.web.endpoint;
|
||||
|
||||
import org.maxkey.dao.service.ReportService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
@ -15,13 +18,24 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
public class IndexEndpoint {
|
||||
|
||||
private static Logger _logger = LoggerFactory.getLogger(IndexEndpoint.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("reportService")
|
||||
ReportService reportService;
|
||||
|
||||
@RequestMapping(value={"/main"})
|
||||
public ModelAndView home() {
|
||||
_logger.debug("IndexController /main.");
|
||||
ModelAndView mainMView=new ModelAndView("main");
|
||||
mainMView.addObject("rptDayCount", reportService.analysisDay(""));
|
||||
mainMView.addObject("rptNewUsers", reportService.analysisNewUsers(""));
|
||||
mainMView.addObject("rptOnlineUsers", reportService.analysisOnlineUsers(""));
|
||||
mainMView.addObject("rptActiveUsers", reportService.analysisActiveUsers(""));
|
||||
|
||||
return new ModelAndView("main");
|
||||
mainMView.addObject("rptMonth", reportService.analysisMonth(""));
|
||||
mainMView.addObject("rptDayHour", reportService.analysisDayHour(""));
|
||||
mainMView.addObject("rptBrowser", reportService.analysisBrowser(null));
|
||||
mainMView.addObject("rptApp", reportService.analysisApp(null));
|
||||
return mainMView;
|
||||
}
|
||||
|
||||
@RequestMapping(value={"/"})
|
||||
|
||||
@ -51,6 +51,17 @@ common.text.status.expired=\u8FC7\u671F
|
||||
common.text.status.delete=\u5220\u9664
|
||||
common.text.description=\u63CF\u8FF0
|
||||
|
||||
main.rpt.newuser=\u5F53\u6708\u65B0\u7528\u6237
|
||||
main.rpt.activeuser=\u672C\u6708\u6D3B\u8DC3\u7528\u6237
|
||||
main.rpt.onlineuser=\u7528\u6237\u5728\u7EBF
|
||||
main.rpt.daycount=\u5F53\u5929\u8BBF\u95EE\u91CF
|
||||
main.rpt.dayhour=\u5F53\u5929\u8BBF\u95EE\u60C5\u51B5
|
||||
main.rpt.month=30\u5929\u8BBF\u95EE\u60C5\u51B5
|
||||
main.rpt.count=\u8BBF\u95EE\u91CF
|
||||
main.rpt.appaccess=30\u5929\u5E94\u7528\u8BBF\u95EE\u7EDF\u8BA1
|
||||
main.rpt.app=\u5E94\u7528\u540D\u79F0
|
||||
main.rpt.browseraccess=30\u5929\u6D4F\u89C8\u5668\u7EDF\u8BA1
|
||||
main.rpt.browser=\u6D4F\u89C8\u5668
|
||||
|
||||
login.text.login.twofactor.obtain.valid=\u91CD\u65B0\u83B7\u53D6
|
||||
login.text.login.twofactor.obtain=\u83B7\u53D6\u52A8\u6001\u9A8C\u8BC1\u7801
|
||||
|
||||
@ -9,7 +9,7 @@ global.text.copyright=CopyRight
|
||||
global.text.copyright.content=Copyright 2018-2020 shimingxy@163.com
|
||||
global.text.copyright.license=Licensed under the Apache License, Version 2.0
|
||||
global.text.logout=Logout
|
||||
global.logout.tip=Tip
|
||||
global.logout.tip=Logout Tip
|
||||
global.logout.text.suffix=re-login
|
||||
global.logout.text.prefix=You have successfully logged out. Please close your browser or
|
||||
login.session.timeout.tip=Login session timeout
|
||||
@ -52,6 +52,19 @@ common.text.status.delete=delete
|
||||
common.text.description=description
|
||||
|
||||
|
||||
main.rpt.newuser=New Users/Month
|
||||
main.rpt.activeuser=Active Users/Month
|
||||
main.rpt.onlineuser=Online Users
|
||||
main.rpt.daycount=Day Login Count
|
||||
main.rpt.dayhour=Day Login Per Hour
|
||||
main.rpt.month=Last 30 days Login Count
|
||||
main.rpt.count=Count
|
||||
main.rpt.appaccess=Last 30 days Apps Login Count
|
||||
main.rpt.app=AppName
|
||||
main.rpt.browseraccess=Last 30 days Browser Count
|
||||
main.rpt.browser=Browser
|
||||
|
||||
|
||||
login.text.login.twofactor.obtain.valid=Regain
|
||||
login.text.login.twofactor.obtain=Get dynamic verification code
|
||||
login.text.login.twofactor.obtain.valid.unit=seconds
|
||||
|
||||
@ -24,144 +24,203 @@
|
||||
<div class="page-container">
|
||||
|
||||
<div class="main-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="breadcrumb-wrapper row">
|
||||
<div class="col-12 col-lg-3 col-md-6">
|
||||
<h4 class="page-title"><@locale code="navs.home"/></h4>
|
||||
</div>
|
||||
<div class="col-12 col-lg-9 col-md-6">
|
||||
<ol class="breadcrumb float-right">
|
||||
<li><a href="<@base/>/main"><@locale
|
||||
code="navs.system"/></a></li>
|
||||
<li class="active">/ <@locale code="navs.home"/></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="breadcrumb-wrapper row">
|
||||
<div class="col-12 col-lg-3 col-md-6">
|
||||
<h4 class="page-title"><@locale code="navs.home"/></h4>
|
||||
</div>
|
||||
<div class="col-12 col-lg-9 col-md-6">
|
||||
<ol class="breadcrumb float-right">
|
||||
<li><a href="<@base/>/main"><@locale code="navs.system"/></a></li>
|
||||
<li class="active"> / <@locale code="navs.home"/></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||
<div class="info-box bg-primary">
|
||||
<div class="icon-box">
|
||||
<i class="lni-home"></i>
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">1125</h4>
|
||||
<p class="info-text">用户在线</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||
<div class="info-box bg-success">
|
||||
<div class="icon-box">
|
||||
<i class="lni-tag"></i>
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">351</h4>
|
||||
<p class="info-text">当天访问量</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||
<div class="info-box bg-info">
|
||||
<div class="icon-box">
|
||||
<i class="lni-cart"></i>
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">774</h4>
|
||||
<p class="info-text">当月新用户</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||
<div class="info-box bg-purple">
|
||||
<div class="icon-box">
|
||||
<i class="lni-wallet"></i>
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">49450</h4>
|
||||
<p class="info-text">本月活跃用户</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">本月访问情况</h5>
|
||||
<div class="float-right">
|
||||
<ul class="list-inline d-none d-sm-block">
|
||||
<li>
|
||||
<span class="status bg-primary"></span>
|
||||
<span class="text-semibold"></span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="status bg-success"></span>
|
||||
<span class="text-semibold"></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="morris-line-example" >
|
||||
<canvas id="canvas" style="height: 400px;width:98%;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var randomScalingFactor = function() {
|
||||
return Math.ceil(Math.random() * 10.0) * Math.pow(10, Math.ceil(Math.random() * 5));
|
||||
};
|
||||
|
||||
var config = {
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||
<div class="info-box bg-primary">
|
||||
<div class="icon-box">
|
||||
<i class="lni-home"></i>
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">${rptOnlineUsers}</h4>
|
||||
<p class="info-text"><@locale code="main.rpt.onlineuser"/></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||
<div class="info-box bg-success">
|
||||
<div class="icon-box">
|
||||
<i class="lni-tag"></i>
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">${rptDayCount}</h4>
|
||||
<p class="info-text"><@locale code="main.rpt.daycount"/></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||
<div class="info-box bg-info">
|
||||
<div class="icon-box">
|
||||
<i class="lni-cart"></i>
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">${rptNewUsers}</h4>
|
||||
<p class="info-text"><@locale code="main.rpt.newuser"/></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||
<div class="info-box bg-purple">
|
||||
<div class="icon-box">
|
||||
<i class="lni-wallet"></i>
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">${rptActiveUsers}</h4>
|
||||
<p class="info-text"><@locale code="main.rpt.activeuser"/></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><@locale code="main.rpt.dayhour"/></h5>
|
||||
<div class="float-right">
|
||||
<ul class="list-inline d-none d-sm-block">
|
||||
<li><span class="status bg-primary"></span> <span
|
||||
class="text-semibold"></span></li>
|
||||
<li><span class="status bg-success"></span> <span
|
||||
class="text-semibold"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="morris-line-example">
|
||||
<canvas id="canvasDayHour" style="height: 400px; width: 98%;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><@locale code="main.rpt.month"/></h5>
|
||||
<div class="float-right">
|
||||
<ul class="list-inline d-none d-sm-block">
|
||||
<li><span class="status bg-primary"></span> <span
|
||||
class="text-semibold"></span></li>
|
||||
<li><span class="status bg-success"></span> <span
|
||||
class="text-semibold"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="morris-line-example">
|
||||
<canvas id="canvasMonth" style="height: 400px; width: 98%;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><@locale code="main.rpt.appaccess"/></h5>
|
||||
<div class="float-right">
|
||||
<ul class="list-inline d-none d-sm-block">
|
||||
<li><span class="status bg-primary"></span> <span
|
||||
class="text-semibold"></span></li>
|
||||
<li><span class="status bg-success"></span> <span
|
||||
class="text-semibold"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="morris-line-example">
|
||||
<table class="table table-bordered" >
|
||||
<tr><td><@locale code="main.rpt.app"/></td><td><@locale code="main.rpt.count"/></td></tr>
|
||||
<#list rptApp as apps><tr><td>${apps.APPNAME}</td><td>${apps.REPORTCOUNT}</td></tr></#list>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><@locale code="main.rpt.browseraccess"/></h5>
|
||||
<div class="float-right">
|
||||
<ul class="list-inline d-none d-sm-block">
|
||||
<li><span class="status bg-primary"></span> <span
|
||||
class="text-semibold"></span></li>
|
||||
<li><span class="status bg-success"></span> <span
|
||||
class="text-semibold"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="morris-line-example">
|
||||
<table class="table table-bordered" >
|
||||
<tr><td><@locale code="main.rpt.browser"/></td><td><@locale code="main.rpt.count"/></td></tr>
|
||||
<#list rptBrowser as browser><tr><td>${browser.REPORTSTRING}</td><td>${browser.REPORTCOUNT}</td></tr></#list>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var configMonth = {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ['1', '2', '3', '4', '5', '6', '7','8','9','10',
|
||||
'11','12','13','14','15','16','17','18','19','20',
|
||||
'21','22','23','24','25','26','27','28','29','30','31'],
|
||||
labels: [<#list rptMonth as month>'${month.REPORTSTRING}',</#list>],
|
||||
datasets: [{
|
||||
label:"访问量",
|
||||
label:'<@locale code="main.rpt.count"/>',
|
||||
backgroundColor: 'rgb(75, 192, 192)',
|
||||
borderColor: 'rgb(75, 192, 192)',
|
||||
fill: false,
|
||||
data: [
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor()
|
||||
],
|
||||
data: [<#list rptMonth as month>${month.REPORTCOUNT},</#list>],
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
title: {
|
||||
display: true
|
||||
//,text: '访问情况'
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
display: true,
|
||||
}],
|
||||
yAxes: [{
|
||||
display: true,
|
||||
type: 'logarithmic',
|
||||
}]
|
||||
}
|
||||
}
|
||||
};
|
||||
var configDayHour = {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: [<#list rptDayHour as dayHour>'${dayHour.REPORTSTRING}',</#list>],
|
||||
datasets: [{
|
||||
label:'<@locale code="main.rpt.count"/>',
|
||||
backgroundColor: 'rgb(178 ,34, 34)',
|
||||
borderColor: 'rgb(178 ,34, 34)',
|
||||
fill: false,
|
||||
data: [<#list rptDayHour as dayHour>${dayHour.REPORTCOUNT},</#list>],
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
@ -181,10 +240,12 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
window.onload = function() {
|
||||
var ctx = document.getElementById('canvas').getContext('2d');
|
||||
window.myLine = new Chart(ctx, config);
|
||||
var ctx = document.getElementById('canvasMonth').getContext('2d');
|
||||
window.myLineMonth = new Chart(ctx, configMonth);
|
||||
|
||||
var ctxdh = document.getElementById('canvasDayHour').getContext('2d');
|
||||
window.myLineDayHour = new Chart(ctxdh, configDayHour);
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user