diff --git a/blog-admin/src/main/resources/static/assets/js/zhyd.echarts.js b/blog-admin/src/main/resources/static/assets/js/zhyd.echarts.js index 48091d00f9b5412b857ebdcc20c4b9141d6f1d7a..5f022e0eee1e43bd0ecc2d3ec5336c4738abadcf 100644 --- a/blog-admin/src/main/resources/static/assets/js/zhyd.echarts.js +++ b/blog-admin/src/main/resources/static/assets/js/zhyd.echarts.js @@ -5,7 +5,450 @@ * @since 1.0 */ var zhyd = window.zhyd || {}; + +//扩展echart图表样式 zhyd.chartConfig = { + + "color": [ + "#5470c6", + "#91cc75", + "#fac858", + "#ee6666", + "#73c0de", + "#3ba272", + "#fc8452", + "#9a60b4", + "#ea7ccc", + "#60c0dd", + "#d7504b", + "#c6e579", + "#f4e001", + "#f0805a", + "#26c0c0" + ], + "backgroundColor": "rgba(254,248,239,1)", + "textStyle": {}, + "title": { + "textStyle": { + "color": "#27727b" + }, + "subtextStyle": { + "color": "#aaaaaa" + } + }, + "line": { + "itemStyle": { + "borderWidth": 1 + }, + "lineStyle": { + "width": "3" + }, + "symbolSize": "5", + "symbol": "emptyCircle", + "smooth": false + }, + "radar": { + "itemStyle": { + "borderWidth": 1 + }, + "lineStyle": { + "width": "3" + }, + "symbolSize": "5", + "symbol": "emptyCircle", + "smooth": false + }, + "bar": { + "itemStyle": { + "barBorderWidth": 0, + "barBorderColor": "#ccc" + } + }, + "pie": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "scatter": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "boxplot": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "parallel": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "sankey": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "funnel": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "gauge": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + } + }, + "candlestick": { + "itemStyle": { + "color": "#c1232b", + "color0": "#b5c334", + "borderColor": "#c1232b", + "borderColor0": "#b5c334", + "borderWidth": 1 + } + }, + "graph": { + "itemStyle": { + "borderWidth": 0, + "borderColor": "#ccc" + }, + "lineStyle": { + "width": 1, + "color": "#aaaaaa" + }, + "symbolSize": "5", + "symbol": "emptyCircle", + "smooth": false, + "color": [ + "#c1232b", + "#27727b", + "#fcce10", + "#e87c25", + "#b5c334", + "#fe8463", + "#9bca63", + "#fad860", + "#f3a43b", + "#60c0dd", + "#d7504b", + "#c6e579", + "#f4e001", + "#f0805a", + "#26c0c0" + ], + "label": { + "color": "#eeeeee" + } + }, + "map": { + "itemStyle": { + "normal": { + "areaColor": "#dddddd", + "borderColor": "#eeeeee", + "borderWidth": 0.5 + }, + "emphasis": { + "areaColor": "#fe994e", + "borderColor": "#444", + "borderWidth": 1 + } + }, + "label": { + "normal": { + "textStyle": { + "color": "#c1232b" + } + }, + "emphasis": { + "textStyle": { + "color": "rgb(100,0,0)" + } + } + } + }, + "geo": { + "itemStyle": { + "normal": { + "areaColor": "#dddddd", + "borderColor": "#eeeeee", + "borderWidth": 0.5 + }, + "emphasis": { + "areaColor": "#fe994e", + "borderColor": "#444", + "borderWidth": 1 + } + }, + "label": { + "normal": { + "textStyle": { + "color": "#c1232b" + } + }, + "emphasis": { + "textStyle": { + "color": "rgb(100,0,0)" + } + } + } + }, + "categoryAxis": { + "axisLine": { + "show": true, + "lineStyle": { + "color": "#27727b" + } + }, + "axisTick": { + "show": true, + "lineStyle": { + "color": "#27727b" + } + }, + "axisLabel": { + "show": true, + "textStyle": { + "color": "#333" + } + }, + "splitLine": { + "show": false, + "lineStyle": { + "color": [ + "#ccc" + ] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": [ + "rgba(250,250,250,0.3)", + "rgba(200,200,200,0.3)" + ] + } + } + }, + "valueAxis": { + "axisLine": { + "show": false, + "lineStyle": { + "color": "#333" + } + }, + "axisTick": { + "show": false, + "lineStyle": { + "color": "#333" + } + }, + "axisLabel": { + "show": true, + "textStyle": { + "color": "#333" + } + }, + "splitLine": { + "show": true, + "lineStyle": { + "color": [ + "#ccc" + ] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": [ + "rgba(250,250,250,0.3)", + "rgba(200,200,200,0.3)" + ] + } + } + }, + "logAxis": { + "axisLine": { + "show": true, + "lineStyle": { + "color": "#27727b" + } + }, + "axisTick": { + "show": true, + "lineStyle": { + "color": "#333" + } + }, + "axisLabel": { + "show": true, + "textStyle": { + "color": "#333" + } + }, + "splitLine": { + "show": true, + "lineStyle": { + "color": [ + "#ccc" + ] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": [ + "rgba(250,250,250,0.3)", + "rgba(200,200,200,0.3)" + ] + } + } + }, + "timeAxis": { + "axisLine": { + "show": true, + "lineStyle": { + "color": "#27727b" + } + }, + "axisTick": { + "show": true, + "lineStyle": { + "color": "#333" + } + }, + "axisLabel": { + "show": true, + "textStyle": { + "color": "#333" + } + }, + "splitLine": { + "show": true, + "lineStyle": { + "color": [ + "#ccc" + ] + } + }, + "splitArea": { + "show": false, + "areaStyle": { + "color": [ + "rgba(250,250,250,0.3)", + "rgba(200,200,200,0.3)" + ] + } + } + }, + "toolbox": { + "iconStyle": { + "normal": { + "borderColor": "#c1232b" + }, + "emphasis": { + "borderColor": "#e87c25" + } + } + }, + "legend": { + "textStyle": { + "color": "#333333" + } + }, + "tooltip": { + "axisPointer": { + "lineStyle": { + "color": "#27727b", + "width": 1 + }, + "crossStyle": { + "color": "#27727b", + "width": 1 + } + } + }, + "timeline": { + "lineStyle": { + "color": "#293c55", + "width": 1 + }, + "itemStyle": { + "normal": { + "color": "#27727b", + "borderWidth": 1 + }, + "emphasis": { + "color": "#72d4e0" + } + }, + "controlStyle": { + "normal": { + "color": "#27727b", + "borderColor": "#27727b", + "borderWidth": 0.5 + }, + "emphasis": { + "color": "#27727b", + "borderColor": "#27727b", + "borderWidth": 0.5 + } + }, + "checkpointStyle": { + "color": "#c1232b", + "borderColor": "#c23531" + }, + "label": { + "normal": { + "textStyle": { + "color": "#293c55" + } + }, + "emphasis": { + "textStyle": { + "color": "#293c55" + } + } + } + }, + "visualMap": { + "color": [ + "#c1232b", + "#fcce10" + ] + }, + "dataZoom": { + "backgroundColor": "rgba(0,0,0,0)", + "dataBackgroundColor": "rgba(181,195,52,0.3)", + "fillerColor": "rgba(181,195,52,0.2)", + "handleColor": "#27727b", + "handleSize": "100%", + "textStyle": { + "color": "#999999" + } + }, + "markPoint": { + "label": { + "color": "#eeeeee" + }, + "emphasis": { + "label": { + "color": "#eeeeee" + } + } + } +} + + +/*初始化数据,这是原来的*/ +/*zhyd.chartConfig = { color: ["#26B99A", "#34495E", "#BDC3C7", "#3498DB", "#9B59B6", "#8abb6f", "#759c6a", "#bfd3b7"], title: { itemGap: 8, @@ -208,7 +651,7 @@ zhyd.chartConfig = { textStyle: { fontFamily: "Arial, Verdana, sans-serif" } - }; + };*/ zhyd.createChart = function (options) { var op = $.extend({ id: '', diff --git a/blog-admin/src/main/resources/templates/config.ftl b/blog-admin/src/main/resources/templates/config.ftl index fad3fb73ecad412a3b280c2b04f89c2266431a76..e73b8c53a4c4a9007931ff90fdad2328a12517c5 100644 --- a/blog-admin/src/main/resources/templates/config.ftl +++ b/blog-admin/src/main/resources/templates/config.ftl @@ -605,6 +605,12 @@ +
+ +
+ +
+
diff --git a/blog-admin/src/main/resources/templates/index.ftl b/blog-admin/src/main/resources/templates/index.ftl index 8e6b60374d86544c377a4f3eaf12576d9a2b41de..e68366cbb61a04e964dc0cafe812a9a7f44009cb 100644 --- a/blog-admin/src/main/resources/templates/index.ftl +++ b/blog-admin/src/main/resources/templates/index.ftl @@ -72,44 +72,67 @@
<#-- 文章 --> -
+
-
-
+
+

