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 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>> analysisApp(Map<String,Object> reportParameter );
|
||||||
|
|
||||||
public List<Map<String,Object>> analysisYears();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,30 +11,39 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class ReportService extends JpaBaseService<JpaBaseDomain>{
|
public class ReportService extends JpaBaseService<JpaBaseDomain>{
|
||||||
|
|
||||||
|
public Integer analysisDay(String reportParameter) {
|
||||||
|
return getMapper().analysisDay(reportParameter);
|
||||||
|
};
|
||||||
|
|
||||||
public List<Map<String,Object>> analysisDay(String reportDate){
|
public Integer analysisNewUsers(String reportParameter) {
|
||||||
return getMapper().analysisDay(reportDate);
|
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){
|
public List<Map<String,Object>> analysisMonth(String reportParameter){
|
||||||
return getMapper().analysisMonth(reportDate);
|
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){
|
public List<Map<String,Object>> analysisApp(Map<String,Object> reportParameter){
|
||||||
return getMapper().analysisBrowser(reportDate);
|
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() {
|
public ReportService() {
|
||||||
|
|||||||
@ -1,66 +1,68 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!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" >
|
<mapper namespace="org.maxkey.dao.persistence.ReportMapper" >
|
||||||
|
<!-- DAY COUNT 一天访问量 -->
|
||||||
<select id="analysisDay" parameterType="String" resultType="Map">
|
<select id="analysisDay" parameterType="String" resultType="Integer">
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(ID) REPORTCOUNT, HOUR(LOGINTIME) REPORTHOUR
|
COUNT(ID) REPORTCOUNT
|
||||||
FROM SECDB.LOGIN_HISTORY
|
FROM history_login
|
||||||
WHERE
|
WHERE
|
||||||
DATE(LOGINTIME) = DATE(#{value})
|
DATE(LOGINTIME) =curdate()
|
||||||
GROUP BY REPORTHOUR
|
</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>
|
</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 id="analysisMonth" parameterType="String" resultType="Map">
|
||||||
SELECT
|
|
||||||
REPORTCOUNT,
|
|
||||||
REPORTYEAR,
|
|
||||||
REPORTMONTH,
|
|
||||||
REPORTDAY
|
|
||||||
FROM
|
|
||||||
REPORT_LOGIN_DAY
|
|
||||||
|
|
||||||
WHERE
|
|
||||||
REPORTYEAR=YEAR(#{value})
|
|
||||||
AND REPORTMONTH=MONTH(#{value})
|
|
||||||
|
|
||||||
ORDER BY REPORTYEAR ,REPORTMONTH,REPORTDAY
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="analysisYear" parameterType="Integer" resultType="Map">
|
|
||||||
SELECT
|
SELECT
|
||||||
REPORTCOUNT,
|
COUNT(ID) REPORTCOUNT, DATE(LOGINTIME) REPORTSTRING
|
||||||
REPORTYEAR,
|
FROM history_login
|
||||||
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
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="analysisBrowser" parameterType="Map" resultType="Map">
|
|
||||||
SELECT COUNT(ID)REPORTCOUNT,BROWSER
|
|
||||||
FROM LOGIN_HISTORY
|
|
||||||
WHERE
|
WHERE
|
||||||
LOGINTIME BETWEEN #{startDate} AND #{endDate}
|
DATE(LOGINTIME) >date_add(curdate(), interval - day(curdate()) -31 day)
|
||||||
GROUP BY BROWSER ORDER BY REPORTCOUNT DESC
|
GROUP BY REPORTSTRING
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 30天浏览器的访问统计 -->
|
||||||
|
<select id="analysisBrowser" parameterType="Map" resultType="Map">
|
||||||
|
SELECT
|
||||||
|
COUNT(ID) REPORTCOUNT, BROWSER REPORTSTRING
|
||||||
|
FROM history_login
|
||||||
|
WHERE
|
||||||
|
DATE(LOGINTIME) >date_add(curdate(), interval - day(curdate()) -31 day)
|
||||||
|
GROUP BY REPORTSTRING
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 30天应用单点登录的访问统计 -->
|
||||||
<select id="analysisApp" parameterType="Map" resultType="Map">
|
<select id="analysisApp" parameterType="Map" resultType="Map">
|
||||||
SELECT COUNT(ID) REPORTCOUNT,APPNAME
|
SELECT COUNT(ID) REPORTCOUNT,APPNAME
|
||||||
FROM LOGIN_APPS_HISTORY
|
FROM HISTORY_LOGIN_APPS
|
||||||
WHERE
|
WHERE
|
||||||
LOGINTIME BETWEEN #{startDate} AND #{endDate}
|
DATE(LOGINTIME) >date_add(curdate(), interval - day(curdate()) -31 day)
|
||||||
GROUP BY APPNAME ORDER BY REPORTCOUNT DESC
|
GROUP BY APPNAME ORDER BY REPORTCOUNT DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@ -7,8 +7,6 @@ import org.maxkey.dao.service.AccountsService;
|
|||||||
import org.maxkey.dao.service.AppsService;
|
import org.maxkey.dao.service.AppsService;
|
||||||
import org.maxkey.dao.service.UserInfoService;
|
import org.maxkey.dao.service.UserInfoService;
|
||||||
import org.maxkey.domain.Accounts;
|
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.WebContext;
|
||||||
import org.maxkey.web.message.Message;
|
import org.maxkey.web.message.Message;
|
||||||
import org.maxkey.web.message.MessageType;
|
import org.maxkey.web.message.MessageType;
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
package org.maxkey.web.endpoint;
|
package org.maxkey.web.endpoint;
|
||||||
|
|
||||||
|
import org.maxkey.dao.service.ReportService;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
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.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
@ -15,13 +18,24 @@ import org.springframework.web.servlet.ModelAndView;
|
|||||||
public class IndexEndpoint {
|
public class IndexEndpoint {
|
||||||
|
|
||||||
private static Logger _logger = LoggerFactory.getLogger(IndexEndpoint.class);
|
private static Logger _logger = LoggerFactory.getLogger(IndexEndpoint.class);
|
||||||
|
@Autowired
|
||||||
|
@Qualifier("reportService")
|
||||||
|
ReportService reportService;
|
||||||
|
|
||||||
@RequestMapping(value={"/main"})
|
@RequestMapping(value={"/main"})
|
||||||
public ModelAndView home() {
|
public ModelAndView home() {
|
||||||
_logger.debug("IndexController /main.");
|
_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={"/"})
|
@RequestMapping(value={"/"})
|
||||||
|
|||||||
@ -51,7 +51,18 @@ common.text.status.expired=\u8FC7\u671F
|
|||||||
common.text.status.delete=\u5220\u9664
|
common.text.status.delete=\u5220\u9664
|
||||||
common.text.description=\u63CF\u8FF0
|
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.valid=\u91CD\u65B0\u83B7\u53D6
|
||||||
login.text.login.twofactor.obtain=\u83B7\u53D6\u52A8\u6001\u9A8C\u8BC1\u7801
|
login.text.login.twofactor.obtain=\u83B7\u53D6\u52A8\u6001\u9A8C\u8BC1\u7801
|
||||||
login.text.login.twofactor.obtain.valid.unit=\u79D2
|
login.text.login.twofactor.obtain.valid.unit=\u79D2
|
||||||
|
|||||||
@ -9,7 +9,7 @@ global.text.copyright=CopyRight
|
|||||||
global.text.copyright.content=Copyright 2018-2020 shimingxy@163.com
|
global.text.copyright.content=Copyright 2018-2020 shimingxy@163.com
|
||||||
global.text.copyright.license=Licensed under the Apache License, Version 2.0
|
global.text.copyright.license=Licensed under the Apache License, Version 2.0
|
||||||
global.text.logout=Logout
|
global.text.logout=Logout
|
||||||
global.logout.tip=Tip
|
global.logout.tip=Logout Tip
|
||||||
global.logout.text.suffix=re-login
|
global.logout.text.suffix=re-login
|
||||||
global.logout.text.prefix=You have successfully logged out. Please close your browser or
|
global.logout.text.prefix=You have successfully logged out. Please close your browser or
|
||||||
login.session.timeout.tip=Login session timeout
|
login.session.timeout.tip=Login session timeout
|
||||||
@ -51,6 +51,19 @@ common.text.status.expired=expired
|
|||||||
common.text.status.delete=delete
|
common.text.status.delete=delete
|
||||||
common.text.description=description
|
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.valid=Regain
|
||||||
login.text.login.twofactor.obtain=Get dynamic verification code
|
login.text.login.twofactor.obtain=Get dynamic verification code
|
||||||
|
|||||||
@ -24,144 +24,174 @@
|
|||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
|
|
||||||
<div class="main-content">
|
<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="container-fluid">
|
||||||
|
<div class="row">
|
||||||
<div class="breadcrumb-wrapper row">
|
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||||
<div class="col-12 col-lg-3 col-md-6">
|
<div class="info-box bg-primary">
|
||||||
<h4 class="page-title"><@locale code="navs.home"/></h4>
|
<div class="icon-box">
|
||||||
</div>
|
<i class="lni-home"></i>
|
||||||
<div class="col-12 col-lg-9 col-md-6">
|
</div>
|
||||||
<ol class="breadcrumb float-right">
|
<div class="info-box-content">
|
||||||
<li><a href="<@base/>/main"><@locale code="navs.system"/></a></li>
|
<h4 class="number">${rptOnlineUsers}</h4>
|
||||||
<li class="active"> / <@locale code="navs.home"/></li>
|
<p class="info-text"><@locale code="main.rpt.onlineuser"/></p>
|
||||||
</ol>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||||
</div>
|
<div class="info-box bg-success">
|
||||||
<div class="container-fluid">
|
<div class="icon-box">
|
||||||
<div class="row">
|
<i class="lni-tag"></i>
|
||||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
</div>
|
||||||
<div class="info-box bg-primary">
|
<div class="info-box-content">
|
||||||
<div class="icon-box">
|
<h4 class="number">${rptDayCount}</h4>
|
||||||
<i class="lni-home"></i>
|
<p class="info-text"><@locale code="main.rpt.daycount"/></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-box-content">
|
</div>
|
||||||
<h4 class="number">1125</h4>
|
</div>
|
||||||
<p class="info-text">用户在线</p>
|
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||||
</div>
|
<div class="info-box bg-info">
|
||||||
</div>
|
<div class="icon-box">
|
||||||
</div>
|
<i class="lni-cart"></i>
|
||||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
</div>
|
||||||
<div class="info-box bg-success">
|
<div class="info-box-content">
|
||||||
<div class="icon-box">
|
<h4 class="number">${rptNewUsers}</h4>
|
||||||
<i class="lni-tag"></i>
|
<p class="info-text"><@locale code="main.rpt.newuser"/></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-box-content">
|
</div>
|
||||||
<h4 class="number">351</h4>
|
</div>
|
||||||
<p class="info-text">当天访问量</p>
|
<div class="col-lg-3 col-md-6 col-xs-12">
|
||||||
</div>
|
<div class="info-box bg-purple">
|
||||||
</div>
|
<div class="icon-box">
|
||||||
</div>
|
<i class="lni-wallet"></i>
|
||||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
</div>
|
||||||
<div class="info-box bg-info">
|
<div class="info-box-content">
|
||||||
<div class="icon-box">
|
<h4 class="number">${rptActiveUsers}</h4>
|
||||||
<i class="lni-cart"></i>
|
<p class="info-text"><@locale code="main.rpt.activeuser"/></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-box-content">
|
</div>
|
||||||
<h4 class="number">774</h4>
|
</div>
|
||||||
<p class="info-text">当月新用户</p>
|
</div>
|
||||||
</div>
|
<div class="row">
|
||||||
</div>
|
<div class="col-md-12">
|
||||||
</div>
|
<div class="card">
|
||||||
<div class="col-lg-3 col-md-6 col-xs-12">
|
<div class="card-header">
|
||||||
<div class="info-box bg-purple">
|
<h5 class="card-title"><@locale code="main.rpt.dayhour"/></h5>
|
||||||
<div class="icon-box">
|
<div class="float-right">
|
||||||
<i class="lni-wallet"></i>
|
<ul class="list-inline d-none d-sm-block">
|
||||||
</div>
|
<li><span class="status bg-primary"></span> <span
|
||||||
<div class="info-box-content">
|
class="text-semibold"></span></li>
|
||||||
<h4 class="number">49450</h4>
|
<li><span class="status bg-success"></span> <span
|
||||||
<p class="info-text">本月活跃用户</p>
|
class="text-semibold"></span></li>
|
||||||
</div>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="card-body">
|
||||||
<div class="row">
|
<div id="morris-line-example">
|
||||||
<div class="col-md-12">
|
<canvas id="canvasDayHour" style="height: 400px; width: 98%;"></canvas>
|
||||||
<div class="card">
|
</div>
|
||||||
<div class="card-header">
|
</div>
|
||||||
<h5 class="card-title">本月访问情况</h5>
|
</div>
|
||||||
<div class="float-right">
|
</div>
|
||||||
<ul class="list-inline d-none d-sm-block">
|
</div>
|
||||||
<li>
|
<div class="row">
|
||||||
<span class="status bg-primary"></span>
|
<div class="col-md-12">
|
||||||
<span class="text-semibold"></span>
|
<div class="card">
|
||||||
</li>
|
<div class="card-header">
|
||||||
<li>
|
<h5 class="card-title"><@locale code="main.rpt.month"/></h5>
|
||||||
<span class="status bg-success"></span>
|
<div class="float-right">
|
||||||
<span class="text-semibold"></span>
|
<ul class="list-inline d-none d-sm-block">
|
||||||
</li>
|
<li><span class="status bg-primary"></span> <span
|
||||||
</ul>
|
class="text-semibold"></span></li>
|
||||||
</div>
|
<li><span class="status bg-success"></span> <span
|
||||||
</div>
|
class="text-semibold"></span></li>
|
||||||
<div class="card-body">
|
</ul>
|
||||||
<div id="morris-line-example" >
|
</div>
|
||||||
<canvas id="canvas" style="height: 400px;width:98%;"></canvas>
|
</div>
|
||||||
</div>
|
<div class="card-body">
|
||||||
</div>
|
<div id="morris-line-example">
|
||||||
</div>
|
<canvas id="canvasMonth" style="height: 400px; width: 98%;"></canvas>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
</div>
|
||||||
var randomScalingFactor = function() {
|
</div>
|
||||||
return Math.ceil(Math.random() * 10.0) * Math.pow(10, Math.ceil(Math.random() * 5));
|
</div>
|
||||||
};
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
var config = {
|
<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',
|
type: 'line',
|
||||||
data: {
|
data: {
|
||||||
labels: ['1', '2', '3', '4', '5', '6', '7','8','9','10',
|
labels: [<#list rptMonth as month>'${month.REPORTSTRING}',</#list>],
|
||||||
'11','12','13','14','15','16','17','18','19','20',
|
|
||||||
'21','22','23','24','25','26','27','28','29','30','31'],
|
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label:"访问量",
|
label:'<@locale code="main.rpt.count"/>',
|
||||||
backgroundColor: 'rgb(75, 192, 192)',
|
backgroundColor: 'rgb(75, 192, 192)',
|
||||||
borderColor: 'rgb(75, 192, 192)',
|
borderColor: 'rgb(75, 192, 192)',
|
||||||
fill: false,
|
fill: false,
|
||||||
data: [
|
data: [<#list rptMonth as month>${month.REPORTCOUNT},</#list>],
|
||||||
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()
|
|
||||||
],
|
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
@ -181,10 +211,41 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
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: {
|
||||||
|
responsive: true,
|
||||||
|
title: {
|
||||||
|
display: true
|
||||||
|
//,text: '访问情况'
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
xAxes: [{
|
||||||
|
display: true,
|
||||||
|
}],
|
||||||
|
yAxes: [{
|
||||||
|
display: true,
|
||||||
|
type: 'logarithmic',
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var ctx = document.getElementById('canvas').getContext('2d');
|
var ctx = document.getElementById('canvasMonth').getContext('2d');
|
||||||
window.myLine = new Chart(ctx, config);
|
window.myLineMonth = new Chart(ctx, configMonth);
|
||||||
|
|
||||||
|
var ctxdh = document.getElementById('canvasDayHour').getContext('2d');
|
||||||
|
window.myLineDayHour = new Chart(ctxdh, configDayHour);
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user