eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [37/44] incubator-eagle git commit: update pom using npm to install web deps
Date Mon, 30 Nov 2015 02:51:11 GMT
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2c3005c9/eagle-webservice/src/main/webapp/app/public/assets/bootstrap-components/js/bootstrap-components.min.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/assets/bootstrap-components/js/bootstrap-components.min.js b/eagle-webservice/src/main/webapp/app/public/assets/bootstrap-components/js/bootstrap-components.min.js
new file mode 100644
index 0000000..5a83489
--- /dev/null
+++ b/eagle-webservice/src/main/webapp/app/public/assets/bootstrap-components/js/bootstrap-components.min.js
@@ -0,0 +1,8 @@
+$.extend({_bc:new Object()});$._bc.vals=new Object();$._bc.vars=function(options,callback){var vars=new Object();if(typeof(options)=="object"){vars.options=options}else{if(typeof(options)=="function"){vars.callback=options}else{if(typeof(options)=="string"){vars.key=options}}}if(typeof(callback)=="function"){vars.callback=callback}return vars};$._bc.get=function(options,key,defaultValue){if(options!=null){if(options[key]!=null){return options[key]}else{return defaultValue}}else{return defaultValue}};$._bc.list=function(){var list=new Array();list.add=function(obj){list.push(obj)};list.remove=function(obj){var loc=null;for(var i=0;i<list.length;i++){var _o=list[i];if(obj==_o){loc=i;break}}if(loc!=null){list.splice(loc,1)}};return list};var userAgent=navigator.userAgent.toLowerCase();$._bc.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozil
 la:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};!function($){var _on=false;$.extend({autotooltip:function(option){if(option===true&&_on==false){$(document).on("mouseover.bs.autotooltip","[data-toggle='tooltip']",tooltipHandler);_on=true}else{if(option===false&&_on==true){$(document).off("mouseover.bs.autotooltip");_on=false}}}});function tooltipHandler(){var _my=$(this);if(_my.attr("data-original-title")==null){_my.tooltip("show")}}}(window.jQuery);!function($){$.fn.extend({checkbox:function(options){var _my=$(this);var vars=$._bc.vars(options);var _options=vars.options;var _checked=$._bc.get(_options,"checked",null);var _to=$._bc.get(_options,"to",null);var _target=_to!=null?$(_to):$(_my.attr("data-to"));if(_to!=null){_my.attr("data-to",_to)}if(_checked!=null){updateStatus(_my,_checked);updateTarget(_target,_checked)}}});function updateStatus(_instance,_checked){if(_checked){_instance.attr("checked","checked")}else{_instance.removeAttr("checked","checked")}}fu
 nction updateTarget(_target,_checked){if(_target!=null){if(_target.is("[type='checkbox']")||_target.is("[type='radio']")){_target.prop("checked",_checked)}else{_target.val(_checked)}}}$(document).on("click.bs.checkbox.label","label",function(event){var _label=$(this);var _my=_label.find(".checkbox[data-toggle='checkbox']");var _checked=null;if(_my.length!=0){var _disabled=_my.attr("disabled")!=null;var _target=$(_my.attr("data-to"));var _checkbox=_label.find("input[type='checkbox']");if(_disabled){if(_checkbox.length!=0){_checked=_my.attr("checked")!=null;_checkbox.prop("checked",_checked)}}else{if(_checkbox.length!=0){_checked=_checkbox.prop("checked")}else{_checked=!(_my.attr("checked")!=null);updateTarget(_target,_checked)}}updateStatus(_my,_checked);_my.add(_target).change()}});$(document).on("click.bs.checkbox",".checkbox[data-toggle='checkbox']",function(event){var _my=$(this);var _target=$(_my.attr("data-to"));var _checked=null;if(_my.closest("label").length==0){_checked=!(_m
 y.attr("checked")!=null);updateStatus(_my,_checked);updateTarget(_target,_checked);_my.add(_target).change()}});function elementValue(ele,val){var _my=$(ele);if(_my.is("input[type='checkbox']")){if(val!=null){_my.prop("checked",val)}return _my.prop("checked")}else{if(val!=null){_my.checkbox({checked:val})}return _my.attr("checked")=="checked"}}$(document).on("change.bs.checkbox_selectAll","[data-checkbox-all]",function(event){var _name=$(this).attr("data-checkbox-all");var _value=elementValue(this);$("[data-checkbox-entity='"+_name+"']").each(function(){elementValue(this,_value)})});$(document).on("change.bs.checkbox_selectAll","[data-checkbox-entity]",function(event){var _name=$(this).attr("data-checkbox-entity");var _checked=true;$("[data-checkbox-entity='"+_name+"']").each(function(){if(!elementValue(this)){_checked=false;return false}});$("[data-checkbox-all='"+_name+"']").each(function(){elementValue(this,_checked)})})}(window.jQuery);$._bc.vals.datepicker=new Object();$._bc.va
 ls.datepicker.index=1;!function($){$.extend({datepicker:{toDate:function(str,format){var date=new Date();try{var lst=["d","M","y","H","m","s"];var dc={};$.each(lst,function(i,c){var _fmt=format.replace(new RegExp(c+"+"),"[TARGET]");$.each(lst,function(i,c){_fmt=_fmt.replace(new RegExp(c+"+"),"\\d+")});_fmt=_fmt.replace("[TARGET]","(\\d+)");var reg=new RegExp(_fmt);dc[c]=Number(str.match(reg)[1])});function val(val,def){if(val===undefined||val===null||isNaN(val)){return def}return val}date.setFullYear(val(dc["y"],1990),(val(dc["M"],1))-1,val(dc["d"],1));date.setHours(val(dc["H"],0),val(dc["m"],0),val(dc["s"],0))}catch(err){return new Date()}if(date==null||isNaN(date)){return new Date()}return date},dateToStrng:function(date,_format){var lst=["d","M","y","H","m","s"];var _val=_format.replace(/y+/,date.getFullYear()).replace(/M+/,fillZero(date.getMonth()+1)).replace(/d+/,fillZero(date.getDate())).replace(/H+/,fillZero(date.getHours())).replace(/m+/,fillZero(date.getMinutes())).replace(
 /s+/,fillZero(date.getSeconds()));
+return _val},monthName:["January","February","March","April","May","June","July","August","September","October","November","December"],yearMonthTitle:"${month}-${year}",},});var _instance=null;var _preventEvent=false;function refreshInstance(instance){if(_instance!=null){var _type=_instance.getType();var _date=_instance.getDate();var _target=_instance.getTarget();var _format=_instance.getFormat();var _preVal=_target.val();var _val=null;_val=$.datepicker.dateToStrng(_date,_format);_target.val(_val);_instance.remove();_instance=null;if(_val!=_preVal){_target.change()}}_instance=instance}function getDaysOfMonth(date){var _startDay,_days;var _date=new Date(date.getTime());_date.setMonth(_date.getMonth()+1,0);_days=_date.getDate();_date.setDate(1);_startDay=_date.getDay();return[_startDay,_days]}function fillZero(str,len){if(len==null){len=2}var ret=str+"";while(ret.length<len){ret="0"+ret}return ret}function toString(date){return date.getFullYear()+"-"+fillZero(date.getMonth()+1)+"-"+fi
 llZero(date.getDate())+" "+fillZero(date.getHours())+":"+fillZero(date.getMinutes())+":"+fillZero(date.getSeconds())}function plusDays(date,year,month,day){if(month==null){month=0}if(day==null){day=0}var _ret=new Date(date.getTime());var _year=_ret.getFullYear();var _month=_ret.getMonth()+month+year*12;var _date=_ret.getDate();_ret.setMonth(_month,1);var _days=getDaysOfMonth(_ret)[1];if(_date<=_days){_ret.setDate(_date)}else{_ret.setDate(_days)}_date=_ret.getDate()+day;_ret.setDate(_date);return _ret}function setDays(date,year,month,day){if(year==null){year=date.getFullYear()}if(month==null){month=date.getMonth()}if(day==null){day=date.getDate()}var _ret=new Date(date.getTime());_ret.setFullYear(year,month,day);_ret.setFullYear(year,month);_ret.setFullYear(year);return _ret}function digitization(str,mix,max){var _str=str+"";var _val=Number(_str);if(isNaN(_val)||_val==null){_val=0}if(_val<mix){_val=mix}if(_val>max){_val=max}return _val}function getDateInRange(current,target,before,af
 ter){if(before!=null&&target>before){return new Date(before.getTime())}if(after!=null&&target<after){return new Date(after.getTime())}return target}$(document).on("click.bs.datepicker","[data-toggle='datepicker']",function(event){_preventEvent=true;var my=$(this);if($(_instance).data("trigger")===this){return}var _autoclose=my.attr("data-autoclose")==="true";var _target=$(my.attr("data-to"));var target=_target.length!=0?_target:my;var _format=my.attr("data-format");var _container=$(my.attr("data-container"));var container=target.parent();if(container.hasClass("input-group-btn")){container=container.parent()}if(container.hasClass("input-group")){container=container.parent()}container=_container.length!=0?_container:container;var _type=my.attr("data-type");var enable_yearpicker=false;var enable_monthpicker=false;var enable_datepicker=false;var enable_timepicker=false;switch(_type){case"year":enable_yearpicker=true;_format=_format||"yyyy";break;case"month":enable_monthpicker=true;_form
 at=_format||"yyyy-MM";break;case"date":enable_datepicker=true;_format=_format||"yyyy-MM-dd";break;case"time":enable_timepicker=true;_format=_format||"HH:mm:ss";break;default:_type="all";enable_datepicker=true;enable_timepicker=true;_format=_format||"yyyy-MM-dd HH:mm:ss"}var _date=target.val();var date=$.datepicker.toDate(_date,_format);var dateShadow=new Date(date.getTime());var dateCurrent=new Date(date.getTime());var _before=my.attr("data-before");var before=_before==null?null:$.datepicker.toDate(_before,_format);var _after=my.attr("data-after");var after=_after==null?null:$.datepicker.toDate(_after,_format);var $container=$('<div class="bsc-datepicker">');$container.data("trigger",this);var $yearpicker=$('<div class="yearpicker picker-group">');var $yearpicker_header=$('<div class="picker-header">');var $yearpicker_header_year_minus=$('<button class="btn btn-default minus" type="button">');$yearpicker_header_year_minus.html('<span class="glyphicon glyphicon-chevron-left"></span>'
 );var $yearpicker_header_title=$("<h4>&nbsp;</h4>");var $yearpicker_header_year_plus=$('<button class="btn btn-default plus" type="button">');$yearpicker_header_year_plus.html('<span class="glyphicon glyphicon-chevron-right"></span>');var $yearpicker_body=$('<div class="picker-body picker-selectable clearfix">');var $monthpicker=$('<div class="monthpicker picker-group">');var $monthpicker_header=$('<div class="picker-header">');var $monthpicker_header_year_minus=$('<button class="btn btn-default minus" type="button">');$monthpicker_header_year_minus.html('<span class="glyphicon glyphicon-chevron-left"></span>');var $monthpicker_header_title=$("<h4>&nbsp;</h4>");var $monthpicker_header_year_plus=$('<button class="btn btn-default plus" type="button">');$monthpicker_header_year_plus.html('<span class="glyphicon glyphicon-chevron-right"></span>');var $monthpicker_body=$('<div class="picker-body picker-selectable clearfix">');var $datepicker=$('<div class="datepicker picker-group">');var
  $datepicker_header=$('<div class="picker-header">');
+var $datepicker_header_month_minus=$('<button class="btn btn-default minus" type="button">');$datepicker_header_month_minus.html('<span class="glyphicon glyphicon-step-backward"></span>');var $datepicker_header_title=$("<h4>&nbsp;</h4>");var $datepicker_header_month_plus=$('<button class="btn btn-default plus" type="button">');$datepicker_header_month_plus.html('<span class="glyphicon glyphicon-step-forward"></span>');var $datepicker_body=$('<div class="picker-body">');var $datepicker_body_description=$('<div class="datepicker-body-description clearfix">');var $datepicker_body_date=$('<div class="datepicker-body-value picker-selectable clearfix">');var $timepicker=$('<div class="timepicker picker-group clearfix">');var $timepicker_group_hours=$('<div class="timepicker-group">');var $timepicker_group_hours_input=$('<input class="form-control" type="text" />');var $timepicker_group_hours_minus=$('<button type="button" class="btn btn-default time-minus">');$timepicker_group_hours_minus
 .html('<span class="glyphicon glyphicon-minus"></span>');var $timepicker_group_hours_plus=$('<button type="button" class="btn btn-default time-plus">');$timepicker_group_hours_plus.html('<span class="glyphicon glyphicon-plus"></span>');var $timepicker_group_minutes=$('<div class="timepicker-group">');var $timepicker_group_minutes_input=$('<input class="form-control" type="text" />');var $timepicker_group_minutes_minus=$('<button type="button" class="btn btn-default time-minus">');$timepicker_group_minutes_minus.html('<span class="glyphicon glyphicon-minus"></span>');var $timepicker_group_minutes_plus=$('<button type="button" class="btn btn-default time-plus">');$timepicker_group_minutes_plus.html('<span class="glyphicon glyphicon-plus"></span>');var $timepicker_group_seconds=$('<div class="timepicker-group">');var $timepicker_group_seconds_input=$('<input class="form-control" type="text" />');var $timepicker_group_seconds_minus=$('<button type="button" class="btn btn-default time-mi
 nus">');$timepicker_group_seconds_minus.html('<span class="glyphicon glyphicon-minus"></span>');var $timepicker_group_seconds_plus=$('<button type="button" class="btn btn-default time-plus">');$timepicker_group_seconds_plus.html('<span class="glyphicon glyphicon-plus"></span>');$container.appendTo(container);$container.append($yearpicker);$yearpicker.append($yearpicker_header);$yearpicker_header.append($yearpicker_header_year_minus);$yearpicker_header.append($yearpicker_header_title);$yearpicker_header.append($yearpicker_header_year_plus);$yearpicker.append($yearpicker_body);$container.append($monthpicker);$monthpicker.append($monthpicker_header);$monthpicker_header.append($monthpicker_header_year_minus);$monthpicker_header.append($monthpicker_header_title);$monthpicker_header.append($monthpicker_header_year_plus);$monthpicker.append($monthpicker_body);$.each(["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],function(i,_month){var $element=$("<span>");$ele
 ment.attr("data-month",i);$element.text(_month);$monthpicker_body.append($element)});$container.append($datepicker);$datepicker.append($datepicker_header);$datepicker_header.append($datepicker_header_month_minus);$datepicker_header.append($datepicker_header_title);$datepicker_header.append($datepicker_header_month_plus);$datepicker.append($datepicker_body);$datepicker_body.append($datepicker_body_description);$.each(["Sun","Mon","Tue","Wed","Thur","Fri","Sat"],function(i,_description){var $element=$('<span class="disabled">');$element.text(_description);$datepicker_body_description.append($element)});$datepicker_body.append($datepicker_body_date);$container.append($timepicker);$timepicker.append($timepicker_group_hours);$timepicker_group_hours.append($timepicker_group_hours_input);$timepicker_group_hours.append($timepicker_group_hours_minus);$timepicker_group_hours.append($timepicker_group_hours_plus);$timepicker.append('<span class="timepicker-spliter">:</span>');$timepicker.append
 ($timepicker_group_minutes);$timepicker_group_minutes.append($timepicker_group_minutes_input);$timepicker_group_minutes.append($timepicker_group_minutes_minus);$timepicker_group_minutes.append($timepicker_group_minutes_plus);$timepicker.append('<span class="timepicker-spliter">:</span>');$timepicker.append($timepicker_group_seconds);$timepicker_group_seconds.append($timepicker_group_seconds_input);$timepicker_group_seconds.append($timepicker_group_seconds_minus);$timepicker_group_seconds.append($timepicker_group_seconds_plus);refreshInstance($container);var pos=target.offset();$container.offset({left:pos.left,top:pos.top+target.outerHeight(),}).click(function(){_preventEvent=true});$container.getFormat=function(){return _format};$container.getTarget=function(){return target};$container.getType=function(){return _type};$container.getDate=function(){return dateCurrent};function refreshCurrentDate(){dateCurrent=getDateInRange(dateCurrent,dateShadow,before,after)}$datepicker_header_titl
 e.click(function(){$datepicker.slideUp();
+$monthpicker.slideDown()});$monthpicker_header_title.click(function(){$monthpicker.slideUp();$yearpicker.slideDown()});$yearpicker_header_year_minus.click(function(){dateShadow=plusDays(dateShadow,-20);refreshCurrentDate();draw()});$yearpicker_header_year_plus.click(function(){dateShadow=plusDays(dateShadow,20);refreshCurrentDate();draw()});$yearpicker_body.on("click","span:not(.disabled)",function(){var year=Number($(this).text());dateShadow=setDays(dateShadow,year);refreshCurrentDate();draw();if(_type==="year"&&_autoclose){refreshInstance(null)}if(!enable_yearpicker){$yearpicker.slideUp();$monthpicker.slideDown()}});$monthpicker_header_year_minus.click(function(){dateShadow=plusDays(dateShadow,-1);refreshCurrentDate();draw()});$monthpicker_header_year_plus.click(function(){dateShadow=plusDays(dateShadow,1);refreshCurrentDate();draw()});$monthpicker_body.on("click","span:not(.disabled)",function(){var _month=Number($(this).attr("data-month"));dateShadow=setDays(dateShadow,null,_mon
 th);refreshCurrentDate();draw();if(_type==="month"&&_autoclose){refreshInstance(null)}if(!enable_monthpicker){$monthpicker.slideUp();$datepicker.slideDown()}});$datepicker_header_month_minus.click(function(){dateShadow=plusDays(dateShadow,0,-1);refreshCurrentDate();draw()});$datepicker_header_month_plus.click(function(){dateShadow=plusDays(dateShadow,0,1);refreshCurrentDate();draw()});$datepicker_body.on("click","span:not(.inactive):not(.disabled)",function(){var _date=Number($(this).text());dateShadow=setDays(dateShadow,null,null,_date);refreshCurrentDate();draw();if(_type==="date"&&_autoclose){refreshInstance(null)}});$timepicker_group_hours_minus.click(function(){dateShadow.setHours(dateShadow.getHours()-1);refreshCurrentDate();draw()});$timepicker_group_hours_plus.click(function(){dateShadow.setHours(dateShadow.getHours()+1);refreshCurrentDate();draw()});$timepicker_group_hours_input.change(function(){var _val=digitization($(this).val(),0,23);dateShadow.setHours(_val);refreshCur
 rentDate();draw()});$timepicker_group_minutes_minus.click(function(){dateShadow.setMinutes(dateShadow.getMinutes()-1);refreshCurrentDate();draw()});$timepicker_group_minutes_plus.click(function(){dateShadow.setMinutes(dateShadow.getMinutes()+1);refreshCurrentDate();draw()});$timepicker_group_minutes_input.change(function(){var _val=digitization($(this).val(),0,59);dateShadow.setMinutes(_val);refreshCurrentDate();draw()});$timepicker_group_seconds_minus.click(function(){dateShadow.setSeconds(dateShadow.getSeconds()-1);refreshCurrentDate();draw()});$timepicker_group_seconds_plus.click(function(){dateShadow.setSeconds(dateShadow.getSeconds()+1);refreshCurrentDate();draw()});$timepicker_group_seconds_input.change(function(){var _val=digitization($(this).val(),0,59);dateShadow.setSeconds(_val);refreshCurrentDate();draw()});if(!enable_yearpicker){$yearpicker.hide()}if(!enable_monthpicker){$monthpicker.hide()}if(!enable_datepicker){$datepicker.hide()}if(!enable_timepicker){$timepicker.hide
 ()}function draw(){var _year=dateShadow.getFullYear();var year_start=_year-_year%20;var year_end=year_start+19;var _month=dateShadow.getMonth();var month=_month+1;var _date=dateShadow.getDate();var days=getDaysOfMonth(dateShadow);var _hours=dateShadow.getHours();var _minutes=dateShadow.getMinutes();var _seconds=dateShadow.getSeconds();$yearpicker_header_title.text(year_start+" - "+year_end);$yearpicker_body.empty();for(var i=year_start;i<=year_end;i+=1){var $element=$("<span>");$element.text(i);if(i==_year){$element.addClass("active")}if((before!=null&&before.getFullYear()<i)||(after!=null&&after.getFullYear()>i)){$element.addClass("disabled")}$yearpicker_body.append($element)}$monthpicker_header_title.text(_year);$monthpicker_body.find("span").each(function(i,ele){var $element=$(ele);$element.removeClass("active");$element.removeClass("disabled");if(i==_month){$element.addClass("active")}if((before!=null&&before.getFullYear()*100+before.getMonth()<_year*100+i)||(after!=null&&after.
 getFullYear()*100+after.getMonth()>_year*100+i)){$element.addClass("disabled")}});$datepicker_header_title.text($.datepicker.yearMonthTitle.replace(/\$\{month\}/g,$.datepicker.monthName[month-1]).replace(/\$\{year\}/g,_year));$datepicker_body_date.empty();for(var i=0;i<days[0];i+=1){var $element=$('<span class="inactive">');$datepicker_body_date.append($element)}for(var i=1;i<=days[1];i+=1){var $element=$("<span>");$element.text(fillZero(i));if(i==_date){$element.addClass("active")}if((before!=null&&before.getFullYear()*10000+before.getMonth()*100+before.getDate()<_year*10000+_month*100+i)||(after!=null&&after.getFullYear()*10000+after.getMonth()*100+after.getDate()>_year*10000+_month*100+i)){$element.addClass("disabled")}$datepicker_body_date.append($element)}$timepicker_group_hours_input.val(fillZero(_hours));$timepicker_group_minutes_input.val(fillZero(_minutes));$timepicker_group_seconds_input.val(fillZero(_seconds))}draw();function viewToDate(){var _year=$yearpicker_body.find("
 span.active")}});
+$(document).on("click.bs.datepicker",function(event){if(_preventEvent==true){_preventEvent=false}else{refreshInstance(null)}})}(window.jQuery);$._bc.vals.dialog=new Object();$._bc.vals.dialog.z_index=1051;$.extend({dialog:function(options,callback){var vars=$._bc.vars(options,callback);var _options=vars.options;var _callback=vars.callback;var _title=$._bc.get(_options,"title","");var _content=$._bc.get(_options,"content","");var _close=$._bc.get(_options,"close",true);var _confirm=$._bc.get(_options,"confirm",false);var _buttons=$._bc.get(_options,"buttons",null);var _fade=$._bc.get(_options,"fade",true);var _size=$._bc.get(_options,"size","");var _ret=null;var $modal=$('<div class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">');var $modal_dialog=$('<div class="modal-dialog">');var $modal_content=$('<div class="modal-content">');var $modal_header=$('<div class="modal-header">');var $modal_header_close=$('<button type="b
 utton" class="close" data-dismiss="modal" aria-hidden="true">x</button>');var $modal_header_head=$('<h4 class="modal-title" id="myModalLabel">');var $modal_body=$('<div class="modal-body">');var $modal_footer=$('<div class="modal-footer">');$modal.appendTo("body");$modal.append($modal_dialog);$modal_dialog.append($modal_content);$modal_content.append($modal_header);if(_close){$modal_header.append($modal_header_close)}$modal_header.append($modal_header_head);$modal_content.append($modal_body);$modal_content.append($modal_footer);$modal_header_head.html(_title);$modal_body.html(_content);if(_fade){$modal.addClass("fade")}switch(_size){case"small":$modal_dialog.addClass("modal-sm");break;case"large":$modal_dialog.addClass("modal-lg");break}if(_buttons!=null){var _len=_buttons.length;for(var i=0;i<_len;i+=1){var _btn=_buttons[i];var _name=_btn.name;var _class=$._bc.get(_btn,"class","btn-default");var _left=_btn.left===true;var _value=$._bc.get(_btn,"value",_name);var $btn=$('<button typ
 e="button" class="btn">');$btn.text(_name);$btn.addClass(_class);if(_left){$btn.addClass("pull-left")}$btn.data("value",_value);$modal_footer.append($btn);$btn.add($btn_confirm).click(function(){_ret=$(this).data("value");$modal.modal("hide")})}}else{if(_confirm){var $btn_cancel=$('<button type="button" class="btn btn-default">Cancel</button>').data("value",false);var $btn_confirm=$('<button type="button" class="btn btn-primary">Confirm</button>').data("value",true);$modal_footer.append($btn_cancel);$modal_footer.append($btn_confirm);$btn_cancel.add($btn_confirm).click(function(){_ret=$(this).data("value");$modal.modal("hide")})}else{var $btn_close=$('<button type="button" class="btn btn-default">Close</button>').data("value",true);$modal_footer.append($btn_close);$btn_close.click(function(){_ret=$(this).data("value");$modal.modal("hide")})}}$modal.modal(_options);var $back=$("body div.modal-backdrop:last");$back.css("z-index",$._bc.vals.dialog.z_index);$modal.css("z-index",$._bc.va
 ls.dialog.z_index+1);$._bc.vals.dialog.z_index+=2;$back.one("bsTransitionEnd",function(){if($(".modal.in").length>1){$modal.css("padding-right",$("body").css("padding-right"))}});$modal.on("hide.bs.modal",function(){if(_callback!=null){return _callback.call($modal,_ret)}});$modal.on("hidden.bs.modal",function(){$(this).remove();$._bc.vals.dialog.z_index-=2;if($(".modal-backdrop").length){$("body").addClass("modal-open")}});return $modal}});!function($){var _input=null;var _target=null;var _preContent=null;var preventPopup=false;function updateElement(){if(_input!=null&&_target!=null){var _html=_target.attr("data-editable")=="html";var content=_input.val();if(_html){_target.html(content)}else{_target.text(content)}if(_preContent!=content){_target.change()}}if(_target!=null){_target.show()}_target=null;if(_input!=null){_input.remove()}_input=null}$(document).on("click.bs.editable","[data-editable]",function(){var _my=$(this);var _html=_my.attr("data-editable")=="html";var $input=_my.i
 s("pre")?$("<textarea>"):$("<input type='text'>");updateElement();var content=_html?_my.html():_my.text();$input.val(content);_my.after($input);$input.addClass("form-control").css("margin",_my.css("margin")).css("padding",_my.css("padding")).css("font-size",_my.css("font-size")).css("font-family",_my.css("font-family")).css("line-height",_my.css("line-height")).css("display",_my.css("display")).css("min-width",_my.css("width")).css("height","auto").css("width","auto").select().focus();$input.click(function(){preventPopup=true}).keydown(function(event){if(event.which==13){updateElement()}});_my.hide();preventPopup=true;_input=$input;_target=_my;_preContent=content});$(document).on("click.bs.removeEditable",function(){if(preventPopup==true){preventPopup=false;return}updateElement()})}(window.jQuery);$._bc.vals.notify=new Object();$._bc.vals.notify.region=new Object();$.extend({notify:function(options,callback){var vars=$._bc.vars(options,callback);var _options=vars.options;var _callba
 ck=vars.callback;
+var _title=$._bc.get(_options,"title","Notification");var _content=$._bc.get(_options,"content","");var _position=$._bc.get(_options,"position","right,top");var _type=$._bc.get(_options,"type","normal");var _timeout=$._bc.get(_options,"timeout",4000);var _overtimeout=$._bc.get(_options,"overtimeout",1000);var _queuetimeout=$._bc.get(_options,"queuetimeout",1000);var _region=$._bc.get(_options,"region","");var _list=null;var _tt=null;var $notification=$("<div class='alert notification-body'>");var $btn=$("<button type='button' class='close'>x</button>");if(_region!=""){$notification.attr("data-region",_region);_list=$._bc.vals.notify.region[_region];if(_list==null){_list=$._bc.list();$._bc.vals.notify.region[_region]=_list}_list.add($notification)}if(_position.indexOf("left")!=-1){$notification.addClass("left")}if(_position.indexOf("right")!=-1){$notification.addClass("right")}if(_position.indexOf("top")!=-1){$notification.addClass("top")}if(_position.indexOf("bottom")!=-1){$notifica
 tion.addClass("bottom")}if(_type=="normal"){$notification.addClass("alert-normal")}if(_type=="warning"){$notification.addClass("alert-warning")}if(_type=="danger"){$notification.addClass("alert-danger")}if(_type=="success"){$notification.addClass("alert-success")}if(_type=="info"){$notification.addClass("alert-info")}$notification.append($btn);if(_title==""){_title="&nbsp;"}if(typeof(_title)=="string"){_title="<h5>"+_title+"</h5>"}$notification.append(_title);if(_content!=""){$notification.append(_content)}$("body").append($notification);$notification.hide();$notification.fadeIn();function close(){if(_list!=null){_list.remove($notification)}$notification.fadeOut(function(){$notification.remove()})}$btn.click(function(){close();refreshAllRelated()});$notification.stopAutoFadeOut=function(){window.clearTimeout(_tt)};$notification.setAutoFadeOut=function(_delay){if(_timeout>0){var _inner_delay=_delay==null?_timeout:_delay;$notification.stopAutoFadeOut();_tt=window.setTimeout(function()
 {close()},_inner_delay)}};if(_timeout>0){$notification.mouseenter(function(){if(_list==null){$notification.stopAutoFadeOut()}else{for(var i=_list.length-1;i>=0;i--){var $element=_list[i];$element.stopAutoFadeOut()}}});$notification.mouseleave(function(){refreshAllRelated(_overtimeout)})}function refreshAllRelated(_delay){var _inner_delay=_delay==null?_timeout:_delay;if(_list==null){$notification.setAutoFadeOut(_inner_delay)}else{var _istop=_position.indexOf("top")!=-1;var _isbottom=_position.indexOf("bottom")!=-1;var _offset=0;for(var i=_list.length-1;i>=0;i--){var $element=_list[i];if(_istop){$element.animate({top:_offset,},{queue:false})}else{if(_isbottom){$element.animate({bottom:_offset,},{queue:false})}}var _marginTop=parseInt($element.css("margin-top").replace("px",""),10);_offset+=$element.outerHeight()+_marginTop;$element.setAutoFadeOut(_inner_delay+i*_queuetimeout)}}}refreshAllRelated();if(_callback!=null){_callback.call($notification)}return $notification}});!function($){$
 .fn.extend({radio:function(options){var _my=$(this);var vars=$._bc.vars(options);var _options=vars.options;var _checked=$._bc.get(_options,"checked",null);var _to=$._bc.get(_options,"to",null);var _val=$._bc.get(_options,"value",null);if(_to!=null){_my.attr("data-to",_to)}if(_val!=null){_my.attr("data-value",_val)}if(_checked===true){checkRadio(_my)}else{if(_checked===false){uncheckRadio(_my)}}}});function checkRadio(_instance){if(_instance.attr("checked")!=null){return}updateTarget(_instance,true)}function uncheckRadio(_instance){if(_instance.attr("checked")==null){return}updateTarget(_instance,false)}function updateTarget(_instance,checked){var _val=_instance.attr("data-value");var _name=_instance.attr("name");var _radios=$(".radio[data-toggle='radio'][name='"+_name+"']");_radios.removeAttr("checked");if(checked){_instance.attr("checked","checked")}else{_val=""}var _target=$(_instance.attr("data-to"));var _pre_val=_target.val();_target.val(_val);_instance.change();if(_pre_val!=_va
 l){_target.change()}}$(document).on("click.bs.radio",".radio[data-toggle='radio']",function(event){var _my=$(this);checkRadio(_my)});$(document).on("click.bs.radio","label",function(event){var _label=$(this);var _my=_label.find(".radio[data-toggle='radio']");if(_my.length!=0){var _disabled=_my.attr("disabled")!=null;if(!_disabled){checkRadio(_my)}}})}(window.jQuery);!function($){$(document).on("click.bs.select","ul.dropdown-menu[role='menu'][data-type='selector'] li a",function(event){var my=$(this);var _val=my.attr("value");var _text=my.text();if(_val==null){_val=_text}var $field=$(this).closest(".dropdown, .btn-group").find("[data-toggle='dropdown'][data-type='selector']");var $field_val=$field.find("[data-value]");var $field_target=$($field.attr("data-to"));var pre_val=$field_val.attr("data-value");var pre_tgt_val=$field_target.val();$field_val.val(_val).text(_text).attr("data-value",_val);$field_target.val(_val);if(pre_val!=_val){my.change()}if(pre_tgt_val!=_val){$field_target.c
 hange()}})}(window.jQuery);
+!function($){$.fn.extend({slider:function(options){if(options==null){options={number:1}}$(this).each(function(){var _my=$(this);var vars=$._bc.vars(options);var _options=vars.options;var _min=$._bc.get(_options,"min",0);var _max=$._bc.get(_options,"max",100);_my.attr("data-min",_min);_my.attr("data-max",_max);var _values=$._bc.get(_options,"value",[]);var _single=$._bc.get(_options,"single",false);var _mixed=$._bc.get(_options,"mixed",false);var _number=_options.number;if(_number==null&&_values.length!=0){_number=_values.length}if(_number!=null){_my.empty();for(var i=0;i<_number;i+=1){var $slider=$("<button type='button' class='btn btn-primary slider' data-toggle='slider'>");_my.append($slider)}}_my.attr("data-slider-container","");if(_single){_my.attr("data-slider-single","")}if(_mixed){_my.attr("data-slider-mixed","")}var _sliders=_my.find("button[data-toggle='slider']");var _len=_sliders.length;for(var i=_len-1;i>0;i-=1){var $bac=$("<div data-toggle='slider-background'>");$bac.at
 tr("data-from",i-1);$bac.attr("data-to",i);_my.prepend($bac)}var _len=_values.length;var _default=_len==0?_min:_values[_len-1];$.each(_sliders,function(i,ele){var _element=$(ele);var _val=i<_len?_values[i]:_default;setValue(_element,_val);var _style=_element.attr("style");if(_style!=null){_element.attr("style",_style.replace(/margin-left/g,"left"))}});refreshBackfround(_my)})}});function index(element){return element.parent().find("button[data-toggle='slider']").index(element)}function getLeft(element){var _process=element.parent();if(_process.attr("data-slider-container")==null){return Number(element.css("margin-left").replace("px",""))}else{return Number(element.css("left").replace("px",""))}}function getWidth(element){var _width=element.outerWidth();if(element.parent().attr("data-slider-container")!=null){var _mgnLeft=Number(element.css("margin-left").replace("px",""));_width+=_mgnLeft*2}return _width}var _instance=null;var _mouseLeft=0;function getValue(_instance){var _min=Numbe
 r(_instance.parent().attr("data-min"));var _max=Number(_instance.parent().attr("data-max"));if(_min==null||isNaN(_min)){_min=0}if(_max==null||isNaN(_max)){_max=100}var _process=_instance.parent();var _sliders=_process.find("button[data-toggle='slider']");var _len=_sliders.length;var _index=index(_instance);var _mixed=_process.attr("data-slider-mixed")!=null;var _value=0;var _total_width=_process.outerWidth()-1;if(_mixed){_total_width-=getWidth(_instance)}else{$.each(_sliders,function(i,ele){var _element=$(ele);_total_width-=getWidth(_element)})}if(_process.attr("data-slider-container")==null){for(var i=0;i<=_index;i+=1){var _element=$(_sliders[i]);var _left=getLeft(_element);_value+=_left}}else{_value=getLeft(_instance);if(!_mixed){for(var i=0;i<_index;i+=1){var _element=$(_sliders[i]);_value-=getWidth(_element)}}}var _ptg=_value/_total_width;var _val=_min+(_max-_min)*_ptg;return _val}function setValue(_instance,value){var _process=_instance.parent();var _min=Number(_process.attr("d
 ata-min"));var _max=Number(_process.attr("data-max"));if(_min==null||isNaN(_min)){_min=0}if(_max==null||isNaN(_max)){_max=100}var _sliders=_process.find("button[data-toggle='slider']");var _index=index(_instance);var _total_width=_process.outerWidth();$.each(_sliders,function(i,ele){var _element=$(ele);_total_width-=getWidth(_element)});var _my_left=_total_width*(value-_min)/(_max-_min);for(var i=0;i<_index;i+=1){var _element=$(_sliders[i]);_my_left+=getWidth(_element)}if(_process.attr("data-slider-container")==null){_instance.css("margin-left",_my_left)}else{_instance.css("left",_my_left)}_instance.val(value).attr("data-value",value)}function doStart(_instance,event){_mouseLeft=event.pageX-_instance.offset().left;var _process=_instance.parent();if(_process.attr("data-slider-container")==null){var _sliders=_process.find("button[data-toggle='slider']");var _index=index(_instance);for(var i=0;i<_index;i+=1){var _element=$(_sliders[i]);_mouseLeft+=getWidth(_element)+getLeft(_element)}}
 }function doMove(_instance,event,recv){var _process=_instance.parent();var _sliders=_process.find("button[data-toggle='slider']");var _len=_sliders.length;var _index=index(_instance);var _total_width=_process.outerWidth()-1;if(_process.attr("data-slider-container")==null){$.each(_sliders,function(i,ele){var _element=$(ele);_total_width-=getWidth(_element)});var _value_range=_total_width;for(var i=0;i<_index;i+=1){var _element=$(_sliders[i]);_value_range-=getLeft(_element)}for(var i=_index+1;i<_len;i+=1){var _element=$(_sliders[i]);_value_range-=getLeft(_element)}var _instance_left=event.pageX-_process.offset().left-_mouseLeft;if(_instance_left<0){_instance_left=0}if(_instance_left>_value_range){_instance_left=_value_range}_instance.css("margin-left",_instance_left)}else{var _mixed=_process.attr("data-slider-mixed")!=null;var _single=_mixed||_process.attr("data-slider-single")!=null;var _pre_left=getLeft(_instance);var _value_start=0;var _value_end=_total_width-getWidth(_instance);if
 (!_mixed){if(_index>0){var _prev=$(_sliders[_index-1]);
+_value_start=getLeft(_prev)+getWidth(_prev)}if(_index<_len-1){if(_single){var _next=$(_sliders[_index+1]);_value_end=getLeft(_next)-getWidth(_instance)}else{var _next=$(_sliders[_index+1]);var _last=$(_sliders[_len-1]);_value_end=_total_width-(getLeft(_last)-getLeft(_instance))-getWidth(_last)}}}var _instance_left=event.pageX-_process.offset().left-_mouseLeft;if(_instance_left<_value_start){_instance_left=_value_start}if(_instance_left>_value_end){_instance_left=_value_end}_instance.css("left",_instance_left);if(!_single){var _dis=_instance_left-_pre_left;for(var i=_index+1;i<_len;i+=1){var _element=$(_sliders[i]);_element.css("left",(getLeft(_element)+_dis))}}}}function doChange(_instance){var _target=$(_instance.attr("data-to"));var _pre_val=Number(_target.val());var _val=getValue(_instance);_instance.val(_val).attr("data-value",_val);_target.val(_val);if(_pre_val!=_val){_target.change()}}function refreshBackfround(_instance){var _process=$(_instance);if(_process.attr("data-slider
 -container")==null){_process=_process.parent()}var _sliders=_process.find("button[data-toggle='slider']");var _lenSliders=_sliders.length;var _backgrounds=_process.find("div[data-toggle='slider-background']");var _lenBackgrounds=_backgrounds.length;for(var i=0;i<_lenBackgrounds;i+=1){var _bac=$(_backgrounds[i]);var _prev=$(_sliders[i]);var _next=$(_sliders[i+1]);var _left=getLeft(_prev)+getWidth(_prev)*0.5;var _right=getLeft(_next)+getWidth(_next)*0.5;var _width=_right-_left;_bac.css("left",_left);_bac.outerWidth(_width)}}$(document).on("mousedown.bs.slider","button[data-toggle='slider']",function(event){if(event.button==0){_instance=$(this);doStart(_instance,event)}});$(document).on("mousemove.bs.slider",function(event){if(_instance!=null){doMove(_instance,event);doChange(_instance);var _process=_instance.parent();var _sliders=_process.find("button[data-toggle='slider']");var _len=_sliders.length;var _index=index(_instance);$.each(_sliders,function(i,element){if(i!=_index){doChange
 ($(element))}});refreshBackfround(_instance)}});$(document).on("mouseup.bs.slider",function(event){if(event.button==0){_instance=null}})}(window.jQuery);!function($){$.fn.extend({tree:function(data,options){var _my=$(this);options=options||{};var _name=data.name;var _list=data.list||[];var _enabled=data.enabled!==false;var _open=_enabled?data.open!==false:data.open===true;var $ul=_my.is("ul")?_my:$("<ul class='treeView'>").appendTo(_my);var $li=$("<li>").appendTo($ul);var $a=$("<a class='tree-icon glyphicon'>").appendTo($li);var $name=(data.url?$("<a>").attr("href",data.url):$("<span>")).html(_name).insertAfter($a);if(!_enabled){$li.addClass("disabled")}if(_list.length){var cls_folder_open=options.folderOpenIcon||"glyphicon-folder-close";var cls_folder_close=options.folderCloseIcon||"glyphicon-folder-open";$a.attr("data-toggle","tree").attr("data-icon-open",cls_folder_open).attr("data-icon-close",cls_folder_close).addClass("glyphicon").addClass(_open?cls_folder_close:cls_folder_open
 );var $sub_ul=$("<ul class='tree-list'>").appendTo($li);$.each(_list,function(i,data){$sub_ul.tree(data,options)});if(!_open){$sub_ul.hide()}}else{var cls_file=options.itemIcon||"glyphicon-file";$a.addClass(cls_file)}return _my},});$(document).on("click.bs.treeView","[data-toggle='tree']",function(event){event.preventDefault();var _my=$(this);if(_my.closest("li").hasClass("disabled")){return}var $list=_my.parent().find("> .tree-list");var clsOpen=_my.attr("data-icon-open");var clsClose=_my.attr("data-icon-close");if($list.is(":hidden")){_my.removeClass(clsOpen);_my.addClass(clsClose);$list.slideDown()}else{_my.addClass(clsOpen);_my.removeClass(clsClose);$list.slideUp()}})}(window.jQuery);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2c3005c9/eagle-webservice/src/main/webapp/app/public/assets/flot/jquery.flot.legend.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/assets/flot/jquery.flot.legend.js b/eagle-webservice/src/main/webapp/app/public/assets/flot/jquery.flot.legend.js
new file mode 100644
index 0000000..b0147e5
--- /dev/null
+++ b/eagle-webservice/src/main/webapp/app/public/assets/flot/jquery.flot.legend.js
@@ -0,0 +1,107 @@
+"use strict";
+
+/* Flot Plugin: Tooltip
+ * Author: Jinlin, Jiang
+ */
+
+(function($) {
+	var defaultOptions = {
+		legend : {
+			clickSelect: false,
+			autoAdjust: true,
+		}
+	};
+
+	var init = function(plot) {
+		var $cntr = $(plot.getPlaceholder());
+		var _statusList = [];
+		var _init = false;
+
+		function getIndex(series) {
+			var _index;
+			$.each(plot.getData(), function(index, _series) {
+				if(_series === series) {
+					_index = index;
+					return false;
+				}
+			});
+			return _index;
+		}
+
+		function isShow(index) {
+			var _data = plot.getData();
+			if(!_data) return null;
+
+			var _series = _data[index];
+			var _oriSeries = _statusList[index];
+
+			return	(_series.bars.show && _oriSeries.bars) || 
+					(_series.lines.show && _oriSeries.lines) || 
+					(_series.points.show && _oriSeries.points);
+		}
+		function show(index, show) {
+			var _data = plot.getData();
+			var series = _data[index];
+			series.lines.show = show && _statusList[index].lines;
+			series.bars.show = show && _statusList[index].bars;
+			series.points.show = show && _statusList[index].points;
+		}
+
+		$cntr.off("click.legend").on("click.legend", ".legend table tbody tr", function() {
+			var _my = $(this);
+			var _index = _my.index();
+			var _data = plot.getData();
+
+			var _myShow = isShow(_index);
+
+			if(plot.getOptions().legend.clickSelect === true) {
+				var _showAll = _myShow && $.grep(_data, function(_series, i) {
+					return !isShow(i);
+				}).length !== 0;
+				$.each(_data, function(i, _series) {
+					show(i, _showAll);
+				});
+				show(_index, true);
+			} else {
+				show(_index, !_myShow);
+			}
+			plot.setData(_data);
+
+			plot.setupGrid();
+			plot.draw();
+		});
+
+		plot.hooks.bindEvents.push(function(plot, eventHolder) {
+			var _data = plot.getData();
+			$.each(_data, function(i, series) {
+				_statusList[i] = {
+					bars: series.bars.show,
+					lines: series.lines.show,
+					points: series.points.show,
+				};
+			});
+
+			_init = true;
+		});
+
+		plot.hooks.processDatapoints.push(function(plot, series, dataPoints) {
+			var _option = plot.getOptions();
+			// Auto adjust view size
+			if(_init && (_option.series && !_option.series.stack) && _option.legend.autoAdjust === true) {
+				var index = getIndex(series);
+
+				if(isShow(index) === false) {
+					dataPoints.points = [];
+				}
+			}
+		});
+	};
+
+	// define Flot plugin
+	$.plot.plugins.push({
+		init : init,
+		options : defaultOptions,
+		name : 'legend',
+		version : '0.8.3'
+	});
+})(jQuery);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2c3005c9/eagle-webservice/src/main/webapp/app/public/assets/flot/jquery.flot.tooltip.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/assets/flot/jquery.flot.tooltip.js b/eagle-webservice/src/main/webapp/app/public/assets/flot/jquery.flot.tooltip.js
new file mode 100644
index 0000000..208e998
--- /dev/null
+++ b/eagle-webservice/src/main/webapp/app/public/assets/flot/jquery.flot.tooltip.js
@@ -0,0 +1,381 @@
+"use strict";
+
+/* Flot Plugin: Tooltip
+ * Author: Jinlin, Jiang
+ */
+
+(function($) {
+	// Common
+	function getValueByPath(unit, path, defaultValue) {
+		if(unit === null || unit === undefined) throw "Unit or path can't be empty!";
+		if(path === "" || path === null || path === undefined) return unit;
+
+		path = path.split(/\./);
+		$.each(path, function(i, path) {
+			unit = unit[path];
+			if(unit == null) {
+				unit = null;
+				return false;
+			}
+		});
+		if(unit === null && defaultValue !== undefined) {
+			unit = defaultValue;
+		}
+		return unit;
+	};
+
+	var OFFSET_X = 15;
+	var OFFSET_Y = 20;
+	var OFFSET_DES = 20;
+
+	var defaultOptions = {
+		tooltip : {
+			show: true,
+			share: true,
+			id: null,						// Define the tool tip id. Will share tool tip if use same id
+			className: "flotToolTip",
+			container: "body",
+			useCSS: true,
+			css: {
+				display: "inline-block",
+				background: "rgba(0,0,0,0.7)",
+				padding: "3px 5px",
+				color: "#FFFFFF",
+				position: "fixed",
+				"z-index": 3,
+				"border-radius": "3px",
+				"font-size": "12px",
+			},
+			chartVisibleCheck: false,		// True will create timer to loop check the chart exist or not. Always suggest use 'plot.destroy' to destroy chart.
+			//xFormat: "YYYY-MM-DD HH:mm:ss",
+			xFormat: "%Y-%M-%D %H:%m:%s",	// %W:weekday, %MS:millionSecond
+			yFormat: "%value",				// %value.number: support to fixed the value
+			formatter: null,				// Customize formatter function. Return DOM element as tooltip content. Return null will not display tool tip.
+		}
+	};
+
+	// ================================================
+	// =                    Format                    =
+	// ================================================
+	function _fillZero(num, len) {
+		if(len === undefined) len = 2;
+		var str = num + "";
+		while(str.length < len) {
+			str = "0" + str;
+		}
+		return str;
+	}
+
+	function _parseValue(value, format, plot) {
+		if(typeof format === "function") {
+			return format(value, plot);
+		} else {
+			var _date = new Date(value);
+
+			return format
+			.replace(/(%value)((\.)(\w+))?/, function() {
+				var _decimal = arguments[4];
+				if(_decimal !== undefined) {
+					return value.toFixed(Number(_decimal));
+				} else {
+					return value;
+				}
+			})
+
+			.replace(/%MS/g, _fillZero(_date.getUTCMilliseconds(), 3))
+			.replace(/%Y/g, _fillZero(_date.getUTCFullYear(), 4))
+			.replace(/%M/g, _fillZero(_date.getUTCMonth() + 1))
+			.replace(/%W/g, _date.getUTCDay() + 1)
+			.replace(/%D/g, _fillZero(_date.getUTCDate()))
+			.replace(/%H/g, _fillZero(_date.getUTCHours()))
+			.replace(/%m/g, _fillZero(_date.getUTCMinutes()))
+			.replace(/%s/g, _fillZero(_date.getUTCSeconds()));
+		}
+	}
+
+	function parseContent(plot, dataList, item, pos, closestSeriesIndex) {
+		var _options = plot.getOptions();
+		var _data = plot.getData();
+		var _tooltipOps = _options.tooltip;
+
+		var $cntr = $("<div>");
+
+		if(getValueByPath(_options, "series.pie.show")) {
+			// Pie Chart
+			if(!item) return null;
+
+			var _series = item.series;
+			var _title = _series.label;
+			if(typeof _title === "number") {
+				_title = _parseValue(_title, _tooltipOps.xFormat, plot);
+			}
+
+			$("<span>")
+			.append($("<span>").html("\u25CF").css("color", _series.color)).append(" ")
+			.append(_title)
+			.append(": ")
+			.append($("<b>").text(_parseValue(item.datapoint[1][0][1], _tooltipOps.yFormat, plot)))
+			.appendTo($cntr);
+		} else {
+			// Other Chart
+			if(!dataList.length) return null;
+
+			var _share = _tooltipOps.share !== false;
+
+			// Check x-axis is same or not
+			var _time = getValueByPath(dataList, "0.0", null);
+			var _multiTime = false;
+			if(_share) {
+				$.each(dataList, function(index, point) {
+					if(point[0] !== _time) {
+						_multiTime = true;
+						return false;
+					}
+				});
+			} else {
+				_multiTime = true;
+			}
+
+			// Display Content
+			$.each(dataList, function(index, point) {
+				if(!_share && closestSeriesIndex !== index) {
+					return;
+				}
+
+				if(point[1] === null) {
+					return;
+				}
+
+				// X-Axis
+				if(index === 0 || _multiTime) {
+					if(index !== 0) $cntr.append("<br/>");
+					$("<span>").text(_parseValue(point[0], _tooltipOps.xFormat, plot)).appendTo($cntr);
+				}
+
+				var _series = _data[index];
+
+				$cntr.append("<br/>");
+				var $row = $("<span>")
+				.append($("<span>").html("\u25CF").css("color", _series.color)).append(" ")
+				.append(_series.label)
+				.append(": ")
+				.append($("<b>").text(_parseValue(point[1], _tooltipOps.yFormat, plot)))
+				.appendTo($cntr);
+			});
+
+			if($($cntr.children()[0]).is("br")) {
+				$($cntr.children()[0]).remove();
+			}
+		}
+
+		return $cntr;
+	}
+
+	// ================================================
+	// =                      UI                      =
+	// ================================================
+	var init = function(plot) {
+		var $cntr = $(plot.getPlaceholder());
+		var _lastToolTip = null;
+		var _checkID = null;
+		var _showID;
+		var _lastPos;
+		var _lastItem;
+		var _elementID;
+
+		function tooltip(ele) {
+			if(ele === null) {
+				$cntr.removeData("flot-tooltip");
+			} else if(ele) {
+				_lastToolTip = ele;
+				$cntr.data("flot-tooltip", ele);
+			}
+			if(_elementID) {
+				ele = $("#" + _elementID);
+				return ele.length ? ele : null;
+			} else {
+				return $cntr.data("flot-tooltip");
+			}
+		}
+
+		function removeTooltip(immediately) {
+			var _timeoutID = $cntr.data("flot-tooltip-timeout");
+			clearTimeout(_timeoutID);
+
+			_timeoutID = setTimeout(function() {
+				_lastToolTip = _elementID ? tooltip() : (_lastToolTip || tooltip());
+				if(!_lastToolTip) return;
+
+				_lastToolTip.fadeOut(function() {
+					$(this).remove();
+				});
+				tooltip(null);
+			}, immediately === true ? 0 : 250);
+
+			$cntr.data("flot-tooltip-timeout", _timeoutID);
+			if(tooltip()) tooltip().data("flot-tooltip-timeout", _timeoutID);
+		}
+
+		// Show tool tip
+		function tracker(plot, eventHolder) {
+			var _options = plot.getOptions();
+			var _tooltipOps = _options.tooltip;
+			var _className = _tooltipOps.className;
+			_elementID = _tooltipOps.id;
+
+			if(!_options.grid.hoverable) return;
+
+			// Loop checker
+			if(_tooltipOps.chartVisibleCheck) {
+				_checkID = setInterval(function() {
+					if(_lastToolTip && !$cntr.is(":visible")) {
+						tooltip(null);
+						_lastToolTip.remove();
+						_lastToolTip = null;
+					}
+				}, 1000);
+			}
+
+			eventHolder.on("mousemove.flot-tooltip", function(event) {
+				clearTimeout($cntr.data("flot-tooltip-timeout"));
+				var _content;
+
+				var $tooltip = tooltip();
+				if(!$tooltip) {
+					_content = getContent();
+					if(_content === null) return;
+
+					$tooltip = $("<div>").addClass(_className).appendTo(_tooltipOps.container);
+					if(_elementID) $tooltip.attr("id", _elementID);
+
+					if(_tooltipOps.useCSS) {
+						$.each(_tooltipOps.css, function(key, value) {
+							$tooltip.css(key, value);
+						});
+					}
+					tooltip($tooltip);
+					showContent(_content);
+				}
+				if(_elementID) {
+					$tooltip.stop().css("opacity", 1);
+					clearTimeout($tooltip.data("flot-tooltip-timeout"));
+				}
+				
+
+				var _x = event.pageX + OFFSET_X;
+				var _y = event.pageY + OFFSET_Y;
+				var _width = $tooltip.outerWidth();
+				var _height = $tooltip.outerHeight();
+				var _winWidth = $(window).width();
+				var _winHeight = $(window).height();
+				var _winLeft = $(window).scrollLeft();
+				var _winTop = $(window).scrollTop();
+
+				if(_x + _width + OFFSET_DES - _winLeft > _winWidth) {
+					_x = event.pageX - _width - OFFSET_X;
+				}
+				if(_y + _height + OFFSET_DES - _winTop > _winHeight) {
+					_y = event.pageY - _height - OFFSET_Y;
+				}
+
+				$tooltip.offset({
+					left: _x,
+					top: _y
+				});
+
+				if(!_showID) {
+					_showID = setTimeout(showContent, tooltip() ? 50 : 0);
+				}
+			});
+			eventHolder.on("mouseout.flot-tooltip", function(event) {
+				removeTooltip();
+			});
+
+			// Tool tip Content
+			function getContent() {
+				var _x = _lastPos.x;
+				var _y = _lastPos.y;
+
+				var axes = plot.getAxes();
+				if(_x < axes.xaxis.min) _x = axes.xaxis.min;
+				if(_x > axes.xaxis.max) _x = axes.xaxis.max;
+				if(_y < axes.yaxis.min) _y = axes.yaxis.min;
+				if(_y > axes.yaxis.max) _y = axes.yaxis.max;
+
+				var _dataList = [];
+				var _closestSeriesIndex = 0;
+				var _closestSeriesDist;
+				$.each(plot.getData(), function(index, series) {
+					var _hasPoint = false;
+					for(var i = 0 ; i < series.data.length - 1 ; i += 1) {
+						var _unitL = series.data[i];
+						var _unitR = series.data[i + 1];
+						var _unitClose;
+
+						if(_unitL[0] <= _x && _x <= _unitR[0]) {
+							// Find Closest
+							if(getValueByPath(series, "bars.show") || Math.abs(_unitL[0] - _x) < Math.abs(_x - _unitR[0])) {
+								_unitClose = _unitL;
+							} else {
+								_unitClose = _unitR;
+							}
+							_dataList.push(_unitClose);
+
+							// Calculate Closest Series
+							var _desX = _x - _unitClose[0];
+							var _desY = _y - _unitClose[1];
+							var _dist = Math.sqrt(_desX * _desX + _desY * _desY);
+							if(_closestSeriesDist === undefined || _dist < _closestSeriesDist) {
+								_closestSeriesIndex = index;
+								_closestSeriesDist = _dist;
+							}
+
+							_hasPoint = true;
+							break;
+						}
+					}
+					if(!_hasPoint) _dataList.push([null, null]);
+				});
+
+				return _tooltipOps.formatter ? _tooltipOps.formatter(plot, _dataList, _lastItem, _lastPos, _closestSeriesIndex) : parseContent(plot, _dataList, _lastItem, _lastPos, _closestSeriesIndex);
+			}
+			function showContent(content) {
+				_showID = 0;
+
+				if(!content) content = getContent();
+
+				if(tooltip()) {
+					if(content) {
+						tooltip().html(content);
+					} else {
+						removeTooltip(true);
+					}
+					return content;
+				}
+				return false;
+			}
+			$cntr.on("plothover.flot-tooltip", function (event, pos, item) {
+				_lastPos = pos;
+				_lastItem = item;
+			});
+		}
+
+		plot.hooks.bindEvents.push(tracker);
+		plot.hooks.shutdown.push(function (plot, eventHolder) {
+			eventHolder.off("mousemove.flot-tooltip");
+			eventHolder.off("mouseout.flot-tooltip");
+			$(plot.getPlaceholder()).off("plothover.flot-tooltip");
+
+			removeTooltip();
+			clearInterval(_checkID);
+		});
+	};
+
+	// define Flot plugin
+	$.plot.plugins.push({
+		init : init,
+		options : defaultOptions,
+		name : 'tooltip',
+		version : '0.8.3.2'
+	});
+})(jQuery);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2c3005c9/eagle-webservice/src/main/webapp/app/public/css/main.css
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/css/main.css b/eagle-webservice/src/main/webapp/app/public/css/main.css
new file mode 100644
index 0000000..a82f336
--- /dev/null
+++ b/eagle-webservice/src/main/webapp/app/public/css/main.css
@@ -0,0 +1,553 @@
+@CHARSET "UTF-8";
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* Frame */
+body.no-sidebar .content-wrapper {
+	margin-left: 0;
+
+	-webkit-transition: none;
+	-moz-transition: none;
+	-o-transition: none;
+	transition: none;
+}
+
+/* Navigation */
+.navbar-nav > .user-menu > .dropdown-menu > li.user-header .img-circle {
+	display: inline-block;
+	border: 3px solid;
+	border-color: rgba(255,255,255,0.2);
+	width: 90px;
+	height: 90px;
+	margin-top: 10px;
+}
+
+.navbar-nav > .user-menu > .dropdown-menu > li.user-header .fa {
+	font-size: 60px;
+	color: rgba(255,255,255,0.8);
+	margin-top: 10px;
+}
+
+/* Common */
+a {
+	cursor: pointer;
+}
+
+.table.table-sm>tbody>tr>td,
+.table.table-sm>tbody>tr>th,
+.table.table-sm>tfoot>tr>td,
+.table.table-sm>tfoot>tr>th,
+.table.table-sm>thead>tr>td,
+.table.table-sm>thead>tr>th{
+	padding: 3px 8px;
+}
+
+.table thead th .fa.fa-sort,
+.table thead th .fa.fa-sort-asc,
+.table thead th .fa.fa-sort-desc {
+	margin-top: 5px;
+	opacity: 0.3;
+	float: right;
+}
+.table thead th:hover .fa.fa-sort,
+.table thead th:hover .fa.fa-sort-asc,
+.table thead th:hover .fa.fa-sort-desc {
+	opacity: 0.8;
+}
+
+.table tr th,
+.table tr td {
+	-webkit-transition: background .5s linear;
+	-o-transition: background .5s linear;
+	transition: background .5s linear;
+}
+
+.sortTable-cntr .pagination {
+	margin-top: 0;
+}
+
+.table th.input-field,
+.table td.input-field {
+	padding: 0;
+	vertical-align: middle;
+}
+
+.table th.input-field > input,
+.table td.input-field > input,
+.table th.input-field > select,
+.table td.input-field > select {
+	border: none;
+	transition: border-color 0s;
+}
+
+.table th.input-field > input:focus,
+.table td.input-field > input:focus,
+.table th.input-field > select:focus,
+.table td.input-field > select:focus {
+	box-shadow: inset 1px 1px 0px #3c8dbc, inset -1px -1px 0px #3c8dbc;
+}
+
+.table th.input-field > input.has-warning,
+.table td.input-field > input.has-warning {
+	box-shadow: inset 1px 1px 0px #f39c12, inset -1px -1px 0px #f39c12;
+}
+
+/* Box */
+.small-box > a.inner {
+	color: #FFF;
+	display: block;
+}
+
+.small-box > a.inner h3 {
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+	font-size: 32px;
+}
+
+.info-box.bg-gray,
+.info-box a {
+	color: #FFFFFF;
+}
+.info-box a:hover {
+	color: #FFFFFF;
+	text-decoration: underline;
+}
+
+.info-box-content a.config {
+	color: rgba(255,255,255,0.8);
+}
+.info-box-content a.config:hover {
+	color: #FFFFFF;
+}
+
+.info-box-content.box-clickable {
+	box-shadow: 0 0 3px;
+}
+.box-clickable {
+	cursor: pointer;
+}
+
+.info-box-content .info-box-text.text-large {
+	font-size: 26px;
+	margin: 5px 0 10px 0;
+}
+
+
+body .tooltip-inner {
+	max-width: 500px;
+}
+
+.text-nowrap {
+	white-space: nowrap;
+}
+
+.text-ellipsis,
+.label.text-ellipsis {
+	overflow:hidden;
+	text-overflow:ellipsis;
+	display: inline-block;
+	white-space: nowrap;
+	max-width: 100%;
+}
+td.text-ellipsis {
+	display: table-cell;
+}
+
+.btn.btn-xs.sm {
+	font-size: 12px;
+	padding: 2px 6px;
+}
+
+.noSelect {
+	-khtml-user-select: none;
+	-moz-user-select: none;
+	-ms-user-select: none;
+	user-select: none;
+	-webkit-touch-callout: none;
+	-webkit-user-select: none;
+}
+
+.inline-group dl,
+.inline-group dl dt,
+.inline-group dl dd {
+	display: inline-block;
+}
+
+.inline-group dl {
+	margin-right: 35px;
+}
+.inline-group dl dt {
+	margin-right: 20px;
+}
+
+.inline-group.form-inline {
+	margin-top: 5px;
+}
+.inline-group dl {
+	margin-right: 25px;
+}
+.inline-group dl dt {
+	margin-right: 5px;
+}
+
+.search-box {
+	position: relative;
+	margin-bottom: 15px;
+}
+.search-box input[type="search"] {
+	padding-left: 26px;
+}
+.search-box .fa.fa-search {
+	position: absolute;
+	top: 8px;
+	left: 8px;
+	z-index: 2;
+	pointer-events: none;
+	color: #999;
+}
+
+/* Navigation Tab */
+.modal-body ul.nav.nav-tabs {
+	border-bottom-color: #F4F4F4;
+	margin-bottom: 15px;
+}
+
+.modal-body ul.nav.nav-tabs li {
+	border-top: 3px solid #FFFFFF;
+	margin-right: 3px;
+}
+.modal-body ul.nav.nav-tabs li.active {
+	border-top-color: #3c8dbc;
+}
+
+.modal-body ul.nav.nav-tabs li > a,
+.modal-body ul.nav.nav-tabs li > a:active,
+.modal-body ul.nav.nav-tabs li > a:hover {
+	border: none;
+	border-radius: 0;
+	margin: 0;
+	padding: 6px 15px 8px 15px;
+	color: #444;
+}
+.modal-body ul.nav.nav-tabs li:not(.active) > a:hover {
+	background: rgba(0,0,0,0);
+	color: #999;
+}
+.modal-body ul.nav.nav-tabs li.active > a {
+	border-left: 1px solid #F4F4F4;
+	border-right: 1px solid #F4F4F4;
+}
+
+/* Step Navigation */
+.step-cntr .step {
+	background: #3c8dbc;
+	margin: 0 0 20px 0;
+	color: #FFF;
+	height: 60px;
+	border-radius: 3px;
+	box-shadow: 0 1px 1px rgba(0,0,0,0.1);
+	display: block;
+
+	-webkit-transition: background .15s linear;
+	-o-transition: background .15s linear;
+	transition: background .15s linear;
+}
+.step-cntr .step.active {
+	background: #f39c12;
+}
+
+.step-cntr .step h1,
+.step-cntr .step h2,
+.step-cntr .step p {
+	margin: 0;
+	padding: 0;
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}
+
+.step-cntr .step h1 {
+	display: inline-block;
+	font-size: 30px;
+	float: left;
+	border-right: 2px solid rgba(255,255,255,0.2);
+	width: 60px;
+	height: 60px;
+	text-align: center;
+	padding-top: 12px;
+	margin-right: 10px;
+}
+.step-cntr .step h2 {
+	font-size: 18px;
+	padding: 8px 0 5px 0;
+}
+
+/* Panel */
+.panel-group.panel-group-sm .panel .panel-heading {
+	padding: 5px 6px 5px 10px;
+}
+.panel-group.panel-group-sm .panel .panel-heading h4 {
+	font-size: 14px;
+}
+.panel-group.panel-group-sm .panel .panel-heading h4 a {
+	display: block;
+}
+.panel-group.panel-group-sm .panel .panel-heading .pull-right {
+	padding-left: 5px;
+	padding-right: 5px;
+	border-radius: 3px;
+}
+
+/* Drop Down */
+.dropdown-menu > li.danger > a {
+	color: #dd4b39;
+}
+.dropdown-menu > li.danger > a:hover {
+	color: #FFFFFF;
+	background: #dd4b39;
+}
+
+/* Input Group */
+.input-group .input-group-btn select {
+	width: auto;
+}
+
+/* Form group */
+.form-group .checkbox {
+	display: inline;
+	margin-right: 10px;
+}
+
+.form-group select.has-warning,
+.form-group input.has-warning {
+	border-color: #f39c12;
+	box-shadow: none;
+}
+
+/* UL */
+ul.path {
+	margin-left: 0;
+}
+
+ul.path li {
+	padding: 0;
+	margin-right: 5px;
+}
+ul.path li a {
+	color: #FFFFFF;
+}
+
+ul.tree {
+	padding: 0 0 0 5px;
+}
+
+ul.tree > li,
+ul.tree > li > ul > li {
+	list-style-type: none;
+}
+
+ul.tree .tree-item .hover {
+	display: none;
+}
+ul.tree .tree-item:hover .hover {
+	display: inline-block;
+}
+
+ul.tree > li > ul {
+	padding: 0 0 0 25px;
+}
+
+ul.tree > li > ul > li.active {
+	background: #F4F4F4;
+}
+
+ul.tree.tree-bordered {
+	border: 1px solid #f4f4f4;
+}
+ul.tree.tree-bordered,
+ul.tree.tree-bordered > li > ul {
+	padding: 0;
+}
+ul.tree.tree-bordered > li:not(:last-child) {
+	border-bottom: 1px solid #f4f4f4;
+}
+ul.tree.tree-bordered > li > ul > li {
+	border-top: 1px solid #f4f4f4;
+}
+ul.tree.tree-bordered > li > span,
+ul.tree.tree-bordered > li > a {
+	display: block;
+	padding: 8px;
+}
+ul.tree.tree-bordered > li > ul > li > span,
+ul.tree.tree-bordered > li > ul > li > a {
+	display: block;
+	padding: 8px 8px 8px 30px;
+}
+
+/* Label */
+.label.label-default {
+	color: #FFFFFF;
+}
+
+/* Chart */
+.chart .chart-header h3 {
+	text-align: center;
+	margin: 10px 0 5px 0;
+}
+.chart .chart-body {
+	height: 200px;
+}
+
+.chart .chart-body .axis path, .axis line {
+	fill: none;
+	stroke: #000;
+	shape-rendering: crispEdges;
+}
+
+.chart .chart-body .bar {
+	fill: steelblue;
+}
+
+/* Tab */
+body .tab-content>.tab-pane {
+	display: block;
+	height: 0px;
+	overflow: hidden;
+	position: relative;
+}
+body .tab-content>.tab-pane.active {
+	height: auto;
+	overflow-y: auto;
+}
+
+/* Customize */
+#content {
+	position: relative;
+}
+
+.page-fixed {
+	position: absolute;
+	top: -45px;
+	right: 0;
+}
+
+@media (max-width:991px) {
+	.page-fixed {
+		top: -70px;
+	}
+}
+
+.fixed-right {
+	position: absolute;
+	right: 0;
+	z-index: 3;
+}
+
+.main-header .logo .logo-lg small {
+	font-size: 12px;
+}
+
+#timeRangePickerCntr .navbar-form {
+	display: inline-block;
+	padding-right: 0;
+}
+
+#timeRangePickerCntr #timeRangePicker {
+	min-width: 300px;
+}
+
+body .login-box, body .register-box {
+	margin: 3% auto;
+}
+
+.content-header > .breadcrumb > li {
+	font-size: 14px;
+}
+
+.daterangepicker .ranges {
+  width: 110px!important;
+}
+.daterangepicker .daterangepicker_start_input,
+.daterangepicker .daterangepicker_end_input {
+	display: block!important;
+	padding: 0!important;
+	float: none!important;
+}
+.daterangepicker .daterangepicker_start_input .input-mini,
+.daterangepicker .daterangepicker_end_input .input-mini {
+	width: 110px!important;
+}
+
+.form-group.inner-icon {
+	position: relative;
+}
+.form-group.inner-icon .fa {
+	position: absolute;
+	left: 10px;
+	top: 10px;
+}
+.form-group.inner-icon input {
+	padding-left: 35px;
+}
+
+#autoRefreshCntr > a {
+	border: none;
+	opacity: 0.3;
+}
+#autoRefreshCntr.autoRefresh > a {
+	opacity: 1;
+}
+
+.table-responsive .row {
+	margin: 0;
+}
+
+
+.content .miao-chart {
+	border: none;
+	margin: 0;
+}
+
+.content .miao-chart .box .chart-entity-title {
+	height: auto;
+	margin: 0;
+}
+
+.content .miao-chart .chart-entity-menu {
+	display: block;
+	top: 5px;
+	right: 25px;
+}
+
+.content .miao-chart .box .chart-entity-menu {
+	display: block;
+	top: 5px;
+	right: 25px;
+	padding-right: 10px;
+	border-right: 1px solid #f4f4f4;
+}
+
+.content .miao-chart .box .chart-entity-drillDownPath .drillDownPath {
+	position: static;
+}
+
+.content .miao-chart[data-miao-drilldown-depth='0'] .box .box-footer {
+	display: none;
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2c3005c9/eagle-webservice/src/main/webapp/app/public/images/favicon.png
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/images/favicon.png b/eagle-webservice/src/main/webapp/app/public/images/favicon.png
new file mode 100644
index 0000000..3bede2a
Binary files /dev/null and b/eagle-webservice/src/main/webapp/app/public/images/favicon.png differ

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2c3005c9/eagle-webservice/src/main/webapp/app/public/js/app.config.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/js/app.config.js b/eagle-webservice/src/main/webapp/app/public/js/app.config.js
new file mode 100644
index 0000000..85559be
--- /dev/null
+++ b/eagle-webservice/src/main/webapp/app/public/js/app.config.js
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use strict";
+
+app.config = {
+	// ============================================================================
+	// =                                   URLs                                   =
+	// ============================================================================
+	urls: {
+		HOST: '..',
+
+		updateEntity: 'rest/entities?serviceName=${serviceName}',
+		queryEntity: 'rest/entities/rowkey?serviceName=${serviceName}&value=${encodedRowkey}',
+		queryEntities: 'rest/list?query=${serviceName}[${condition}]{${values}}&pageSize=100000',
+		deleteEntity: 'rest/entities/delete?serviceName=${serviceName}&byId=true',
+		deleteEntities: 'rest/entities?query=${serviceName}[${condition}]{*}&pageSize=100000',
+
+		queryGroup: 'rest/list?query=${serviceName}[${condition}]<${groupBy}>{${values}}&pageSize=100000',
+		querySeries: 'rest/list?query=${serviceName}[${condition}]<${groupBy}>{${values}}&pageSize=100000&timeSeries=true&intervalmin=${intervalmin}',
+
+		query: 'rest/',
+
+		userProfile: 'rest/authentication',
+		logout: 'logout',
+	},
+
+	// ============================================================================
+	// =                               Data Sources                               =
+	// ============================================================================
+	dataSource: {
+		uiInvisibleList: ["userProfile"],
+	},
+};
+
+// ============================================================================
+// =                                   URLs                                   =
+// ============================================================================
+app.getURL = function(name, kvs) {
+	var _host = localStorage.getItem("HOST") || app.config.urls.HOST;
+	var _path = app.config.urls[name];
+	if(!_path) throw "URL:'" + name + "' not exist!";
+	var _url = (_host ? _host + "/" : '') + _path;
+	if(kvs !== undefined) {
+		_url = common.template(_url, kvs);
+	}
+	return _url;
+};
+
+app._Host = function(host) {
+	if(host) {
+		localStorage.setItem("HOST", host);
+		return app;
+	}
+	return localStorage.getItem("HOST");
+};
+app._Host.clear = function() {
+	localStorage.removeItem("HOST");
+};
+app._Host.sample = "http://localhost:9099/eagle-service";
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/2c3005c9/eagle-webservice/src/main/webapp/app/public/js/app.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/js/app.js b/eagle-webservice/src/main/webapp/app/public/js/app.js
new file mode 100644
index 0000000..c8654f3
--- /dev/null
+++ b/eagle-webservice/src/main/webapp/app/public/js/app.js
@@ -0,0 +1,684 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+'use strict';
+
+var app = {};
+
+/* App Module */
+var eagleApp = angular.module('eagleApp', ['ngRoute', 'ngCookies', 'damControllers']);
+
+eagleApp.config(function($routeProvider) {
+	$routeProvider.when('/dam/summary', {
+		templateUrl : 'partials/dam/summary.html',
+		controller : 'summaryCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+
+	// Authorization
+	}).when('/dam/login', {
+		templateUrl : 'partials/dam/login.html',
+		controller : 'authLoginCtrl',
+		access: {skipCheck: true},
+
+	// Policy
+	}).when('/dam/policyList', {
+		templateUrl : 'partials/dam/policyList.html',
+		controller : 'policyListCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+	}).when('/dam/policyList/:dataSource', {
+		templateUrl : 'partials/dam/policyList.html',
+		controller : 'policyListCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+	}).when('/dam/policyDetail/', {
+		templateUrl : 'partials/dam/policyDetail.html',
+		controller : 'policyDetailCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+	}).when('/dam/policyDetail/:encodedRowkey', {
+		templateUrl : 'partials/dam/policyDetail.html',
+		controller : 'policyDetailCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+	}).when('/dam/policyEdit/:encodedRowkey', {
+		templateUrl : 'partials/dam/policyEdit.html',
+		controller : 'policyEditCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+	}).when('/dam/policyCreate/', {
+		templateUrl : 'partials/dam/policyEdit.html',
+		controller : 'policyCreateCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+
+	// Alert
+	}).when('/dam/alertList', {
+		templateUrl : 'partials/dam/alertList.html',
+		controller : 'alertListCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+	}).when('/dam/alertList/:dataSource', {
+		templateUrl : 'partials/dam/alertList.html',
+		controller : 'alertListCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+	}).when('/dam/alertDetail/:encodedRowkey', {
+		templateUrl : 'partials/dam/alertDetail.html',
+		controller : 'alertDetailCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+
+	// Stream
+	}).when('/dam/streamList', {
+		templateUrl : 'partials/dam/streamList.html',
+		controller : 'streamListCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+
+	// Site
+	}).when('/dam/siteList', {
+		templateUrl : 'partials/dam/siteList.html',
+		controller : 'siteListCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+		access: {roles: ["ROLE_ADMIN"]},
+
+	// Sensitivity
+	}).when('/dam/sensitivitySummary', {
+		templateUrl : 'partials/dam/sensitivitySummary.html',
+		controller : 'sensitivitySummaryCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+	}).when('/dam/sensitivity', {
+		templateUrl : 'partials/dam/sensitivity.html',
+		controller : 'sensitivityCtrl',
+		reloadOnSearch: false,
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+
+	// User Profile
+	}).when('/dam/userProfileList', {
+		templateUrl : 'partials/dam/userProfileList.html',
+		controller : 'userProfileListCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+	}).when('/dam/userProfileDetail/:user', {
+		templateUrl : 'partials/dam/userProfileDetail.html',
+		controller : 'userProfileDetailCtrl',
+		resolve: {
+			site: function(Site) {return Site._promise();},
+			auth: function(Authorization) {return Authorization._promise();},
+		},
+
+	}).otherwise({
+		redirectTo : '/dam/summary'
+	});
+});
+
+eagleApp.service('globalContent', function(Entities, $rootScope, $route, $location) {
+	var content = {
+		pageTitle: "",
+		pageSubTitle: "",
+		pageList: [],
+		navPath: [],
+		navMapping: {},
+
+		hideSite: false,
+		lockSite: false,
+
+		dataSrcList: [],
+
+		setConfig: function(config) {
+			// Clean up
+			content.navPath = [];
+
+			// Fill configuration
+			$.extend(content, config);
+		},
+	};
+
+	return content;
+});
+
+// Site
+eagleApp.service('Site', function(Authorization, Entities, $rootScope, $route, $location, $q) {
+	var _currentSite;
+	var content = {};
+
+	content.list = [];
+	content.list.set = {};
+	content.dataSrcList = [];
+
+	content.current = function(site) {
+		if(site) {
+			var _prev = _currentSite;
+			_currentSite = site;
+
+			// Broadcast if site update
+			if(!_prev || _prev.name !== _currentSite.name) {
+				if(sessionStorage) {
+					sessionStorage.setItem("site", _currentSite.name);
+				}
+
+				if(!content.hideSite) $route.reload();
+			}
+		}
+		return _currentSite;
+	};
+	content.find = function(siteName) {
+		return common.array.find(siteName, content.list, "name");
+	};
+	content.url = function(site, url) {
+		if(arguments.length == 1) {
+			url = site;
+		} else {
+			content.current(site);
+		}
+		$location.url(url);
+
+		if ($rootScope.$$phase != '$apply' && $rootScope.$$phase != '$digest') {
+			$rootScope.$apply();
+		}
+	};
+
+	var _promise;
+	content.refresh = function() {
+		content.list = [];
+		content.list.set = {};
+
+		content.dataSrcList = Entities.queryEntities("AlertDataSourceService", '');
+		content.dataSrcList._promise.success(function() {
+			$.each(content.dataSrcList, function(i, dataSrc) {
+				var _site = content.list.set[dataSrc.tags.site];
+				if(!_site) {
+					_site = content.list.set[dataSrc.tags.site] = {
+						name: dataSrc.tags.site,
+						dataSrcList: []
+					};
+					_site.dataSrcList.find = function(dataSrcName) {
+						return common.array.find(dataSrcName, _site.dataSrcList, "tags.dataSource");
+					};
+					content.list.push(_site);
+				}
+				_site.dataSrcList.push(dataSrc);
+
+				// UI visible check
+				if($.inArray(dataSrc.tags.dataSource, app.config.dataSource.uiInvisibleList) !== -1) {
+					dataSrc.hide = true;
+				}
+			});
+
+			if(sessionStorage && content.find(sessionStorage.getItem("site"))) {
+				content.current(content.find(sessionStorage.getItem("site")));
+			} else {
+				content.current(content.list[0]);
+			}
+		});
+
+		_promise = content.dataSrcList._promise;
+		return _promise;
+	};
+
+	content._promise = function() {
+		if(!_promise) {
+			content.refresh();
+		}
+		return _promise;
+	};
+
+	return content;
+});
+
+// Authorization
+eagleApp.service('Authorization', function($http, $location, $cookies) {
+	$http.defaults.withCredentials = true;
+
+	var _path = "";
+	var _userProfile = null;
+
+	var content = {
+		isLogin: true,	// Status mark. Work for UI status check, changed when eagle api return 403 authorization failure.
+		login: function(username, password) {
+			var _hash = btoa(username + ':' + password);
+			return $http({
+				url : app.getURL('userProfile'),
+				method : "GET",
+				headers: {
+					'Authorization': "Basic " + _hash
+				}
+			}).then(function() {
+				content.isLogin = true;
+				return true;
+			}, function() {
+				return false;
+			});
+		},
+		logout: function() {
+			$http({
+				url : app.getURL('logout'),
+				method : "GET",
+			});
+		},
+		path: function(path) {
+			if(typeof path === "string") {
+				_path = path;
+			} else if(path === true) {
+				$location.path(_path || "");
+				_path = "";
+			}
+		},
+	};
+
+	var _promise;
+	content.userProfile = {};
+	content.isRole = function(role) {
+		if(!content.userProfile.roles) return null;
+
+		return content.userProfile.roles[role] === true;
+	};
+
+	content.refresh = function() {
+		_promise = $http({
+			url : app.getURL('userProfile'),
+			method : "GET",
+		}).then(function(data) {
+			content.userProfile = data.data;
+
+			// Role
+			content.userProfile.roles = {};
+			$.each(content.userProfile.authorities, function(i, role) {
+				content.userProfile.roles[role.authority] = true;
+			});
+		});
+		return _promise;
+	};
+
+	content._promise = function() {
+		if(!_promise) {
+			content.refresh();
+		}
+		return _promise;
+	};
+
+	return content;
+});
+
+eagleApp.service('Entities', function($http, $q, $rootScope, $location, Authorization) {
+	// Query
+	function _query(name, kvs) {
+		kvs = kvs || {};
+		var _list = [];
+		var _condition = kvs._condition || {};
+		var _addtionalCondition = _condition.additionalCondition || {};
+
+		// Initial
+		// > Condition
+		delete kvs._condition;
+		if(_condition) {
+			kvs.condition = _condition.condition;
+		}
+
+		// > Values
+		if(!kvs.values) {
+			kvs.values = "*";
+		} else if($.isArray(kvs.values)) {
+			kvs.values = $.map(kvs.values, function(field) {
+				return (field[0] === "@" ? '' : '@') + field;
+			}).join(",");
+		}
+
+		var _url = app.getURL(name, kvs);
+
+		// Fill special parameters
+		// > Query by time duration
+		if(_addtionalCondition._duration) {
+			var _endTime = app.time.now();
+			var _startTime = _endTime.clone().subtract(_addtionalCondition._duration, "ms");
+
+			// Debug usage. Extend more time duration for end time
+			if(_addtionalCondition.__ETD) {
+				_endTime.add(_addtionalCondition.__ETD, "ms");
+			}
+
+			_addtionalCondition._startTime = _startTime;
+			_addtionalCondition._endTime = _endTime;
+
+			var _startTimeStr = _startTime.format("YYYY-MM-DD HH:mm:ss");
+			var _endTimeStr = _endTime.clone().add(1, "s").format("YYYY-MM-DD HH:mm:ss");
+
+			_url += "&startTime=" + _startTimeStr + "&endTime=" + _endTimeStr;
+		} else if(_addtionalCondition._startTime && _addtionalCondition._endTime) {
+			var _startTimeStr = _addtionalCondition._startTime.format("YYYY-MM-DD HH:mm:ss");
+			var _endTimeStr = _addtionalCondition._endTime.clone().add(1, "s").format("YYYY-MM-DD HH:mm:ss");
+
+			_url += "&startTime=" + _startTimeStr + "&endTime=" + _endTimeStr;
+		}
+
+		// > Query contains metric name
+		if(_addtionalCondition._metricName) {
+			_url += "&metricName=" + _addtionalCondition._metricName;
+		}
+
+		// > Customize page size
+		if(_addtionalCondition._pageSize) {
+			_url = _url.replace(/pageSize=\d+/, "pageSize=" + _addtionalCondition._pageSize);
+		}
+
+		// AJAX
+		var canceler = $q.defer();
+		_list._promise = $http.get(_url, {timeout: canceler.promise}).success(function(data) {
+			_list.push.apply(_list, data.obj);
+		});
+		_list._promise.abort = function() {
+			canceler.resolve();
+		};
+
+		_list._promise.then(function() {}, function(data) {
+			if(data.status === 403) {
+				Authorization.isLogin = false;
+				$location.path("/dam/login");
+			}
+		});
+
+		return _list;
+	}
+	function _post(url, entities) {
+		var _list = [];
+		_list._promise = $http({
+			method: 'POST',
+			url: url,
+			headers: {
+				"Content-Type": "application/json"
+			},
+			data: entities
+		}).success(function(data) {
+			_list.push.apply(_list, data.obj);
+		});
+		return _list;
+	}
+	function _delete(url) {
+		var _list = [];
+		_list._promise = $http({
+			method: 'DELETE',
+			url: url,
+			headers: {
+				"Content-Type": "application/json"
+			},
+		}).success(function(data) {
+			_list.push.apply(_list, data.obj);
+		});
+		return _list;
+	}
+	function _parseCondition(condition) {
+		var _this = this;
+		_this.condition = "";
+		_this.additionalCondition = {};
+
+		if(typeof condition === "string") {
+			_this.condition = condition;
+		} else {
+			_this.condition = $.map(condition, function(value, key) {
+				if(!key.match(/^_/)) {
+					if(value === undefined || value === null) {
+						return '@' + key + '=~".*"';
+					} else {
+						return '@' + key + '="' + value + '"';
+					}
+				} else {
+					_this.additionalCondition[key] = value;
+					return null;
+				}
+			}).join(" AND ");
+		}
+		return _this;
+	}
+
+	var pkg = {
+		_query: _query,
+		_post: _post,
+
+		updateEntity: function(serviceName, entities, config) {
+			config = config || {};
+			if(!$.isArray(entities)) entities = [entities];
+
+			// Post clone entities
+			var _entities = $.map(entities, function(entity) {
+				var _entity = {};
+
+				// Clone variables
+				$.each(entity, function(key, value) {
+					// Skip inner variables
+					if(!key.match(/^__/)) {
+						_entity[key] = entity[key];
+					}
+				});
+
+				// Add timestamp
+				if(config.timestamp !== false) {
+					if(config.createTime !== false && !_entity.createdTime) {
+						_entity.createdTime = new moment().valueOf();
+					}
+					if(config.lastModifiedDate !== false) {
+						_entity.lastModifiedDate = new moment().valueOf();
+					}
+				}
+
+				return _entity;
+			});
+
+			return _post(app.getURL("updateEntity", {serviceName: serviceName}), _entities);
+		},
+
+		deleteEntity: function(serviceName, entities) {
+			if(!$.isArray(entities)) entities = [entities];
+
+			var _entities = $.map(entities, function(entity) {
+				return typeof entity === "object" ? entity.encodedRowkey : entity;
+			});
+			return _post(app.getURL("deleteEntity", {serviceName: serviceName}), _entities);
+		},
+		deleteEntities: function(serviceName, condition) {
+			return _delete(app.getURL("deleteEntities", {serviceName: serviceName, condition: new _parseCondition(condition).condition}));
+		},
+
+		queryEntity: function(serviceName, encodedRowkey) {
+			return _query("queryEntity", {serviceName: serviceName, encodedRowkey: encodedRowkey});
+		},
+		queryEntities: function(serviceName, condition, fields) {
+			return _query("queryEntities", {serviceName: serviceName, _condition: new _parseCondition(condition), values: fields});
+		},
+		queryGroup: function(serviceName, condition, groupBy, fields) {
+			return _query("queryGroup", {serviceName: serviceName, _condition: new _parseCondition(condition), groupBy: groupBy, values: fields});
+		},
+		querySeries: function(serviceName, condition, groupBy, fields, intervalmin) {
+			var _cond = new _parseCondition(condition);
+			var _list = _query("querySeries", {serviceName: serviceName, _condition: _cond, groupBy: groupBy, values: fields, intervalmin: intervalmin});
+			_list._promise.success(function() {
+				if(_list.length === 0) {
+					_list._empty = true;
+					_list._convert = true;
+
+					for(var i = 0; i <= (_cond.additionalCondition._endTime.valueOf() - _cond.additionalCondition._startTime.valueOf()) / (1000 * 60 * intervalmin); i += 1) {
+						_list.push(0);
+					}
+				} else if(_list.length === 1) {
+					_list._convert = true;
+					var _unit = _list.pop();
+					_list.push.apply(_list, _unit.value[0]);
+				}
+
+				if(_list._convert) {
+					var _current = _cond.additionalCondition._startTime.clone();
+					$.each(_list, function(i, value) {
+						_list[i] = [_current.valueOf(), value];
+						_current.add(intervalmin, "m");
+					});
+				}
+			});
+			return _list;
+		},
+
+		query: function(path, params) {
+			var _list = [];
+			_list._promise = $http({
+				method: 'GET',
+				url: app.getURL("query") + path,
+				params: params
+			}).success(function(data) {
+				_list.push.apply(_list, data.obj);
+			});
+			return _list;
+		},
+
+		dialog: function(data, callback) {
+			if(data.success === false || (data.exception || "").trim()) {
+				return $.dialog({
+					title: "OPS",
+					content: $("<pre>").html(data.exception)
+				}, callback);
+			}
+			return false;
+		},
+	};
+	return pkg;
+});
+
+eagleApp.filter('parseJSON', function() {
+	return function(input, defaultVal) {
+		return common.parseJSON(input, defaultVal);
+	};
+});
+
+eagleApp.filter('split', function() {
+	return function(input, regex) {
+		return input.split(regex);
+	};
+});
+
+eagleApp.filter('reverse', function() {
+	return function(items) {
+		return items.slice().reverse();
+	};
+});
+
+eagleApp.controller('MainCtrl', function($scope, $location, $http, globalContent, Site, Authorization, Entities) {
+	window.globalContent = $scope.globalContent = globalContent;
+	window.site = $scope.site = Site;
+	window.auth = $scope.auth = Authorization;
+	window.entities = $scope.entities = Entities;
+	$scope.app = app;
+
+	// Clean up
+	$scope.$on('$routeChangeStart', function(event, next, current) {
+		// Page initialization
+		globalContent.pageTitle = "";
+		globalContent.pageSubTitle = "";
+		globalContent.hideSite = false;
+		globalContent.lockSite = false;
+		globalContent.hideSidebar = false;
+		globalContent.hideUser = false;
+
+		// Authorization
+		// > Login check
+		if(!common.getValueByPath(next, "access.skipCheck", false)) {
+			if(!Authorization.isLogin) {
+				$location.path("/dam/login");
+			}
+		}
+
+		// > Role control
+		var _roles = common.getValueByPath(next, "access.roles", []);
+		if(_roles.length && Authorization.userProfile.roles) {
+			var _roleMatch = false;
+			$.each(_roles, function(i, roleName) {
+				if(Authorization.isRole(roleName)) {
+					_roleMatch = true;
+					return false;
+				}
+			});
+
+			if(!_roleMatch) {
+				$location.path("/dam");
+			}
+		}
+	});
+
+	// Get side bar navigation item class
+	$scope.getNavClass = function(page) {
+		var path = page.url.replace(/^#/, '');
+
+		if ($location.path() == path) {
+			globalContent.pageTitle = globalContent.pageTitle || page.title;
+			return "active";
+		} else {
+			return "";
+		}
+	};
+
+	// Get side bar navigation item class visible
+	$scope.getNavVisible = function(page) {
+		if(!page.roles) return true;
+
+		for(var i = 0 ; i < page.roles.length ; i += 1) {
+			var roleName = page.roles[i];
+			if(Authorization.isRole(roleName)) {
+				return true;
+			}
+		}
+
+		return false;
+	};
+
+	// Authorization
+	$scope.logout = function() {
+		Authorization.logout();
+		$location.path("/dam/login");
+	};
+});



Mime
View raw message