Showing preview only (2,649K chars total). Download the full file or copy to clipboard to get everything.
Repository: BetterJS/badjs-web
Branch: master
Commit: 0e8c6e974943
Files: 200
Total size: 2.4 MB
Directory structure:
gitextract_d1_lp_hk/
├── .editorconfig
├── .gitignore
├── .jshintrc
├── LICENSE
├── Readme.md
├── app.js
├── controller/
│ ├── action/
│ │ ├── ApplyAction.js
│ │ ├── ApproveAction.js
│ │ ├── IndexAction.js
│ │ ├── LogAction.js
│ │ ├── StatisticsAction.js
│ │ ├── UserAction.js
│ │ └── UserApplyAction.js
│ └── router.js
├── dao/
│ ├── ApplyDao.js
│ ├── ApproveDao.js
│ ├── StatisticsDao.js
│ ├── UserApplyDao.js
│ └── UserDao.js
├── db/
│ └── create.sql
├── gulpfile.js
├── model/
│ ├── Apply.js
│ ├── Approve.js
│ ├── User.js
│ └── UserApply.js
├── oos/
│ └── demo/
│ └── demooos.js
├── package.json
├── project.debug.json
├── project.json
├── retCode.txt
├── service/
│ ├── ApplyService.js
│ ├── ApproveService.js
│ ├── BusinessService.js
│ ├── EmailService.js
│ ├── LogService.js
│ ├── OfflineLogService.js
│ ├── RealtimeService.js
│ ├── StatisticsService.js
│ ├── UserApplyService.js
│ ├── UserService.js
│ └── worker/
│ ├── Processor.js
│ ├── ProcessorPool.js
│ └── Worker.js
├── static/
│ ├── badjs/
│ │ ├── bj-report.js
│ │ └── bj-wrap.js
│ ├── common/
│ │ ├── delegator.js
│ │ └── dialog/
│ │ ├── dialog.js
│ │ └── modal.ejs
│ ├── common.js
│ ├── entry.apply.js
│ ├── entry.applyList.js
│ ├── entry.authUserManage.js
│ ├── entry.charts.js
│ ├── entry.home.js
│ ├── entry.log.js
│ ├── entry.offlinelog.js
│ ├── entry.projectTotal.js
│ ├── entry.realtime.js
│ ├── entry.statistics.js
│ ├── entry.userManage.js
│ ├── img/
│ │ └── tmp/
│ │ └── tmp
│ ├── js/
│ │ ├── beautify.js
│ │ └── require.js
│ ├── lib/
│ │ ├── bootstrap/
│ │ │ ├── bootstrap-theme.css
│ │ │ ├── bootstrap.css
│ │ │ └── bootstrap.js
│ │ ├── charts/
│ │ │ ├── highcharts.js
│ │ │ └── sand-signika.js
│ │ ├── jquery/
│ │ │ └── jquery.datetimepicker.js
│ │ └── underscore/
│ │ └── underscore.ext.js
│ └── module/
│ ├── apply/
│ │ ├── load.apply.js
│ │ └── mod.apply.js
│ ├── applyList/
│ │ ├── load.applyList.js
│ │ ├── mod.applyList.js
│ │ └── template/
│ │ └── applyTable.ejs
│ ├── authUserManage/
│ │ ├── load.authUserManage.js
│ │ ├── mod.authUserManage.js
│ │ └── template/
│ │ └── userTable.ejs
│ ├── charts/
│ │ ├── load.charts.js
│ │ └── mod.charts.js
│ ├── common/
│ │ ├── app.css
│ │ └── last.select.js
│ ├── home/
│ │ └── load.home.js
│ ├── locales/
│ │ ├── bootstrap-datetimepicker.ar.js
│ │ ├── bootstrap-datetimepicker.bg.js
│ │ ├── bootstrap-datetimepicker.ca.js
│ │ ├── bootstrap-datetimepicker.cs.js
│ │ ├── bootstrap-datetimepicker.da.js
│ │ ├── bootstrap-datetimepicker.de.js
│ │ ├── bootstrap-datetimepicker.ee.js
│ │ ├── bootstrap-datetimepicker.el.js
│ │ ├── bootstrap-datetimepicker.es.js
│ │ ├── bootstrap-datetimepicker.fi.js
│ │ ├── bootstrap-datetimepicker.fr.js
│ │ ├── bootstrap-datetimepicker.he.js
│ │ ├── bootstrap-datetimepicker.hr.js
│ │ ├── bootstrap-datetimepicker.hu.js
│ │ ├── bootstrap-datetimepicker.id.js
│ │ ├── bootstrap-datetimepicker.is.js
│ │ ├── bootstrap-datetimepicker.it.js
│ │ ├── bootstrap-datetimepicker.ja.js
│ │ ├── bootstrap-datetimepicker.ko.js
│ │ ├── bootstrap-datetimepicker.lt.js
│ │ ├── bootstrap-datetimepicker.lv.js
│ │ ├── bootstrap-datetimepicker.ms.js
│ │ ├── bootstrap-datetimepicker.nb.js
│ │ ├── bootstrap-datetimepicker.nl.js
│ │ ├── bootstrap-datetimepicker.no.js
│ │ ├── bootstrap-datetimepicker.pl.js
│ │ ├── bootstrap-datetimepicker.pt-BR.js
│ │ ├── bootstrap-datetimepicker.pt.js
│ │ ├── bootstrap-datetimepicker.ro.js
│ │ ├── bootstrap-datetimepicker.rs-latin.js
│ │ ├── bootstrap-datetimepicker.rs.js
│ │ ├── bootstrap-datetimepicker.ru.js
│ │ ├── bootstrap-datetimepicker.sk.js
│ │ ├── bootstrap-datetimepicker.sl.js
│ │ ├── bootstrap-datetimepicker.sv.js
│ │ ├── bootstrap-datetimepicker.sw.js
│ │ ├── bootstrap-datetimepicker.th.js
│ │ ├── bootstrap-datetimepicker.tr.js
│ │ ├── bootstrap-datetimepicker.ua.js
│ │ ├── bootstrap-datetimepicker.uk.js
│ │ ├── bootstrap-datetimepicker.zh-CN.js
│ │ └── bootstrap-datetimepicker.zh-TW.js
│ ├── log/
│ │ ├── load.log.js
│ │ ├── load.offlinelog.js
│ │ ├── load.realtime.js
│ │ ├── logDetailDialog/
│ │ │ ├── logDetailDialog.js
│ │ │ └── tpl/
│ │ │ └── dialog.ejs
│ │ ├── mod.log.js
│ │ ├── mod.offlinelog.js
│ │ ├── mod.realtime.js
│ │ ├── offlineDialog/
│ │ │ ├── offlineDialog.js
│ │ │ └── tpl/
│ │ │ ├── dialog.ejs
│ │ │ └── offline_monitor_row.ejs
│ │ ├── source.trigger.js
│ │ └── template/
│ │ ├── debar.ejs
│ │ ├── keyword.ejs
│ │ └── logTable.ejs
│ ├── projectTotal/
│ │ ├── load.projectTotal.js
│ │ ├── mod.projectTotal.js
│ │ └── template/
│ │ └── statistics.ejs
│ ├── statistics/
│ │ ├── load.statistics.js
│ │ ├── mod.statistics.js
│ │ └── template/
│ │ └── statistics.ejs
│ └── userManage/
│ ├── load.userManage.js
│ ├── mod.userManage.js
│ └── template/
│ └── userTable.ejs
├── test/
│ ├── test-busiess-services.js
│ ├── test-crypto.js
│ ├── test-db-connect.js
│ ├── test-email-add.js
│ ├── test-fetch-statistics-to-today.js
│ ├── test-fetch-statistics.js
│ ├── test-getProjects.js
│ ├── test-processor.js
│ ├── test-sendAll.js
│ ├── test-sendEmail.js
│ ├── test-statistics-find-by-time.js
│ └── test-zmq.js
├── tmp/
│ └── tmp
├── utils/
│ ├── auth.js
│ ├── dateFormat.js
│ ├── des.js
│ ├── email.js
│ ├── email_tof.js
│ ├── express-websocket.js
│ └── uniform_msg_client
├── views/
│ ├── account.html
│ ├── apply.html
│ ├── applyList.html
│ ├── approve.html
│ ├── authUserManage.html
│ ├── charts.html
│ ├── common/
│ │ ├── commonLinks.html
│ │ ├── footer.html
│ │ ├── header.html
│ │ ├── indexHeader.html
│ │ ├── leftSide.html
│ │ ├── logo.html
│ │ └── nav.html
│ ├── help.html
│ ├── index.html
│ ├── introduce.html
│ ├── log.html
│ ├── login.html
│ ├── modifyUser.html
│ ├── monitor.html
│ ├── offlinelog.html
│ ├── projectTotal.html
│ ├── realtimelog.html
│ ├── register.html
│ ├── statistics.html
│ └── userManage.html
├── webpack.config.js
├── workflow/
│ ├── ExpressInitWorker.js
│ ├── InitWorker.js
│ └── ServiceInitWorker.js
└── workflow.config.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# Tabs in JS unless otherwise specified
[**.js]
indent_style = space
indent_size = 4
[**.html]
indent_style = space
indent_size = 4
[**.css]
indent_style = space
indent_size = 4
[**.sass]
indent_style = space
indent_size = 4
================================================
FILE: .gitignore
================================================
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
*.pubxml
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
#############
## Windows detritus
#############
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac crap
.DS_Store
#############
## Python
#############
*.py[co]
# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg
#############
## NodeJS
#############
node_modules/
coverage.html
web-debug.bat
#############
## webstorm
#############
.idea/
================================================
FILE: .jshintrc
================================================
// 根据 knightli 提供的配置改编, 欢迎试用
// update by kaelyang 2015/07/31
{
// 参考 http://jslinterrors.com/
// ==============预定义变量============
"globals":{
"$": true,
"GLOBAL": true,
"global": true,
"jQuery": true,
"exports": true,
"module": true,
"define": true,
"require": true,
"it": true,
"before": true,
"describe": true,
"beforeEach": true,
"afterEach": true,
"__inline": true,
"__uri": true
},
// ==============Legacy Options============
// 注: 这些选项继承自jslint
// 当变量名以"_"开头或结尾时,是否告警
"nomen": false,
// 是否只允许出现一个var在函数中
"onevar": false,
// 是否遇到第一个错误的时候就终止
"passfail": false,
// 让JSHint检查你的代码是否违反道格拉斯的JS编码风格(严格的空白规范??).
"white": false,
// 最大错误数目,超过则停止分析(默认:50)
"maxerr": 50,
// ==============Environments Options============
// 是否预定义现代浏览器暴露出来的全局变量(不包括alert和console)
"browser": true,
// 是否预定义console,alert这种开发阶段的调试代码
"devel": true,
// 该选项定义了一些非标准但广泛使用的全局变量,像"escape"和"unescape".
"nonstandard": true,
// ==============Enforcing Options============
// 禁止使用位运算符
"bitwise": true,
// 只允许使用camelCase or UPPER_CASE
"camelcase": false,
// 必须给block加括号
"curly": false,
// 不安全的== (会建议换成===或者!==)
"eqeqeq": false,
// 不安全的for in
"forin": false,
// 立即函数调用必须用(function(){}())而不是(function(){})()
"immed": true,
// 必须先定义再使用
"latedef": false,
// 构造函数名的首字母必须大写
"newcap": true,
// 禁止arguments.caller和arguments.callee的使用(ES5的严格模式中被禁用了,并且不是所有js实现中都有)
"noarg": true,
// 禁止空的代码块或未赋值的构造器
"noempty": false,
// 不允许不做赋值的构造函数
"nonew": true,
// 不允许使用++或者--的操作符
"plusplus": false,
// 正则中不允许使用.或者[^…]
"regexp": false,
// 未定义的XXX
"undef": true,
// 未使用的XXX
"unused": false,
// 需要使用strict mode,详见http:// ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
"strict": false,
// 行末有多余的空格
"trailing": false,
// 配置单双引号规则: "false"或者不设置 不做限制 "single" 只许单引号 "double" 只许双引号 "true" 两者选其一,但不能同时出现
"quotmark": "false",
// 配置缩进规则: 设置缩进对应的空格数,如不设置,则不对缩进做要求
// 注: 这里配置了indent,则即使上面的white设置了false,也还是会导致 swindent 报warning(https:// github.com/jshint/jshint/issues/935)
// TODO:确认jshint解决了 swindent 的支持后可重新配置此项
// "indent": 4,
// 配置单行代码的最大长度
// "maxlen": 120,
// 配置函数的最多参数个数: 参数过多时,可读性下降,可考虑用options对象字段来减少参数个数
// "maxparams": 5,
// 配置函数内代码块嵌套最多层数
// "maxdepth": 5,
// 配置函数内最多有多少条语句(一个函数声明会被当作一条语句)
// "maxstatements": 50,
// 配置最大圈复杂度(http://en.wikipedia.org/wiki/Cyclomatic_complexity)
// "maxcomplexity": 10, // TODO:打开来优化代码复杂度
// ==============Relaxing Options============
// 代码末尾缺失分号,是否放过
"asi": false,
// for等预期是==的地方用了=,是否放过
"boss": false,
// 代码中有debugger语句,是否放过
"debug": false,
// 使用"=="来比较变量与null,是否放过
"eqnull": false,
// ES5语法校验报警,是否放过
"es5": false,
// ECMAScript 6语法校验报警,是否放过
"esnext": true,
// 代码中使用了eval,是否放过
"evil": true,
// 只允许在函数调用或赋值时使用表达式(原因???) 2 > 1 ? (alert(1)) : (alert(2));
"expr": true,
// 在控制语句中定义了变量,却在控制语句之外使用变量 function(){ if(1) {var x = 0;} x = x + 1;}
"funcscope": false,
// 使用了全局级别的严格模式,是否放过
"globalstrict": false,
// 使用了__iterator__这个属性(并非所有浏览器支持), 是否放过 (原因???)
"iterator": false,
// 是否允许单行语句块中最后一条语句不写分号
"lastsemic": false,
// 是否允许出现不安全的换行(示例???)
"laxbreak": true,
// 是否允许逗号出现在行首的换行方式
"laxcomma": false,
// 是否允许在循环里定义函数
"loopfunc": true,
// 是否允许多行字符串(原因???)
"multistr": true,
// 是否允许在代码中使用__proto__属性(并非所有浏览器支持)
"proto": false,
// 是否允许在switch语句中只出现一个case
"onecase": true,
// 是否允许unescaped - in the end of regular expressions.
"regexdash": false,
// 是否允许在代码中使用"javascript:..."这样的url
"scripturl": true,
// 是否使用smarttab风格混用tab和space(http:// www.emacswiki.org/emacs/SmartTabs)
"smarttabs": false,
// 是否允许使用shadow变量(shadow变量:当一个变量所在的作用域之外还有一个同名的变量,称为shadow变量)
// http:// stackoverflow.com/questions/5373278/variable-shadowing-in-javascript
"shadow": false,
// 是否允许用obj['name']和obj.name两种方式访问对象的属性
"sub": true,
// 是否允许使用像"new function() {...}"这样怪异的构造器
"supernew": true,
// 是否允许在严格模式下的非构造函数中使用this(该选项只能用于函数作用域中)
"validthis": false,
// Missing radix parameter to parseInt (defaults to 10)
"-W065": false,
// Literal accessor is better written in dot notation
"-W069": false
}
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2015 , imweb(http://imweb.io/)
Copyright (c) 2015 , chriscai(345446383@qq.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Readme.md
================================================
#badjs-storage
> badjs manage system .
# 运行
```javascript
node app.js
```
# 启动参数
--debug log 采用debug 级别, 默认使用info
--project 使用测试环境( project.debug.json )配置 , 默认使用 project.json
# 构建
静态页面使用webpack ,开发阶段使用
```javascript
webpack -w
```
上线阶段需要打包打包命令
```javascript
webpack
```
# 数据库初始化
db/create.sql 是需要初始化到 mysql 的中。其中默认的超级管理员帐号是 admin , 密码是 admin
# 配置说明
```
{
"host" : "http://badjs.server.com/", //配额管理服务器地址,用于邮件中的图片展示
"mysql" : {
"url" : "mysql://root:root@localhost:3306/badjs" // mysql 地址
},
"storage" : { // 存储服务器的地址, 这里配置badjs-storage 的地址
"errorMsgTopUrl" : "http://127.0.0.1:9000/errorMsgTop",
"errorMsgTopCacheUrl" : "http://127.0.0.1:9000/errorMsgTopCache",
"queryUrl" : "http://127.0.0.1:9000/query"
},
"acceptor": { //badjs-acceptor 模块的地址, 这里用于同步审核通过的业务的id 到接入层进行验证
"pushProjectUrl" : "http://127.0.0.1:9001/getProjects"
},
"openapi": { //badjs-acceptor 模块的地址, 这里用于同步审核通过的业务的appkey 到openapi 进行验证
"pushProjectUrl" : "http://127.0.0.1:9002/getProjects"
},
"mq" : { // badjs-mq 的地址
"url" : "tcp://127.0.0.1:10000",
"subscribe" : "badjs" // 跟 badjs-aceptor 中的subscribe 对应
"module": "axon" // 指定 mq 模块,
},
"email": { // 发送 email 配置
"homepage": "http://badjs.server.com/user/index.html", // 邮件中的 快捷入口
"from": "noreply-badjs@demo.com", //邮件中的发送者名字
"smtp": "smtp.demo.com", // smtp 服务器
"emailSuffix" : "@demo.com", //收件人的邮件后缀,收件人地址 username + emailSuffix
"time": "09:00:00", // 几点发送邮件
"top": 20, //邮件只发送错误排名的配置的top20
"module": "email" // 邮件发送模块
},
"oos" : { //接入公司的统一登录, 删掉使用系统自己的用户管理
"module":"demo/demooos"
}
}
```
# oos 接入
查看当前目录的 oos/demooos.js 如何处理。
> 腾讯内部接入可以[参考](https://github.com/BetterJS/oos-tencent)
================================================
FILE: app.js
================================================
var workflow = require('./workflow.config.json'),
_ = require("underscore");
var workflowPath = workflow.path;
if(!workflowPath){
workflowPath = "./"
}
if(!workflow.workflow){
return ;
}
_.each(workflow.workflow , function (value , key){
require(workflowPath +"/"+ value)();
})
================================================
FILE: controller/action/ApplyAction.js
================================================
/**
* @info : APPLY ACION
* @author : coverguo
* @date : 2015-01-07
*/
var log4js = require('log4js'),
logger = log4js.getLogger(),
_ = require('underscore'),
crypto = require('crypto'),
ApplyService = require('../../service/ApplyService'),
isError = function(res, error) {
if (error) {
res.json({
ret: 1,
msg: error
});
return true;
}
return false;
};
var REG_DOMAIN_STAR = /^\*(\.[^\/]+)?$/;
var REG_REFERER = /^https?:\/\/[^\/]+\//i;
var processData = function(data) {
_.each(data, function(value, key) {
if (value.createTime) {
value.createTime = (new Date(value.createTime) - 0);
}
if (value.passTime) {
value.passTime = (new Date(value.passTime) - 0);
}
});
return data;
};
var applyAction = {
addApply: function(params, req, res) {
// 必要信息为空,则报错
var url = params.url;
var url_no_match = !REG_DOMAIN_STAR.test(url) && !REG_REFERER.test(url);
if (params.name === "" || url_no_match) {
res.json({
ret: 1002,
msg: "params error"
});
return;
}
var apply = params;
apply.userName = params.user.loginName;
var applyService = new ApplyService();
if (apply.id) {
applyService.update(apply, function(err, items) {
if (isError(res, err)) {
return;
}
res.json({
ret: 0,
msg: "success-add"
});
});
} else {
apply.status = 0;
apply.createTime = new Date();
apply.appkey = crypto.createHash("md5").update(new Date - 0 + "badjsappkey" + params.user.loginName).digest('hex');
applyService.add(apply, function(err, items) {
if (isError(res, err)) {
return;
}
res.json({
ret: 0,
msg: "success-add"
});
});
}
},
queryListByUser: function(params, req, res) {
var applyService = new ApplyService();
if (params.user.role != 1) {
applyService.queryListByUser(params, function(err, items) {
if (isError(res, err)) {
return;
}
res.json({
ret: 0,
msg: "success",
data: {
role: params.user.role,
item: processData(items)
}
});
});
} else {
applyService.queryListByAdmin(params, function(err, items) {
if (isError(res, err)) {
return;
}
res.json({
ret: 0,
msg: "success",
data: {
role: params.user.role,
item: processData(items)
}
});
});
}
},
queryListByAdmin: function(params, req, res) {
var applyService = new ApplyService();
//不是管理员的话直接返回错误提示
if (params.user.role != 1) {
res.json({
ret: 1003,
msg: "权限不足"
});
return;
}
applyService.queryListByAdmin(params, function(err, items) {
if (isError(res, err)) {
return;
}
res.json({
ret: 0,
msg: "success",
data: processData(items)
});
});
},
queryListBySearch: function(params, req, res) {
var applyService = new ApplyService();
var searchParam = {};
if (params.user.role != 1) {
searchParam.userName = params.user.loginName;
}
//搜索全部
if (params.statusType != 3) {
searchParam.status = params.statusType;
}
applyService.queryListBySearch(searchParam, function(err, items) {
if (isError(res, err)) {
return;
}
res.json({
ret: 0,
msg: "success",
data: {
role: params.user.role,
item: processData(items)
}
});
});
},
queryByApplyId: function(params, cb) {
var applyService = new ApplyService();
applyService.queryById({
id: params.applyId
}, function(err, apply) {
cb(err, apply);
});
},
update: function(params, req, res) {
var as = new ApplyService();
as.update(params, function() {
});
},
remove: function(params, req, res) {
var applyService = new ApplyService();
applyService.remove(params, function(err) {
if (err) {
res.json({
ret: 3,
msg: "fail remove"
});
} else {
res.json({
ret: 0,
msg: "success remove"
});
}
});
}
};
module.exports = applyAction;
================================================
FILE: controller/action/ApproveAction.js
================================================
/**
* @info : APPROVE ACION
* @author : coverguo
* @date : 2015-01-12
*/
var log4js = require('log4js'),
logger = log4js.getLogger(),
ApproveService = require('../../service/ApproveService'),
LogService = require('../../service/LogService'),
isError = function (res , error){
if(error){
res.json({ret : 1 , msg : error});
return true;
}
return false;
};
var approveAction = {
doApprove: function(params, req , res){
var approve = params;
approve.createTime = new Date();
approve.userName = params.user.loginName;
logger.debug('add_approve param :' + approve);
var approveService = new ApproveService();
var logService = new LogService();
approveService.add(params, function (err, items) {
if(isError(res, err)){
return;
}
if(params.applyStatus == 1 || params.applyStatus == 2){
var pushProject = function (){
logService.pushProject(function (err){
if(err){
logger.warn('push project error ' + err);
}else {
logger.info('push project success from approve ');
}
});
}
pushProject();
}
res.json({ret:0, msg:"审核完成"});
});
},
queryList : function (params,cb) {
var as = new ApproveService();
as.query(params,cb);
},
update:function(){
var as = new ApproveService();
as.update(params,cb);
},
remove: function(params , cb){
var as = new ApproveService();
as.remove(params,cb);
}
};
module.exports = approveAction;
================================================
FILE: controller/action/IndexAction.js
================================================
/**
* Created by chriscai on 2015/1/15.
*/
var BusinessService = require('../../service/BusinessService');
var fs = require("fs");
var path = require("path");
var log4js = require('log4js'),
logger = log4js.getLogger();
var IndexAction = {
index : function(parm , req, res){
var params = req.query,
user = req.session.user;
var businessService = new BusinessService();
businessService.findBusinessByUser(user.loginName , function (err, item){
res.render('log', { layout: false, user: user, index:"log" , items : item} );
});
},
realtime : function(parm , req, res){
var params = req.query,
user = req.session.user;
var businessService = new BusinessService();
businessService.findBusinessByUser(user.loginName , function (err, item){
res.render('realtimelog', { layout: false, user: user, index:"realtime" , items : item , systime : new Date - 0} );
});
},
offline : function(parm , req, res){
var params = req.query,
user = req.session.user;
var businessService = new BusinessService();
businessService.findBusinessByUser(user.loginName , function (err, item){
res.render('offlinelog', { layout: false, user: user, index:"offlinelog" , items : item , systime : new Date - 0} );
});
}
};
module.exports = IndexAction;
================================================
FILE: controller/action/LogAction.js
================================================
/**
* @info : LOG ACION
* @author : coverguo
* @date : 2014-12-16
*/
var LogService = require('../../service/LogService'),
log4js = require('log4js'),
http = require('http'),
logger = log4js.getLogger(),
isError = function (res , error){
if(error){
res.json({ret : 1 , msg : error});
return true;
}
return false;
};
var fs = require("fs")
var path = require("path")
var LogAction = {
queryLogList : function (params, req , res) {
var logService = new LogService();
params['endDate'] -=0;
params['startDate'] -=0;
params['id'] -=0;
delete params.user;
logService.query(params,function(err, items){
if(isError(res, err)){
return;
};
res.json({ret:0, msg:"success-query", data:items });
});
},
showOfflineFiles : function (params, req , res) {
if(!params.id){
res.json({ret:0, msg:"success-query", data:[] });
return
}
if(!/^\w+$/i.test( params.id)){
res.json({ret:0, msg:"success-query", data:[] });
return ;
}
var filePath = path.join(__dirname , '..' , '..' , 'offline_log' , params.id +"");
if(!fs.existsSync(filePath)){
res.json({ret:0, msg:"success-query", data:[] });
return
}
var offlineFiles = fs.readdirSync(filePath);
var offlineFilesList = [];
offlineFiles.sort(function (a, b){
if(a < b ){
return 1;
}else {
return -1;
}
})
offlineFiles = offlineFiles.slice(0,50);
offlineFiles.forEach(function (item){
offlineFilesList.push({
id : item
})
})
res.json({ret:0, msg:"success-query", data:offlineFilesList });
},
showOfflineLog : function (params, req , res) {
if(!params.fileId || !params.id){
res.json({ret:0, msg:"success-query", data:[] });
return
}
if(!/^\w+$/i.test( params.id)){
res.json({ret:0, msg:"success-query", data:[] });
return ;
}
if(!/^\w+$/i.test( params.fileId)){
res.json({ret:0, msg:"success-query", data:[] });
return ;
}
var filePath = path.join(__dirname , '..' , '..' , 'offline_log' ,params.id +"" , params.fileId);
if(!fs.existsSync(filePath)){
res.json({ret:0, msg:"success-query", data:[] });
return
}
var offlineFiles = fs.readFileSync(filePath);
res.json({ret:0, msg:"success-query", data:offlineFiles.toString() });
},
deleteOfflineLogConfig : function (params, req , res){
if(!params.id || !params.uin ){
res.json({ret:0, msg:"", data:{} });
return
}
if (global.offlineLogMonitorInfo[params.id] && global.offlineLogMonitorInfo[params.id][params.uin] ){
delete global.offlineLogMonitorInfo[params.id][params.uin]
}
res.json({ret:0, msg:"", data:{} });
},
getOfflineLogConfig : function (params, req , res){
if(!params.id ){
res.json({ret:0, msg:"", data:{}});
return
}
var result = {};
if (global.offlineLogMonitorInfo[params.id] ){
result = global.offlineLogMonitorInfo[params.id];
}
res.json({ret:0, msg:"", data:result});
},
addOfflineLogConfig : function (params, req , res){
if(!params.id || !params.uin){
res.json({ret:-1, msg:"", data:{} });
return
}
if(!global.offlineLogMonitorInfo[params.id]){
global.offlineLogMonitorInfo[params.id] = {}
}
var hadAdd = false;
if(!global.offlineLogMonitorInfo[params.id][params.uin]){
global.offlineLogMonitorInfo[params.id][params.uin] = true;
}else {
hadAdd = true;
}
res.json({ret:0, msg:"success-query", data:{hadAdd : hadAdd } });
},
code : function (params, req , res){
http.get(params.target , function(response){
var buffer = '';
response.on('data' , function (chunk){
buffer += chunk.toString();
}).on('end' , function (){
res.json({ret:0, msg:"success-query", data:buffer});
});
})
}
};
module.exports = LogAction;
================================================
FILE: controller/action/StatisticsAction.js
================================================
/**
* Created by chriscai on 2015/1/15.
*/
var BusinessService = require('../../service/BusinessService'),
_ = require('underscore'),
StatisticsService = require('../../service/StatisticsService');
var log4js = require('log4js'),
logger = log4js.getLogger();
var StatisticsAction = {
index: function(param, req, res) {
var params = req.query,
user = req.session.user;
var businessService = new BusinessService();
businessService.findBusinessByUser(user.loginName, function(err, item) {
res.render(param.tpl, {
layout: false,
user: user,
index: 'statistics',
statisticsTitle: param.statisticsTitle,
items: item
});
});
},
projectTotal: function(param, req, res) {
var params = req.query,
user = req.session.user;
var businessService = new BusinessService();
businessService.findBusiness(function(err, items) {
res.render(param.tpl, {
layout: false,
user: user,
index: 'projectTotal',
statisticsTitle: param.statisticsTitle,
items: items
});
});
},
queryByChart: function(param, req, res) {
var statisticsService = new StatisticsService();
if (!param.projectId || isNaN(param.projectId) || !param.timeScope) {
res.json({
ret: 0,
msg: 'success',
data: {}
});
return;
}
statisticsService.queryByChart({
userName: param.user.loginName,
projectId: param.projectId - 0,
timeScope: param.timeScope - 0
}, function(err, data) {
if (err) {
res.json({
ret: -1,
msg: "error"
});
return;
}
res.json(data);
});
},
queryByChartForAdmin: function(param, req, res) {
var statisticsService = new StatisticsService();
if (!param.projectId || isNaN(param.projectId) || !param.timeScope || param.user.role != 1) {
res.json({
ret: 0,
msg: 'success',
data: {}
});
return;
}
statisticsService.queryByChart({
projectId: param.projectId - 0,
timeScope: param.timeScope - 0
}, function(err, data) {
if (err) {
res.json({
ret: -1,
msg: "error"
});
return;
}
res.json(data);
return;
});
},
queryById: function(param, req, res) {
var statisticsService = new StatisticsService();
if (!req.query.projectId || isNaN(req.query.projectId) || !req.query.startDate) {
res.json({
ret: 0,
msg: 'query invalid!',
data: {}
});
return;
}
//console.log(param);
statisticsService.queryById({
userName: param.user.loginName,
projectId: req.query.projectId - 0,
startDate: new Date(param.startDate - 0)
}, function(err, data) {
if (err) {
res.json({
ret: -1,
msg: 'error',
data: {}
});
} else {
res.json({
ret: 0,
msg: 'success',
data: data
});
}
});
}
};
module.exports = StatisticsAction;
================================================
FILE: controller/action/UserAction.js
================================================
/**
* Created by coverguo on 2015/1/12.
*/
var log4js = require('log4js'),
logger = log4js.getLogger(),
UserService = require('../../service/UserService'),
crypto = require('crypto'),
BusinessService = require('../../service/BusinessService'),
isError = function (res , error){
if(error){
res.json({ret : 1 , msg : error});
return true;
}
return false;
};
var userAction = {
index: function(params , req , res){
var params = req.query,
user = req.session.user;
var businessService = new BusinessService();
if(user.role == 1 ){
businessService.findBusiness( function (err, item){
res.render('userManage', { layout: false, user: user, index:'manage', manageTitle: '项目用户权限' , items : item} );
});
}else {
businessService.findBusinessByProjectOwner(user.loginName , function (err, item){
res.render('userManage', { layout: false, user: user, index:'manage', manageTitle: '项目用户权限' , items : item} );
});
}
},
authUserManger : function (params , req , res){
var user = req.session.user;
res.render('authUserManage', { layout: false, user: user, index:'manage', manageTitle: '注册用户列表' } );
},
login : function (params , req , res){
var method = req.method.toLowerCase();
if(method == "post"){
var userDao = req.models.userDao;
userDao.one({ loginName : req.body.username } ,function (err , user) {
if(err || !user || (crypto.createHash("md5").update(req.body.password).digest('hex') != user.password)){
res.render('login', { name:req.body.username, isUseOA : !! global.pjconfig.oos, index:"login" , message : "帐号或则密码错误"} );
}else {
req.session.user = {
role : user.role,
id : user.id,
email : user.email,
loginName : user.loginName ,
chineseName : user.chineseName
}
res.redirect(req.protocol + "://" + req.get('host') + '/user/index.html');
}
});
}else {
res.render('login', { isUseOA : !! global.pjconfig.oos, message : "" } );
}
},
register : function (params , req , res){
var method = req.method.toLowerCase();
if(method == "post"){
if( !req.body.username || !req.body.password) {
res.render('register', { isUseOA : !! global.pjconfig.oos, name: req.body.username , message : "帐号密码不能为空"} );
return ;
}else if( req.body.password != req.body.password2) {
res.render('register', { isUseOA : !! global.pjconfig.oos, name: req.body.username , message : "密码和确认密码不一致"} );
return ;
}
var userDao = req.models.userDao;
userDao.one({ loginName : req.body.username } ,function (err , user) {
if(err){
logger.error("register user error : " + err.toString());
res.render('register', { isUseOA : !! global.pjconfig.oos, name: req.body.username , message : "系统错误,请联系管理员"} );
} else if(user){
res.render('register', {isUseOA : !! global.pjconfig.oos, name: req.body.username , message : "用户已经存在"} );
return ;
} else {
var newUser = { chineseName: req.body.username, role : 0 ,loginName : req.body.username ,password : crypto.createHash("md5").update(req.body.password).digest('hex')};
userDao.create(newUser , function (err) {
if(err){
res.render('register', { isUseOA : !! global.pjconfig.oos, message : "系统错误,请联系管理员"} );
}
res.render('register', { isUseOA : !! global.pjconfig.oos, type : "1", message : '注册成功 '} )
});
}
});
}else {
res.render('register', { isUseOA : !! global.pjconfig.oos, message : "" } );
}
},
modify : function (params , req , res){
var params = req.query,
user = req.session.user;
var method = req.method.toLowerCase();
if(method == "post"){
if( !req.body.newpassword || !req.body.oldpassword) {
res.render('modifyUser', { layout:false, user: user , index:'modifyUser', manageTitle: '修改密码', message : "密码不能为空"} );
return ;
}if( req.body.newpassword != req.body.newpassword2) {
res.render('modifyUser', { layout:false, user: user , index:'modifyUser', manageTitle: '修改密码' , message : "密码和确认密码不一致"} );
return ;
}else if( req.body.oldpassword == req.body.newpassword) {
res.render('modifyUser', { layout:false, user: user , index:'modifyUser', manageTitle: '修改密码' , message : "新旧密码不能一致"} );
return
}
var userDao = req.models.userDao;
userDao.one({ loginName : user.loginName } ,function (err , user) {
var newpassword = crypto.createHash("md5").update(req.body.newpassword).digest('hex')
var oldpassword = crypto.createHash("md5").update(req.body.oldpassword).digest('hex')
if(err){
logger.error("modifyUser user error : " + err.toString());
res.render('modifyUser', { layout:false, user: user , index:'modifyUser', manageTitle: '修改密码' , message : "系统错误,请联系管理员"} );
}else if(!user){
res.render('modifyUser', { layout:false, user: user , index:'modifyUser', manageTitle: '修改密码' , message : "用户不存在"} );
}else if (oldpassword != user.password){
res.render('modifyUser', { layout:false, user: user , index:'modifyUser', manageTitle: '修改密码' , message : "原始密码不正确"} );
}else {
user.password = newpassword;
user.save( function (err) {
if(err){
res.render('modifyUser', { layout:false, user: user , index:'modifyUser', manageTitle: '修改密码' , message : "系统错误,请联系管理员"} );
}
req.session.user = null;
res.render('modifyUser', { layout:false, user: user , index:'modifyUser', manageTitle: '修改密码' , type : "1", message : '修改成功 ,3s 后跳转到登录界面'} );
});
}
});
}else {
res.render('modifyUser', { layout:false, user: user , index:'modifyUser', manageTitle: '修改密码'} );
}
},
// addUser: function(params, cb){
// var us = new UserService();
// us.add(params,cb);
// },
queryListByCondition : function (params , req , res) {
var userService = new UserService();
var isAdmin = req.session.user.role == 1;
//用户根据项目查询项目成员
if(params.applyId && params.role){
params.applyId -=0;
params.role -=0;
}else{
res.json({ret:1002, msg:"need some params"});
return;
}
if(params.user.role != 1){
params.userId = params.user.id;
}
userService.queryListByCondition(params,function(err, items){
if(isError(res, err)){
return;
}
res.json({ret:0, data:items, msg:"success" , isAdmin : isAdmin});
});
},
queryUserByCondition : function (params , req , res){
var userService = new UserService();
var user = req.session.user;
var isAdmin = req.session.user.role == 1;
if(!isAdmin){
res.json({ret:-1, data:{}, msg:"error" });
return ;
}
var target = {};
if(params.roleType >= 0){
target.role = params.roleType;
}
userService.queryUsersByCondition(target , function (err , item){
res.json({ret:0, data:item, msg:"success" });
})
},
authUser : function (params , req , res){
var userService = new UserService();
userService.update({id : params.id, role : params.role} , function (err ){
if(err){
res.json({ret:-1, msg:"error" });
}else {
res.json({ret:0, msg:"success" });
}
})
},
update:function(req, res){
},
remove: function(){
}
};
module.exports = userAction;
================================================
FILE: controller/action/UserApplyAction.js
================================================
/**
* Created by coverguo on 2015/1/12.
*/
var log4js = require('log4js'),
logger = log4js.getLogger(),
UserApplyService = require('../../service/UserApplyService'),
isError = function (res , error){
if(error){
res.json({ret : 1 , msg : error});
return true;
}
return false;
};
var userAction = {
addUserApply: function(userApply, req , res){
if(userApply.userName ==""){
res.json({ret: 1002, msg: "userName为空"});
return;
}
userApply.createTime = new Date();
var userApplyService = new UserApplyService();
userApplyService.add(userApply,function(err, items) {
if (isError(res, err)) {
return;
}
res.json({ret: 0, msg: "success-add"});
});
},
//update:function(req, res){
//
//},
remove: function(remove, req, res){
if(remove.id ==""){
res.json({ret: 1002, msg: "id为空"});
return;
}
var userApplyService = new UserApplyService();
userApplyService.remove(remove,function(err, items) {
if (isError(res, err)) {
return;
}
res.json({ret: 0, msg: "success-remove"});
});
},
auth: function(auth, req, res){
if(auth.id ==""){
res.json({ret: 1002, msg: "id为空"});
return;
}
var userApplyService = new UserApplyService();
userApplyService.auth(auth,function(err, items) {
if (isError(res, err)) {
return;
}
res.json({ret: 0, msg: "success-update"});
});
}
};
module.exports = userAction;
================================================
FILE: controller/router.js
================================================
/**
* @info : 页面申请路由
* @author : coverguo
* @date : 2014-12-16
*/
var LogAction = require('./action/LogAction'),
ApplyAction = require('./action/ApplyAction'),
UserAction = require("./action/UserAction"),
IndexAction = require("./action/IndexAction"),
StatisticsAction = require("./action/StatisticsAction"),
ApproveAction = require("./action/ApproveAction"),
realtimeService = require("../service/RealtimeService"),
UserApplyAction = require("./action/UserApplyAction");
var _ = require("underscore");
var log4js = require('log4js'),
logger = log4js.getLogger();
module.exports = function(app){
realtimeService(app);
//html页面请求
app.get('/', function (req , res){
res.render('index',{} );
});
app.get('/index.html', function (req , res){
res.render('index',{} );
} );
app.get('/user/index.html', function (req , res){
IndexAction.index({} , req , res);
} );
app.use('/login.html', function (req , res){
UserAction.login({}, req , res);
} );
app.use('/register.html', function (req , res){
UserAction.register({}, req , res);
} );
app.get('/user/apply.html', function(req, res){
var user = req.session.user;
if(req.query && req.query.applyId){
ApplyAction.queryByApplyId({applyId :req.query.applyId } , function (err , apply){
res.render('apply', { layout: false, user: user, index:'apply' , apply : apply });
});
}else {
res.render('apply', { layout: false, user: user, index:'apply' , apply : {} });
}
});
app.get('/user/applyList.html', function(req, res){
var user = req.session.user;
res.render('applyList', { layout: false, user: user, index:'manage', manageTitle: '申请项目列表'});
});
app.get('/user/userManage.html', function (req , res){
UserAction.index({} , req , res);
});
app.use('/user/modifyUser.html', function (req , res){
UserAction.modify(req.param , req , res);
});
app.get('/user/authUserManage.html', function (req , res){
UserAction.authUserManger(req.param , req , res);
});
app.get('/user/statistics.html' , function (req , res){
StatisticsAction.index({tpl:"statistics", statisticsTitle: "日志统计"} , req , res);
});
app.get('/user/realtimelog.html' , function (req , res){
IndexAction.realtime({} , req , res);
});
app.get('/user/offlinelog.html' , function (req , res){
IndexAction.offline({} , req , res);
});
app.get('/user/charts.html' , function (req , res){
StatisticsAction.index({tpl:"charts", statisticsTitle: "图表统计"} , req , res);
});
app.get('/user/projectTotal.html' , function (req , res){
StatisticsAction.projectTotal({tpl:"projectTotal", statisticsTitle: "项目统计"} , req , res);
});
app.get('/user/introduce.html' , function (req , res){
res.render('introduce', { layout: false, user: req.session.user, index:'guide', guideTitle: '使用指南'});
});
app.get('/user/monitor.html' , function (req , res){
res.render('monitor', { layout: false, user: req.session.user, index:'guide', guideTitle: '实时监控'});
});
/**
* 登出
* */
app.get('/logout', function(req, res){
req.session.user = null;
var homeUrl = req.protocol + "://" + req.get('host') + '/index.html';
delete req.session.user;
res.redirect(homeUrl);
});
// 请求路径为: controller/xxxAction/xxx.do (get || post)
app.use("/",function(req, res , next){
//controller 请求action
if(!/\/controller/i.test(req.url)){
next();
return ;
}
var url = req.url;
var action = url.match(/controller\/(\w*)Action/i)[1];
var operation = url.match(/\/(\w+)\.do/i)[1];
logger.debug("the operation is: " + action + " --operation: "+ operation);
//判断是get还是post请求, 获取参数params
var method = req.method.toLowerCase();
var params = method =="post"? req.body : req.query;
params = _.extend({} , params );
params.user = req.session.user;
if( !params.user ){
res.json({ret : -2 , msg : "should login"});
return ;
}
//根据不同actionName 调用不同action
try{
switch(action){
case "user": UserAction[operation](params,req, res);break;
case "apply": ApplyAction[operation](params,req, res);break;
case "approve": ApproveAction[operation](params,req, res);break;
case "log" : LogAction[operation](params,req, res); break;
case "userApply": UserApplyAction[operation](params,req, res);break;
case "statistics" : StatisticsAction[operation](params, req, res); break;
default : next();
}
}catch(e){
logger.warn(e)
res.send(404, 'Sorry! can not found action.');
}
return;
});
};
================================================
FILE: dao/ApplyDao.js
================================================
/**
* @info: ApplyDao
* @author: coverGuo
* @date: 2014-12-30
*/
//status: 0 审核中- 1-审核通过, 2-审核失败
module.exports = function (db){
var apply = db.define("b_apply", {
id : Number,
userName : String,
status : Number,
name : String,
appkey : String,
url : String,
blacklist : String,
description : String,
mail : String,
createTime : Date,
passTime : Date
});
return apply;
}
================================================
FILE: dao/ApproveDao.js
================================================
/**
* @info: approveDao
* @author: coverguo
* @date: 2014-12-30
*/
module.exports = function (db){
var approve = db.define("b_approve", {
id : Number,
userName : String,
reply : String,
createTime : Date,
applyId : Number,
applyStatus : Number
});
return approve;
}
================================================
FILE: dao/StatisticsDao.js
================================================
/**
* @info: statisticsDao
* @author: chriscai
* @date: 2014-01-14
*/
module.exports = function (db){
var Statistics = db.define("b_statistics", {
id : Number,
projectId : Number,
startDate : Date,
endDate : Date,
content : String,
total : Number
});
return Statistics;
}
================================================
FILE: dao/UserApplyDao.js
================================================
/**
* @info: UserApplyDao
* @author: coverguo
* @date: 2014-01-15
*/
module.exports = function (db){
var user_apply = db.define("b_user_apply", {
userId : Number,
applyId : Number,
role : Number,
createTime : Date
});
return user_apply;
};
================================================
FILE: dao/UserDao.js
================================================
/**
* @info: userDao
* @author: coverGuo
* @date: 2014-12-30
*/
module.exports = function (db){
var user = db.define("b_user", {
id : Number,
loginName : String,
chineseName : String,
role : Number,
email : String,
password : String
});
return user;
}
================================================
FILE: db/create.sql
================================================
-- --------------------------------------------------------
-- 主机: 127.0.0.1
-- 服务器版本: 5.6.21-log - MySQL Community Server (GPL)
-- 服务器操作系统: Win64
-- HeidiSQL 版本: 9.1.0.4867
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
CREATE DATABASE IF NOT EXISTS `badjs` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `badjs`;
-- 导出 表 betterjs.b_statistics 结构
DROP TABLE IF EXISTS `b_statistics`;
CREATE TABLE IF NOT EXISTS `b_statistics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`projectId` int(11) DEFAULT NULL,
`startDate` datetime DEFAULT NULL,
`endDate` datetime DEFAULT NULL,
`content` longtext COLLATE utf8_unicode_ci,
`total` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table structure for table `b_apply`
--
DROP TABLE IF EXISTS `b_apply`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `b_apply` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userName` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`status` int(11) NOT NULL,
`name` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`appkey` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
`url` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
`blacklist` text COLLATE utf8_unicode_ci ,
`description` text COLLATE utf8_unicode_ci,
`mail` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
`createTime` datetime DEFAULT NULL,
`passTime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `b_approve`
--
DROP TABLE IF EXISTS `b_approve`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `b_approve` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userName` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`reply` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`applyId` int(11) NOT NULL,
`createTime` timestamp NULL DEFAULT NULL,
`applyStatus` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `applyId` (`applyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `b_user`
--
DROP TABLE IF EXISTS `b_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `b_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`loginName` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`chineseName` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`role` int(11) NOT NULL,
`email` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`password` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
/*!40000 ALTER TABLE `b_user` DISABLE KEYS */;
INSERT INTO `b_user` (`id`, `loginName`, `chineseName`, `role`, `email`, `password`) VALUES
(1, 'admin', 'admin', 1, NULL, '21232f297a57a5a743894a0e4a801fc3');
--
-- Table structure for table `b_user_apply`
--
DROP TABLE IF EXISTS `b_user_apply`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `b_user_apply` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL,
`applyId` int(11) NOT NULL,
`role` int(1) NOT NULL DEFAULT '0',
`createTime` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `applyId_idx` (`applyId`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
-- Dump completed on 2015-01-20 9:43:38
================================================
FILE: gulpfile.js
================================================
var gulp = require("gulp");
var del = require('del');
var webpack = require("webpack");
gulp.task('clean', function(cb) {
del(['public'], cb);
});
gulp.task('default', function() {
});
gulp.task("webpack", function(callback) {
// run webpack
webpack({
}, function(err, stats) {
if(err) throw new gutil.PluginError("webpack", err);
gutil.log("[webpack]", stats.toString({
// output options
}));
callback();
});
});
================================================
FILE: model/Apply.js
================================================
/**
* *@info: Apply 数据实体
* @author: coverGuo
* @date: 2014-12-30
*/
var _ = require('underscore')._;
/**
* status 0 审核中 , 1 通过 , 2 不通过
* @param args
* @constructor
*/
var Apply = function (args){
if(!args){
return ;
}
_.defaults( this , _.pick(args , 'userName' ,'name' , 'id' , 'description' , 'main', 'createTime' , 'passTime' ) );
}
Apply.prototype = {
userName : undefined,
name : undefined,
url : undefined,
status : undefined,
id : undefined,
mail : undefined,
description : undefined,
createTime : undefined,
passTime : undefined
}
Apply.STATUS_APPLYING = 0 ; // 审核中
Apply.STATUS_PASS = 1 ; // 通过
Apply.STATUS_FAIL = 2 ; // 拒绝
module.exports = Apply;
================================================
FILE: model/Approve.js
================================================
/**
* *@info: Approve 数据实体
* @author: coverGuo
* @date: 2014-12-30
*/
var _ = require('underscore')._;
var Approve = function (args){
if(!args){
return ;
}
_.defaults(this , _.pick(args , 'id' ,'reply' , 'applyId' ));
}
Approve.prototype = {
id : undefined,
reply : undefined,
applyId : undefined,
userName : undefined,
createTime : undefined,
applyStatus : undefined
}
module.exports = Approve;
================================================
FILE: model/User.js
================================================
/**
* *@info: User 数据实体
* @author: coverGuo
* @date: 2014-12-30
*/
var _ = require("underscore");
/**
* role : 0 普通成员 1 管理员
* @param args
* @constructor User
*/
var User = function(args){
if(!args){
return;
}
_.defaults(this, _.pick(args, 'id', 'loginName', 'chineseName', 'role'));
}
User.prototype = {
id : undefined,
loginName : undefined,
chineseName: undefined,
role : undefined
}
module.exports = User;
================================================
FILE: model/UserApply.js
================================================
/**
* *@info: userApply 数据实体
* @author: coverGuo
* @date: 2015-01-15
*/
var _ = require('underscore')._;
var User_Apply = function (args){
if(!args){
return ;
}
_.defaults(this , _.pick(args , 'userId' ,'applyId' ,'createTime', 'role' ));
}
User_Apply.prototype = {
userId : undefined,
applyId : undefined,
createTime : undefined,
role : undefined
}
module.exports = User_Apply;
================================================
FILE: oos/demo/demooos.js
================================================
var oa = require('yourOaModuel');
var crypto = require('crypto');
var log4js = require('log4js'),
logger = log4js.getLogger();
var isError = function(res, error) {
if (error) {
res.json({
ret: 1,
msg: error
});
return true;
}
return false;
};
module.exports = function(req, res, next) {
var params = req.query,
user = req.session.user,
userDao = req.models.userDao;
req.indexUrl = req.protocol + "://" + req.get('host') + '/user/index.html';
//跳转到 oa 进行登录
if (/^\/oalogin/i.test(req.url)) {
var redirectUrl = req.indexUrl;
res.redirect('http://youroalogin.com?url=' + redirectUrl);
return;
}
//判断是否有ticket ,一般的oa统一登录都会有用 ticket进行统一登录
if (params && params.ticket) {
// 调用你的oa 组件,进行登录处理
oa.passport(params.ticket, function(result) {
if (result) {
// 存入session ,用于判断此用户已经登录
user = req.session.user = {
loginName: result.LoginName,
chineseName: result.ChineseName,
role: 0
};
userDao.one({
loginName: result.LoginName
}, function(err, dbUser) {
if (isError(res, err)) {
return;
}
// 用户没有登录 badjs, 进行创建用户信息
if (!dbUser) {
req.session.user.email = user.loginName + GLOBAL.pjconfig.email.emailSuffix;
req.session.user.password = crypto.createHash("md5").update(user.loginName).digest('hex');
userDao.create(req.session.user, function(err, result) {
if (isError(res, err)) {
return;
}
req.session.user.role = result.role;
req.session.user.id = result.id;
logger.info("New User:" + JSON.stringify(req.session.user) + "insert into db-badjs");
next();
});
} else {
// 已经登陆过了,将更加详细的信息注入到session中
logger.info("Old User:" + JSON.stringify(req.session.user));
req.session.user.role = dbUser.role;
req.session.user.id = dbUser.id;
req.session.user.email = dbUser.email;
// 用户没有登陆过,但是在 http://badjs.server.com/user/userManage.html 创建过id
// 讲oa 回传的信息存入数据库
if (!dbUser.chineseName) {
dbUser.chineseName = result.ChineseName;
dbUser.save(function(err, result) {});
}
next();
}
});
} else {
res.send(403, 'Sorry! you can not see that.');
}
});
} else {
next();
}
};
================================================
FILE: package.json
================================================
{
"name": "badjs-web",
"version": "0.1.0",
"description": "",
"main": "app.js",
"dependencies": {
"body-parser": "^1.9.0",
"connect-flash": "^0.1.1",
"cookie-parser": "^1.3.3",
"crypto": "0.0.3",
"ejs-loader": "^0.2.1",
"emailjs": "0.3.16",
"expose-loader": "^0.6.0",
"express": "^4.9.8",
"express-micro-tpl": "^0.3.1",
"express-session": "^1.9.0",
"jquery": "^2.1.3",
"log4js": "^0.6.2",
"map-stream": "0.0.5",
"moment": "^2.10.2",
"mysql": "^2.11.1",
"node-highcharts-exporting": "~0.0.9",
"orm": "^3.2.0",
"orm-transaction": "0.0.2",
"passport": "^0.2.1",
"passport-local": "^1.0.0",
"request": "^2.63.0",
"serve-static": "^1.7.1",
"underscore": "1.5.2",
"url-join": "0.0.1",
"url-valid": "^0.3.0",
"ws": "~1.0.0",
"axon": "^2.0.0"
},
"devDependencies": {
"webpack": "~1.8.5",
"glob": "~5.0.5"
},
"scripts": {},
"author": "",
"license": "MIT"
}
================================================
FILE: project.debug.json
================================================
{
"host" : "http://badjs.server.com/",
"port": 8081,
"mysql" : {
"url" : "mysql://root:root@localhost:3306/badjs"
},
"storage" : {
"errorMsgTopUrl" : "http://127.0.0.1:9000/errorMsgTop",
"queryUrl" : "http://127.0.0.1:9000/query"
},
"acceptor": {
"pushProjectUrl" : "http://127.0.0.1:9001/getProjects"
},
"openapi": {
"pushProjectUrl" : "http://127.0.0.1:9002/getProjects"
},
"mq": {
"url": "tcp://127.0.0.1:10000",
"subscribe": "badjs",
"module": "axon"
},
"email": {
"homepage": "http://badjs.server.com/user/index.html",
"from": "noreply-badjs@demo.com",
"emailSuffix" : "@demo.com",
"smtp": "smtp.demo.com",
"smtpUser": "username",
"smtpPassword":"password",
"time": "09:00:00",
"top": 20,
"module": "email"
}
}
================================================
FILE: project.json
================================================
{
"host" : "http://badjs.server.com/",
"port": 8081,
"mysql" : {
"url" : "mysql://root:root@localhost:3306/badjs"
},
"storage" : {
"errorMsgTopUrl" : "http://127.0.0.1:9000/errorMsgTop",
"queryUrl" : "http://127.0.0.1:9000/query"
},
"acceptor": {
"pushProjectUrl" : "http://127.0.0.1:9001/getProjects"
},
"openapi": {
"pushProjectUrl" : "http://127.0.0.1:9002/getProjects"
},
"mq": {
"url": "tcp://127.0.0.1:10000",
"subscribe": "badjs",
"module": "axon"
},
"email": {
"homepage": "http://badjs.server.com/user/index.html",
"from": "noreply-badjs@demo.com",
"emailSuffix" : "@demo.com",
"smtp": "smtp.demo.com",
"smtpUser": "username",
"smtpPassword":"password",
"time": "09:00:00",
"top": 20,
"module": "email"
}
}
================================================
FILE: retCode.txt
================================================
ret结果码记录:
0 : 成功
1001: 没有登录
1002: 缺少参数 或参数错误
1003: 权限不足
1004: 查询为空
================================================
FILE: service/ApplyService.js
================================================
/**
* Created by coverguo on 2015/01/08.
*/
var http = require('http');
var log4js = require('log4js'),
logger = log4js.getLogger();
var UserApplyService = require('./UserApplyService');
var LogService = require('./LogService');
var ApplyService = function() {
this.applyDao = global.models.applyDao;
this.userApplyDao = global.models.userApplyDao;
};
var logService = new LogService();
var pushProject = function(from) {
logService.pushProject(function(err) {
if (err) {
logger.warn('push project error ' + err);
} else {
logger.info('push project success from ' + from + ' .');
}
});
}
ApplyService.prototype = {
queryListByAdmin: function(target, callback) {
this.applyDao.find(["createTime", "Z"], function(err, items) {
if (err) {
callback(err);
return;
}
callback(null, items);
});
},
queryListByUser: function(target, callback) {
this.applyDao.find({
userName: target.user.loginName
}, ["createTime", "Z"], function(err, items) {
if (err) {
callback(err);
return;
}
callback(null, items);
});
},
queryListBySearch: function(searchParam, callback) {
this.applyDao.find(searchParam, ["createTime", "Z"], function(err, items) {
if (err) {
callback(err);
return;
}
callback(null, items);
});
},
add: function(target, callback) {
var self = this;
var userId = target.user.id;
this.applyDao.create(target, function(err, newApply) {
if (err) {
callback(err);
return;
}
logger.debug("Insert into b_apply success! target1: " + newApply.id);
//创建项目的即为管理员 故role ==1
var userApply = {
userId: userId,
applyId: newApply.id,
role: 1,
createTime: new Date()
};
self.userApplyDao.create(userApply, function(err, items) {
if (err) {
callback(err);
return;
}
callback(null);
})
});
},
remove: function(target, callback) {
this.applyDao.one({
id: target.id
}, function(err, apply) {
// SQL: "SELECT * FROM b_apply WHERE name = 'xxxx'"
if (err || !apply) {
callback(new Error("can not found apply , id" + target.id));
return;
}
for (var key in target) {
apply[key] = target[key];
};
apply.remove(function(err) {
if (err) {
console.error("remove error : " + err.toString())
throw err;
}
var userApplyService = new UserApplyService();
userApplyService.removeByApplyId({
applyId: apply.id
}, function(err) {
if (err) {
callback(null);
} else {
callback(null);
}
});
pushProject('remove');
});
});
},
update: function(target, callback) {
this.applyDao.one({
id: target.id
}, function(err, apply) {
// SQL: "SELECT * FROM b_apply WHERE name = 'xxxx'"
for (var key in target) {
apply[key] = target[key];
};
apply.save(function(err) {
// err.msg = "under-age";
callback(null, {
ret: 0,
msg: "success update"
});
// update project.db
pushProject('update');
});
});
},
queryById: function(target, callback) {
this.applyDao.one({
id: target.id
}, function(err, apply) {
callback(err, apply);
});
}
}
module.exports = ApplyService;
================================================
FILE: service/ApproveService.js
================================================
/**
* Created by coverguo on 2015/01/12.
*/
var http = require('http');
var log4js = require('log4js'),
logger = log4js.getLogger();
var ApproveService = function() {
this.approveDao = global.models.approveDao;
this.applyDao = global.models.applyDao;
};
ApproveService.prototype = {
query: function(target, callback) {
//管理员
if (target.user.role == 1) {
this.approveDao.all({}, function(err, items) {
if (err) {
callback(err);
return;
}
callback(null, {
ret: 0,
msg: "success",
data: items
});
});
} else {
this.approveDao.find({
userName: target.user.loginName
}, function(err, items) {
if (err) {
callback(err);
return;
}
callback(null, {
ret: 0,
msg: "success",
data: items
});
});
}
},
add: function(target, callback) {
var self = this;
this.approveDao.create(target, function(err, items) {
if (err) {
callback(err);
return;
}
logger.info("Insert into b_approve success! target: ", target);
// 改变申请表状态
var apply = {
id: parseInt(target.applyId, 10),
status: parseInt(target.applyStatus, 10)
};
if (target.applyStatus == 1) {
apply.passTime = target.createTime;
}
self.update(apply, function(err, data) {
if (err) {
callback(err);
return;
}
logger.info("Update b_apply success! apply: ", apply);
callback(null, {
ret: 0,
msg: "success add"
});
})
});
},
remove: function(target, callback) {
},
update: function(target, callback) {
this.applyDao.one({
id: target.id
}, function(err, apply) {
// SQL: "SELECT * FROM b_apply WHERE name = 'xxxx'"
for (key in target) {
apply[key] = target[key];
}
apply.save(function(err) {
if (err) {
callback(err);
return;
}
callback(null);
});
});
}
}
module.exports = ApproveService;
================================================
FILE: service/BusinessService.js
================================================
/**
* Created by chriscai on 2014/12/17.
*/
var Apply = require('../model/Apply');
var _ = require('underscore');
var BusinessService = function() {
this.db = global.models.db;
};
BusinessService.prototype = {
findBusinessByUser: function(userName, callback) {
var string = "select a.id, u.loginName, u.chineseName, ua.role, a.name " +
"from b_user as u join b_user_apply as ua on(ua.userId = u.id) " +
"join b_apply as a on (a.id =ua.applyId) " +
"where a.status=? and u.loginName=? ";
var condition = [Apply.STATUS_PASS];
condition.push(userName);
// console.log(string);
this.db.driver.execQuery(string, condition, function(err, data) {
if (err) {
callback(err);
return;
}
callback(null, data);
});
},
findBusinessByProjectOwner: function(userName, callback) {
var string = "select a.id, u.loginName, u.chineseName, ua.role, a.name " +
"from b_user as u join b_user_apply as ua on(ua.userId = u.id) " +
"join b_apply as a on (a.id =ua.applyId) " +
"where a.status=? and u.loginName=? and ua.role =1";
var condition = [Apply.STATUS_PASS];
condition.push(userName);
// console.log(string);
this.db.driver.execQuery(string, condition, function(err, data) {
if (err) {
callback(err);
return;
}
callback(null, data);
});
},
findBusiness: function(callback) {
var string = "select a.id, a.url, a.blacklist , a.appkey, u.loginName, u.chineseName, a.name " +
"from b_apply a join b_user u on (a.userName=u.loginName) " +
"where a.status=?";
var condition = [Apply.STATUS_PASS];
// console.log(string);
this.db.driver.execQuery(string, condition, function(err, data) {
if (err) {
return callback(err);
}
_.each(data, function(value, ke) {
value.role = 1;
});
callback(null, data);
});
}
};
module.exports = BusinessService;
================================================
FILE: service/EmailService.js
================================================
/* global global, global, module, __dirname, Buffer */
/**
* Created by kaelyang on 2015/5/19.
*/
var fs = require("fs");
var http = require('http');
var path = require("path");
var _ = require('underscore');
var logger = require('log4js').getLogger();
var UserService = require('./UserService');
var dateFormat = require("../utils/dateFormat");
var exporting = require('node-highcharts-exporting');
var StatisticsService = require('./StatisticsService');
var sendEmail = require("../utils/" + global.pjconfig.email.module);
var DAY_LENGTH = 30;
var EmailService = function() {
this.userService = new UserService();
this.statisticsService = new StatisticsService();
this.top = parseInt(global.pjconfig.email.top, 10) || 20;
this.from = global.pjconfig.email.from || "noreply-badjs@tencent.com";
this.homepage = global.pjconfig.email.homepage;
};
var getYesterday = function() {
var date = new Date();
date.setDate(date.getDate() - 1);
date.setHours(0, 0, 0, 0);
return date;
};
var setChartX = function(number) {
var days = [];
var nowDay = new Date() - 0;
for (var i = number; i > 0; i--) {
var day = nowDay - i * 1000 * 60 * 60 * 24;
days.push(dateFormat(new Date(day), 'MM-dd'));
}
return days;
};
var getImageData = function(name, data) {
var totalArray = [];
var categories = setChartX(DAY_LENGTH);
for (var i = 0; i < DAY_LENGTH; i++) {
totalArray.push(0);
}
function whichDayIndex(day1) {
for (var i = 0, len = categories.length; i < len; i++) {
if (day1 == categories[i]) {
return i;
}
}
return false;
}
_.forEach(data, function(value, key) {
var index = whichDayIndex(dateFormat(new Date(value.startDate), 'MM-dd'));
totalArray[index] = value.total;
});
return {
data: {
width: 800,
title: {
text: "The last " + DAY_LENGTH + " days line charts"
},
xAxis: {
categories: categories
},
yAxis: {
min: 0,
title: {
text: 'Total'
}
},
series: [{
data: totalArray,
name: "-"
}]
}
};
};
var encodeHtml = function(str) {
return (str + '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\x60/g, '`').replace(/\x27/g, ''').replace(/\x22/g, '"').replace(/\u0000/g, ' ');
};
EmailService.prototype = {
render: function(data, imagePath) {
var that = this;
data = data || {};
var html = [];
html.push('<html>');
html.push('<h3>【BadJS日报邮件】 ' + data.title + '</h3>');
that.homepage &&
html.push('<p style="font-size:12px"><a href="{{homepage}}">日志查看点这: {{homepage}}</a></p>'
.replace(/{{homepage}}/g, that.homepage));
var content = data.content;
if (content && content.length) {
if (imagePath) {
html.push('<h4>最近' + DAY_LENGTH + '天图表统计</h4>');
html.push('<p><img src="' + global.pjconfig.host + imagePath + '"></p>');
}
html.push('<table style="border-collapse:collapse;;width:95%"><tr style="background-color:#188eee;text-align:left;color:#fff"><th style="padding:2px 0 2px 10px;border:1px solid #dedede;width:60px">#</th><th style="padding:2px 0 2px 10px;border:1px solid #dedede;;width:120px">出现次数</th><th style="padding:2px 0 2px 10px;border:1px solid #dedede">错误内容</th></tr>');
var total_top = 0;
var index = 0;
content.forEach(function(v) {
v = typeof v === 'object' ? v : null;
if (v) {
html.push('<tr style="background-color:{{bgc}}"><td style="padding:2px 0 2px 10px;border:1px solid #dedede">{{index}}</td><td style="padding:2px 0 2px 10px;border:1px solid #dedede">{{times}}</td><td style="padding:2px 0 2px 10px;border:1px solid #dedede">{{desc}}</td></tr>'
.replace(/{{index}}/g, index + 1)
.replace(/{{times}}/g, v.total)
.replace(/{{desc}}/g, encodeHtml(v.title))
.replace(/{{bgc}}/g, index % 2 ? '#fff' : '#eee')
);
total_top += v.total;
++index;
}
});
html.push('</table>');
var total = data.total;
total > 0 && html.push('<p style="border-top:1px solid #666;margin-top:20px;width:520px;padding:5px 0 0 10px">共 {{total}} 条记录, Top {{top}} 占 {{per}}.</p>'
.replace(/{{total}}/g, total)
.replace(/{{top}}/g, that.top)
.replace(/{{per}}/g, (total_top * 100 / total).toFixed(2) + '%')
);
} else {
html.push('<p style="border-top:1px solid #666;margin-top:20px;width:520px;padding:5px 0 0 10px">暂无数据</p>');
}
html.push('</html>');
return html.join('');
},
queryAll: function(isRetry, sendObject) {
var that = this;
that.date = getYesterday();
logger.info('Send mail query all start');
that.userService.queryListByCondition({
applyId: -1,
role: -1
}, function(err, userlist) {
if (err) {
return logger.error('Send email userService queryListByCondition error');
} else {
var orderByApplyId = {};
userlist.forEach(function(v) {
// 兼容没有登陆过的用户,自动拼接 邮箱后缀
if (!v.email) {
v.email = v.loginName + global.pjconfig.email.emailSuffix;
}
if (orderByApplyId[v.applyId]) {
orderByApplyId[v.applyId].push(v);
} else {
orderByApplyId[v.applyId] = [v];
}
});
var count = 0 ;
for (var applyId in orderByApplyId) {
(function(users, applyId) {
var to_list = []; // 收件方
var cc_list = []; // 抄送方
var name = '';
users.forEach(function(v) {
v.role === 0 ? cc_list.push(v.email) : to_list.push(v.email);
name = v.name;
}); // jshint ignore:line
// 测试代码
if (sendObject) {
if (sendObject.sendId && sendObject.sendId != applyId) {
return;
}
if (sendObject.sendToList.length) {
to_list = sendObject.sendToList;
}
cc_list = [];
}
that.statisticsService.queryById({
top: that.top,
projectId: applyId,
startDate: that.date
}, function(err, data) {
if (err) return logger.error('Send email statisticsService queryById error ' + applyId);
if (data && data.length > 0) {
that.statisticsService.queryByChart({
projectId: applyId,
timeScope: 2
}, function(err, chartData) {
if (err || chartData.data.length <= 0) {
that.sendEmail({
to: to_list,
cc: cc_list,
title: name
}, data[0]);
} else {
count ++ ;
setTimeout(function (){
exporting(getImageData(name, chartData.data), function(err, image) {
if (err) {
logger.info("generate image error " + err.toString() + ", id =" + applyId);
that.sendEmail({
to: to_list,
cc: cc_list,
title: name
}, data[0]);
} else {
var imagePath = "static/img/tmp/" + (new Date - 0 + applyId) + ".png";
fs.writeFile(path.join(__dirname, "..", imagePath), new Buffer(image, 'base64'), function() {
that.sendEmail({
to: to_list,
cc: cc_list,
title: name,
imagePath: imagePath
}, data[0]);
});
}
});
}, 1000 * count)
}
});
} else {
logger.error('Send email data format error by ' + applyId );
}
}); // jshint ignore:line
})(orderByApplyId[applyId], applyId); // jshint ignore:line
}
}
});
// if( isRetry === undefined ? true : !!isRetry) {
setTimeout(function() {
that.queryAll();
}, 86400000);
// }
},
sendEmail: function(emails, data) {
var title = "【BadJS 日报 " + dateFormat(this.date, "yyyy-MM-dd") + "】- " + emails.title;
data.title = emails.title;
var content = this.render(data, emails.imagePath);
sendEmail(this.from, emails.to, emails.cc, title, content);
},
start: function() {
var that = this;
var date = new Date();
date.setDate(date.getDate() + 1);
var time = global.pjconfig.email.time.toString().split(':');
date.setHours(parseInt(time[0], 10) || 9, parseInt(time[1], 10) || 0, parseInt(time[2], 10) || 0, 0);
var timeDiff = date.valueOf() - (new Date()).valueOf();
setTimeout(function() {
that.queryAll();
}, timeDiff);
logger.info('Email service will start after: ' + timeDiff);
}
};
module.exports = EmailService;
================================================
FILE: service/LogService.js
================================================
/* global global */
/**
* Created by chriscai on 2014/12/16.
*/
var http = require('http');
var log4js = require('log4js'),
BusinessService = require('./BusinessService'),
_ = require('underscore'),
logger = log4js.getLogger();
var request = require("request");
var LogService = function() {
/*
if(global.DEBUG){
this.queryUrl = 'http://localhost:9000/query';
}else {
this.queryUrl = 'http://10.143.132.205:9000/query';
this.pushProjectUrl = 'http://10.143.132.205:9001/getProjects';
}
*/
this.queryUrl = global.pjconfig.storage.queryUrl;
this.pushProjectUrl = global.pjconfig.acceptor.pushProjectUrl;
this.pushProjectUrl2 = global.pjconfig.openapi.pushProjectUrl;
// this.url = 'http://127.0.0.1:9000/query';
logger.debug('query url : ' + this.queryUrl);
};
LogService.prototype = {
query: function(params, callback) {
var startDate = new Date;
var strParams = '';
for (var key in params) {
if (key == 'index') {
strParams += key + "=" + params[key] + "&";
} else {
strParams += key + "=" + encodeURIComponent(JSON.stringify(params[key])) + "&";
}
}
strParams += '_=1';
logger.debug('query param : ' + strParams);
http.get(this.queryUrl + '?' + strParams, function(res) {
var buffer = '';
res.on('data', function(chunk) {
buffer += chunk.toString();
}).on('end', function() {
try {
callback(null, JSON.parse(buffer));
} catch (e) {
callback(e);
}
logger.info('query log spend : ' + (new Date - startDate) + "ms by " + params.id);
});
}).on('error', function(err) {
logger.warn('error :' + err);
callback(err);
});
},
pushProject: function(callback) {
var self = this;
callback || (callback = function() {});
var businessService = new BusinessService();
var push = function() {
businessService.findBusiness(function(err, item) {
var projectsInfo = {};
_.each(item, function(value) {
try{
value.blacklist = JSON.parse(value.blacklist || {})
}catch(e){
value.blacklist = {}
}
projectsInfo[value.id] = {id : value.id , url : value.url , blacklist : value.blacklist , appkey : value.appkey};
});
var result = [0, 0];
var resultCall = function() {
if (result[0] < 0 && result[1] < 0) {
callback(new Error("error"));
} else if (result[0] > 0 && result[1] > 0) {
callback();
}
};
request.post(self.pushProjectUrl, {
form: {
projectsInfo: JSON.stringify(projectsInfo),
auth: "badjsAccepter"
}
}, function(err) {
if (err) {
logger.warn('push projectIds to acceptor error :' + err);
result[0] = -1;
} else {
logger.info('push projectIds to acceptor success');
result[0] = 1;
}
resultCall();
});
request.post(self.pushProjectUrl2, {
form: {
projectsInfo: JSON.stringify(projectsInfo),
auth: "badjsOpen"
}
}, function(err) {
if (err) {
logger.warn('push projectIds to open error :' + err);
result[1] = -1;
} else {
logger.info('push projectIds to openapi success');
result[1] = 1;
}
resultCall();
});
});
};
push();
}
};
module.exports = LogService;
================================================
FILE: service/OfflineLogService.js
================================================
/**
* Created by chriscai on 2015/4/29.
*/
var fs = require("fs");
var http = require("http");
var path = require("path");
var bodyParser = require('body-parser');
var express = require('express');
var app = express();
global.offlineLogMonitorInfo = {}
var log4js = require('log4js'),
logger = log4js.getLogger();
var offlineLogMonitorPath = path.join(__dirname , '..' , 'offline_log' , "offline_log_monitor.db");
try{
global.offlineLogMonitorInfo = JSON.parse( fs.readFileSync(offlineLogMonitorPath).toString());
logger.info("offline_log_monitor.db success " )
}catch(e){
logger.error("offline_log_monitor.db error " , e)
}
setInterval(function (){
fs.writeFileSync(offlineLogMonitorPath , JSON.stringify(global.offlineLogMonitorInfo));
},3600000 )
app.use(bodyParser.urlencoded({ extended: false }));
app.post("/offlineLogReport" , function (req, res){
var param = req.body;
if(param && param.offline_log){
try{
var offline_log = JSON.parse(param.offline_log);
if(!/[\w]{1,7}/.test(offline_log.id) ){
throw new Error("invalid id " + offline_log.id)
}
global.models.applyDao.one({
id: offline_log.id
}, function(err, apply) {
if(!apply || err || apply.status != 1){
logger.info('invaild offlineLog id: ' + offline_log.id);
return ;
}
if(!/^\w+$/i.test( offline_log.id )){
logger.info('error log_id: ' + offline_log.id);
return ;
}
var filePath = path.join(__dirname , '..' , 'offline_log' , offline_log.id +"");
var fileName = offline_log.uin +"_"+ offline_log.startDate + "_" + offline_log.endDate;
if(!fs.existsSync(filePath)){
fs.mkdirSync(filePath)
}
fs.writeFile(path.join(filePath , fileName ) , param.offline_log, function(err) {
if (err) {
logger.info('write offline log error', err);
throw err;
}
});
logger.info('get offline log : ' + path.join(filePath , fileName ));
});
}catch(e){
logger.warn("invaild offlineLog error "+ e);
}
}
res.end();
})
app.use("/offlineLogCheck" , function (req, res){
var param = req.query;
if(param.id && param.uin && global.offlineLogMonitorInfo[param.id] && global.offlineLogMonitorInfo[param.id][param.uin]){
delete global.offlineLogMonitorInfo[param.id][param.uin]
logger.info('should download offline log: ' + (param.id + "_" + param.uin));
res.end("true")
}else {
res.end("false")
}
})
/**
* dispatcher
* @returns {Stream}
*/
module.exports = function () {
logger.info("offline service start ok...")
app.listen(9010);
};
================================================
FILE: service/RealtimeService.js
================================================
/**
* Created by chriscai on 2015/4/29.
*/
var ProcessorThread = require("../service/worker/ProcessorPool");
var WebSocketServer = require('ws').Server;
var http = require("http");
var path = require("path");
var log4js = require('log4js'),
logger = log4js.getLogger();
/**
* dispatcher
* @returns {Stream}
*/
module.exports = function (app) {
logger.info("starting mq ..." );
var server = http.createServer(app);
app.listen = function(){
return server.listen.apply(server, arguments)
};
var webSocketServer = new WebSocketServer({
server: server,
path: "/ws/realtimeLog"
});
ProcessorThread.createPool();
webSocketServer.on('connection', function (ws) {
try{
logger.info("one client connected , ip: " + ws._socket.remoteAddress)
}catch(e){}
createProcessor(ws);
});
webSocketServer.on('close', function (ws) {
try{
logger.info("one client closed , ip: " + ws._socket.remoteAddress)
}catch(e){}
});
var createProcessor = function (ws){
ProcessorThread.getProcessor().start({wbClient : ws});
}
};
================================================
FILE: service/StatisticsService.js
================================================
/**
* Created by chriscai on 2015/1/12.
*/
var http = require('http');
var log4js = require('log4js'),
Apply = require('../model/Apply'),
http = require('http'),
_ = require('underscore'),
logger = log4js.getLogger(),
ORM = require("orm");
var dateFormat = function(date, fmt) {
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
}
return fmt;
};
var StatisticsService = function() {
this.statisticsDao = global.models.statisticsDao;
this.applyDao = global.models.applyDao;
//this.triggerUrl = global.pjconfig.storage.errorMsgTopCacheUrl;
this.url = global.pjconfig.storage.errorMsgTopUrl;
logger.debug('query url : ' + this.url);
};
StatisticsService.prototype = {
queryById: function(param, callback) {
this.statisticsDao.find({
projectId: param.projectId,
startDate: dateFormat(param.startDate, 'yyyy-MM-dd hh:mm:ss')
}, function(err, items) {
if (err) {
callback(err);
return;
}
try {
if (items[0]) {
items[0].content = JSON.parse(items[0].content);
if (param.top) {
items[0].content = items[0].content.slice(0, param.top);
}
}
} catch (e) {
callback(e);
logger.error("queryById error : " + param.projectId + ", error :" + e.toString());
return;
}
callback(null, items);
});
},
queryByChart: function(param, callback) {
//筛选参数
var s_params = {};
if (param.projectId != -1) {
s_params.projectId = param.projectId;
}
//时间开始范围 7天内 或者1个月内
var oneDay = 1000 * 60 * 60 * 24;
var day = param.timeScope == 1 ? 7 : 30;
param.startTime = new Date() - oneDay * day;
param.startTime = dateFormat(new Date(param.startTime), 'yyyy-MM-dd');
if (global.DEBUG) {
logger.debug("query start time is " + param.startTime);
}
this.statisticsDao.find(s_params)
.only("endDate", "startDate", "projectId", "id", "total")
.where("startDate >=?", [param.startTime])
.all(function(err, items) {
if (err) {
callback(err);
return;
}
callback(null, {
ret: 0,
msg: "success",
data: items
});
}).where(function() {
});
},
fetchAndSave: function(id, startDate, cb) {
var self = this;
http.get((this.url + '?id=' + id + '&startDate=' + (startDate - 0)), function(res) {
var buffer = '';
res.on('data', function(chunk) {
buffer += chunk.toString();
}).on('end', function() {
var saveModel = {};
try {
//replace emoji to empty , mysql unsupported emoji code
buffer=buffer.replace(/\ud83d[\udc00-\udfff]/gi , "")
var result = JSON.parse(buffer);
_.forEach(result.item, function(value, key) {
value.title = value._id;
delete value._id;
});
saveModel = {
startDate: new Date(result.startDate),
endDate: new Date(result.endDate),
content: JSON.stringify(result.item),
projectId: id,
total: result.pv
};
} catch (err) {
logger.error('parse statistic result error(id='+id+') :' + err);
saveModel = {
startDate: startDate,
endDate: new Date(+startDate + 86400000-1),
content: "[]",
projectId: id,
total: 0
};
}
self.statisticsDao.create(saveModel, function(err, items) {
if (err) {
logger.error("Insert into b_statistics error(id=", id + ") : " + err);
}
logger.info("Insert into b_statistics success(id=", id + ") : ");
cb && cb(err);
});
});
}).on('error', function(err) {
logger.error('error :' + err);
});
},
//triggerStorageCache: function(ids, startDate, cb) {
// http.get((this.triggerUrl + '?ids=' + ids + '&startDate=' + (startDate - 0)), function(res) {
// // res.on("end" , function (){
// cb();
// // });
// }).on('error', function(err) {
// cb(err);
// logger.error('triggerStorageCache error :' + err);
// });
//},
startMonitor: function() {
var self = this;
var getFetchDate = function() {
var tomorrow = new Date(nowDate);
tomorrow.setHours(2, 0, 0, 0);
tomorrow.setDate(tomorrow.getDate() + 1);
return tomorrow;
};
var getStartDay = function() {
var startDate = new Date(nowDate);
startDate.setHours(0, 0, 0, 0);
return startDate;
};
var nowDate = new Date;
var targetDate = getFetchDate();
var startTimeout = function() {
var afterDate = targetDate - nowDate;
// after date 有误,取消循环
if (isNaN(afterDate) || afterDate < 1000 * 60 * 60) {
logger.info("afterDate error : targetDate" + targetDate + " , now:" + nowDate);
return;
}
setTimeout(function() {
var startDate = getStartDay();
self.applyDao.find({
status: Apply.STATUS_PASS
}, function(err, item) {
if (err) {
logger.error("find apply error : " + err);
}
var ids = "0";
_.each(item, function(value, key) {
ids += "_" + value.id;
});
//self.triggerStorageCache(ids, startDate, function(err) {
// logger.info("trigger success and after 5400000s fetch result");
//if (!err) {
// setTimeout(function() {
logger.info("start fetching result ... ");
var count = 0;
_.each(item, function(value, key) {
setTimeout(function (){
self.fetchAndSave(value.id, startDate);
}, count * 500)
count ++;
});
//}, 5400000); // 1个半小时候后,拉取统计
//}
//});
nowDate = new Date();
targetDate = getFetchDate();
startTimeout();
});
}, afterDate);
logger.info("after " + ((afterDate) / 1000) + "s will fetch again ");
};
startTimeout();
}
};
module.exports = StatisticsService;
================================================
FILE: service/UserApplyService.js
================================================
/**
* Created by coverguo on 2015/01/15.
*/
var http = require('http'),
log4js = require('log4js'),
logger = log4js.getLogger();
var userApplyService = function (){
this.userApplyDao = global.models.userApplyDao;
this.userDao = global.models.userDao;
};
userApplyService.prototype = {
query : function (target , callback){
},
add: function(target, callback){
var self = this;
var userApply ={
applyId : target.applyId,
role : 0,
createTime : new Date()
};
this.userDao.one({loginName:target.userName}, function(err, item){
if(err){
callback(err);
return;
}
if(item){
userApply.userId = item.id;
self.userApplyDao.create(userApply , function (err , items){
if(err){
callback(err);
return;
}
logger.info("Insert into b_user_apply success! target1: " + items.id);
callback(null);
return;
});
}else {
var newUser = {
loginName : target.userName,
role : 0,
createTime : new Date()
};
self.userDao.create(newUser,function(err){
if(err){
callback(err);
return;
}
logger.info("Insert into b_user success! ");
self.add(target, callback);
})
}
})
},
removeByApplyId : function(target, callback){
this.userApplyDao.find({applyId: target.applyId}).remove( function (err) {
if(err ){
callback(err);
}else {
callback(null);
}
})
},
remove : function(target, callback){
this.userApplyDao.one({id: target.id}, function (err, item) {
if(err){
callback(err);
return;
}
item.remove(function(err) {
if (err) {
callback(err);
return;
}
if (global.DEBUG) {
logger.info("remove success item: " + item);
}
callback(null);
});
})
},
auth : function(target, callback){
this.userApplyDao.one({id: target.id}, function (err, item) {
if(err){
callback(err);
return;
}
if(item.role == 1){
callback("had authed");
return ;
}
item.role = 1;
item.save(function(err) {
if (err) {
callback(err);
return;
}
if (global.DEBUG) {
logger.info("auth success item: " + item);
}
callback(null);
});
})
}
}
module.exports = userApplyService;
================================================
FILE: service/UserService.js
================================================
/**
/**
* Created by coverguo on 2015/1/12.
*/
var http = require('http');
var Apply = require('../model/Apply');
var log4js = require('log4js'),
logger = log4js.getLogger();
var UserService = function (){
this.userDao = global.models.userDao;
this.userApplyDao = global.models.userApplyDao;
this.db = global.models.db;
};
UserService.prototype = {
queryListByCondition : function (target , callback){
var string = "select ua.id, u.loginName, u.email, u.chineseName, ua.applyId, ua.role, a.name "+
"from b_user as u join b_user_apply as ua on(ua.userId = u.id) "+
"join b_apply as a on (a.id =ua.applyId) where a.status=? ";
var condition = [Apply.STATUS_PASS ];
if(target.userId){
string += "and applyId in(select applyId from b_user_apply where userId =? and role = 1)";
condition.push(target.userId);
}
if(target.applyId !=-1){
string += "and applyId =? ";
condition.push(target.applyId);
}
if(target.role !=-1){
string += "and ua.role =? ";
condition.push(target.role);
}
this.db.driver.execQuery(string,condition, function (err, data) {
if(err){
callback(err);
return;
}
callback(null, data);
});
},
//查询用户创建项目的项目成员列表
queryListByUserProject : function(target, callback){
var string = "select ua.id, u.loginName, u.chineseName, ua.applyId, ua.role, a.name "+
"from b_user as u join b_user_apply as ua on(ua.userId = u.id) "+
"join b_apply as a on (a.id =ua.applyId) "+
"where applyId in(select applyId from b_user_apply where userId =?"+
" and role = 1);";
//console.log(string);
this.db.driver.execQuery(string,[target.user.id], function (err, data) {
if(err){
callback(err);
return;
}
callback(null, data);
});
},
queryUsersByCondition : function (target ,callback){
this.userDao.find(target , function (err , items){
if(err){
callback(err);
return;
}
callback(null, items);
});
},
add: function(target, callback){
this.userDao.create(target , function (err , items){
if(err){
callback(err);
return;
}
logger.info("Insert into b_user success! target1: ",target);
callback(null,{ret:0, msg:"success add"});
});
},
remove : function(target, callback){
},
update : function(target, callback){
this.userDao.one({id: target.id }, function (err, user) {
// SQL: "SELECT * FROM b_apply WHERE name = 'xxxx'"
for(key in target){
user[key] = target[key];
};
user.save(function (err) {
callback(err);
// err.msg = "under-age";
});
});
}
}
module.exports = UserService;
================================================
FILE: service/worker/Processor.js
================================================
var mq = require(global.pjconfig.mq.module)
, client = mq.socket('sub')
, mqUrl = global.pjconfig.mq.url
, service = global.pjconfig.mq.subscribe;
var log4js = require('log4js'),
logger = log4js.getLogger();
var events = require('events');
var _ = require("underscore");
var path = require("path");
var cluster = require('cluster');
cluster.setupMaster({
exec: path.join(__dirname , "Worker.js")
});
var support_signal = false;
var log4js = require('log4js'),
logger = log4js.getLogger();
var Processor = function (){
this.worker = cluster.fork({mqUrl : mqUrl , service :service , debug : !!global.DEBUG , mqModule : global.pjconfig.mq.module });
this.__pid__ = this.worker.process.pid;
this.eventEmitter = new events.EventEmitter();
}
Processor.prototype = {
start : function (obj){
this.wbClient = obj.wbClient;
this.id = 0;
logger.info("processor("+this.__pid__+") start monitor");
var self = this;
var messageQueue = [{type:"READY"}];
this.wbClient.on("message" , function (data){
if(self.worker.state == "online"){
// 新建一个worker 是有延迟的, 这个时候有message ,怎么加入队列,待其 OK 后在 send 给他
if(messageQueue.length){
_.each(messageQueue , function (value){
self.worker.send(value);
});
messageQueue = [];
}
self.worker.send(JSON.parse(data));
}else {
messageQueue.push(JSON.parse(data));
}
});
this.worker.on('message', function (data) {
if(data.type == "_STOP_"){
self.destroy();
}else {
try{
self.wbClient && self.wbClient.send(JSON.stringify(data));
}catch(e){
logger.info("one client had closed");
self.destroy();
}
}
});
this.wbClient.on("close" , function (data){
self.worker.send({type : "STOP"});
self.destroy();
});
},
isDead : function (){
if(!this.worker){
return true;
}
return this.worker.isDead();
},
destroy : function (isKill){
if(isKill){
this.worker.kill();
logger.info("processor("+this.__pid__+") killed " );
}else {
logger.info("processor("+this.__pid__+") stop monitor " );
}
this.worker.removeAllListeners();
this.wbClient = null;
this.eventEmitter.emit("destroy");
},
wait : function (){
support_signal && this.worker.kill("SIGSTOP");
},
notify : function (){
support_signal && this.worker.kill("SIGCONT");
},
on : function (key , cb){
var self = this;
this.eventEmitter.on(key , function (){
cb.apply(self,arguments);
})
}
};
module.exports = Processor;
================================================
FILE: service/worker/ProcessorPool.js
================================================
var Processor = require("./Processor");
var _ = require("underscore");
var log4js = require('log4js'),
logger = log4js.getLogger();
var STATUS_IDLE = "IDLE";
var STATUS_RUNNING = "RUNNING";
// 半个小时,回收新增的线程
var IDLE_TIMEOUT = 1800000;
var maxIdle = 15;
var ProcessorPool = function (){
var currentId = 0;
var idlePool = [];
var runningPool = [];
var processorMapping = {};
var init = function (){
monitorError();
recovery();
}
/* private */
var createProcessor = function (obj){
var p = {id : currentId++ , processor : new Processor() , status : obj.status || STATUS_IDLE , role : obj.role , createTime : new Date -0 };
p.processor.__id__ = p.id;
processorMapping[p.id] = p;
bindProcessorEvent(p);
return p;
}
var bindProcessorEvent = function (p){
p.processor.on("destroy" , function (){
ProcessorPool.destroy(this);
});
}
var monitorError = function (){
process.on("exit" , function (){
_.each(runningPool , function (value){
value.processor.destroy(true);
});
_.each(idlePool , function (value){
value.processor.destroy(true);
});
})
}
var idleProcessor = function (p){
var processor = processorMapping[p.__id__];
if(processor.status == STATUS_IDLE || processor.processor.isDead() ){
return ;
}else {
var index = 0;
for(var i = 0 ; i < runningPool.length ; i ++){
if(runningPool[i].id == p.__id__){
index = i;
break;
}
}
processor.status = STATUS_IDLE;
processor.processor.wait();
idlePool.push(runningPool.splice(index , 1)[0]);
logger.debug("idleProcessor id="+ p.__id__ + ", idle count: " + ProcessorPool.idleProcessors() +", running count: " + ProcessorPool.runningProcessors());
}
}
var recovery = function (){
setInterval(function (){
if( idlePool.length <= maxIdle){
return ;
}
var diff = idlePool.length - maxIdle;
logger.info("had "+diff + " should remove ... ");
for(var i = 0 ; i < diff ; i++){
var value = idlePool.splice(0,1)[0];
if(value){
value.processor.destroy(true);
logger.info("processor("+value.processor.__pid__+") remove");
}
}
logger.info("current length of idlePool " + idlePool.length);
//}, 1000 * 10 );
},900000); //15分钟,检测一次是否有多余的进程
}
ProcessorPool.createPool = function (number){
if(number){
maxIdle = number;
}
for(var i= 0 ; i <maxIdle ; i ++) {
var p = createProcessor({});
p.processor.wait();
idlePool.push(p);
}
logger.info("create ProcessPool , number : " + maxIdle);
monitorError();
}
ProcessorPool.getProcessor = function (){
var p;
if(idlePool.length <=0 ){
p = createProcessor({status : STATUS_RUNNING });
}else {
p = idlePool.splice(0,1)[0];
}
p.status = STATUS_RUNNING;
runningPool.push(p);
p.processor.notify();
logger.debug("runningProcessor id="+ p.processor.__id__ + ", idle count: " + ProcessorPool.idleProcessors() +", running count: " + ProcessorPool.runningProcessors());
return p.processor;
}
/**
* destroy processor
* @param p
*/
ProcessorPool.destroy = function (p){
idleProcessor(p);
}
/**
* return number of processor
* @returns {number}
*/
ProcessorPool.totalProcessors = function (){
return runningPool.length + idlePool.length;
}
/**
* return number of running processor
* @returns {Number}
*/
ProcessorPool.runningProcessors = function (){
return runningPool.length;
}
/**
* return number of idle processor
*/
ProcessorPool.idleProcessors = function (){
return idlePool.length;
}
init();
return ProcessorPool;
}
module.exports = ProcessorPool();
================================================
FILE: service/worker/Worker.js
================================================
/* global process */
var mq = require(process.env.mqModule);
var log4js = require('log4js'),
logger = log4js.getLogger();
var mqUrl = process.env.mqUrl;
var service = process.env.service;
var isDebug = process.env.debug == "false" ? false : true;
if (isDebug) {
logger.setLevel('DEBUG');
}
var filter = {};
var isInclude = function(str, regs) {
var result = true;
regs.forEach(function(value, key) {
if (str.indexOf(value) >= 0) {
result = result && true;
} else {
result = result && false;
}
});
return result;
};
var isExclude = function(str, regs) {
var result = true;
regs.forEach(function(value, key) {
if (str.indexOf(value) >= 0) {
result = result && true;
} else {
result = result && false;
}
});
return result;
};
var getSubscribe = function (str){
if(process.env.mqModule == "axon") {
return str + "*"
}
return str;
}
var monitorWorker = {
wbClient: {},
filter: {},
monitorKey: '',
mqClient: null,
_resetTimeoutFlag: function() {
this.wbClient._keepalive = new Date - 0;
this.wbClient._timeoutTimes = 0;
},
_keepAliveMonitor: function() {
var self = this;
if (this._monitorTimeoutId) {
clearInterval(this._monitorTimeoutId);
}
this._monitorTimeoutId = setInterval(function() {
var currentDate = new Date - 0;
if (!self.wbClient._keepalive) {
self._resetTimeoutFlag();
}
if (currentDate - self.wbClient._keepalive > 5000) {
self.wbClient._timeoutTimes++;
}
if (self.wbClient._timeoutTimes > 2) {
logger.info("one client timeout ");
process.send({
type: "_STOP_"
});
self.stopMonitor();
}
}, 5000);
},
init: function() {
var self = this;
process.on("message", function(data) {
switch (data.type) {
case "KEEPALIVE":
self._resetTimeoutFlag();
break;
case "READY":
self._keepAliveMonitor();
break;
case "INIT":
self.startMonitor(data);
break;
case "STOP":
self.stopMonitor();
break;
default:
break;
}
if (isDebug) {
logger.debug("pid=" + process.pid + " , " + JSON.stringify(data));
}
});
},
isMatch: function(data) {
try {
var msg = data.msg + "||" + data.uin + "||" + data.url + "||" + data.userAgent + "||" + data.from;
if (filter.level.indexOf(data.level) < 0) {
return false;
}
if (filter.include && filter.include.length !== 0) {
if (!isInclude(msg, filter.include)) {
return false;
}
}
if (filter.exclude && filter.exclude.length !== 0) {
if (isExclude(msg, filter.exclude)) {
return false;
}
}
} catch (e) {
logger.error("isMatch error : " + e + "data :" + JSON.stringify(data));
}
return true;
},
startMonitor: function(data) {
var self = this;
this.monitorKey = service + data.id + "|";
this.mqClient = mq.socket('sub');
this.mqClient.connect(mqUrl);
this.mqClient.subscribe(getSubscribe(this.monitorKey));
filter = {
level: data.level,
include: data.include,
exclude: data.exclude
};
logger.info("worker(" + process.pid + ") start accept service:" + this.monitorKey);
this.mqClient.on("message", function(data) {
var dataStr = data.toString();
data = dataStr.substring(dataStr.indexOf(' '));
try {
data = JSON.parse(data);
} catch (e) {}
if (self.isMatch(data)) {
process.send({
type: "MESSAGE",
message: data
});
}
});
},
stopMonitor: function() {
logger.info("worker(" + process.pid + ") stop accept, service:" + this.monitorKey);
try {
this.mqClient && this.mqClient.close();
} catch (ex) {
logger.error('mq client close error!');
}
this.wbClient = {};
clearInterval(this._monitorTimeoutId);
}
};
monitorWorker.init();
================================================
FILE: static/badjs/bj-report.js
================================================
/*!
* @module report
* @author kael, chriscai
* @date @DATE
* Copyright (c) 2014 kael, chriscai
* Licensed under the MIT license.
*/
var BJ_REPORT = (function(global) {
if (global.BJ_REPORT) return global.BJ_REPORT;
var _error = [];
var _error_map = {};
var _config = {
id: 0, // 上报 id
uin: 0, // user id
url: "", // 上报 接口
combo: 1, // 是否合并 !0-合并 0-不合并
ext: null, // 扩展参数 用于自定义上报
level: 4, // 错误级别 1-debug 2-info 4-error
ignore: [], // 忽略某个错误, 支持 Regexp 和 Function
random: 1, // 抽样 (0-1] 1-全量
delay: 1000, // 延迟上报 combo 为 true 时有效
submit: null, // 自定义上报方式
repeat: 1 // 重复上报次数(对于同一个错误超过多少次不上报)
};
var _isOBJByType = function(o, type) {
return Object.prototype.toString.call(o) === "[object " + (type || "Object") + "]";
};
var _isOBJ = function(obj) {
var type = typeof obj;
return type === "object" && !!obj;
};
var _isEmpty = function(obj) {
if (obj === null) return true;
if (_isOBJByType(obj, "Number")) {
return false;
}
return !obj;
};
var orgError = global.onerror;
// rewrite window.oerror
global.onerror = function(msg, url, line, col, error) {
var newMsg = msg;
if (error && error.stack) {
newMsg = _processStackMsg(error);
}
if (_isOBJByType(newMsg, "Event")) {
newMsg += newMsg.type ?
("--" + newMsg.type + "--" + (newMsg.target ?
(newMsg.target.tagName + "::" + newMsg.target.src) : "")) : "";
}
report.push({
msg: newMsg,
target: url,
rowNum: line,
colNum: col
});
_send();
orgError && orgError.apply(global, arguments);
};
var _processError = function(errObj) {
try {
if (errObj.stack) {
var url = errObj.stack.match("https?://[^\n]+");
url = url ? url[0] : "";
var rowCols = url.match(":(\\d+):(\\d+)");
if (!rowCols) {
rowCols = [0, 0, 0];
}
var stack = _processStackMsg(errObj);
return {
msg: stack,
rowNum: rowCols[1],
colNum: rowCols[2],
target: url.replace(rowCols[0], "")
};
} else {
//ie 独有 error 对象信息,try-catch 捕获到错误信息传过来,造成没有msg
if (errObj.name && errObj.message && errObj.description) {
return {
msg: JSON.stringify(errObj)
};
}
return errObj;
}
} catch (err) {
return errObj;
}
};
var _processStackMsg = function(error) {
var stack = error.stack
.replace(/\n/gi, "")
.split(/\bat\b/)
.slice(0, 9)
.join("@")
.replace(/\?[^:]+/gi, "");
var msg = error.toString();
if (stack.indexOf(msg) < 0) {
stack = msg + "@" + stack;
}
return stack;
};
var _error_tostring = function(error, index) {
var param = [];
var params = [];
var stringify = [];
if (_isOBJ(error)) {
error.level = error.level || _config.level;
for (var key in error) {
var value = error[key];
if (!_isEmpty(value)) {
if (_isOBJ(value)) {
try {
value = JSON.stringify(value);
} catch (err) {
value = "[BJ_REPORT detect value stringify error] " + err.toString();
}
}
stringify.push(key + ":" + value);
param.push(key + "=" + encodeURIComponent(value));
params.push(key + "[" + index + "]=" + encodeURIComponent(value));
}
}
}
// msg[0]=msg&target[0]=target -- combo report
// msg:msg,target:target -- ignore
// msg=msg&target=target -- report with out combo
return [params.join("&"), stringify.join(","), param.join("&")];
};
var _imgs = [];
var _submit = function(url) {
if (_config.submit) {
_config.submit(url);
} else {
var _img = new Image();
_imgs.push(_img);
_img.src = url;
}
};
var _is_repert = function(error) {
if (!_isOBJ(error)) return true;
var msg = error.msg;
var times = _error_map[msg] = (parseInt(_error_map[msg], 10) || 0) + 1;
return times > _config.repeat;
};
var error_list = [];
var comboTimeout = 0;
var _send = function(isReoprtNow) {
if (!_config.report) return;
while (_error.length) {
var isIgnore = false;
var error = _error.shift();
// 重复上报
if (_is_repert(error)) continue;
var error_str = _error_tostring(error, error_list.length);
if (_isOBJByType(_config.ignore, "Array")) {
for (var i = 0, l = _config.ignore.length; i < l; i++) {
var rule = _config.ignore[i];
if ((_isOBJByType(rule, "RegExp") && rule.test(error_str[1])) ||
(_isOBJByType(rule, "Function") && rule(error, error_str[1]))) {
isIgnore = true;
break;
}
}
}
if (!isIgnore) {
if (_config.combo) {
error_list.push(error_str[0]);
} else {
_submit(_config.report + error_str[2] + "&_t=" + (+new Date));
}
_config.onReport && (_config.onReport(_config.id, error));
}
}
// 合并上报
var count = error_list.length;
if (count) {
var comboReport = function() {
clearTimeout(comboTimeout);
_submit(_config.report + error_list.join("&") + "&count=" + error_list.length + "&_t=" + (+new Date));
comboTimeout = 0;
error_list = [];
};
if (isReoprtNow) {
comboReport(); // 立即上报
} else if (!comboTimeout) {
comboTimeout = setTimeout(comboReport, _config.delay); // 延迟上报
}
}
};
var report = global.BJ_REPORT = {
push: function(msg) { // 将错误推到缓存池
// 抽样
if (Math.random() >= _config.random) {
return report;
}
var data = _isOBJ(msg) ? _processError(msg) : {
msg: msg
};
// ext 有默认值, 且上报不包含 ext, 使用默认 ext
if (_config.ext && !data.ext) {
data.ext = _config.ext;
}
_error.push(data);
_send();
return report;
},
report: function(msg) { // error report
msg && report.push(msg);
_send(true);
return report;
},
info: function(msg) { // info report
if (!msg) {
return report;
}
if (_isOBJ(msg)) {
msg.level = 2;
} else {
msg = {
msg: msg,
level: 2
};
}
report.push(msg);
return report;
},
debug: function(msg) { // debug report
if (!msg) {
return report;
}
if (_isOBJ(msg)) {
msg.level = 1;
} else {
msg = {
msg: msg,
level: 1
};
}
report.push(msg);
return report;
},
init: function(config) { // 初始化
if (_isOBJ(config)) {
for (var key in config) {
_config[key] = config[key];
}
}
// 没有设置id将不上报
var id = parseInt(_config.id, 10);
if (id) {
// set default report url and uin
if (/qq\.com$/gi.test(location.hostname)) {
if (!_config.url) {
_config.url = "//badjs2.qq.com/badjs";
}
if (!_config.uin) {
_config.uin = parseInt((document.cookie.match(/\buin=\D+(\d+)/) || [])[1], 10);
}
}
_config.report = (_config.url || "/badjs") +
"?id=" + id +
"&uin=" + _config.uin +
"&from=" + encodeURIComponent(location.href) +
"&";
}
// if had error in cache , report now
if (_error.length) {
_send();
}
return report;
},
__onerror__: global.onerror
};
typeof console !== "undefined" && console.error && setTimeout(function() {
var err = ((location.hash || "").match(/([#&])BJ_ERROR=([^&$]+)/) || [])[2];
err && console.error("BJ_ERROR", decodeURIComponent(err).replace(/(:\d+:\d+)\s*/g, "$1\n"));
}, 0);
return report;
}(window));
if (typeof module !== "undefined") {
module.exports = BJ_REPORT;
}
================================================
FILE: static/badjs/bj-wrap.js
================================================
(function(global) {
if (!global.BJ_REPORT) {
console.error("please load bg-report first");
return;
}
var _onthrow = function(errObj) {
global.BJ_REPORT.report(errObj);
};
var tryJs = {};
global.BJ_REPORT.tryJs = function(throwCb) {
throwCb && (_onthrow = throwCb);
return tryJs;
};
// merge
var _merge = function(org, obj) {
for (var key in obj) {
org[key] = obj[key];
}
};
// function or not
var _isFunction = function(foo) {
return typeof foo === "function";
};
var timeoutkey;
var cat = function(foo, args) {
return function() {
try {
return foo.apply(this, args || arguments);
} catch (error) {
_onthrow(error);
//some browser throw error (chrome) , can not find error where it throw, so print it on console;
if (error.stack && console && console.error) {
console.error("[BJ-REPORT]", error.stack);
}
// hang up browser and throw , but it should trigger onerror , so rewrite onerror then recover it
if (!timeoutkey) {
var orgOnerror = global.onerror;
global.onerror = function() {};
timeoutkey = setTimeout(function() {
global.onerror = orgOnerror;
timeoutkey = null;
}, 50);
}
throw error;
}
};
};
var catArgs = function(foo) {
return function() {
var arg, args = [];
for (var i = 0, l = arguments.length; i < l; i++) {
arg = arguments[i];
_isFunction(arg) && (arg = cat(arg));
args.push(arg);
}
return foo.apply(this, args);
};
};
var catTimeout = function(foo) {
return function(cb, timeout) {
// for setTimeout(string, delay)
if (typeof cb === "string") {
try {
cb = new Function(cb);
} catch (err) {
throw err;
}
}
var args = [].slice.call(arguments, 2);
// for setTimeout(function, delay, param1, ...)
cb = cat(cb, args.length && args);
return foo(cb, timeout);
};
};
/**
* makeArgsTry
* wrap a function's arguments with try & catch
* @param {Function} foo
* @param {Object} self
* @returns {Function}
*/
var makeArgsTry = function(foo, self) {
return function() {
var arg, tmp, args = [];
for (var i = 0, l = arguments.length; i < l; i++) {
arg = arguments[i];
_isFunction(arg) && (tmp = cat(arg)) &&
(arg.tryWrap = tmp) && (arg = tmp);
args.push(arg);
}
return foo.apply(self || this, args);
};
};
/**
* makeObjTry
* wrap a object's all value with try & catch
* @param {Function} foo
* @param {Object} self
* @returns {Function}
*/
var makeObjTry = function(obj) {
var key, value;
for (key in obj) {
value = obj[key];
if (_isFunction(value)) obj[key] = cat(value);
}
return obj;
};
/**
* wrap jquery async function ,exp : event.add , event.remove , ajax
* @returns {Function}
*/
tryJs.spyJquery = function() {
var _$ = global.$;
if (!_$ || !_$.event) {
return tryJs;
}
var _add, _remove;
if (_$.zepto) {
_add = _$.fn.on, _remove = _$.fn.off;
_$.fn.on = makeArgsTry(_add);
_$.fn.off = function() {
var arg, args = [];
for (var i = 0, l = arguments.length; i < l; i++) {
arg = arguments[i];
_isFunction(arg) && arg.tryWrap && (arg = arg.tryWrap);
args.push(arg);
}
return _remove.apply(this, args);
};
} else if (window.jQuery) {
_add = _$.event.add, _remove = _$.event.remove;
_$.event.add = makeArgsTry(_add);
_$.event.remove = function() {
var arg, args = [];
for (var i = 0, l = arguments.length; i < l; i++) {
arg = arguments[i];
_isFunction(arg) && arg.tryWrap && (arg = arg.tryWrap);
args.push(arg);
}
return _remove.apply(this, args);
};
}
var _ajax = _$.ajax;
if (_ajax) {
_$.ajax = function(url, setting) {
if (!setting) {
setting = url;
url = undefined;
}
makeObjTry(setting);
if (url) return _ajax.call(_$, url, setting);
return _ajax.call(_$, setting);
};
}
return tryJs;
};
/**
* wrap amd or commonjs of function ,exp : define , require ,
* @returns {Function}
*/
tryJs.spyModules = function() {
var _require = global.require,
_define = global.define;
if (_define && _define.amd && _require) {
global.require = catArgs(_require);
_merge(global.require, _require);
global.define = catArgs(_define);
_merge(global.define, _define);
}
if (global.seajs && _define) {
global.define = function() {
var arg, args = [];
for (var i = 0, l = arguments.length; i < l; i++) {
arg = arguments[i];
if (_isFunction(arg)) {
arg = cat(arg);
//seajs should use toString parse dependencies , so rewrite it
arg.toString = (function(orgArg) {
return function() {
return orgArg.toString();
};
}(arguments[i]));
}
args.push(arg);
}
return _define.apply(this, args);
};
global.seajs.use = catArgs(global.seajs.use);
_merge(global.define, _define);
}
return tryJs;
};
/**
* wrap async of function in window , exp : setTimeout , setInterval
* @returns {Function}
*/
tryJs.spySystem = function() {
global.setTimeout = catTimeout(global.setTimeout);
global.setInterval = catTimeout(global.setInterval);
return tryJs;
};
/**
* wrap custom of function ,
* @param obj - obj or function
* @returns {Function}
*/
tryJs.spyCustom = function(obj) {
if (_isFunction(obj)) {
return cat(obj);
} else {
return makeObjTry(obj);
}
};
/**
* run spyJquery() and spyModules() and spySystem()
* @returns {Function}
*/
tryJs.spyAll = function() {
tryJs
.spyJquery()
.spyModules()
.spySystem();
return tryJs;
};
}(window));
================================================
FILE: static/common/delegator.js
================================================
/**
* Map
* @class
*/
function Map() {
this.map = {};
this.length = 0;
}
Map.prototype = {
constructor: Map,
/**
* has
* @param {String} key
* @returns {Boolean}
*/
has: function (key) {
return (key in this.map);
},
/**
* get
* @param {String} key
* @returns {Any}
*/
get: function (key) {
return this.map[key];
},
/**
* set
* @param {String} key
* @param {Any} value
*/
set: function (key, value) {
!this.has(key) && this.length++;
return (this.map[key] = value);
},
/**
* count
* @returns {Number}
*/
count: function () {
return this.length;
},
/**
* remove
* @param {String} key
*/
remove: function (key) {
if (this.has(key)) {
this.map[key] = null;
delete this.map[key];
this.length--;
}
}
};
var cache = new Map(), set = cache.set, uid = 0;
cache.set = function (node, value) {
if (!value) {
value = node;
set.call(cache, ++uid + '', value);
return uid;
} else {
typeof node === 'string' &&
(node = $(node)[0]);
$.data(node, 'event-data', value);
return this;
}
};
function _key(arr) {
if (!arr) return {};
arr = arr.split(' ');
var obj = {};
for (var i = 0, l = arr.length; i < l; i++) {
obj[arr[i]] = true;
}
return obj;
}
/**
* Delegator
* @class
* @param {Selector} container
*/
function Delegator(container) {
this.container = $(container);
this.listenerMap = new Map();
}
/**
* getKey
* @param {Any} value
* @returns {Number}
*/
Delegator.set = cache.set;
/**
* cache
* @class
* @static
*/
Delegator.cache = cache;
Delegator.prototype = {
constructor: Delegator,
_getListener: function (type) {
if (this.listenerMap.has(type)) {
return this.listenerMap.get(type);
}
function listener(e) {
var data = $.data(this),
routes = data['event-' + type + '-routes'],
eventData = data['event-data'], handle, dataKey;
// preprocessing
if (!routes && (routes = this.getAttribute('data-event-' + type))) {
(routes = routes.split(' ')) &&
(data['event-' + type + '-routes'] = routes);
!eventData &&
(dataKey = this.getAttribute('data-event-data')) &&
(eventData = cache.get(dataKey)) &&
(data['event-data'] = eventData) &&
(cache.remove(dataKey));
!data['event-stop-propagation'] &&
(data['event-stop-propagation'] = _key(this.getAttribute('data-event-stop-propagation')));
}
if (routes) {
for (var i = 0, l = routes.length; i < l; i++) {
handle = listener.handleMap.get(routes[i]);
if (handle) {
handle.call(this, e, eventData);
}
data['event-stop-propagation'][type] &&
e.stopPropagation();
}
}
}
listener.handleMap = new Map();
this.listenerMap.set(type, listener);
this.container.on(type, '[data-event-' + type + ']', listener);
return listener;
},
/**
* on
* @param {String} type
* @param {String} name
* @param {Function} handle
*/
on: function (type, name, handle) {
var listener = this._getListener(type);
listener.handleMap.set(name, handle);
return this;
},
/**
* off
* @param {String} type
* @param {String} name
*/
off: function (type, name) {
var listener = this._getListener(type),
handleMap = listener.handleMap;
handleMap.remove(name);
if (!handleMap.count()) {
this.container.off(type, '[data-event-' + type + ']', listener);
this.listenerMap.remove(type);
}
}
};
module.exports = Delegator;
================================================
FILE: static/common/dialog/dialog.js
================================================
var Delegator = require("delegator");
var modal = require("./modal.ejs");
var container;
function hide() {
container.removeClass('in');
container.find('.modal-backdrop').removeClass('in');
setTimeout(function () {
container.remove();
container = undefined;
}, 300);
}
function Dialog (param) {
if (container) {
container.remove();
container = undefined;
}
container = $(modal({it :param}))
.appendTo(document.body)
.show();
var key,
action,
delegator,
on = param.on || {};
delegator = (new Delegator(container))
.on('click', 'close', hide);
for (key in on) {
action = key.split('/');
delegator.on(action[0], action[1], on[key]);
}
setTimeout(function () {
container.addClass('in');
container.find('.modal-backdrop').addClass('in');
}, 0);
}
Dialog.hide = hide;
module.exports = Dialog;
================================================
FILE: static/common/dialog/modal.ejs
================================================
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" id="<%=it.id || '' %>">
<div class="modal-backdrop fade"></div>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" data-event-click="close">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title"><%=it.header%></h4>
</div>
<div class="modal-body">
<%=it.body%>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-event-click="close">Close</button>
</div>
</div>
</div>
</div>
================================================
FILE: static/common.js
================================================
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ var parentJsonpFunction = window["webpackJsonp"];
/******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) {
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, callbacks = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId])
/******/ callbacks.push.apply(callbacks, installedChunks[chunkId]);
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);
/******/ while(callbacks.length)
/******/ callbacks.shift().call(null, __webpack_require__);
/******/ if(moreModules[0]) {
/******/ installedModules[0] = 0;
/******/ return __webpack_require__(0);
/******/ }
/******/ };
/******/ // The module cache
/******/ var installedModules = {};
/******/ // object to store loaded and loading chunks
/******/ // "0" means "already loaded"
/******/ // Array means "loading", array contains callbacks
/******/ var installedChunks = {
/******/ 3:0
/******/ };
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = function requireEnsure(chunkId, callback) {
/******/ // "0" is the signal for "already loaded"
/******/ if(installedChunks[chunkId] === 0)
/******/ return callback.call(null, __webpack_require__);
/******/ // an array means "currently loading".
/******/ if(installedChunks[chunkId] !== undefined) {
/******/ installedChunks[chunkId].push(callback);
/******/ } else {
/******/ // start chunk loading
/******/ installedChunks[chunkId] = [callback];
/******/ var head = document.getElementsByTagName('head')[0];
/******/ var script = document.createElement('script');
/******/ script.type = 'text/javascript';
/******/ script.charset = 'utf-8';
/******/ script.async = true;
/******/ script.src = __webpack_require__.p + "" + chunkId + "../" + ({"0":"entry.home","1":"entry.apply","2":"entry.realtime","4":"entry.charts","5":"entry.authUserManage","6":"entry.userManage","7":"entry.projectTotal","8":"entry.statistics","9":"entry.offlinelog","10":"entry.log","11":"entry.applyList"}[chunkId]||chunkId) + ".js";
/******/ head.appendChild(script);
/******/ }
/******/ };
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(4);
__webpack_require__(1);
__webpack_require__(5);
__webpack_require__(6);
__webpack_require__(2);
module.exports = __webpack_require__(3);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(_) {
if(!_){
_={};
}
_.formatDate= function(date, formatString){
/*
* eg:formatString="YYYY-MM-DD hh:mm:ss";
*/
var o = {
"M+" : date.getMonth()+1, //month
"D+" : date.getDate(), //day
"h+" : date.getHours(), //hour
"m+" : date.getMinutes(), //minute
"s+" : date.getSeconds(), //second
"q+" : Math.floor((date.getMonth()+3)/3), //quarter
"S" : date.getMilliseconds() //millisecond
}
if(/(Y+)/.test(formatString)){
formatString = formatString.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length));
}
for(var k in o){
if(new RegExp("("+ k +")").test(formatString)){
formatString = formatString.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
}
}
return formatString;
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(jQuery) {/*!
* Bootstrap v3.3.0 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
if (typeof jQuery === 'undefined') {
throw new Error('Bootstrap\'s JavaScript requires jQuery')
}
+function ($) {
var version = $.fn.jquery.split(' ')[0].split('.')
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
}
}(jQuery);
/* ========================================================================
* Bootstrap: transition.js v3.3.0
* http://getbootstrap.com/javascript/#transitions
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
// ============================================================
function transitionEnd() {
var el = document.createElement('bootstrap')
var transEndEventNames = {
WebkitTransition : 'webkitTransitionEnd',
MozTransition : 'transitionend',
OTransition : 'oTransitionEnd otransitionend',
transition : 'transitionend'
}
for (var name in transEndEventNames) {
if (el.style[name] !== undefined) {
return { end: transEndEventNames[name] }
}
}
return false // explicit for ie8 ( ._.)
}
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) {
var called = false
var $el = this
$(this).one('bsTransitionEnd', function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
}
$(function () {
$.support.transition = transitionEnd()
if (!$.support.transition) return
$.event.special.bsTransitionEnd = {
bindType: $.support.transition.end,
delegateType: $.support.transition.end,
handle: function (e) {
if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
}
}
})
}(jQuery);
/* ========================================================================
* Bootstrap: alert.js v3.3.0
* http://getbootstrap.com/javascript/#alerts
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// ALERT CLASS DEFINITION
// ======================
var dismiss = '[data-dismiss="alert"]'
var Alert = function (el) {
$(el).on('click', dismiss, this.close)
}
Alert.VERSION = '3.3.0'
Alert.TRANSITION_DURATION = 150
Alert.prototype.close = function (e) {
var $this = $(this)
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = $(selector)
if (e) e.preventDefault()
if (!$parent.length) {
$parent = $this.closest('.alert')
}
$parent.trigger(e = $.Event('close.bs.alert'))
if (e.isDefaultPrevented()) return
$parent.removeClass('in')
function removeElement() {
// detach from parent, fire event then clean up data
$parent.detach().trigger('closed.bs.alert').remove()
}
$.support.transition && $parent.hasClass('fade') ?
$parent
.one('bsTransitionEnd', removeElement)
.emulateTransitionEnd(Alert.TRANSITION_DURATION) :
removeElement()
}
// ALERT PLUGIN DEFINITION
// =======================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.alert')
if (!data) $this.data('bs.alert', (data = new Alert(this)))
if (typeof option == 'string') data[option].call($this)
})
}
var old = $.fn.alert
$.fn.alert = Plugin
$.fn.alert.Constructor = Alert
// ALERT NO CONFLICT
// =================
$.fn.alert.noConflict = function () {
$.fn.alert = old
return this
}
// ALERT DATA-API
// ==============
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
}(jQuery);
/* ========================================================================
* Bootstrap: button.js v3.3.0
* http://getbootstrap.com/javascript/#buttons
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// BUTTON PUBLIC CLASS DEFINITION
// ==============================
var Button = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Button.DEFAULTS, options)
this.isLoading = false
}
Button.VERSION = '3.3.0'
Button.DEFAULTS = {
loadingText: 'loading...'
}
Button.prototype.setState = function (state) {
var d = 'disabled'
var $el = this.$element
var val = $el.is('input') ? 'val' : 'html'
var data = $el.data()
state = state + 'Text'
if (data.resetText == null) $el.data('resetText', $el[val]())
// push to event loop to allow forms to submit
setTimeout($.proxy(function () {
$el[val](data[state] == null ? this.options[state] : data[state])
if (state == 'loadingText') {
this.isLoading = true
$el.addClass(d).attr(d, d)
} else if (this.isLoading) {
this.isLoading = false
$el.removeClass(d).removeAttr(d)
}
}, this), 0)
}
Button.prototype.toggle = function () {
var changed = true
var $parent = this.$element.closest('[data-toggle="buttons"]')
if ($parent.length) {
var $input = this.$element.find('input')
if ($input.prop('type') == 'radio') {
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
else $parent.find('.active').removeClass('active')
}
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
} else {
this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
}
if (changed) this.$element.toggleClass('active')
}
// BUTTON PLUGIN DEFINITION
// ========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.button')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.button', (data = new Button(this, options)))
if (option == 'toggle') data.toggle()
else if (option) data.setState(option)
})
}
var old = $.fn.button
$.fn.button = Plugin
$.fn.button.Constructor = Button
// BUTTON NO CONFLICT
// ==================
$.fn.button.noConflict = function () {
$.fn.button = old
return this
}
// BUTTON DATA-API
// ===============
$(document)
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
var $btn = $(e.target)
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
Plugin.call($btn, 'toggle')
e.preventDefault()
})
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
$(e.target).closest('.btn').toggleClass('focus', e.type == 'focus')
})
}(jQuery);
/* ========================================================================
* Bootstrap: carousel.js v3.3.0
* http://getbootstrap.com/javascript/#carousel
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// CAROUSEL CLASS DEFINITION
// =========================
var Carousel = function (element, options) {
this.$element = $(element)
this.$indicators = this.$element.find('.carousel-indicators')
this.options = options
this.paused =
this.sliding =
this.interval =
this.$active =
this.$items = null
this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
.on('mouseenter.bs.carousel', $.proxy(this.pause, this))
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
}
Carousel.VERSION = '3.3.0'
Carousel.TRANSITION_DURATION = 600
Carousel.DEFAULTS = {
interval: 5000,
pause: 'hover',
wrap: true,
keyboard: true
}
Carousel.prototype.keydown = function (e) {
switch (e.which) {
case 37: this.prev(); break
case 39: this.next(); break
default: return
}
e.preventDefault()
}
Carousel.prototype.cycle = function (e) {
e || (this.paused = false)
this.interval && clearInterval(this.interval)
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}
Carousel.prototype.getItemIndex = function (item) {
this.$items = item.parent().children('.item')
return this.$items.index(item || this.$active)
}
Carousel.prototype.getItemForDirection = function (direction, active) {
var delta = direction == 'prev' ? -1 : 1
var activeIndex = this.getItemIndex(active)
var itemIndex = (activeIndex + delta) % this.$items.length
return this.$items.eq(itemIndex)
}
Carousel.prototype.to = function (pos) {
var that = this
var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
if (pos > (this.$items.length - 1) || pos < 0) return
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
if (activeIndex == pos) return this.pause().cycle()
return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
}
Carousel.prototype.pause = function (e) {
e || (this.paused = true)
if (this.$element.find('.next, .prev').length && $.support.transition) {
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
this.interval = clearInterval(this.interval)
return this
}
Carousel.prototype.next = function () {
if (this.sliding) return
return this.slide('next')
}
Carousel.prototype.prev = function () {
if (this.sliding) return
return this.slide('prev')
}
Carousel.prototype.slide = function (type, next) {
var $active = this.$element.find('.item.active')
var $next = next || this.getItemForDirection(type, $active)
var isCycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
var fallback = type == 'next' ? 'first' : 'last'
var that = this
if (!$next.length) {
if (!this.options.wrap) return
$next = this.$element.find('.item')[fallback]()
}
if ($next.hasClass('active')) return (this.sliding = false)
var relatedTarget = $next[0]
var slideEvent = $.Event('slide.bs.carousel', {
relatedTarget: relatedTarget,
direction: direction
})
this.$element.trigger(slideEvent)
if (slideEvent.isDefaultPrevented()) return
this.sliding = true
isCycling && this.pause()
if (this.$indicators.length) {
this.$indicators.find('.active').removeClass('active')
var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
$nextIndicator && $nextIndicator.addClass('active')
}
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
if ($.support.transition && this.$element.hasClass('slide')) {
$next.addClass(type)
$next[0].offsetWidth // force reflow
$active.addClass(direction)
$next.addClass(direction)
$active
.one('bsTransitionEnd', function () {
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function () {
that.$element.trigger(slidEvent)
}, 0)
})
.emulateTransitionEnd(Carousel.TRANSITION_DURATION)
} else {
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger(slidEvent)
}
isCycling && this.cycle()
return this
}
// CAROUSEL PLUGIN DEFINITION
// ==========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.carousel')
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
var action = typeof option == 'string' ? option : options.slide
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (action) data[action]()
else if (options.interval) data.pause().cycle()
})
}
var old = $.fn.carousel
$.fn.carousel = Plugin
$.fn.carousel.Constructor = Carousel
// CAROUSEL NO CONFLICT
// ====================
$.fn.carousel.noConflict = function () {
$.fn.carousel = old
return this
}
// CAROUSEL DATA-API
// =================
var clickHandler = function (e) {
var href
var $this = $(this)
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
if (!$target.hasClass('carousel')) return
var options = $.extend({}, $target.data(), $this.data())
var slideIndex = $this.attr('data-slide-to')
if (slideIndex) options.interval = false
Plugin.call($target, options)
if (slideIndex) {
$target.data('bs.carousel').to(slideIndex)
}
e.preventDefault()
}
$(document)
.on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
.on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
$(window).on('load', function () {
$('[data-ride="carousel"]').each(function () {
var $carousel = $(this)
Plugin.call($carousel, $carousel.data())
})
})
}(jQuery);
/* ========================================================================
* Bootstrap: collapse.js v3.3.0
* http://getbootstrap.com/javascript/#collapse
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// COLLAPSE PUBLIC CLASS DEFINITION
// ================================
var Collapse = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Collapse.DEFAULTS, options)
this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
this.transitioning = null
if (this.options.parent) {
this.$parent = this.getParent()
} else {
this.addAriaAndCollapsedClass(this.$element, this.$trigger)
}
if (this.options.toggle) this.toggle()
}
Collapse.VERSION = '3.3.0'
Collapse.TRANSITION_DURATION = 350
Collapse.DEFAULTS = {
toggle: true,
trigger: '[data-toggle="collapse"]'
}
Collapse.prototype.dimension = function () {
var hasWidth = this.$element.hasClass('width')
return hasWidth ? 'width' : 'height'
}
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var activesData
var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing')
if (actives && actives.length) {
activesData = actives.data('bs.collapse')
if (activesData && activesData.transitioning) return
}
var startEvent = $.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
if (actives && actives.length) {
Plugin.call(actives, 'hide')
activesData || actives.data('bs.collapse', null)
}
var dimension = this.dimension()
this.$element
.removeClass('collapse')
.addClass('collapsing')[dimension](0)
.attr('aria-expanded', true)
this.$trigger
.removeClass('collapsed')
.attr('aria-expanded', true)
this.transitioning = 1
var complete = function () {
this.$element
.removeClass('collapsing')
.addClass('collapse in')[dimension]('')
this.transitioning = 0
this.$element
.trigger('shown.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
this.$element
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
}
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
var startEvent = $.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
var dimension = this.dimension()
this.$element[dimension](this.$element[dimension]())[0].offsetHeight
this.$element
.addClass('collapsing')
.removeClass('collapse in')
.attr('aria-expanded', false)
this.$trigger
.addClass('collapsed')
.attr('aria-expanded', false)
this.transitioning = 1
var complete = function () {
this.transitioning = 0
this.$element
.removeClass('collapsing')
.addClass('collapse')
.trigger('hidden.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
this.$element
[dimension](0)
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)
}
Collapse.prototype.toggle = function () {
this[this.$element.hasClass('in') ? 'hide' : 'show']()
}
Collapse.prototype.getParent = function () {
return $(this.options.parent)
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
.each($.proxy(function (i, element) {
var $element = $(element)
this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
}, this))
.end()
}
Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
var isOpen = $element.hasClass('in')
$element.attr('aria-expanded', isOpen)
$trigger
.toggleClass('collapsed', !isOpen)
.attr('aria-expanded', isOpen)
}
function getTargetFromTrigger($trigger) {
var href
var target = $trigger.attr('data-target')
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
return $(target)
}
// COLLAPSE PLUGIN DEFINITION
// ==========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.collapse')
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data && options.toggle && option == 'show') options.toggle = false
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.collapse
$.fn.collapse = Plugin
$.fn.collapse.Constructor = Collapse
// COLLAPSE NO CONFLICT
// ====================
$.fn.collapse.noConflict = function () {
$.fn.collapse = old
return this
}
// COLLAPSE DATA-API
// =================
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
var $this = $(this)
if (!$this.attr('data-target')) e.preventDefault()
var $target = getTargetFromTrigger($this)
var data = $target.data('bs.collapse')
var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this })
Plugin.call($target, option)
})
}(jQuery);
/* ========================================================================
* Bootstrap: dropdown.js v3.3.0
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// DROPDOWN CLASS DEFINITION
// =========================
var backdrop = '.dropdown-backdrop'
var toggle = '[data-toggle="dropdown"]'
var Dropdown = function (element) {
$(element).on('click.bs.dropdown', this.toggle)
}
Dropdown.VERSION = '3.3.0'
Dropdown.prototype.toggle = function (e) {
var $this = $(this)
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
clearMenus()
if (!isActive) {
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
// if mobile we use a backdrop because click events don't delegate
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
}
var relatedTarget = { relatedTarget: this }
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
$this
.trigger('focus')
.attr('aria-expanded', 'true')
$parent
.toggleClass('open')
.trigger('shown.bs.dropdown', relatedTarget)
}
return false
}
Dropdown.prototype.keydown = function (e) {
if (!/(38|40|27|32)/.test(e.which)) return
var $this = $(this)
e.preventDefault()
e.stopPropagation()
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
if ((!isActive && e.which != 27) || (isActive && e.which == 27)) {
if (e.which == 27) $parent.find(toggle).trigger('focus')
return $this.trigger('click')
}
var desc = ' li:not(.divider):visible a'
var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
if (!$items.length) return
var index = $items.index(e.target)
if (e.which == 38 && index > 0) index-- // up
if (e.which == 40 && index < $items.length - 1) index++ // down
if (!~index) index = 0
$items.eq(index).trigger('focus')
}
function clearMenus(e) {
if (e && e.which === 3) return
$(backdrop).remove()
$(toggle).each(function () {
var $this = $(this)
var $parent = getParent($this)
var relatedTarget = { relatedTarget: this }
if (!$parent.hasClass('open')) return
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
$this.attr('aria-expanded', 'false')
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
})
}
function getParent($this) {
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = selector && $(selector)
return $parent && $parent.length ? $parent : $this.parent()
}
// DROPDOWN PLUGIN DEFINITION
// ==========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.dropdown')
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
var old = $.fn.dropdown
$.fn.dropdown = Plugin
$.fn.dropdown.Constructor = Dropdown
// DROPDOWN NO CONFLICT
// ====================
$.fn.dropdown.noConflict = function () {
$.fn.dropdown = old
return this
}
// APPLY TO STANDARD DROPDOWN ELEMENTS
// ===================================
$(document)
.on('click.bs.dropdown.data-api', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
}(jQuery);
/* ========================================================================
* Bootstrap: modal.js v3.3.0
* http://getbootstrap.com/javascript/#modals
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// MODAL CLASS DEFINITION
// ======================
var Modal = function (element, options) {
this.options = options
this.$body = $(document.body)
this.$element = $(element)
this.$backdrop =
this.isShown = null
this.scrollbarWidth = 0
if (this.options.remote) {
this.$element
.find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
}
}
Modal.VERSION = '3.3.0'
Modal.TRANSITION_DURATION = 300
Modal.BACKDROP_TRANSITION_DURATION = 150
Modal.DEFAULTS = {
backdrop: true,
keyboard: true,
show: true
}
Modal.prototype.toggle = function (_relatedTarget) {
return this.isShown ? this.hide() : this.show(_relatedTarget)
}
Modal.prototype.show = function (_relatedTarget) {
var that = this
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
if (this.isShown || e.isDefaultPrevented()) return
this.isShown = true
this.checkScrollbar()
this.$body.addClass('modal-open')
this.setScrollbar()
this.escape()
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade')
if (!that.$element.parent().length) {
that.$element.appendTo(that.$body) // don't move modals dom position
}
that.$element
.show()
.scrollTop(0)
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element
.addClass('in')
.attr('aria-hidden', false)
that.enforceFocus()
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
transition ?
that.$element.find('.modal-dialog') // wait for modal to slide in
.one('bsTransitionEnd', function () {
that.$element.trigger('focus').trigger(e)
})
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
that.$element.trigger('focus').trigger(e)
})
}
Modal.prototype.hide = function (e) {
if (e) e.preventDefault()
e = $.Event('hide.bs.modal')
this.$element.trigger(e)
if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
this.escape()
$(document).off('focusin.bs.modal')
this.$element
.removeClass('in')
.attr('aria-hidden', true)
.off('click.dismiss.bs.modal')
$.support.transition && this.$element.hasClass('fade') ?
this.$element
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
this.hideModal()
}
Modal.prototype.enforceFocus = function () {
$(document)
.off('focusin.bs.modal') // guard against infinite focus loop
.on('focusin.bs.modal', $.proxy(function (e) {
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
this.$element.trigger('focus')
}
}, this))
}
Modal.prototype.escape = function () {
if (this.isShown && this.options.keyboard) {
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
e.which == 27 && this.hide()
}, this))
} else if (!this.isShown) {
this.$element.off('keydown.dismiss.bs.modal')
}
}
Modal.prototype.hideModal = function () {
var that = this
this.$element.hide()
this.backdrop(function () {
that.$body.removeClass('modal-open')
that.resetScrollbar()
that.$element.trigger('hidden.bs.modal')
})
}
Modal.prototype.removeBackdrop = function () {
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}
Modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
var doAnimate = $.support.transition && animate
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.prependTo(this.$element)
.on('click.dismiss.bs.modal', $.proxy(function (e) {
if (e.target !== e.currentTarget) return
this.options.backdrop == 'static'
? this.$element[0].focus.call(this.$element[0])
: this.hide.call(this)
}, this))
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass('in')
if (!callback) return
doAnimate ?
this.$backdrop
.one('bsTransitionEnd', callback)
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
var callbackRemove = function () {
that.removeBackdrop()
callback && callback()
}
$.support.transition && this.$element.hasClass('fade') ?
this.$backdrop
.one('bsTransitionEnd', callbackRemove)
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
callbackRemove()
} else if (callback) {
callback()
}
}
Modal.prototype.checkScrollbar = function () {
this.scrollbarWidth = this.measureScrollbar()
}
Modal.prototype.setScrollbar = function () {
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
}
Modal.prototype.resetScrollbar = function () {
this.$body.css('padding-right', '')
}
Modal.prototype.measureScrollbar = function () { // thx walsh
if (document.body.clientWidth >= window.innerWidth) return 0
var scrollDiv = document.createElement('div')
scrollDiv.className = 'modal-scrollbar-measure'
this.$body.append(scrollDiv)
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
this.$body[0].removeChild(scrollDiv)
return scrollbarWidth
}
// MODAL PLUGIN DEFINITION
// =======================
function Plugin(option, _relatedTarget) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.modal')
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option](_relatedTarget)
else if (options.show) data.show(_relatedTarget)
})
}
var old = $.fn.modal
$.fn.modal = Plugin
$.fn.modal.Constructor = Modal
// MODAL NO CONFLICT
// =================
$.fn.modal.noConflict = function () {
$.fn.modal = old
return this
}
// MODAL DATA-API
// ==============
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
if ($this.is('a')) e.preventDefault()
$target.one('show.bs.modal', function (showEvent) {
if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
$target.one('hidden.bs.modal', function () {
$this.is(':visible') && $this.trigger('focus')
})
})
Plugin.call($target, option, this)
})
}(jQuery);
/* ========================================================================
* Bootstrap: tooltip.js v3.3.0
* http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// TOOLTIP PUBLIC CLASS DEFINITION
// ===============================
var Tooltip = function (element, options) {
this.type =
this.options =
this.enabled =
this.timeout =
this.hoverState =
this.$element = null
this.init('tooltip', element, options)
}
Tooltip.VERSION = '3.3.0'
Tooltip.TRANSITION_DURATION = 150
Tooltip.DEFAULTS = {
animation: true,
placement: 'top',
selector: false,
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
trigger: 'hover focus',
title: '',
delay: 0,
html: false,
container: false,
viewport: {
selector: 'body',
padding: 0
}
}
Tooltip.prototype.init = function (type, element, options) {
this.enabled = true
this.type = type
this.$element = $(element)
this.options = this.getOptions(options)
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
var triggers = this.options.trigger.split(' ')
for (var i = triggers.length; i--;) {
var trigger = triggers[i]
if (trigger == 'click') {
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
} else if (trigger != 'manual') {
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
}
this.options.selector ?
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
this.fixTitle()
}
Tooltip.prototype.getDefaults = function () {
return Tooltip.DEFAULTS
}
Tooltip.prototype.getOptions = function (options) {
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
if (options.delay && typeof options.delay == 'number') {
options.delay = {
show: options.delay,
hide: options.delay
}
}
return options
}
Tooltip.prototype.getDelegateOptions = function () {
var options = {}
var defaults = this.getDefaults()
this._options && $.each(this._options, function (key, value) {
if (defaults[key] != value) options[key] = value
})
return options
}
Tooltip.prototype.enter = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget).data('bs.' + this.type)
if (self && self.$tip && self.$tip.is(':visible')) {
self.hoverState = 'in'
return
}
if (!self) {
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
$(obj.currentTarget).data('bs.' + this.type, self)
}
clearTimeout(self.timeout)
self.hoverState = 'in'
if (!self.options.delay || !self.options.delay.show) return self.show()
self.timeout = setTimeout(function () {
if (self.hoverState == 'in') self.show()
}, self.options.delay.show)
}
Tooltip.prototype.leave = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget).data('bs.' + this.type)
if (!self) {
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
$(obj.currentTarget).data('bs.' + this.type, self)
}
clearTimeout(self.timeout)
self.hoverState = 'out'
if (!self.options.delay || !self.options.delay.hide) return self.hide()
self.timeout = setTimeout(function () {
if (self.hoverState == 'out') self.hide()
}, self.options.delay.hide)
}
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
if (e.isDefaultPrevented() || !inDom) return
var that = this
var $tip = this.tip()
var tipId = this.getUID(this.type)
this.setContent()
$tip.attr('id', tipId)
this.$element.attr('aria-describedby', tipId)
if (this.options.animation) $tip.addClass('fade')
var placement = typeof this.options.placement == 'function' ?
this.options.placement.call(this, $tip[0], this.$element[0]) :
this.options.placement
var autoToken = /\s?auto?\s?/i
var autoPlace = autoToken.test(placement)
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
$tip
.detach()
.css({ top: 0, left: 0, display: 'block' })
.addClass(placement)
.data('bs.' + this.type, this)
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
var pos = this.getPosition()
var actualWidth = $tip[0].offsetWidth
var actualHeight = $tip[0].offsetHeight
if (autoPlace) {
var orgPlacement = placement
var $container = this.options.container ? $(this.options.container) : this.$element.parent()
var containerDim = this.getPosition($container)
placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' :
placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' :
placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' :
placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' :
placement
$tip
.removeClass(orgPlacement)
.addClass(placement)
}
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
this.applyPlacement(calculatedOffset, placement)
var complete = function () {
var prevHoverState = that.hoverState
that.$element.trigger('shown.bs.' + that.type)
that.hoverState = null
if (prevHoverState == 'out') that.leave(that)
}
$.support.transition && this.$tip.hasClass('fade') ?
$tip
.one('bsTransitionEnd', complete)
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
complete()
}
}
Tooltip.prototype.applyPlacement = function (offset, placement) {
var $tip = this.tip()
var width = $tip[0].offsetWidth
var height = $tip[0].offsetHeight
// manually read margins because getBoundingClientRect includes difference
var marginTop = parseInt($tip.css('margin-top'), 10)
var marginLeft = parseInt($tip.css('margin-left'), 10)
// we must check for NaN for ie 8/9
if (isNaN(marginTop)) marginTop = 0
if (isNaN(marginLeft)) marginLeft = 0
offset.top = offset.top + marginTop
offset.left = offset.left + marginLeft
// $.fn.offset doesn't round pixel values
// so we use setOffset directly with our own function B-0
$.offset.setOffset($tip[0], $.extend({
using: function (props) {
$tip.css({
top: Math.round(props.top),
left: Math.round(props.left)
})
}
}, offset), 0)
$tip.addClass('in')
// check to see if placing tip in new offset caused the tip to resize itself
var actualWidth = $tip[0].offsetWidth
var actualHeight = $tip[0].offsetHeight
if (placement == 'top' && actualHeight != height) {
offset.top = offset.top + height - actualHeight
}
var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
if (delta.left) offset.left += delta.left
else offset.top += delta.top
var isVertical = /top|bottom/.test(placement)
var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
$tip.offset(offset)
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
}
Tooltip.prototype.replaceArrow = function (delta, dimension, isHorizontal) {
this.arrow()
.css(isHorizontal ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
.css(isHorizontal ? 'top' : 'left', '')
}
Tooltip.prototype.setContent = function () {
var $tip = this.tip()
var title = this.getTitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
$tip.removeClass('fade in top bottom left right')
}
Tooltip.prototype.hide = function (callback) {
var that = this
var $tip = this.tip()
var e = $.Event('hide.bs.' + this.type)
function complete() {
if (that.hoverState != 'in') $tip.detach()
that.$element
.removeAttr('aria-describedby')
.trigger('hidden.bs.' + that.type)
callback && callback()
}
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$tip.removeClass('in')
$.support.transition && this.$tip.hasClass('fade') ?
$tip
.one('bsTransitionEnd', complete)
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
complete()
this.hoverState = null
return this
}
Tooltip.prototype.fixTitle = function () {
var $e = this.$element
if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
}
}
Tooltip.prototype.hasContent = function () {
return this.getTitle()
}
Tooltip.prototype.getPosition = function ($element) {
$element = $element || this.$element
var el = $element[0]
var isBody = el.tagName == 'BODY'
var elRect = el.getBoundingClientRect()
if (elRect.width == null) {
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
}
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
return $.extend({}, elRect, scroll, outerDims, elOffset)
}
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
}
Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
var delta = { top: 0, left: 0 }
if (!this.$viewport) return delta
var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
var viewportDimensions = this.getPosition(this.$viewport)
if (/right|left/.test(placement)) {
var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
if (topEdgeOffset < viewportDimensions.top) { // top overflow
delta.top = viewportDimensions.top - topEdgeOffset
} else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
}
} else {
var leftEdgeOffset = pos.left - viewportPadding
var rightEdgeOffset = pos.left + viewportPadding + actualWidth
if (leftEdgeOffset < viewportDimensions.left) { // left overflow
delta.left = viewportDimensions.left - leftEdgeOffset
} else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
}
}
return delta
}
Tooltip.prototype.getTitle = function () {
var title
var $e = this.$element
var o = this.options
title = $e.attr('data-original-title')
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
return title
}
Tooltip.prototype.getUID = function (prefix) {
do prefix += ~~(Math.random() * 1000000)
while (document.getElementById(prefix))
return prefix
}
Tooltip.prototype.tip = function () {
return (this.$tip = this.$tip || $(this.options.template))
}
Tooltip.prototype.arrow = function () {
return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
}
Tooltip.prototype.enable = function () {
this.enabled = true
}
Tooltip.prototype.disable = function () {
this.enabled = false
}
Tooltip.prototype.toggleEnabled = function () {
this.enabled = !this.enabled
}
Tooltip.prototype.toggle = function (e) {
var self = this
if (e) {
self = $(e.currentTarget).data('bs.' + this.type)
if (!self) {
self = new this.constructor(e.currentTarget, this.getDelegateOptions())
$(e.currentTarget).data('bs.' + this.type, self)
}
}
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
}
Tooltip.prototype.destroy = function () {
var that = this
clearTimeout(this.timeout)
this.hide(function () {
that.$element.off('.' + that.type).removeData('bs.' + that.type)
})
}
// TOOLTIP PLUGIN DEFINITION
// =========================
function Plugin(option) {
return this.each(funct
gitextract_d1_lp_hk/ ├── .editorconfig ├── .gitignore ├── .jshintrc ├── LICENSE ├── Readme.md ├── app.js ├── controller/ │ ├── action/ │ │ ├── ApplyAction.js │ │ ├── ApproveAction.js │ │ ├── IndexAction.js │ │ ├── LogAction.js │ │ ├── StatisticsAction.js │ │ ├── UserAction.js │ │ └── UserApplyAction.js │ └── router.js ├── dao/ │ ├── ApplyDao.js │ ├── ApproveDao.js │ ├── StatisticsDao.js │ ├── UserApplyDao.js │ └── UserDao.js ├── db/ │ └── create.sql ├── gulpfile.js ├── model/ │ ├── Apply.js │ ├── Approve.js │ ├── User.js │ └── UserApply.js ├── oos/ │ └── demo/ │ └── demooos.js ├── package.json ├── project.debug.json ├── project.json ├── retCode.txt ├── service/ │ ├── ApplyService.js │ ├── ApproveService.js │ ├── BusinessService.js │ ├── EmailService.js │ ├── LogService.js │ ├── OfflineLogService.js │ ├── RealtimeService.js │ ├── StatisticsService.js │ ├── UserApplyService.js │ ├── UserService.js │ └── worker/ │ ├── Processor.js │ ├── ProcessorPool.js │ └── Worker.js ├── static/ │ ├── badjs/ │ │ ├── bj-report.js │ │ └── bj-wrap.js │ ├── common/ │ │ ├── delegator.js │ │ └── dialog/ │ │ ├── dialog.js │ │ └── modal.ejs │ ├── common.js │ ├── entry.apply.js │ ├── entry.applyList.js │ ├── entry.authUserManage.js │ ├── entry.charts.js │ ├── entry.home.js │ ├── entry.log.js │ ├── entry.offlinelog.js │ ├── entry.projectTotal.js │ ├── entry.realtime.js │ ├── entry.statistics.js │ ├── entry.userManage.js │ ├── img/ │ │ └── tmp/ │ │ └── tmp │ ├── js/ │ │ ├── beautify.js │ │ └── require.js │ ├── lib/ │ │ ├── bootstrap/ │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap.css │ │ │ └── bootstrap.js │ │ ├── charts/ │ │ │ ├── highcharts.js │ │ │ └── sand-signika.js │ │ ├── jquery/ │ │ │ └── jquery.datetimepicker.js │ │ └── underscore/ │ │ └── underscore.ext.js │ └── module/ │ ├── apply/ │ │ ├── load.apply.js │ │ └── mod.apply.js │ ├── applyList/ │ │ ├── load.applyList.js │ │ ├── mod.applyList.js │ │ └── template/ │ │ └── applyTable.ejs │ ├── authUserManage/ │ │ ├── load.authUserManage.js │ │ ├── mod.authUserManage.js │ │ └── template/ │ │ └── userTable.ejs │ ├── charts/ │ │ ├── load.charts.js │ │ └── mod.charts.js │ ├── common/ │ │ ├── app.css │ │ └── last.select.js │ ├── home/ │ │ └── load.home.js │ ├── locales/ │ │ ├── bootstrap-datetimepicker.ar.js │ │ ├── bootstrap-datetimepicker.bg.js │ │ ├── bootstrap-datetimepicker.ca.js │ │ ├── bootstrap-datetimepicker.cs.js │ │ ├── bootstrap-datetimepicker.da.js │ │ ├── bootstrap-datetimepicker.de.js │ │ ├── bootstrap-datetimepicker.ee.js │ │ ├── bootstrap-datetimepicker.el.js │ │ ├── bootstrap-datetimepicker.es.js │ │ ├── bootstrap-datetimepicker.fi.js │ │ ├── bootstrap-datetimepicker.fr.js │ │ ├── bootstrap-datetimepicker.he.js │ │ ├── bootstrap-datetimepicker.hr.js │ │ ├── bootstrap-datetimepicker.hu.js │ │ ├── bootstrap-datetimepicker.id.js │ │ ├── bootstrap-datetimepicker.is.js │ │ ├── bootstrap-datetimepicker.it.js │ │ ├── bootstrap-datetimepicker.ja.js │ │ ├── bootstrap-datetimepicker.ko.js │ │ ├── bootstrap-datetimepicker.lt.js │ │ ├── bootstrap-datetimepicker.lv.js │ │ ├── bootstrap-datetimepicker.ms.js │ │ ├── bootstrap-datetimepicker.nb.js │ │ ├── bootstrap-datetimepicker.nl.js │ │ ├── bootstrap-datetimepicker.no.js │ │ ├── bootstrap-datetimepicker.pl.js │ │ ├── bootstrap-datetimepicker.pt-BR.js │ │ ├── bootstrap-datetimepicker.pt.js │ │ ├── bootstrap-datetimepicker.ro.js │ │ ├── bootstrap-datetimepicker.rs-latin.js │ │ ├── bootstrap-datetimepicker.rs.js │ │ ├── bootstrap-datetimepicker.ru.js │ │ ├── bootstrap-datetimepicker.sk.js │ │ ├── bootstrap-datetimepicker.sl.js │ │ ├── bootstrap-datetimepicker.sv.js │ │ ├── bootstrap-datetimepicker.sw.js │ │ ├── bootstrap-datetimepicker.th.js │ │ ├── bootstrap-datetimepicker.tr.js │ │ ├── bootstrap-datetimepicker.ua.js │ │ ├── bootstrap-datetimepicker.uk.js │ │ ├── bootstrap-datetimepicker.zh-CN.js │ │ └── bootstrap-datetimepicker.zh-TW.js │ ├── log/ │ │ ├── load.log.js │ │ ├── load.offlinelog.js │ │ ├── load.realtime.js │ │ ├── logDetailDialog/ │ │ │ ├── logDetailDialog.js │ │ │ └── tpl/ │ │ │ └── dialog.ejs │ │ ├── mod.log.js │ │ ├── mod.offlinelog.js │ │ ├── mod.realtime.js │ │ ├── offlineDialog/ │ │ │ ├── offlineDialog.js │ │ │ └── tpl/ │ │ │ ├── dialog.ejs │ │ │ └── offline_monitor_row.ejs │ │ ├── source.trigger.js │ │ └── template/ │ │ ├── debar.ejs │ │ ├── keyword.ejs │ │ └── logTable.ejs │ ├── projectTotal/ │ │ ├── load.projectTotal.js │ │ ├── mod.projectTotal.js │ │ └── template/ │ │ └── statistics.ejs │ ├── statistics/ │ │ ├── load.statistics.js │ │ ├── mod.statistics.js │ │ └── template/ │ │ └── statistics.ejs │ └── userManage/ │ ├── load.userManage.js │ ├── mod.userManage.js │ └── template/ │ └── userTable.ejs ├── test/ │ ├── test-busiess-services.js │ ├── test-crypto.js │ ├── test-db-connect.js │ ├── test-email-add.js │ ├── test-fetch-statistics-to-today.js │ ├── test-fetch-statistics.js │ ├── test-getProjects.js │ ├── test-processor.js │ ├── test-sendAll.js │ ├── test-sendEmail.js │ ├── test-statistics-find-by-time.js │ └── test-zmq.js ├── tmp/ │ └── tmp ├── utils/ │ ├── auth.js │ ├── dateFormat.js │ ├── des.js │ ├── email.js │ ├── email_tof.js │ ├── express-websocket.js │ └── uniform_msg_client ├── views/ │ ├── account.html │ ├── apply.html │ ├── applyList.html │ ├── approve.html │ ├── authUserManage.html │ ├── charts.html │ ├── common/ │ │ ├── commonLinks.html │ │ ├── footer.html │ │ ├── header.html │ │ ├── indexHeader.html │ │ ├── leftSide.html │ │ ├── logo.html │ │ └── nav.html │ ├── help.html │ ├── index.html │ ├── introduce.html │ ├── log.html │ ├── login.html │ ├── modifyUser.html │ ├── monitor.html │ ├── offlinelog.html │ ├── projectTotal.html │ ├── realtimelog.html │ ├── register.html │ ├── statistics.html │ └── userManage.html ├── webpack.config.js ├── workflow/ │ ├── ExpressInitWorker.js │ ├── InitWorker.js │ └── ServiceInitWorker.js └── workflow.config.json
SYMBOL INDEX (744 symbols across 32 files)
FILE: db/create.sql
type `b_statistics` (line 18) | CREATE TABLE IF NOT EXISTS `b_statistics` (
type `b_apply` (line 36) | CREATE TABLE `b_apply` (
type `b_approve` (line 59) | CREATE TABLE `b_approve` (
type `b_user` (line 78) | CREATE TABLE IF NOT EXISTS `b_user` (
type `b_user_apply` (line 103) | CREATE TABLE `b_user_apply` (
FILE: service/EmailService.js
function whichDayIndex (line 54) | function whichDayIndex(day1) {
FILE: static/common.js
function __webpack_require__ (line 37) | function __webpack_require__(moduleId) {
function transitionEnd (line 181) | function transitionEnd() {
function removeElement (line 273) | function removeElement() {
function Plugin (line 289) | function Plugin(option) {
function Plugin (line 394) | function Plugin(option) {
function Plugin (line 615) | function Plugin(option) {
function getTargetFromTrigger (line 834) | function getTargetFromTrigger($trigger) {
function Plugin (line 846) | function Plugin(option) {
function clearMenus (line 978) | function clearMenus(e) {
function getParent (line 997) | function getParent($this) {
function Plugin (line 1014) | function Plugin(option) {
function Plugin (line 1285) | function Plugin(option, _relatedTarget) {
function complete (line 1627) | function complete() {
function Plugin (line 1779) | function Plugin(option) {
function Plugin (line 1899) | function Plugin(option) {
function ScrollSpy (line 1948) | function ScrollSpy(element, options) {
function Plugin (line 2071) | function Plugin(option) {
function next (line 2178) | function next() {
function Plugin (line 2224) | function Plugin(option) {
function Plugin (line 2381) | function Plugin(option) {
function isArrayLike (line 4522) | function isArrayLike( obj ) {
function Sizzle (line 4731) | function Sizzle( selector, context, results, seed ) {
function createCache (line 4871) | function createCache() {
function markFunction (line 4889) | function markFunction( fn ) {
function assert (line 4898) | function assert( fn ) {
function addHandle (line 4920) | function addHandle( attrs, handler ) {
function siblingCheck (line 4935) | function siblingCheck( a, b ) {
function createInputPseudo (line 4962) | function createInputPseudo( type ) {
function createButtonPseudo (line 4973) | function createButtonPseudo( type ) {
function createPositionalPseudo (line 4984) | function createPositionalPseudo( fn ) {
function testContext (line 5007) | function testContext( context ) {
function setFilters (line 6052) | function setFilters() {}
function toSelector (line 6123) | function toSelector( tokens ) {
function addCombinator (line 6133) | function addCombinator( matcher, combinator, base ) {
function elementMatcher (line 6191) | function elementMatcher( matchers ) {
function multipleContexts (line 6205) | function multipleContexts( selector, contexts, results ) {
function condense (line 6214) | function condense( unmatched, map, filter, context, xml ) {
function setMatcher (line 6235) | function setMatcher( preFilter, selector, matcher, postFilter, postFinde...
function matcherFromTokens (line 6328) | function matcherFromTokens( tokens ) {
function matcherFromGroupMatchers (line 6386) | function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
function winnow (line 6724) | function winnow( elements, qualifier, not ) {
function sibling (line 7031) | function sibling( cur, dir ) {
function createOptions (line 7107) | function createOptions( options ) {
function completed (line 7542) | function completed() {
function Data (line 7653) | function Data() {
function dataAttr (line 7863) | function dataAttr( elem, key, data ) {
function adjustCSS (line 8180) | function adjustCSS( elem, prop, valueParts, tween ) {
function getAll (line 8269) | function getAll( context, tag ) {
function setGlobalEval (line 8286) | function setGlobalEval( elems, refElements ) {
function buildFragment (line 8302) | function buildFragment( elems, context, scripts, selection, ignored ) {
function returnTrue (line 8423) | function returnTrue() {
function returnFalse (line 8427) | function returnFalse() {
function safeActiveElement (line 8433) | function safeActiveElement() {
function on (line 8439) | function on( elem, types, selector, data, fn, one ) {
function manipulationTarget (line 9131) | function manipulationTarget( elem, content ) {
function disableScript (line 9141) | function disableScript( elem ) {
function restoreScript (line 9145) | function restoreScript( elem ) {
function cloneCopyEvent (line 9157) | function cloneCopyEvent( src, dest ) {
function fixInput (line 9192) | function fixInput( src, dest ) {
function domManip (line 9205) | function domManip( collection, args, callback, ignored ) {
function remove (line 9295) | function remove( elem, selector, keepData ) {
function actualDisplay (line 9586) | function actualDisplay( name, doc ) {
function defaultDisplay (line 9602) | function defaultDisplay( nodeName ) {
function computeStyleTests (line 9698) | function computeStyleTests() {
function curCSS (line 9788) | function curCSS( elem, name, computed ) {
function addGetHookIf (line 9838) | function addGetHookIf( conditionFn, hookFn ) {
function vendorPropName (line 9875) | function vendorPropName( name ) {
function setPositiveNumber (line 9894) | function setPositiveNumber( elem, value, subtract ) {
function augmentWidthOrHeight (line 9906) | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
function getWidthOrHeight (line 9950) | function getWidthOrHeight( elem, name, extra ) {
function showHide (line 9995) | function showHide( elements, show ) {
function Tween (line 10334) | function Tween( elem, options, prop, end, easing ) {
function createFxNow (line 10458) | function createFxNow() {
function genFx (line 10466) | function genFx( type, includeWidth ) {
function createTween (line 10486) | function createTween( value, prop, animation ) {
function defaultPrefilter (line 10500) | function defaultPrefilter( elem, props, opts ) {
function propFilter (line 10636) | function propFilter( props, specialEasing ) {
function Animation (line 10673) | function Animation( elem, properties, options ) {
function getClass (line 11362) | function getClass( elem ) {
function addToPrefiltersOrTransports (line 12018) | function addToPrefiltersOrTransports( structure ) {
function inspectPrefiltersOrTransports (line 12052) | function inspectPrefiltersOrTransports( structure, options, originalOpti...
function ajaxExtend (line 12081) | function ajaxExtend( target, src ) {
function ajaxHandleResponses (line 12101) | function ajaxHandleResponses( s, jqXHR, responses ) {
function ajaxConvert (line 12159) | function ajaxConvert( s, response, jqXHR, isSuccess ) {
function done (line 12664) | function done( status, nativeStatusText, responses, headers ) {
function buildParams (line 12917) | function buildParams( prefix, obj, traditional, add ) {
function getWindow (line 13483) | function getWindow( elem ) {
function hooks (line 13835) | function hooks () {
function setHookCallback (line 13841) | function setHookCallback (callback) {
function isArray (line 13845) | function isArray(input) {
function isObject (line 13849) | function isObject(input) {
function isObjectEmpty (line 13855) | function isObjectEmpty(obj) {
function isUndefined (line 13864) | function isUndefined(input) {
function isNumber (line 13868) | function isNumber(input) {
function isDate (line 13872) | function isDate(input) {
function map (line 13876) | function map(arr, fn) {
function hasOwnProp (line 13884) | function hasOwnProp(a, b) {
function extend (line 13888) | function extend(a, b) {
function createUTC (line 13906) | function createUTC (input, format, locale, strict) {
function defaultParsingFlags (line 13910) | function defaultParsingFlags() {
function getParsingFlags (line 13930) | function getParsingFlags(m) {
function isValid (line 13957) | function isValid(m) {
function createInvalid (line 13990) | function createInvalid (flags) {
function copyConfig (line 14006) | function copyConfig(to, from) {
function Moment (line 14056) | function Moment(config) {
function isMoment (line 14071) | function isMoment (obj) {
function absFloor (line 14075) | function absFloor (number) {
function toInt (line 14084) | function toInt(argumentForCoercion) {
function compareArrays (line 14096) | function compareArrays(array1, array2, dontConvert) {
function warn (line 14110) | function warn(msg) {
function deprecate (line 14117) | function deprecate(msg, fn) {
function deprecateSimple (line 14149) | function deprecateSimple(name, msg) {
function isFunction (line 14162) | function isFunction(input) {
function set (line 14166) | function set (config) {
function mergeConfigs (line 14185) | function mergeConfigs(parentConfig, childConfig) {
function Locale (line 14211) | function Locale(config) {
function calendar (line 14244) | function calendar (key, mom, now) {
function longDateFormat (line 14258) | function longDateFormat (key) {
function invalidDate (line 14275) | function invalidDate () {
function ordinal (line 14282) | function ordinal (number) {
function relativeTime (line 14303) | function relativeTime (number, withoutSuffix, string, isFuture) {
function pastFuture (line 14310) | function pastFuture (diff, output) {
function addUnitAlias (line 14317) | function addUnitAlias (unit, shorthand) {
function normalizeUnits (line 14322) | function normalizeUnits(units) {
function normalizeObjectUnits (line 14326) | function normalizeObjectUnits(inputObject) {
function addUnitPriority (line 14345) | function addUnitPriority(unit, priority) {
function getPrioritizedUnits (line 14349) | function getPrioritizedUnits(unitsObj) {
function makeGetSet (line 14360) | function makeGetSet (unit, keepTime) {
function get (line 14372) | function get (mom, unit) {
function set$1 (line 14377) | function set$1 (mom, unit, value) {
function stringGet (line 14385) | function stringGet (units) {
function stringSet (line 14394) | function stringSet (units, value) {
function zeroFill (line 14410) | function zeroFill(number, targetLength, forceSign) {
function addFormatToken (line 14430) | function addFormatToken (token, padded, ordinal, callback) {
function removeFormattingTokens (line 14452) | function removeFormattingTokens(input) {
function makeFormatFunction (line 14459) | function makeFormatFunction(format) {
function formatMoment (line 14480) | function formatMoment(m, format) {
function expandFormat (line 14491) | function expandFormat(format, locale) {
function addRegexToken (line 14535) | function addRegexToken (token, regex, strictRegex) {
function getParseRegexForToken (line 14541) | function getParseRegexForToken (token, config) {
function unescapeFormat (line 14550) | function unescapeFormat(s) {
function regexEscape (line 14556) | function regexEscape(s) {
function addParseToken (line 14562) | function addParseToken (token, callback) {
function addWeekParseToken (line 14577) | function addWeekParseToken (token, callback) {
function addTimeToArrayFromToken (line 14584) | function addTimeToArrayFromToken(token, input, config) {
function daysInMonth (line 14619) | function daysInMonth(year, month) {
function localeMonths (line 14674) | function localeMonths (m, format) {
function localeMonthsShort (line 14684) | function localeMonthsShort (m, format) {
function handleStrictParse (line 14693) | function handleStrictParse(monthName, format, strict) {
function localeMonthsParse (line 14734) | function localeMonthsParse (monthName, format, strict) {
function setMonth (line 14774) | function setMonth (mom, value) {
function getSetMonth (line 14799) | function getSetMonth (value) {
function getDaysInMonth (line 14809) | function getDaysInMonth () {
function monthsShortRegex (line 14814) | function monthsShortRegex (isStrict) {
function monthsRegex (line 14834) | function monthsRegex (isStrict) {
function computeMonthsParse (line 14853) | function computeMonthsParse () {
function daysInYear (line 14931) | function daysInYear(year) {
function isLeapYear (line 14935) | function isLeapYear(year) {
function getIsLeapYear (line 14949) | function getIsLeapYear () {
function createDate (line 14953) | function createDate (y, m, d, h, M, s, ms) {
function createUTCDate (line 14965) | function createUTCDate (y) {
function firstWeekOffset (line 14976) | function firstWeekOffset(year, dow, doy) {
function dayOfYearFromWeeks (line 14986) | function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
function weekOfYear (line 15009) | function weekOfYear(mom, dow, doy) {
function weeksInYear (line 15031) | function weeksInYear(year, dow, doy) {
function localeWeek (line 15067) | function localeWeek (mom) {
function localeFirstDayOfWeek (line 15076) | function localeFirstDayOfWeek () {
function localeFirstDayOfYear (line 15080) | function localeFirstDayOfYear () {
function getSetWeek (line 15086) | function getSetWeek (input) {
function getSetISOWeek (line 15091) | function getSetISOWeek (input) {
function parseWeekday (line 15157) | function parseWeekday(input, locale) {
function parseIsoWeekday (line 15174) | function parseIsoWeekday(input, locale) {
function localeWeekdays (line 15184) | function localeWeekdays (m, format) {
function localeWeekdaysShort (line 15194) | function localeWeekdaysShort (m) {
function localeWeekdaysMin (line 15199) | function localeWeekdaysMin (m) {
function handleStrictParse$1 (line 15203) | function handleStrictParse$1(weekdayName, format, strict) {
function localeWeekdaysParse (line 15267) | function localeWeekdaysParse (weekdayName, format, strict) {
function getSetDayOfWeek (line 15309) | function getSetDayOfWeek (input) {
function getSetLocaleDayOfWeek (line 15322) | function getSetLocaleDayOfWeek (input) {
function getSetISODayOfWeek (line 15330) | function getSetISODayOfWeek (input) {
function weekdaysRegex (line 15348) | function weekdaysRegex (isStrict) {
function weekdaysShortRegex (line 15368) | function weekdaysShortRegex (isStrict) {
function weekdaysMinRegex (line 15388) | function weekdaysMinRegex (isStrict) {
function computeWeekdaysParse (line 15408) | function computeWeekdaysParse () {
function hFormat (line 15451) | function hFormat() {
function kFormat (line 15455) | function kFormat() {
function meridiem (line 15481) | function meridiem (token, lowercase) {
function matchMeridiem (line 15499) | function matchMeridiem (isStrict, locale) {
function localeIsPM (line 15559) | function localeIsPM (input) {
function localeMeridiem (line 15566) | function localeMeridiem (hours, minutes, isLower) {
function normalizeLocale (line 15612) | function normalizeLocale(key) {
function chooseLocale (line 15619) | function chooseLocale(names) {
function loadLocale (line 15643) | function loadLocale(name) {
function getSetGlobalLocale (line 15662) | function getSetGlobalLocale (key, values) {
function defineLocale (line 15681) | function defineLocale (name, config) {
function updateLocale (line 15728) | function updateLocale(name, config) {
function getLocale (line 15756) | function getLocale (key) {
function listLocales (line 15779) | function listLocales() {
function checkOverflow (line 15783) | function checkOverflow (m) {
function configFromISO (line 15851) | function configFromISO(config) {
function configFromRFC2822 (line 15907) | function configFromRFC2822(config) {
function configFromString (line 15975) | function configFromString(config) {
function defaults (line 16012) | function defaults(a, b, c) {
function currentDateArray (line 16022) | function currentDateArray(config) {
function configFromArray (line 16035) | function configFromArray (config) {
function dayOfYearFromWeekInfo (line 16097) | function dayOfYearFromWeekInfo(config) {
function configFromStringAndFormat (line 16161) | function configFromStringAndFormat(config) {
function meridiemFixWrap (line 16233) | function meridiemFixWrap (locale, hour, meridiem) {
function configFromStringAndArray (line 16259) | function configFromStringAndArray(config) {
function configFromObject (line 16303) | function configFromObject(config) {
function createFromConfig (line 16316) | function createFromConfig (config) {
function prepareConfig (line 16327) | function prepareConfig (config) {
function configFromInput (line 16360) | function configFromInput(config) {
function createLocalOrUTC (line 16383) | function createLocalOrUTC (input, format, locale, strict, isUTC) {
function createLocal (line 16407) | function createLocal (input, format, locale, strict) {
function pickBy (line 16440) | function pickBy(fn, moments) {
function min (line 16458) | function min () {
function max (line 16464) | function max () {
function isDurationValid (line 16476) | function isDurationValid(m) {
function isValid$1 (line 16498) | function isValid$1() {
function createInvalid$1 (line 16502) | function createInvalid$1() {
function Duration (line 16506) | function Duration (duration) {
function isDuration (line 16543) | function isDuration (obj) {
function absRound (line 16547) | function absRound (number) {
function offset (line 16557) | function offset (token, separator) {
function offsetFromString (line 16588) | function offsetFromString(matcher, string) {
function cloneWithOffset (line 16605) | function cloneWithOffset(input, model) {
function getDateOffset (line 16619) | function getDateOffset (m) {
function getSetOffset (line 16643) | function getSetOffset (input, keepLocalTime, keepMinutes) {
function getSetZone (line 16681) | function getSetZone (input, keepLocalTime) {
function setOffsetToUTC (line 16695) | function setOffsetToUTC (keepLocalTime) {
function setOffsetToLocal (line 16699) | function setOffsetToLocal (keepLocalTime) {
function setOffsetToParsedOffset (line 16711) | function setOffsetToParsedOffset () {
function hasAlignedHourOffset (line 16726) | function hasAlignedHourOffset (input) {
function isDaylightSavingTime (line 16735) | function isDaylightSavingTime () {
function isDaylightSavingTimeShifted (line 16742) | function isDaylightSavingTimeShifted () {
function isLocal (line 16763) | function isLocal () {
function isUtcOffset (line 16767) | function isUtcOffset () {
function isUtc (line 16771) | function isUtc () {
function createDuration (line 16783) | function createDuration (input, key) {
function parseIso (line 16847) | function parseIso (inp, sign) {
function positiveMomentsDifference (line 16856) | function positiveMomentsDifference(base, other) {
function momentsDifference (line 16870) | function momentsDifference(base, other) {
function createAdder (line 16889) | function createAdder(direction, name) {
function addSubtract (line 16906) | function addSubtract (mom, duration, isAdding, updateOffset) {
function getCalendarFormat (line 16935) | function getCalendarFormat(myMoment, now) {
function calendar$1 (line 16945) | function calendar$1 (time, formats) {
function clone (line 16957) | function clone () {
function isAfter (line 16961) | function isAfter (input, units) {
function isBefore (line 16974) | function isBefore (input, units) {
function isBetween (line 16987) | function isBetween (from, to, units, inclusivity) {
function isSame (line 16993) | function isSame (input, units) {
function isSameOrAfter (line 17008) | function isSameOrAfter (input, units) {
function isSameOrBefore (line 17012) | function isSameOrBefore (input, units) {
function diff (line 17016) | function diff (input, units, asFloat) {
function monthDiff (line 17054) | function monthDiff (a, b) {
function toString (line 17078) | function toString () {
function toISOString (line 17082) | function toISOString() {
function inspect (line 17103) | function inspect () {
function format (line 17121) | function format (inputString) {
function from (line 17129) | function from (time, withoutSuffix) {
function fromNow (line 17139) | function fromNow (withoutSuffix) {
function to (line 17143) | function to (time, withoutSuffix) {
function toNow (line 17153) | function toNow (withoutSuffix) {
function locale (line 17160) | function locale (key) {
function localeData (line 17185) | function localeData () {
function startOf (line 17189) | function startOf (units) {
function endOf (line 17233) | function endOf (units) {
function valueOf (line 17247) | function valueOf () {
function unix (line 17251) | function unix () {
function toDate (line 17255) | function toDate () {
function toArray (line 17259) | function toArray () {
function toObject (line 17264) | function toObject () {
function toJSON (line 17277) | function toJSON () {
function isValid$2 (line 17282) | function isValid$2 () {
function parsingFlags (line 17286) | function parsingFlags () {
function invalidAt (line 17290) | function invalidAt () {
function creationData (line 17294) | function creationData() {
function addWeekYearFormatToken (line 17314) | function addWeekYearFormatToken (token, getter) {
function getSetWeekYear (line 17355) | function getSetWeekYear (input) {
function getSetISOWeekYear (line 17364) | function getSetISOWeekYear (input) {
function getISOWeeksInYear (line 17369) | function getISOWeeksInYear () {
function getWeeksInYear (line 17373) | function getWeeksInYear () {
function getSetWeekYearHelper (line 17378) | function getSetWeekYearHelper(input, week, weekday, dow, doy) {
function setWeekAll (line 17391) | function setWeekAll(weekYear, week, weekday, dow, doy) {
function getSetQuarter (line 17422) | function getSetQuarter (input) {
function getSetDayOfYear (line 17480) | function getSetDayOfYear (input) {
function parseMs (line 17579) | function parseMs(input, array) {
function getZoneAbbr (line 17597) | function getZoneAbbr () {
function getZoneName (line 17601) | function getZoneName () {
function createUnix (line 17709) | function createUnix (input) {
function createInZone (line 17713) | function createInZone () {
function preParsePostFormat (line 17717) | function preParsePostFormat (string) {
function get$1 (line 17759) | function get$1 (format, index, field, setter) {
function listMonthsImpl (line 17765) | function listMonthsImpl (format, index, field) {
function listWeekdaysImpl (line 17793) | function listWeekdaysImpl (localeSorted, format, index, field) {
function listMonths (line 17829) | function listMonths (format, index) {
function listMonthsShort (line 17833) | function listMonthsShort (format, index) {
function listWeekdays (line 17837) | function listWeekdays (localeSorted, format, index) {
function listWeekdaysShort (line 17841) | function listWeekdaysShort (localeSorted, format, index) {
function listWeekdaysMin (line 17845) | function listWeekdaysMin (localeSorted, format, index) {
function abs (line 17867) | function abs () {
function addSubtract$1 (line 17884) | function addSubtract$1 (duration, input, value, direction) {
function add$1 (line 17895) | function add$1 (input, value) {
function subtract$1 (line 17900) | function subtract$1 (input, value) {
function absCeil (line 17904) | function absCeil (number) {
function bubble (line 17912) | function bubble () {
function daysToMonths (line 17959) | function daysToMonths (days) {
function monthsToDays (line 17965) | function monthsToDays (months) {
function as (line 17970) | function as (units) {
function valueOf$1 (line 18001) | function valueOf$1 () {
function makeAs (line 18013) | function makeAs (alias) {
function get$2 (line 18028) | function get$2 (units) {
function makeGetter (line 18033) | function makeGetter(name) {
function weeks (line 18047) | function weeks () {
function substituteTimeAgo (line 18062) | function substituteTimeAgo(string, number, withoutSuffix, isFuture, loca...
function relativeTime$1 (line 18066) | function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
function getSetRelativeTimeRounding (line 18094) | function getSetRelativeTimeRounding (roundingFunction) {
function getSetRelativeTimeThreshold (line 18106) | function getSetRelativeTimeThreshold (threshold, limit) {
function humanize (line 18120) | function humanize (withSuffix) {
function toISOString$1 (line 18137) | function toISOString$1() {
function webpackContext (line 18535) | function webpackContext(req) {
function webpackContextResolve (line 18538) | function webpackContextResolve(req) {
function plural (line 19403) | function plural(word, num) {
function relativeTimeWithPlural (line 19407) | function relativeTimeWithPlural(number, withoutSuffix, key) {
function relativeTimeWithMutation (line 19883) | function relativeTimeWithMutation(number, withoutSuffix, key) {
function specialMutationForYears (line 19891) | function specialMutationForYears(number) {
function lastNumber (line 19903) | function lastNumber(number) {
function mutation (line 19909) | function mutation(text, number) {
function softMutation (line 19915) | function softMutation(text) {
function translate (line 19997) | function translate(number, withoutSuffix, key) {
function plural (line 20239) | function plural(n) {
function translate (line 20242) | function translate(number, withoutSuffix, key, isFuture) {
function processRelativeTime (line 20636) | function processRelativeTime(number, withoutSuffix, key, isFuture) {
function processRelativeTime (line 20719) | function processRelativeTime(number, withoutSuffix, key, isFuture) {
function processRelativeTime (line 20802) | function processRelativeTime(number, withoutSuffix, key, isFuture) {
function isFunction (line 20987) | function isFunction(input) {
function processRelativeTime (line 21703) | function processRelativeTime(number, withoutSuffix, key, isFuture) {
function translate (line 21975) | function translate(number, withoutSuffix, key, isFuture) {
function verbalNumber (line 22009) | function verbalNumber(number, isFuture) {
function processRelativeTime (line 22640) | function processRelativeTime(number, withoutSuffix, key, isFuture) {
function translate (line 23000) | function translate(number, withoutSuffix, key) {
function translate (line 23151) | function translate(number, withoutSuffix, key, isFuture) {
function week (line 23180) | function week(isFuture) {
function plural (line 23452) | function plural(n) {
function translate (line 23460) | function translate(number, withoutSuffix, key, isFuture) {
function processRelativeTime (line 24380) | function processRelativeTime(number, withoutSuffix, key, isFuture) {
function processFutureTime (line 24390) | function processFutureTime(string) {
function processPastTime (line 24397) | function processPastTime(string) {
function eifelerRegelAppliesToNumber (line 24411) | function eifelerRegelAppliesToNumber(number) {
function translateSeconds (line 24608) | function translateSeconds(number, withoutSuffix, key, isFuture) {
function translateSingular (line 24615) | function translateSingular(number, withoutSuffix, key, isFuture) {
function special (line 24618) | function special(number) {
function forms (line 24621) | function forms(key) {
function translate (line 24624) | function translate(number, withoutSuffix, key, isFuture) {
function format (line 24734) | function format(forms, number, withoutSuffix) {
function relativeTimeWithPlural (line 24744) | function relativeTimeWithPlural(number, withoutSuffix, key) {
function relativeTimeWithSingular (line 24747) | function relativeTimeWithSingular(number, withoutSuffix, key) {
function relativeSeconds (line 24750) | function relativeSeconds(number, withoutSuffix) {
function relativeTimeMr (line 25212) | function relativeTimeMr(number, withoutSuffix, string, isFuture)
function plural (line 26204) | function plural(n) {
function translate (line 26207) | function translate(number, withoutSuffix, key) {
function relativeTimeWithPlural (line 26451) | function relativeTimeWithPlural(number, withoutSuffix, key) {
function plural (line 26532) | function plural(word, num) {
function relativeTimeWithPlural (line 26536) | function relativeTimeWithPlural(number, withoutSuffix, key) {
function plural (line 26966) | function plural(n) {
function translate (line 26969) | function translate(number, withoutSuffix, key, isFuture) {
function processRelativeTime (line 27118) | function processRelativeTime(number, withoutSuffix, key, isFuture) {
function translateFuture (line 28265) | function translateFuture(output) {
function translatePast (line 28277) | function translatePast(output) {
function translate (line 28289) | function translate(number, withoutSuffix, string, isFuture) {
function numberAsNoun (line 28305) | function numberAsNoun(number) {
function processRelativeTime (line 28542) | function processRelativeTime(number, withoutSuffix, key, isFuture) {
function plural (line 28706) | function plural(word, num) {
function relativeTimeWithPlural (line 28710) | function relativeTimeWithPlural(number, withoutSuffix, key) {
function weekdaysCaseReplace (line 28728) | function weekdaysCaseReplace(m, format) {
function processHoursFunction (line 28746) | function processHoursFunction(str) {
FILE: static/common/delegator.js
function Map (line 5) | function Map() {
function _key (line 70) | function _key(arr) {
function Delegator (line 85) | function Delegator(container) {
function listener (line 109) | function listener(e) {
FILE: static/common/dialog/dialog.js
function hide (line 6) | function hide() {
function Dialog (line 15) | function Dialog (param) {
FILE: static/entry.apply.js
function bindEvent (line 28) | function bindEvent() {
function init (line 75) | function init() {
function Map (line 94) | function Map() {
function _key (line 159) | function _key(arr) {
function Delegator (line 174) | function Delegator(container) {
function listener (line 198) | function listener(e) {
function hide (line 275) | function hide() {
function Dialog (line 284) | function Dialog (param) {
FILE: static/entry.applyList.js
function doApprove (line 34) | function doApprove(params , cb){
function bindEvent (line 65) | function bindEvent() {
function getSearchList (line 133) | function getSearchList(params,cb){
function getApplyList (line 149) | function getApplyList(cb){
function init (line 167) | function init() {
function Map (line 199) | function Map() {
function _key (line 264) | function _key(arr) {
function Delegator (line 279) | function Delegator(container) {
function listener (line 303) | function listener(e) {
function hide (line 380) | function hide() {
function Dialog (line 389) | function Dialog (param) {
function print (line 430) | function print() { __p += __j.call(arguments, '') }
FILE: static/entry.authUserManage.js
function bindEvent (line 26) | function bindEvent() {
function $ajax (line 52) | function $ajax(url, params, cb,type){
function fetch (line 73) | function fetch() {
function print (line 105) | function print() { __p += __j.call(arguments, '') }
FILE: static/entry.charts.js
function setChartX (line 105) | function setChartX(number) {
function setDefaultTotal (line 116) | function setDefaultTotal(arr, number) {
function whichDayIndex (line 122) | function whichDayIndex(day1) {
function sortChartData (line 131) | function sortChartData(data) {
function Map (line 155) | function Map() {
function _key (line 220) | function _key(arr) {
function Delegator (line 235) | function Delegator(container) {
function listener (line 259) | function listener(e) {
function getCurrentValue (line 2021) | function getCurrentValue() {
function b (line 2164) | function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=...
function c (line 2164) | function c(){f=null}
function d (line 2164) | function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type...
function hide (line 2195) | function hide() {
function Dialog (line 2204) | function Dialog (param) {
function q (line 2249) | function q(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}
function w (line 2249) | function w(){var a,b=arguments,c,d={},e=function(a,b){var c,d;typeof a!=...
function z (line 2249) | function z(a,b){return parseInt(a,b||
function Fa (line 2250) | function Fa(a){return typeof a==="string"}
function ca (line 2250) | function ca(a){return typeof a==="object"}
function La (line 2250) | function La(a){return Object.prototype.toString.call(a)==="[object Array]"}
function ha (line 2250) | function ha(a){return typeof a==="number"}
function za (line 2250) | function za(a){return U.log(a)/U.LN10}
function ia (line 2250) | function ia(a){return U.pow(10,a)}
function ja (line 2250) | function ja(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}
function r (line 2250) | function r(a){return a!==t&&a!==null}
function H (line 2250) | function H(a,b,c){var d,e;if(Fa(b))r(c)?a.setAttribute(b,c):a&&a.getAttr...
function qa (line 2251) | function qa(a){return La(a)?a:[a]}
function m (line 2251) | function m(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++)if(c=a[b],ty...
function G (line 2251) | function G(a,b){if(Aa&&!aa&&b&&b.opacity!==t)b.filter="alpha(opacity="+b...
function Y (line 2251) | function Y(a,b,c,d,e){a=y.createElement(a);b&&q(a,b);e&&G(a,{padding:0,b...
function ka (line 2251) | function ka(a,b){var c=function(){};c.prototype=new a;q(c.prototype,b);r...
function Ga (line 2252) | function Ga(a,b,c,d){var e=E.lang,a=+a||0,f=b===-1?(a.toString().split("...
function Ha (line 2252) | function Ha(a,b){return Array((b||2)+1-String(a).length).join(0)+a}
function Ma (line 2252) | function Ma(a,b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slic...
function Ia (line 2253) | function Ia(a,b){for(var c="{",d=!1,e,f,g,h,i,j=[];(c=a.indexOf(c))!==-1...
function mb (line 2253) | function mb(a){return U.pow(10,T(U.log(a)/
function nb (line 2254) | function nb(a,b,c,d){var e,c=m(c,1);e=a/c;b||(b=[1,2,2.5,5,10],d&&d.allo...
function Bb (line 2254) | function Bb(){this.symbol=this.color=0}
function ob (line 2254) | function ob(a,b){var c=a.length,d,e;for(e=0;e<c;e++)a[e].ss_i=e;a.sort(f...
function Na (line 2254) | function Na(a){for(var b=a.length,c=a[0];b--;)a[b]<c&&(c=a[b]);return c}
function Ba (line 2254) | function Ba(a){for(var b=
function Oa (line 2255) | function Oa(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destr...
function Pa (line 2255) | function Pa(a){db||(db=Y(Ja));a&&db.appendChild(a);db.innerHTML=""}
function ra (line 2255) | function ra(a,b){var c="Highcharts error #"+a+": www.highcharts.com/erro...
function da (line 2255) | function da(a){return parseFloat(a.toPrecision(14))}
function Qa (line 2255) | function Qa(a,b){va=m(a,b.animation)}
function Cb (line 2255) | function Cb(){var a=E.global.useUTC,b=a?"getUTC":"get",c=a?"setUTC":"set...
function P (line 2256) | function P(){}
function Sa (line 2256) | function Sa(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!...
function la (line 2256) | function la(){this.init.apply(this,arguments)}
function Ya (line 2256) | function Ya(){this.init.apply(this,arguments)}
function Hb (line 2256) | function Hb(a,b,c,d,e){var f=a.chart.inverted;
function j (line 2309) | function j(){var a,b;a=s.element.style;J=(Va===void 0||wb===void 0||n.st...
function k (line 2310) | function k(){var a=n.styles,a=a&&a.textAlign,b=v+x*(1-L),c;c=h?0:na;if(r...
function l (line 2310) | function l(a,b){m?m.attr(a,b):B[a]=b}
function a (line 2335) | function a(){var a=
function a (line 2483) | function a(){var a={width:b.yAxis.len,height:b.xAxis.len};p(["group","ma...
FILE: static/entry.log.js
function addKeyword (line 58) | function addKeyword() {
function addDebar (line 77) | function addDebar() {
function bindEvent (line 96) | function bindEvent() {
function isTimeRight (line 201) | function isTimeRight(begin, end) {
function removeValue (line 219) | function removeValue(value, arr) {
function showLogs (line 227) | function showLogs(opts, isAdd) {
function init (line 304) | function init() {
function Map (line 410) | function Map() {
function _key (line 475) | function _key(arr) {
function Delegator (line 490) | function Delegator(container) {
function listener (line 514) | function listener(e) {
function hide (line 591) | function hide() {
function Dialog (line 601) | function Dialog (param) {
function getCurrentValue (line 2331) | function getCurrentValue() {
function b (line 2474) | function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=...
function c (line 2474) | function c(){f=null}
function d (line 2474) | function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type...
function hide (line 2505) | function hide() {
function Dialog (line 2514) | function Dialog (param) {
function print (line 2555) | function print() { __p += __j.call(arguments, '') }
function getBrowserType (line 2568) | function getBrowserType(ua) {
function sourcePage (line 2615) | function sourcePage(data, type, opt) {
FILE: static/entry.offlinelog.js
function addKeyword (line 100) | function addKeyword() {
function addDebar (line 119) | function addDebar() {
function bindEvent (line 140) | function bindEvent() {
function removeValue (line 312) | function removeValue(value, arr) {
function fetchOfflineFile (line 322) | function fetchOfflineFile (id){
function showLogs (line 357) | function showLogs(data , opt) {
function init (line 425) | function init() {
function Map (line 450) | function Map() {
function _key (line 515) | function _key(arr) {
function Delegator (line 530) | function Delegator(container) {
function listener (line 554) | function listener(e) {
function hide (line 631) | function hide() {
function Dialog (line 641) | function Dialog (param) {
function hide (line 687) | function hide() {
function showOfflineLogConfig (line 696) | function showOfflineLogConfig(logConfig){
function Dialog (line 714) | function Dialog (param) {
function hide (line 804) | function hide() {
function Dialog (line 813) | function Dialog (param) {
function print (line 854) | function print() { __p += __j.call(arguments, '') }
function getBrowserType (line 867) | function getBrowserType(ua) {
function sourcePage (line 914) | function sourcePage(data, type, opt) {
FILE: static/entry.projectTotal.js
function setChartX (line 115) | function setChartX(number) {
function setDefaultTotal (line 126) | function setDefaultTotal(arr, number) {
function whichDayIndex (line 132) | function whichDayIndex(day1) {
function sortChartData (line 141) | function sortChartData(data) {
function Map (line 164) | function Map() {
function _key (line 229) | function _key(arr) {
function Delegator (line 244) | function Delegator(container) {
function listener (line 268) | function listener(e) {
function getCurrentValue (line 2030) | function getCurrentValue() {
function b (line 2173) | function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=...
function c (line 2173) | function c(){f=null}
function d (line 2173) | function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type...
function hide (line 2204) | function hide() {
function Dialog (line 2213) | function Dialog (param) {
function q (line 2258) | function q(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}
function w (line 2258) | function w(){var a,b=arguments,c,d={},e=function(a,b){var c,d;typeof a!=...
function z (line 2258) | function z(a,b){return parseInt(a,b||
function Fa (line 2259) | function Fa(a){return typeof a==="string"}
function ca (line 2259) | function ca(a){return typeof a==="object"}
function La (line 2259) | function La(a){return Object.prototype.toString.call(a)==="[object Array]"}
function ha (line 2259) | function ha(a){return typeof a==="number"}
function za (line 2259) | function za(a){return U.log(a)/U.LN10}
function ia (line 2259) | function ia(a){return U.pow(10,a)}
function ja (line 2259) | function ja(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}
function r (line 2259) | function r(a){return a!==t&&a!==null}
function H (line 2259) | function H(a,b,c){var d,e;if(Fa(b))r(c)?a.setAttribute(b,c):a&&a.getAttr...
function qa (line 2260) | function qa(a){return La(a)?a:[a]}
function m (line 2260) | function m(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++)if(c=a[b],ty...
function G (line 2260) | function G(a,b){if(Aa&&!aa&&b&&b.opacity!==t)b.filter="alpha(opacity="+b...
function Y (line 2260) | function Y(a,b,c,d,e){a=y.createElement(a);b&&q(a,b);e&&G(a,{padding:0,b...
function ka (line 2260) | function ka(a,b){var c=function(){};c.prototype=new a;q(c.prototype,b);r...
function Ga (line 2261) | function Ga(a,b,c,d){var e=E.lang,a=+a||0,f=b===-1?(a.toString().split("...
function Ha (line 2261) | function Ha(a,b){return Array((b||2)+1-String(a).length).join(0)+a}
function Ma (line 2261) | function Ma(a,b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slic...
function Ia (line 2262) | function Ia(a,b){for(var c="{",d=!1,e,f,g,h,i,j=[];(c=a.indexOf(c))!==-1...
function mb (line 2262) | function mb(a){return U.pow(10,T(U.log(a)/
function nb (line 2263) | function nb(a,b,c,d){var e,c=m(c,1);e=a/c;b||(b=[1,2,2.5,5,10],d&&d.allo...
function Bb (line 2263) | function Bb(){this.symbol=this.color=0}
function ob (line 2263) | function ob(a,b){var c=a.length,d,e;for(e=0;e<c;e++)a[e].ss_i=e;a.sort(f...
function Na (line 2263) | function Na(a){for(var b=a.length,c=a[0];b--;)a[b]<c&&(c=a[b]);return c}
function Ba (line 2263) | function Ba(a){for(var b=
function Oa (line 2264) | function Oa(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destr...
function Pa (line 2264) | function Pa(a){db||(db=Y(Ja));a&&db.appendChild(a);db.innerHTML=""}
function ra (line 2264) | function ra(a,b){var c="Highcharts error #"+a+": www.highcharts.com/erro...
function da (line 2264) | function da(a){return parseFloat(a.toPrecision(14))}
function Qa (line 2264) | function Qa(a,b){va=m(a,b.animation)}
function Cb (line 2264) | function Cb(){var a=E.global.useUTC,b=a?"getUTC":"get",c=a?"setUTC":"set...
function P (line 2265) | function P(){}
function Sa (line 2265) | function Sa(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!...
function la (line 2265) | function la(){this.init.apply(this,arguments)}
function Ya (line 2265) | function Ya(){this.init.apply(this,arguments)}
function Hb (line 2265) | function Hb(a,b,c,d,e){var f=a.chart.inverted;
function j (line 2318) | function j(){var a,b;a=s.element.style;J=(Va===void 0||wb===void 0||n.st...
function k (line 2319) | function k(){var a=n.styles,a=a&&a.textAlign,b=v+x*(1-L),c;c=h?0:na;if(r...
function l (line 2319) | function l(a,b){m?m.attr(a,b):B[a]=b}
function a (line 2344) | function a(){var a=
function a (line 2492) | function a(){var a={width:b.yAxis.len,height:b.xAxis.len};p(["group","ma...
function print (line 2670) | function print() { __p += __j.call(arguments, '') }
FILE: static/entry.realtime.js
function addKeyword (line 121) | function addKeyword() {
function addDebar (line 140) | function addDebar() {
function bindEvent (line 161) | function bindEvent() {
function removeValue (line 267) | function removeValue(value, arr) {
function showLogs (line 310) | function showLogs(data) {
function init (line 331) | function init() {
function Map (line 364) | function Map() {
function _key (line 429) | function _key(arr) {
function Delegator (line 444) | function Delegator(container) {
function listener (line 468) | function listener(e) {
function hide (line 545) | function hide() {
function Dialog (line 555) | function Dialog (param) {
function hide (line 600) | function hide() {
function Dialog (line 609) | function Dialog (param) {
function print (line 650) | function print() { __p += __j.call(arguments, '') }
function getBrowserType (line 663) | function getBrowserType(ua) {
function sourcePage (line 710) | function sourcePage(data, type, opt) {
FILE: static/entry.statistics.js
function Map (line 105) | function Map() {
function _key (line 170) | function _key(arr) {
function Delegator (line 185) | function Delegator(container) {
function listener (line 209) | function listener(e) {
function getCurrentValue (line 1971) | function getCurrentValue() {
function b (line 2114) | function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=...
function c (line 2114) | function c(){f=null}
function d (line 2114) | function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type...
function hide (line 2145) | function hide() {
function Dialog (line 2154) | function Dialog (param) {
function print (line 2195) | function print() { __p += __j.call(arguments, '') }
FILE: static/entry.userManage.js
function bindEvent (line 27) | function bindEvent() {
function reloadPage (line 79) | function reloadPage(){
function $ajax (line 89) | function $ajax(url, params, cb,type){
function init (line 127) | function init() {
function Map (line 177) | function Map() {
function _key (line 242) | function _key(arr) {
function Delegator (line 257) | function Delegator(container) {
function listener (line 281) | function listener(e) {
function hide (line 358) | function hide() {
function Dialog (line 367) | function Dialog (param) {
function print (line 408) | function print() { __p += __j.call(arguments, '') }
FILE: static/js/beautify.js
function in_array (line 147) | function in_array(what, arr) {
function trim (line 156) | function trim(s) {
function js_beautify (line 160) | function js_beautify(js_source_text, options) {
function Beautifier (line 176) | function Beautifier(js_source_text, options) {
function OutputLine (line 1219) | function OutputLine() {
function Output (line 1279) | function Output(indent_string, baseIndentString) {
function tokenizer (line 1411) | function tokenizer(input, opts, indent_string) {
FILE: static/js/require.js
function I (line 2) | function I(b){return"[object Function]"===P.call(b)}
function J (line 2) | function J(b){return"[object Array]"===P.call(b)}
function x (line 2) | function x(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+...
function Q (line 2) | function Q(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b))...
function r (line 2) | function r(b,c){return ga.call(b,c)}
function m (line 2) | function m(b,c){return r(b,c)&&b[c]}
function G (line 2) | function G(b,c){for(var d in b)if(r(b,d)&&c(b[d],d))break}
function R (line 2) | function R(b,c,d,m){c&&G(c,function(c,k){if(d||!r(b,k))m&&"string"!==typ...
function t (line 3) | function t(b,c){return function(){return c.apply(b,arguments)}}
function ba (line 3) | function ba(b){throw b;}
function ca (line 3) | function ca(b){if(!b)return b;var c=aa;x(b.split("."),function(b){c=c[b]...
function A (line 3) | function A(b,c,d,m){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"...
function ha (line 3) | function ha(b){function c(a,f,B){var e,n,b,c,d,S,h,g=f&&f.split("/"),k=j...
FILE: static/lib/bootstrap/bootstrap.js
function transitionEnd (line 33) | function transitionEnd() {
function removeElement (line 125) | function removeElement() {
function Plugin (line 141) | function Plugin(option) {
function Plugin (line 246) | function Plugin(option) {
function Plugin (line 467) | function Plugin(option) {
function getTargetFromTrigger (line 686) | function getTargetFromTrigger($trigger) {
function Plugin (line 698) | function Plugin(option) {
function clearMenus (line 830) | function clearMenus(e) {
function getParent (line 849) | function getParent($this) {
function Plugin (line 866) | function Plugin(option) {
function Plugin (line 1137) | function Plugin(option, _relatedTarget) {
function complete (line 1479) | function complete() {
function Plugin (line 1631) | function Plugin(option) {
function Plugin (line 1751) | function Plugin(option) {
function ScrollSpy (line 1800) | function ScrollSpy(element, options) {
function Plugin (line 1923) | function Plugin(option) {
function next (line 2030) | function next() {
function Plugin (line 2076) | function Plugin(option) {
function Plugin (line 2233) | function Plugin(option) {
FILE: static/lib/charts/highcharts.js
function q (line 8) | function q(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}
function w (line 8) | function w(){var a,b=arguments,c,d={},e=function(a,b){var c,d;typeof a!=...
function z (line 8) | function z(a,b){return parseInt(a,b||
function Fa (line 9) | function Fa(a){return typeof a==="string"}
function ca (line 9) | function ca(a){return typeof a==="object"}
function La (line 9) | function La(a){return Object.prototype.toString.call(a)==="[object Array]"}
function ha (line 9) | function ha(a){return typeof a==="number"}
function za (line 9) | function za(a){return U.log(a)/U.LN10}
function ia (line 9) | function ia(a){return U.pow(10,a)}
function ja (line 9) | function ja(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}
function r (line 9) | function r(a){return a!==t&&a!==null}
function H (line 9) | function H(a,b,c){var d,e;if(Fa(b))r(c)?a.setAttribute(b,c):a&&a.getAttr...
function qa (line 10) | function qa(a){return La(a)?a:[a]}
function m (line 10) | function m(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++)if(c=a[b],ty...
function G (line 10) | function G(a,b){if(Aa&&!aa&&b&&b.opacity!==t)b.filter="alpha(opacity="+b...
function Y (line 10) | function Y(a,b,c,d,e){a=y.createElement(a);b&&q(a,b);e&&G(a,{padding:0,b...
function ka (line 10) | function ka(a,b){var c=function(){};c.prototype=new a;q(c.prototype,b);r...
function Ga (line 11) | function Ga(a,b,c,d){var e=E.lang,a=+a||0,f=b===-1?(a.toString().split("...
function Ha (line 11) | function Ha(a,b){return Array((b||2)+1-String(a).length).join(0)+a}
function Ma (line 11) | function Ma(a,b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slic...
function Ia (line 12) | function Ia(a,b){for(var c="{",d=!1,e,f,g,h,i,j=[];(c=a.indexOf(c))!==-1...
function mb (line 12) | function mb(a){return U.pow(10,T(U.log(a)/
function nb (line 13) | function nb(a,b,c,d){var e,c=m(c,1);e=a/c;b||(b=[1,2,2.5,5,10],d&&d.allo...
function Bb (line 13) | function Bb(){this.symbol=this.color=0}
function ob (line 13) | function ob(a,b){var c=a.length,d,e;for(e=0;e<c;e++)a[e].ss_i=e;a.sort(f...
function Na (line 13) | function Na(a){for(var b=a.length,c=a[0];b--;)a[b]<c&&(c=a[b]);return c}
function Ba (line 13) | function Ba(a){for(var b=
function Oa (line 14) | function Oa(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destr...
function Pa (line 14) | function Pa(a){db||(db=Y(Ja));a&&db.appendChild(a);db.innerHTML=""}
function ra (line 14) | function ra(a,b){var c="Highcharts error #"+a+": www.highcharts.com/erro...
function da (line 14) | function da(a){return parseFloat(a.toPrecision(14))}
function Qa (line 14) | function Qa(a,b){va=m(a,b.animation)}
function Cb (line 14) | function Cb(){var a=E.global.useUTC,b=a?"getUTC":"get",c=a?"setUTC":"set...
function P (line 15) | function P(){}
function Sa (line 15) | function Sa(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!...
function la (line 15) | function la(){this.init.apply(this,arguments)}
function Ya (line 15) | function Ya(){this.init.apply(this,arguments)}
function Hb (line 15) | function Hb(a,b,c,d,e){var f=a.chart.inverted;
function j (line 68) | function j(){var a,b;a=s.element.style;J=(Va===void 0||wb===void 0||n.st...
function k (line 69) | function k(){var a=n.styles,a=a&&a.textAlign,b=v+x*(1-L),c;c=h?0:na;if(r...
function l (line 69) | function l(a,b){m?m.attr(a,b):B[a]=b}
function a (line 94) | function a(){var a=
function a (line 242) | function a(){var a={width:b.yAxis.len,height:b.xAxis.len};p(["group","ma...
FILE: static/lib/jquery/jquery.datetimepicker.js
function getCurrentValue (line 1691) | function getCurrentValue() {
function b (line 1834) | function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=...
function c (line 1834) | function c(){f=null}
function d (line 1834) | function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type...
FILE: static/module/apply/mod.apply.js
function bindEvent (line 14) | function bindEvent() {
function init (line 61) | function init() {
FILE: static/module/applyList/mod.applyList.js
function doApprove (line 20) | function doApprove(params , cb){
function bindEvent (line 51) | function bindEvent() {
function getSearchList (line 119) | function getSearchList(params,cb){
function getApplyList (line 135) | function getApplyList(cb){
function init (line 153) | function init() {
FILE: static/module/authUserManage/mod.authUserManage.js
function bindEvent (line 12) | function bindEvent() {
function $ajax (line 38) | function $ajax(url, params, cb,type){
function fetch (line 59) | function fetch() {
FILE: static/module/charts/mod.charts.js
function setChartX (line 91) | function setChartX(number) {
function setDefaultTotal (line 102) | function setDefaultTotal(arr, number) {
function whichDayIndex (line 108) | function whichDayIndex(day1) {
function sortChartData (line 117) | function sortChartData(data) {
FILE: static/module/log/logDetailDialog/logDetailDialog.js
function hide (line 6) | function hide() {
function Dialog (line 16) | function Dialog (param) {
FILE: static/module/log/mod.log.js
function addKeyword (line 39) | function addKeyword() {
function addDebar (line 58) | function addDebar() {
function bindEvent (line 77) | function bindEvent() {
function isTimeRight (line 182) | function isTimeRight(begin, end) {
function removeValue (line 200) | function removeValue(value, arr) {
function showLogs (line 208) | function showLogs(opts, isAdd) {
function init (line 285) | function init() {
FILE: static/module/log/mod.offlinelog.js
function addKeyword (line 39) | function addKeyword() {
function addDebar (line 58) | function addDebar() {
function bindEvent (line 79) | function bindEvent() {
function removeValue (line 251) | function removeValue(value, arr) {
function fetchOfflineFile (line 261) | function fetchOfflineFile (id){
function showLogs (line 296) | function showLogs(data , opt) {
function init (line 364) | function init() {
FILE: static/module/log/mod.realtime.js
function addKeyword (line 36) | function addKeyword() {
function addDebar (line 55) | function addDebar() {
function bindEvent (line 76) | function bindEvent() {
function removeValue (line 182) | function removeValue(value, arr) {
function showLogs (line 225) | function showLogs(data) {
function init (line 246) | function init() {
FILE: static/module/log/offlineDialog/offlineDialog.js
function hide (line 7) | function hide() {
function showOfflineLogConfig (line 16) | function showOfflineLogConfig(logConfig){
function Dialog (line 34) | function Dialog (param) {
FILE: static/module/projectTotal/mod.projectTotal.js
function setChartX (line 101) | function setChartX(number) {
function setDefaultTotal (line 112) | function setDefaultTotal(arr, number) {
function whichDayIndex (line 118) | function whichDayIndex(day1) {
function sortChartData (line 127) | function sortChartData(data) {
FILE: static/module/userManage/mod.userManage.js
function bindEvent (line 13) | function bindEvent() {
function reloadPage (line 65) | function reloadPage(){
function $ajax (line 75) | function $ajax(url, params, cb,type){
function init (line 113) | function init() {
FILE: utils/express-websocket.js
function addSocketRoute (line 22) | function addSocketRoute(route, middleware, callback) {
Condensed preview — 200 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,834K chars).
[
{
"path": ".editorconfig",
"chars": 436,
"preview": "# This file is for unifying the coding style for different editors and IDEs\n# editorconfig.org\n\nroot = true\n\n\n[*]\nend_of"
},
{
"path": ".gitignore",
"chars": 2768,
"preview": "#################\n## Eclipse\n#################\n\n*.pydevproject\n.project\n.metadata\nbin/\n*.tmp\n*.bak\n*.swp\n*~.nib\nlocal.pr"
},
{
"path": ".jshintrc",
"chars": 4503,
"preview": "// 根据 knightli 提供的配置改编, 欢迎试用\n// update by kaelyang 2015/07/31\n{\n // 参考 http://jslinterrors.com/\n // =============="
},
{
"path": "LICENSE",
"chars": 1140,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 , imweb(http://imweb.io/)\nCopyright (c) 2015 , chriscai(345446383@qq.com)\n\nPer"
},
{
"path": "Readme.md",
"chars": 2012,
"preview": "#badjs-storage\n\n> badjs manage system .\n\n# 运行\n```javascript\nnode app.js\n```\n\n# 启动参数\n--debug log 采用debug 级别, 默认使用info\n\n-"
},
{
"path": "app.js",
"chars": 303,
"preview": "var workflow = require('./workflow.config.json'),\n _ = require(\"underscore\");\n\n\nvar workflowPath = workflow.path;\n\nif"
},
{
"path": "controller/action/ApplyAction.js",
"chars": 5416,
"preview": "/**\n * @info : APPLY ACION\n * @author : coverguo\n * @date : 2015-01-07\n */\n\n\nvar log4js = require('log4js'),\n logger "
},
{
"path": "controller/action/ApproveAction.js",
"chars": 1830,
"preview": "/**\n * @info : APPROVE ACION\n * @author : coverguo\n * @date : 2015-01-12\n */\n\n\nvar log4js = require('log4js'),\n logge"
},
{
"path": "controller/action/IndexAction.js",
"chars": 1449,
"preview": "/**\n * Created by chriscai on 2015/1/15.\n */\n\n\nvar BusinessService = require('../../service/BusinessService');\n\nvar fs ="
},
{
"path": "controller/action/LogAction.js",
"chars": 4594,
"preview": "/**\n * @info : LOG ACION\n * @author : coverguo\n * @date : 2014-12-16\n */\n\nvar LogService = require('../../service/LogSer"
},
{
"path": "controller/action/StatisticsAction.js",
"chars": 3787,
"preview": "/**\n * Created by chriscai on 2015/1/15.\n */\nvar BusinessService = require('../../service/BusinessService'),\n _ = req"
},
{
"path": "controller/action/UserAction.js",
"chars": 8792,
"preview": "/**\n * Created by coverguo on 2015/1/12.\n */\n\nvar log4js = require('log4js'),\n logger = log4js.getLogger(),\n UserS"
},
{
"path": "controller/action/UserApplyAction.js",
"chars": 1746,
"preview": "/**\n * Created by coverguo on 2015/1/12.\n */\n\nvar log4js = require('log4js'),\n logger = log4js.getLogger(),\n UserA"
},
{
"path": "controller/router.js",
"chars": 5198,
"preview": "/**\n * @info : 页面申请路由\n * @author : coverguo\n * @date : 2014-12-16\n */\n\nvar LogAction = require('./action/LogAction'),\n "
},
{
"path": "dao/ApplyDao.js",
"chars": 531,
"preview": "\n/**\n * @info: ApplyDao\n * @author: coverGuo\n * @date: 2014-12-30\n */\n//status: 0 审核中- 1-审核通过, 2-审核失败\nmodule.exports "
},
{
"path": "dao/ApproveDao.js",
"chars": 357,
"preview": "/**\n * @info: approveDao\n * @author: coverguo\n * @date: 2014-12-30\n */\n\nmodule.exports = function (db){\n var appr"
},
{
"path": "dao/StatisticsDao.js",
"chars": 370,
"preview": "\n/**\n * @info: statisticsDao\n * @author: chriscai\n * @date: 2014-01-14\n */\n\nmodule.exports = function (db){\n var "
},
{
"path": "dao/UserApplyDao.js",
"chars": 309,
"preview": "/**\n * @info: UserApplyDao\n * @author: coverguo\n * @date: 2014-01-15\n */\n\nmodule.exports = function (db){\n var us"
},
{
"path": "dao/UserDao.js",
"chars": 354,
"preview": "\n/**\n * @info: userDao\n * @author: coverGuo\n * @date: 2014-12-30\n */\n\nmodule.exports = function (db){\n var user ="
},
{
"path": "db/create.sql",
"chars": 4051,
"preview": "-- --------------------------------------------------------\n-- 主机: 127.0.0.1\n-- 服务器版本: "
},
{
"path": "gulpfile.js",
"chars": 487,
"preview": "var gulp = require(\"gulp\");\nvar del = require('del');\nvar webpack = require(\"webpack\");\n\n\ngulp.task('clean', function(cb"
},
{
"path": "model/Apply.js",
"chars": 736,
"preview": "/**\n * *@info: Apply 数据实体\n * @author: coverGuo\n * @date: 2014-12-30\n */\n\n\nvar _ = require('underscore')._;\n\n/**\n * sta"
},
{
"path": "model/Approve.js",
"chars": 454,
"preview": "/**\n * *@info: Approve 数据实体\n * @author: coverGuo\n * @date: 2014-12-30\n */\n\nvar _ = require('underscore')._;\n\nvar Appro"
},
{
"path": "model/User.js",
"chars": 463,
"preview": "/**\n * *@info: User 数据实体\n * @author: coverGuo\n * @date: 2014-12-30\n */\n\n\nvar _ = require(\"underscore\");\n\n/**\n * role :"
},
{
"path": "model/UserApply.js",
"chars": 429,
"preview": "/**\n * *@info: userApply 数据实体\n * @author: coverGuo\n * @date: 2015-01-15\n */\n\nvar _ = require('underscore')._;\n\nvar Use"
},
{
"path": "oos/demo/demooos.js",
"chars": 3094,
"preview": "var oa = require('yourOaModuel');\nvar crypto = require('crypto');\nvar log4js = require('log4js'),\n logger = log4js.ge"
},
{
"path": "package.json",
"chars": 986,
"preview": "{\n \"name\": \"badjs-web\",\n \"version\": \"0.1.0\",\n \"description\": \"\",\n \"main\": \"app.js\",\n \"dependencies\": {\n \"body-pa"
},
{
"path": "project.debug.json",
"chars": 912,
"preview": "{\n \"host\" : \"http://badjs.server.com/\",\n \"port\": 8081,\n \"mysql\" : {\n \"url\" : \"mysql://root:root@localhos"
},
{
"path": "project.json",
"chars": 912,
"preview": "{\n \"host\" : \"http://badjs.server.com/\",\n \"port\": 8081,\n \"mysql\" : {\n \"url\" : \"mysql://root:root@localhos"
},
{
"path": "retCode.txt",
"chars": 72,
"preview": "\n\nret结果码记录:\n\n\n0 : 成功\n1001: 没有登录\n1002: 缺少参数 或参数错误\n1003: 权限不足\n1004: 查询为空\n"
},
{
"path": "service/ApplyService.js",
"chars": 4276,
"preview": "/**\n * Created by coverguo on 2015/01/08.\n */\n\nvar http = require('http');\n\nvar log4js = require('log4js'),\n logger ="
},
{
"path": "service/ApproveService.js",
"chars": 2704,
"preview": "/**\n * Created by coverguo on 2015/01/12.\n */\n\nvar http = require('http');\n\nvar log4js = require('log4js'),\n logger ="
},
{
"path": "service/BusinessService.js",
"chars": 2235,
"preview": "/**\n * Created by chriscai on 2014/12/17.\n */\n\n\nvar Apply = require('../model/Apply');\nvar _ = require('underscore');\n\nv"
},
{
"path": "service/EmailService.js",
"chars": 11287,
"preview": "/* global global, global, module, __dirname, Buffer */\n/**\n * Created by kaelyang on 2015/5/19.\n */\nvar fs = require(\"fs"
},
{
"path": "service/LogService.js",
"chars": 4350,
"preview": "/* global global */\n/**\n * Created by chriscai on 2014/12/16.\n */\n\nvar http = require('http');\n\nvar log4js = require('lo"
},
{
"path": "service/OfflineLogService.js",
"chars": 3016,
"preview": "/**\n * Created by chriscai on 2015/4/29.\n */\n\nvar fs = require(\"fs\");\nvar http = require(\"http\");\nvar path = require(\"pa"
},
{
"path": "service/RealtimeService.js",
"chars": 1174,
"preview": "/**\n * Created by chriscai on 2015/4/29.\n */\n\nvar ProcessorThread = require(\"../service/worker/ProcessorPool\");\n\n\nvar We"
},
{
"path": "service/StatisticsService.js",
"chars": 8140,
"preview": "/**\n * Created by chriscai on 2015/1/12.\n */\nvar http = require('http');\n\nvar log4js = require('log4js'),\n Apply = re"
},
{
"path": "service/UserApplyService.js",
"chars": 3202,
"preview": "/**\n * Created by coverguo on 2015/01/15.\n */\n\nvar http = require('http'),\n log4js = require('log4js'),\n logger = "
},
{
"path": "service/UserService.js",
"chars": 3203,
"preview": "/**\n /**\n * Created by coverguo on 2015/1/12.\n */\n\nvar http = require('http');\n\nvar Apply = require('../model/Apply');\n"
},
{
"path": "service/worker/Processor.js",
"chars": 3024,
"preview": "var mq = require(global.pjconfig.mq.module)\n , client = mq.socket('sub')\n , mqUrl = global.pjconfig.mq.url\n , "
},
{
"path": "service/worker/ProcessorPool.js",
"chars": 4367,
"preview": "\nvar Processor = require(\"./Processor\");\nvar _ = require(\"underscore\");\n\n\nvar log4js = require('log4js'),\n logger = l"
},
{
"path": "service/worker/Worker.js",
"chars": 4817,
"preview": "/* global process */\n\nvar mq = require(process.env.mqModule);\n\nvar log4js = require('log4js'),\n logger = log4js.getLo"
},
{
"path": "static/badjs/bj-report.js",
"chars": 9622,
"preview": "/*!\n * @module report\n * @author kael, chriscai\n * @date @DATE\n * Copyright (c) 2014 kael, chriscai\n * Licensed under th"
},
{
"path": "static/badjs/bj-wrap.js",
"chars": 7444,
"preview": "(function(global) {\n\n if (!global.BJ_REPORT) {\n console.error(\"please load bg-report first\");\n return;\n"
},
{
"path": "static/common/delegator.js",
"chars": 4146,
"preview": "/**\n * Map\n * @class\n */\nfunction Map() {\n this.map = {};\n this.length = 0;\n}\nMap.prototype = {\n constructor: M"
},
{
"path": "static/common/dialog/dialog.js",
"chars": 1091,
"preview": "var Delegator = require(\"delegator\");\nvar modal = require(\"./modal.ejs\");\n\n var container;\n\n function hide() {\n "
},
{
"path": "static/common/dialog/modal.ejs",
"chars": 727,
"preview": "<div class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\" id=\"<%=it.id || ''"
},
{
"path": "static/common.js",
"chars": 896186,
"preview": "/******/ (function(modules) { // webpackBootstrap\n/******/ \t// install a JSONP callback for chunk loading\n/******/ \tvar "
},
{
"path": "static/entry.apply.js",
"chars": 9016,
"preview": "webpackJsonp([1],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar apply = __webpack_require__(9)"
},
{
"path": "static/entry.applyList.js",
"chars": 19079,
"preview": "webpackJsonp([11],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar applyList = __webpack_require"
},
{
"path": "static/entry.authUserManage.js",
"chars": 3883,
"preview": "webpackJsonp([5],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar usermanger = __webpack_require"
},
{
"path": "static/entry.charts.js",
"chars": 238221,
"preview": "webpackJsonp([4],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar charts = __webpack_require__(1"
},
{
"path": "static/entry.home.js",
"chars": 484,
"preview": "webpackJsonp([0],[\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function"
},
{
"path": "static/entry.log.js",
"chars": 102580,
"preview": "webpackJsonp([10],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar log = __webpack_require__(12)"
},
{
"path": "static/entry.offlinelog.js",
"chars": 36454,
"preview": "webpackJsonp([9],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar log = __webpack_require__(15);"
},
{
"path": "static/entry.projectTotal.js",
"chars": 240015,
"preview": "webpackJsonp([7],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar projectTotal = __webpack_requi"
},
{
"path": "static/entry.realtime.js",
"chars": 28372,
"preview": "webpackJsonp([2],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar log = __webpack_require__(17);"
},
{
"path": "static/entry.statistics.js",
"chars": 83041,
"preview": "webpackJsonp([8],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar statistics = __webpack_require"
},
{
"path": "static/entry.userManage.js",
"chars": 13283,
"preview": "webpackJsonp([6],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar usermanger = __webpack_require"
},
{
"path": "static/img/tmp/tmp",
"chars": 0,
"preview": ""
},
{
"path": "static/js/beautify.js",
"chars": 85432,
"preview": "/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2013"
},
{
"path": "static/js/require.js",
"chars": 15614,
"preview": "var requirejs,require,define;\n(function(aa){function I(b){return\"[object Function]\"===P.call(b)}function J(b){return\"[ob"
},
{
"path": "static/lib/bootstrap/bootstrap-theme.css",
"chars": 21691,
"preview": "/*!\n * Bootstrap v3.3.0 (http://getbootstrap.com)\n * Copyright 2011-2014 Twitter, Inc.\n * Licensed under MIT (https://gi"
},
{
"path": "static/lib/bootstrap/bootstrap.css",
"chars": 137545,
"preview": "/*!\n * Bootstrap v3.3.0 (http://getbootstrap.com)\n * Copyright 2011-2014 Twitter, Inc.\n * Licensed under MIT (https://gi"
},
{
"path": "static/lib/bootstrap/bootstrap.js",
"chars": 65813,
"preview": "/*!\n * Bootstrap v3.3.0 (http://getbootstrap.com)\n * Copyright 2011-2014 Twitter, Inc.\n * Licensed under MIT (https://gi"
},
{
"path": "static/lib/charts/highcharts.js",
"chars": 152253,
"preview": "/*\n Highcharts JS v4.0.1 (2014-04-24)\n\n (c) 2009-2014 Torstein Honsi\n\n License: www.highcharts.com/license\n*/\n(function("
},
{
"path": "static/lib/charts/sand-signika.js",
"chars": 1451,
"preview": "/**\n * Sand-Signika theme for Highcharts JS\n * @author Torstein Honsi\n */\n\n\n\n// Add the background image to the containe"
},
{
"path": "static/lib/jquery/jquery.datetimepicker.js",
"chars": 70054,
"preview": "/**\n * @preserve jQuery DateTimePicker plugin v2.4.1\n * @homepage http://xdsoft.net/jqplugins/datetimepicker/\n * (c) 201"
},
{
"path": "static/lib/underscore/underscore.ext.js",
"chars": 884,
"preview": "\nif(!_){\n _={};\n}\n\n_.formatDate= function(date, formatString){\n /*\n * eg:formatString=\"YYYY-MM-DD hh:mm:ss\";\n "
},
{
"path": "static/module/apply/load.apply.js",
"chars": 50,
"preview": "var apply = require(\"./mod.apply\");\n\napply.init();"
},
{
"path": "static/module/apply/mod.apply.js",
"chars": 1720,
"preview": "/**\n * @info 申请新页面页面js\n * @author coverguo\n * */\n\nvar REG_REFERER = /^https?:\\/\\/[^\\/]+\\//i;\nvar REG_DOMAIN_STAR = /^\\*("
},
{
"path": "static/module/applyList/load.applyList.js",
"chars": 62,
"preview": "var applyList = require(\"./mod.applyList\");\n\napplyList.init();"
},
{
"path": "static/module/applyList/mod.applyList.js",
"chars": 5450,
"preview": "/**\n * @info 申请列表js\n * @author coverguo\n * */\n\n\nvar Dialog = require(\"dialog/dialog\");\nvar applyTable = require(\"./templ"
},
{
"path": "static/module/applyList/template/applyTable.ejs",
"chars": 4519,
"preview": "<%\n var len = it.item.length;\n\n var statue = \"\";\n\n%>\n<% if(len !=0){%>\n<thead>\n<tr>\n <!--<th><input class=\"tabl"
},
{
"path": "static/module/authUserManage/load.authUserManage.js",
"chars": 72,
"preview": "var usermanger = require(\"./mod.authUserManage.js\");\n\nusermanger.init();"
},
{
"path": "static/module/authUserManage/mod.authUserManage.js",
"chars": 1965,
"preview": "/**\n * @info 用户列表js\n * @author coverguo\n * */\n\nvar userTable = require(\"./template/userTable.ejs\");\n\n\n var encodeHtml"
},
{
"path": "static/module/authUserManage/template/userTable.ejs",
"chars": 873,
"preview": "<% for(var i =0, len = it.length;i<len; i++){\n var role =\"普通用户\";\n var operationType = 0;\n if(it[i].role == 1){\n"
},
{
"path": "static/module/charts/load.charts.js",
"chars": 53,
"preview": "var charts = require('./mod.charts');\n\ncharts.init();"
},
{
"path": "static/module/charts/mod.charts.js",
"chars": 4064,
"preview": "/* global _ */\n/**\n * @info 图表统计js\n * @author coverguo\n */\nrequire(\"jquery/jquery.datetimepicker\");\nrequire(\"charts/high"
},
{
"path": "static/module/common/app.css",
"chars": 20139,
"preview": "@charset 'UTF-8';\nbody,\nhtml\n{\n font-family: 'Hiragino Sans GB', 'Microsoft Yahei', arial, \\5b8b\\4f53, 'Helvetica Neu"
},
{
"path": "static/module/common/last.select.js",
"chars": 366,
"preview": "exports.init = function(){\n\tvar last_select = -1;\n\t\n\ttry {\n\n\t last_select = localStorage.last_select >> 0; // jshint "
},
{
"path": "static/module/home/load.home.js",
"chars": 269,
"preview": "var $nav = $('.toolar-ul');\n\n$nav.on(\"click\" , \"a\" , function (e){\n e.preventDefault();\n var href = $(this).attr(\""
},
{
"path": "static/module/locales/bootstrap-datetimepicker.ar.js",
"chars": 710,
"preview": "/**\n* Arabic translation for bootstrap-datetimepicker\n* Ala' Mohammad <amohammad@birzeit.ecu>\n*/\n;(function($){\n\t$.fn.da"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.bg.js",
"chars": 679,
"preview": "/**\n * Bulgarian translation for bootstrap-datetimepicker\n * Apostol Apostolov <apostol.s.apostolov@gmail.com>\n */\n;(fun"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.ca.js",
"chars": 676,
"preview": "/**\n * Catalan translation for bootstrap-datetimepicker\n * J. Garcia <jogaco.en@gmail.com>\n */\n;(function($){\n\t$.fn.date"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.cs.js",
"chars": 751,
"preview": "/**\n * Czech translation for bootstrap-datetimepicker\n * Matěj Koubík <matej@koubik.name>\n * Fixes by Michal Remiš <mich"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.da.js",
"chars": 681,
"preview": "/**\n * Danish translation for bootstrap-datetimepicker\n * Christian Pedersen <http://github.com/chripede>\n */\n;(function"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.de.js",
"chars": 712,
"preview": "/**\n * German translation for bootstrap-datetimepicker\n * Sam Zurcher <sam@orelias.ch>\n */\n;(function($){\n\t$.fn.datetime"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.ee.js",
"chars": 764,
"preview": "/**\n * Estonian translation for bootstrap-datetimepicker\n * Rene Korss <http://rene.korss.ee> \n */\n;(function($){\n\t$.fn."
},
{
"path": "static/module/locales/bootstrap-datetimepicker.el.js",
"chars": 686,
"preview": "/**\n* Greek translation for bootstrap-datetimepicker\n*/\n;(function($){\n $.fn.datetimepicker.dates['el'] = {\n\t days: "
},
{
"path": "static/module/locales/bootstrap-datetimepicker.es.js",
"chars": 681,
"preview": "/**\n * Spanish translation for bootstrap-datetimepicker\n * Bruno Bonamin <bruno.bonamin@gmail.com>\n */\n;(function($){\n\t$"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.fi.js",
"chars": 721,
"preview": "/**\n * Finnish translation for bootstrap-datetimepicker\n * Jaakko Salonen <https://github.com/jsalonen>\n */\n;(function($"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.fr.js",
"chars": 724,
"preview": "/**\n * French translation for bootstrap-datetimepicker\n * Nico Mollet <nico.mollet@gmail.com>\n */\n;(function($){\n\t$.fn.d"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.he.js",
"chars": 656,
"preview": "/**\n * Hebrew translation for bootstrap-datetimepicker\n * Sagie Maoz <sagie@maoz.info>\n */\n;(function($){\n $.fn.datetim"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.hr.js",
"chars": 624,
"preview": "/**\n * Croatian localisation\n */\n;(function($){\n\t$.fn.datetimepicker.dates['hr'] = {\n\t\tdays: [\"Nedjelja\", \"Ponedjelja\", "
},
{
"path": "static/module/locales/bootstrap-datetimepicker.hu.js",
"chars": 702,
"preview": "/**\n * Hungarian translation for bootstrap-datetimepicker\n * darevish <http://github.com/darevish>\n */\n;(function($){\n\t$"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.id.js",
"chars": 647,
"preview": "/**\n * Bahasa translation for bootstrap-datetimepicker\n * Azwar Akbar <azwar.akbar@gmail.com>\n */\n;(function($){\n\t$.fn.d"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.is.js",
"chars": 714,
"preview": "/**\n * Icelandic translation for bootstrap-datetimepicker\n * Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>\n */\n;(function"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.it.js",
"chars": 736,
"preview": "/**\n * Italian translation for bootstrap-datetimepicker\n * Enrico Rubboli <rubboli@gmail.com>\n */\n;(function($){\n\t$.fn.d"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.ja.js",
"chars": 563,
"preview": "/**\n * Japanese translation for bootstrap-datetimepicker\n * Norio Suzuki <https://github.com/suzuki/>\n */\n;(function($){"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.ko.js",
"chars": 625,
"preview": "/**\n * Korean translation for bootstrap-datetimepicker\n * Gu Youn <http://github.com/guyoun>\n * Baekjoon Choi <http://gi"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.lt.js",
"chars": 790,
"preview": "/**\n * Lithuanian translation for bootstrap-datetimepicker\n * Šarūnas Gliebus <ssharunas@yahoo.co.uk>\n */\n\n;(function($"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.lv.js",
"chars": 759,
"preview": "/**\n * Latvian translation for bootstrap-datetimepicker\n * Artis Avotins <artis@apit.lv>\n */\n\n;(function($){\n $.fn.da"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.ms.js",
"chars": 659,
"preview": "/**\n * Malay translation for bootstrap-datetimepicker\n * Ateman Faiz <noorulfaiz@gmail.com>\n */\n;(function($){\n\t$.fn.dat"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.nb.js",
"chars": 691,
"preview": "/**\n * Norwegian (bokmål) translation for bootstrap-datetimepicker\n * Fredrik Sundmyhr <http://github.com/fsundmyhr>\n */"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.nl.js",
"chars": 681,
"preview": "/**\n * Dutch translation for bootstrap-datetimepicker\n * Reinier Goltstein <mrgoltstein@gmail.com>\n */\n;(function($){\n\t$"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.no.js",
"chars": 669,
"preview": "/**\n * Norwegian translation for bootstrap-datetimepicker\n * Rune Warhuus <rune@dinkdonkd.no>\n */\n;(function($){\n\t$.fn.d"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.pl.js",
"chars": 730,
"preview": "/**\n * Polish translation for bootstrap-datetimepicker\n * Robert <rtpm@gazeta.pl>\n */\n;(function($){\n$.fn.datetimepicker"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.pt-BR.js",
"chars": 707,
"preview": "/**\n * Brazilian translation for bootstrap-datetimepicker\n * Cauan Cabral <cauan@radig.com.br>\n */\n;(function($){\n\t$.fn."
},
{
"path": "static/module/locales/bootstrap-datetimepicker.pt.js",
"chars": 741,
"preview": "/**\n * Portuguese translation for bootstrap-datetimepicker\n * Original code: Cauan Cabral <cauan@radig.com.br>\n * Tiago "
},
{
"path": "static/module/locales/bootstrap-datetimepicker.ro.js",
"chars": 705,
"preview": "/**\n * Romanian translation for bootstrap-datetimepicker\n * Cristian Vasile <cristi.mie@gmail.com>\n */\n;(function($){\n\t$"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.rs-latin.js",
"chars": 675,
"preview": "/**\n * Serbian latin translation for bootstrap-datetimepicker\n * Bojan Milosavlević <milboj@gmail.com>\n */\n;(function($)"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.rs.js",
"chars": 675,
"preview": "/**\n * Serbian cyrillic translation for bootstrap-datetimepicker\n * Bojan Milosavlević <milboj@gmail.com>\n */\n;(function"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.ru.js",
"chars": 687,
"preview": "/**\n * Russian translation for bootstrap-datetimepicker\n * Victor Taranenko <darwin@snowdale.com>\n */\n;(function($){\n\t$."
},
{
"path": "static/module/locales/bootstrap-datetimepicker.sk.js",
"chars": 715,
"preview": "/**\n * Slovak translation for bootstrap-datetimepicker\n * Marek Lichtner <marek@licht.sk>\n * Fixes by Michal Remiš <mich"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.sl.js",
"chars": 679,
"preview": "/**\n * Slovene translation for bootstrap-datetimepicker\n * Gregor Rudolf <gregor.rudolf@gmail.com>\n */\n;(function($){\n\t$"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.sv.js",
"chars": 676,
"preview": "/**\n * Swedish translation for bootstrap-datetimepicker\n * Patrik Ragnarsson <patrik@starkast.net>\n */\n;(function($){\n\t$"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.sw.js",
"chars": 811,
"preview": "/**\n * Swahili translation for bootstrap-datetimepicker\n * Edwin Mugendi <https://github.com/edwinmugendi>\n * Source: ht"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.th.js",
"chars": 676,
"preview": "/**\n * Thai translation for bootstrap-datetimepicker\n * Suchau Jiraprapot <seroz24@gmail.com>\n */\n;(function($){\n\t$.fn.d"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.tr.js",
"chars": 668,
"preview": "/**\n * Turkish translation for bootstrap-datetimepicker\n * Serkan Algur <kaisercrazy_2@hotmail.com>\n */\n;(function($){\n\t"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.ua.js",
"chars": 653,
"preview": "/**\n * Ukrainian translation for bootstrap-datepicker\n * Igor Polynets\n */\n;(function($){\n\t$.fn.datetimepicker.dates['ua"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.uk.js",
"chars": 706,
"preview": "/**\n * Ukrainian translation for bootstrap-datetimepicker\n * Andrey Vityuk <andrey [dot] vityuk [at] gmail.com>\n */\n;(fu"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.zh-CN.js",
"chars": 601,
"preview": "/**\n * Simplified Chinese translation for bootstrap-datetimepicker\n * Yuan Cheung <advanimal@gmail.com>\n */\n;(function($"
},
{
"path": "static/module/locales/bootstrap-datetimepicker.zh-TW.js",
"chars": 601,
"preview": "/**\n * Traditional Chinese translation for bootstrap-datetimepicker\n * Rung-Sheng Jang <daniel@i-trend.co.cc>\n */\n;(func"
},
{
"path": "static/module/log/load.log.js",
"chars": 190,
"preview": "var log = require(\"./mod.log\");\nlog.init();\n\nvar source_trigger = require(\"./source.trigger\");\nsource_trigger.init();\n\nv"
},
{
"path": "static/module/log/load.offlinelog.js",
"chars": 202,
"preview": "var log = require(\"./mod.offlinelog\");\nlog.init();\n\nvar source_trigger = require(\"./source.trigger\");\nsource_trigger.ini"
},
{
"path": "static/module/log/load.realtime.js",
"chars": 195,
"preview": "var log = require(\"./mod.realtime\");\nlog.init();\n\nvar source_trigger = require(\"./source.trigger\");\nsource_trigger.init("
},
{
"path": "static/module/log/logDetailDialog/logDetailDialog.js",
"chars": 1090,
"preview": "var Delegator = require(\"delegator\");\nvar dialogTpl = require(\"./tpl/dialog.ejs\");\n\n var container;\n\n function hid"
},
{
"path": "static/module/log/logDetailDialog/tpl/dialog.ejs",
"chars": 1422,
"preview": "\n\n<div class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\" id=\"logDetailMod"
},
{
"path": "static/module/log/mod.log.js",
"chars": 9930,
"preview": "/* global _ */\nvar dialog = require(\"dialog/dialog\");\nvar Delegator = require(\"delegator\");\n\nvar logTable = require(\"./t"
},
{
"path": "static/module/log/mod.offlinelog.js",
"chars": 11302,
"preview": "var dialog = require(\"dialog/dialog\");\nvar Delegator = require(\"delegator\");\n\nvar logTable = require(\"./template/logTabl"
},
{
"path": "static/module/log/mod.realtime.js",
"chars": 8152,
"preview": "var dialog = require(\"dialog/dialog\");\nvar Delegator = require(\"delegator\");\n\nvar logTable = require(\"./template/logTabl"
},
{
"path": "static/module/log/offlineDialog/offlineDialog.js",
"chars": 3187,
"preview": "var Delegator = require(\"delegator\");\nvar offline_monitor_row = require(\"./tpl/offline_monitor_row.ejs\");\nvar dialogTpl "
},
{
"path": "static/module/log/offlineDialog/tpl/dialog.ejs",
"chars": 1261,
"preview": "<div class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\" id=\"offlineConfigM"
},
{
"path": "static/module/log/offlineDialog/tpl/offline_monitor_row.ejs",
"chars": 155,
"preview": "<tr>\n <td style=\"width:70%\"><%=uin%></td>\n <td>监听中</td>\n <td><a uin=\"<%=uin%>\" data-event-click=\"deleteUin\" hre"
},
{
"path": "static/module/log/source.trigger.js",
"chars": 1040,
"preview": "exports.init = function() {\n\tvar not_show_source_page = false;\n\tvar hideform_class_name = 'main-table-hidefrom';\n\n\ttry {"
},
{
"path": "static/module/log/template/debar.ejs",
"chars": 146,
"preview": "<a class=\"keyword-tag\"><%=it.value%><span class=\"keyword-del\" data-event-click=\"removeDebar\" data-event-data=\"<%=opt.set"
},
{
"path": "static/module/log/template/keyword.ejs",
"chars": 148,
"preview": "<a class=\"keyword-tag\"><%=it.value%><span class=\"keyword-del\" data-event-click=\"removeKeyword\" data-event-data=\"<%=opt.s"
},
{
"path": "static/module/log/template/logTable.ejs",
"chars": 5166,
"preview": "<%\nvar urls;\nvar not_show_source_page = true;\ntry {\n not_show_source_page = !!localStorage.not_show_source_page;\n} ca"
},
{
"path": "static/module/projectTotal/load.projectTotal.js",
"chars": 74,
"preview": "var projectTotal = require('./mod.projectTotal.js');\n\nprojectTotal.init();"
},
{
"path": "static/module/projectTotal/mod.projectTotal.js",
"chars": 4278,
"preview": "/* global _ */\n/**\n * @info 图表统计js\n * @author coverguo\n *\n */\nrequire(\"jquery/jquery.datetimepicker\");\nrequire(\"charts/h"
},
{
"path": "static/module/projectTotal/template/statistics.ejs",
"chars": 791,
"preview": "<thead>\n <th style=\"width:200px;\">#</th>\n<%\n$.each(item[0].date , function (key, value){\n%>\n <th><%= value %></th>"
},
{
"path": "static/module/statistics/load.statistics.js",
"chars": 137,
"preview": "var statistics = require(\"./mod.statistics\");\nstatistics.init();\n\nvar last_select = require(\"../common/last.select\");\nla"
},
{
"path": "static/module/statistics/mod.statistics.js",
"chars": 1649,
"preview": "/**\n * @info 用户列表js\n * @author coverguo\n * */\n\n\nrequire(\"jquery/jquery.datetimepicker\");\nvar Dialog = require(\"dialog/di"
},
{
"path": "static/module/statistics/template/statistics.ejs",
"chars": 576,
"preview": "<%\n if (!it.data || !it.data[0] || !it.data[0].content || !it.data[0].content[0]) {\n%>\n <tr ><td colspan=\"3\" style"
},
{
"path": "static/module/userManage/load.userManage.js",
"chars": 65,
"preview": "var usermanger = require(\"./mod.userManage\");\n\nusermanger.init();"
},
{
"path": "static/module/userManage/mod.userManage.js",
"chars": 4447,
"preview": "/**\n * @info 用户列表js\n * @author coverguo\n * */\n\nvar Dialog = require(\"dialog/dialog\");\nvar userTable = require(\"./templat"
},
{
"path": "static/module/userManage/template/userTable.ejs",
"chars": 774,
"preview": "<% for(var i =0, len = it.length;i<len; i++){\n var role =\"参与者\";\n if(it[i].role == 1){\n role =\"项目管理员\";\n }"
},
{
"path": "test/test-busiess-services.js",
"chars": 743,
"preview": "var mysql = require('mysql'),\n BusinessService = require('../service/BusinessService'),\n orm = require('orm');\n\nGL"
},
{
"path": "test/test-crypto.js",
"chars": 101,
"preview": "var crypto = require('crypto');\n\nconsole.log(crypto.createHash(\"md5\").update(\"admin\").digest('hex'));"
},
{
"path": "test/test-db-connect.js",
"chars": 270,
"preview": "\nvar mysql = require('mysql');\n\nvar conn = mysql.createConnection({\n host : '127.0.0.1',\n user : 'root',\n "
},
{
"path": "test/test-email-add.js",
"chars": 509,
"preview": "var mysql = require('mysql'),\n orm = require('orm');\n\nvar mysql = \"mysql://root:root@localhost:3306/badjs\";\n//var mys"
},
{
"path": "test/test-fetch-statistics-to-today.js",
"chars": 1210,
"preview": "\nvar mysql = require('mysql'),\n StatisticsService = require('../service/StatisticsService'),\n orm = require('orm')"
},
{
"path": "test/test-fetch-statistics.js",
"chars": 917,
"preview": "\nvar mysql = require('mysql'),\n StatisticsService = require('../service/StatisticsService'),\n orm = require('orm')"
},
{
"path": "test/test-getProjects.js",
"chars": 354,
"preview": "var http = require('http');\n\n\n\nvar strParams=\"auth=badjsAccepter&projectsId=6_7_911_4_3_5\";\n\n\nhttp.get( \"http://10.143.1"
},
{
"path": "test/test-processor.js",
"chars": 892,
"preview": "\nvar EventEmitter = require(\"events\");\n\nvar eventEmitter = new EventEmitter;\n\nGLOBAL= {\n pjconfig : {\n zmq : {"
},
{
"path": "test/test-sendAll.js",
"chars": 605,
"preview": "GLOBAL.pjconfig = require('../project.json');\nvar EmailService = require(\"../service/EmailService\");\n\nvar orm = require("
},
{
"path": "test/test-sendEmail.js",
"chars": 692,
"preview": "GLOBAL.pjconfig = require('../project.json');\nvar EmailService = require('../service/EmailService');\n\nvar orm = require("
},
{
"path": "test/test-statistics-find-by-time.js",
"chars": 1946,
"preview": " var mysql = require('mysql'),\n StatisticsService = require('../service/StatisticsService'),\n orm = require('orm'"
},
{
"path": "test/test-zmq.js",
"chars": 452,
"preview": "/**\n * Created by chriscai on 2015/4/29.\n */\n\n\nvar pjconfig = require('../project.json');\n\nvar zmq = require('zmq')\n "
},
{
"path": "tmp/tmp",
"chars": 0,
"preview": ""
},
{
"path": "utils/auth.js",
"chars": 510,
"preview": "var config = require('../package');\nvar des = require('./des');\nvar appKey = config.appKey;\nvar sysId = config.sysId;\n\t\n"
},
{
"path": "utils/dateFormat.js",
"chars": 671,
"preview": "/* global module */\nmodule.exports = function(date, fmt) {\n var o = {\n \"M+\": date.getMonth() + 1, //月份\n "
},
{
"path": "utils/des.js",
"chars": 576,
"preview": "var crypto = require('crypto');\n\nexports.encrypt = function (data, key) {\n\tvar key = new Buffer(key, 'ascii').toString('"
},
{
"path": "utils/email.js",
"chars": 1214,
"preview": "/* global module */\nvar log4js = require('log4js');\nvar logger = log4js.getLogger();\nvar emailjs = require(\"emailjs\");\nv"
},
{
"path": "utils/email_tof.js",
"chars": 1182,
"preview": "/* global module */\nvar child_process = require('child_process');\nvar log4js = require('log4js');\nvar logger = log4js.ge"
},
{
"path": "utils/express-websocket.js",
"chars": 1717,
"preview": "var http = require('http');\nvar urlJoin = require('url-join');\nvar ServerResponse = http.ServerResponse;\nvar WebSocketSe"
},
{
"path": "views/account.html",
"chars": 183,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/header.html')(it, opt)%>\nHello, <%=it.user.usern"
},
{
"path": "views/apply.html",
"chars": 5025,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/header.html')(it, opt)%>\n<main id=\"content\" role"
},
{
"path": "views/applyList.html",
"chars": 1591,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/header.html')(it, opt)%>\n\n<main id=\"content\" rol"
},
{
"path": "views/approve.html",
"chars": 0,
"preview": ""
},
{
"path": "views/authUserManage.html",
"chars": 1848,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('/common/header.html')(it, opt)%>\n\n<main id=\"content\" role"
},
{
"path": "views/charts.html",
"chars": 1480,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n\n<%=include('./common/header.html')(it, opt)%>\n\n<main id=\"content\" ro"
},
{
"path": "views/common/commonLinks.html",
"chars": 942,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <meta http-e"
},
{
"path": "views/common/footer.html",
"chars": 43,
"preview": "<script src=\"/static/common.js\"></script>\n\n"
},
{
"path": "views/common/header.html",
"chars": 365,
"preview": "<header>\n <%=include('./logo.html')(it, opt)%>\n <div class=\"head-user\">\n <% if (it.user) { %>\n <span"
},
{
"path": "views/common/indexHeader.html",
"chars": 246,
"preview": "<header style=\"border-bottom:1px solid #B8B8B8;position:fixed;top:0\">\n <%=include('./logo.html')(it, opt)%>\n <div "
},
{
"path": "views/common/leftSide.html",
"chars": 1433,
"preview": "\n\n<div class=\"left-side\">\n <section>\n <label>日志</label>\n <ul>\n\n <li class=\"<%= it.index=='lo"
},
{
"path": "views/common/logo.html",
"chars": 137,
"preview": "<div class=\"head-logo\">\n <a href=\"index.html\">\n <img src=\"/static/img/logo2.png\" >\n </a>\n <span>前端js异常监控"
},
{
"path": "views/common/nav.html",
"chars": 2053,
"preview": "<nav id=\"navbar\">\n <ul class=\"nav\">\n <li class=\"item <%= it.index=='log' ? 'active' : ''%>\">\n <a hr"
},
{
"path": "views/help.html",
"chars": 4112,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/header.html')(it, opt)%>\n\n<main id=\"content\" rol"
},
{
"path": "views/index.html",
"chars": 3508,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/indexHeader.html')(it, opt)%>\n\n\n\n<div style=\"mar"
},
{
"path": "views/introduce.html",
"chars": 4466,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/header.html')(it, opt)%>\n\n<main id=\"content\" rol"
},
{
"path": "views/log.html",
"chars": 5813,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/header.html')(it, opt)%>\n\n<main id=\"content\" rol"
},
{
"path": "views/login.html",
"chars": 1168,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/indexHeader.html')(it, opt)%>\n\n<main class=\"inde"
},
{
"path": "views/modifyUser.html",
"chars": 2191,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/header.html')(it, opt)%>\n<main id=\"content\" role"
},
{
"path": "views/monitor.html",
"chars": 2231,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/header.html')(it, opt)%>\n\n<main id=\"content\" rol"
},
{
"path": "views/offlinelog.html",
"chars": 5730,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/header.html')(it, opt)%>\n\n<main id=\"content\" rol"
},
{
"path": "views/projectTotal.html",
"chars": 1552,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n\n<%=include('./common/header.html')(it, opt)%>\n\n<main id=\"content\" ro"
},
{
"path": "views/realtimelog.html",
"chars": 5614,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/header.html')(it, opt)%>\n\n<main id=\"content\" rol"
},
{
"path": "views/register.html",
"chars": 1554,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('./common/indexHeader.html')(it, opt)%>\n\n<main class=\"inde"
},
{
"path": "views/statistics.html",
"chars": 2079,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('/common/header.html')(it, opt)%>\n\n<main id=\"content\" role"
},
{
"path": "views/userManage.html",
"chars": 2928,
"preview": "<%=include('./common/commonLinks.html')(it, opt)%>\n<%=include('/common/header.html')(it, opt)%>\n\n<main id=\"content\" role"
},
{
"path": "webpack.config.js",
"chars": 1389,
"preview": "var webpack = require(\"webpack\");\nvar glob = require(\"glob\")\n\nvar path = require(\"path\");\n\n\nvar staticPath = path.join(_"
},
{
"path": "workflow/ExpressInitWorker.js",
"chars": 2031,
"preview": "var express = require('express')\n , tpl = require('express-micro-tpl')\n , crypto = require('crypto')\n , session"
},
{
"path": "workflow/InitWorker.js",
"chars": 542,
"preview": "var log4js = require('log4js'),\n logger = log4js.getLogger();\n\nvar path = require(\"path\");\n\n\n\nvar argv = process.arg"
},
{
"path": "workflow/ServiceInitWorker.js",
"chars": 967,
"preview": "var log4js = require('log4js'),\n logger = log4js.getLogger();\n\n\n\n\n\n\nmodule.exports = function (){\n setTimeout(func"
},
{
"path": "workflow.config.json",
"chars": 115,
"preview": "{\n \"path\" : \"./workflow\",\n \"workflow\": [\n \"InitWorker\",\n \"ExpressInitWorker\",\n \"ServiceInitWorker\"\n ]\n}"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the BetterJS/badjs-web GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 200 files (2.4 MB), approximately 649.9k tokens, and a symbol index with 744 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.