文章

<#-- 标签 --> - <#-- 网站首页的项目介绍内容 --> -<@aboutOneBlog> +<#--<@aboutOneBlog>--> <@footer> @@ -267,34 +290,75 @@ /* 顶部卡片统计 */ $.post("/statistics/siteInfo", function (json) { $.alert.ajaxSuccess(json); - if(json.status == 200){ + if (json.status == 200) { + //给隐藏域里面设置访问量,好让点击的时候能看到具体的数字,心理有个数 + var $this = $(".statistics-lookCount"); var jsonData = json.data; + var jsonKey = $this.data("key"); + $("#fangwen_inp").val(jsonData[jsonKey]); + + //end function setValue(dom, value) { var $dom = dom; $dom.find("div.tile-stats .count").text(value); + } - $(".statistics-tag, .statistics-type, .statistics-comment, .statistics-article").each(function () { + $(".statistics-tag, .statistics-type, .statistics-comment, .statistics-article, .statistics-lookCount, .statistics-zanCount").each(function () { var $this = $(this); var jsonKey = $this.data("key"); setValue($this, jsonData[jsonKey]); }); } + //设置显示数字格式,k或者w + $(function () { + var num = $("#l_count_mxx").text(); + + // var num = 1209; + //点击显示访问量 + $("#fangwen").click(function () { + layui.use('layer', function () { + var layer = layui.layer; + layer.msg("总访问量是:" + $("#fangwen_inp").val(), { + time: 2000 //20s后自动关闭 + + }); + }); + }); + //转换数字格式,k或者w + if (num >= 10000) { + num = Math.round(num / 1000) / 10 + 'W'; + + } else if (num >= 1000) { + num = Math.round(num / 100) / 10 + 'K'; + } + $("#l_count_mxx").text(num); + //点击显示详细的 + + + }); + }); + + /* 分类文章数统计 */ $.post("/statistics/listType", function (json) { $.alert.ajaxSuccess(json); - if(json.status == 200){ + if (json.status == 200) { var jsonData = json.data; - zhyd.createChart({id:'echart_type', legendData: getNames(jsonData, 'name'), series:{name:'分类文章数统计', type: 'pie', seriesData: jsonData}}); + zhyd.createChart({ + id: 'echart_type', + legendData: getNames(jsonData, 'name'), + series: {name: '分类文章数统计', type: 'pie', seriesData: jsonData} + }); } }); /* 爬虫访问统计 */ $.post("/statistics/listSpider", function (json) { $.alert.ajaxSuccess(json); - if(json.status == 200){ + if (json.status == 200) { var jsonData = json.data || [{name: '暂无', value: 0}]; zhyd.createChart({id:'echart_spider', legendData: getNames(jsonData, 'name'), series:{name:'爬虫访问统计', type: 'pie', seriesData: jsonData}}); } @@ -309,6 +373,10 @@ }); return resultArr; } + init_echarts(); + $("#noticeModal").modal('show'); + + diff --git a/blog-admin/src/main/resources/templates/layout/footer.ftl b/blog-admin/src/main/resources/templates/layout/footer.ftl index e0f86ac10c62f6252a911e4326a9a2b98ec240af..dd32e3683df29de883a5b614d0b2cef825fa8f7e 100644 --- a/blog-admin/src/main/resources/templates/layout/footer.ftl +++ b/blog-admin/src/main/resources/templates/layout/footer.ftl @@ -27,6 +27,7 @@ + <#-- diff --git a/blog-core/src/main/java/com/zyd/blog/business/enums/ConfigKeyEnum.java b/blog-core/src/main/java/com/zyd/blog/business/enums/ConfigKeyEnum.java index 3c4772893ecd13820b40a37c0ba89403e900a6f5..c5c6170d10635d2da71f1ac7587354f6c32c4d55 100644 --- a/blog-core/src/main/java/com/zyd/blog/business/enums/ConfigKeyEnum.java +++ b/blog-core/src/main/java/com/zyd/blog/business/enums/ConfigKeyEnum.java @@ -231,6 +231,11 @@ public enum ConfigKeyEnum { * 自定义“js”脚本内容 */ CUSTOM_JS("customJs"), + + /** + * 自定义“CSS”内容 + */ + CUSTOM_CSS("customCss"), ; private final String key; diff --git a/blog-core/src/main/resources/config/application-center-dev.yml b/blog-core/src/main/resources/config/application-center-dev.yml index d21702be4adadbc6a5dbef908aa994fe0942c1dc..b5e7a173612d3bf5bfe2aea728afc8ac6fcc260f 100644 --- a/blog-core/src/main/resources/config/application-center-dev.yml +++ b/blog-core/src/main/resources/config/application-center-dev.yml @@ -8,7 +8,7 @@ spring: driver-class-name: com.mysql.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource url: jdbc:mysql://localhost:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true - username: root + username: dblog password: root ####### Redis Config ####### redis: @@ -18,7 +18,7 @@ spring: # Redis服务器连接端口 port: 6379 # Redis服务器连接密码(默认为空) - password: qwe!@#123 + password: ####### redis缓存服务配置 ####### session: diff --git a/blog-core/src/main/resources/mybatis/SysConfigMapper.xml b/blog-core/src/main/resources/mybatis/SysConfigMapper.xml index 2ca408ac2cc1cff11343329ca118406e78b8d129..3677ae383f25fc74bd8b9611dca10817bf7179f6 100644 --- a/blog-core/src/main/resources/mybatis/SysConfigMapper.xml +++ b/blog-core/src/main/resources/mybatis/SysConfigMapper.xml @@ -4,7 +4,7 @@ diff --git a/blog-core/src/main/resources/rebel.xml b/blog-core/src/main/resources/rebel.xml new file mode 100644 index 0000000000000000000000000000000000000000..152c318f1660cfc6b45ca2e480fe63868abc3ce0 --- /dev/null +++ b/blog-core/src/main/resources/rebel.xml @@ -0,0 +1,16 @@ + + + + + + blog-core + + + + + + + diff --git a/blog-file/src/main/resources/rebel.xml b/blog-file/src/main/resources/rebel.xml new file mode 100644 index 0000000000000000000000000000000000000000..294c2c2140ad392f9b0750c1c4d7d5e183f95907 --- /dev/null +++ b/blog-file/src/main/resources/rebel.xml @@ -0,0 +1,16 @@ + + + + + + blog-file + + + + + + + diff --git a/blog-web/src/main/resources/templates/include/macros.ftl b/blog-web/src/main/resources/templates/include/macros.ftl index b1c68777099a18ae338b881ce56e87ea3fcb2952..7568a799ee1518ceed9daee776dd26a0b055c45a 100644 --- a/blog-web/src/main/resources/templates/include/macros.ftl +++ b/blog-web/src/main/resources/templates/include/macros.ftl @@ -29,6 +29,10 @@ <#nested> + + <#include "/layout/header.ftl"/>