global.js 1.2 KB

12345678910111213141516171819202122232425
  1. var AutoPlayer = false; //开启自动漫游
  2. var SERVER_URL = "http://127.0.0.1:8080/api"
  3. var PLAYER3D_URL = "ws://192.168.66.133:8082"; //
  4. var DEV_ALAR_COLOR = "ff6c00"; //全局设备告警颜色
  5. var DEV_HINT_COLOR = "d69d85"; //设备盘头剩余20-50之间的提示颜色
  6. var DEV_OFFLINE_COLOR = "666666"; //设备未接入的颜色
  7. var ONLIME_TIMEOUT = 1000 * 60 * 5; //在线设备定时任务时间
  8. var INDEX_TIMEOUT = 5 * 60 * 1000; //首页统计数据定时任务时间
  9. var ALARM_TIMEOUT = 30 * 1000; //告警数据定时任务时间
  10. Date.prototype.Format = function(fmt) { //author: meizz
  11. var o = {
  12. "M+": this.getMonth() + 1, //月份
  13. "d+": this.getDate(), //日
  14. "h+": this.getHours(), //小时
  15. "m+": this.getMinutes(), //分
  16. "s+": this.getSeconds(), //秒
  17. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  18. "S": this.getMilliseconds() //毫秒
  19. };
  20. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  21. for (var k in o)
  22. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  23. return fmt;
  24. }