add-baidu-stat
This commit is contained in:
@@ -100,10 +100,11 @@ https://gitee.com/bnu_mixly/mixio-linux-x86-dist/blob/darwin/mixio
|
||||
15. OFFLINE_MODE - bool,是否禁用天气/地图数据,默认为true
|
||||
16. BAIDU_MAP_AK - string,百度地图客户端应用AK(OFFLINE_MODE=false时必须配置),默认为""
|
||||
17. BAIDU_MAP_SERVER_AK - string,百度地图服务端应用AK(OFFLINE_MODE=false时必须配置),默认为""
|
||||
18. ADMIN_USERNAME - string,管理后台用户名,默认为"admin"
|
||||
19. ADMIN_PASSWORD - string,管理后台密码,默认为"public"
|
||||
20. STORAGE_ENGINE - string,数据库引擎,默认为"sqlite"
|
||||
21. MYSQL_HOST - string,MySQL地址(STORAGE_ENGINE="mysql"时必须配置),默认为"localhost"
|
||||
18. BAIDU_STAT_LINK - string, 百度统计链接,通常以"https://hm.baidu.com/hm.js?"开头
|
||||
19. ADMIN_USERNAME - string,管理后台用户名,默认为"admin"
|
||||
20. ADMIN_PASSWORD - string,管理后台密码,默认为"public"
|
||||
21. STORAGE_ENGINE - string,数据库引擎,默认为"sqlite"
|
||||
22. MYSQL_HOST - string,MySQL地址(STORAGE_ENGINE="mysql"时必须配置),默认为"localhost"
|
||||
23. MYSQL_PORT - int,MySQL地址(STORAGE_ENGINE="mysql"时必须配置),默认为3306
|
||||
24. MYSQL_USER - string,MySQL用户名(STORAGE_ENGINE="mysql"时必须配置),默认为""
|
||||
25. MYSQL_PASS - string,MySQL密码(STORAGE_ENGINE="mysql"时必须配置),默认为""
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<script src="js/lang.js?v=5"></script>
|
||||
<script src="js/tools.js?v=10"></script>
|
||||
<script src="js/login.js?v=22"></script>
|
||||
<script src="<%=configs["BAIDU_STAT_LINK"]%>"></script>
|
||||
</head>
|
||||
|
||||
<body id="body" class="bg-gradient-light" style="height:100vh">
|
||||
|
||||
@@ -258,6 +258,14 @@
|
||||
<input type="text" id="BAIDU_MAP_SERVER_AK">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span>百度统计链接AK:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="BAIDU_STAT_LINK">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button class="btn btn-lg btn-success" style="margin-top:20px;" onclick="saveAndRestart()" id="saveAndRestart"><i class="fa fa-check"></i> 保存设置并重新启动</button>
|
||||
</div>
|
||||
@@ -354,6 +362,7 @@
|
||||
var OFFLINE_MODE = <%=configs["OFFLINE_MODE"]%>
|
||||
var BAIDU_MAP_AK = "<%=configs["BAIDU_MAP_AK"]%>"
|
||||
var BAIDU_MAP_SERVER_AK = "<%=configs["BAIDU_MAP_SERVER_AK"]%>"
|
||||
var BAIDU_STAT_LINK = "<%=configs["BAIDU_STAT_LINK"]%>"
|
||||
var ADMIN_USERNAME = "<%=configs["ADMIN_USERNAME"]%>"
|
||||
var ADMIN_PASSWORD = "<%=configs["ADMIN_PASSWORD"]%>"
|
||||
$("#OFFLINE_MODE").bind('change',function(){
|
||||
@@ -386,6 +395,7 @@
|
||||
$("#MAX_MESSAGE_PER_SECOND").val(MAX_MESSAGE_PER_SECOND)
|
||||
$("#ADMIN_USERNAME").val(ADMIN_USERNAME)
|
||||
$("#ADMIN_PASSWORD").val(ADMIN_PASSWORD)
|
||||
$("#BAIDU_STAT_LINK").val(BAIDU_STAT_LINK)
|
||||
if($("#OFFLINE_MODE").prop("checked"))
|
||||
{
|
||||
$("#BAIDU_MAP_AK").attr("disabled","true")
|
||||
@@ -420,6 +430,7 @@
|
||||
configs["BAIDU_MAP_SERVER_AK"] = $("#BAIDU_MAP_SERVER_AK").val()
|
||||
configs["ADMIN_USERNAME"] = $("#ADMIN_USERNAME").val()
|
||||
configs["ADMIN_PASSWORD"] = $("#ADMIN_PASSWORD").val()
|
||||
configs["BAIDU_STAT_LINK"] = $("#BAIDU_STAT_LINK").val()
|
||||
$.get('/saveAndRestart',{'configs':JSON.stringify(configs,null,2)},function(res){
|
||||
if(res=="1")
|
||||
{
|
||||
|
||||
4
mixio.js
4
mixio.js
@@ -123,6 +123,7 @@ function init(cb){
|
||||
"OFFLINE_MODE": true,
|
||||
"BAIDU_MAP_AK": "",
|
||||
"BAIDU_MAP_SERVER_AK": "",
|
||||
"BAIDU_STAT_LINK": "",
|
||||
"ADMIN_USERNAME":"admin",
|
||||
"ADMIN_PASSWORD":"public",
|
||||
"STORAGE_ENGINE":"sqlite",
|
||||
@@ -965,7 +966,8 @@ var mixioServer = function() {
|
||||
app.get('/index', function(req, res) {
|
||||
ejs.renderFile(__dirname + '/ejs/index.ejs', {
|
||||
'main':fs.existsSync("config/certs/chain.crt"),
|
||||
'mixly':fs.existsSync("../mixly")
|
||||
'mixly':fs.existsSync("../mixly"),
|
||||
'configs': configs
|
||||
}, function(err, data) {
|
||||
res.send(data)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user