[유치수] [NOBTS] 서버노드 클릭하며 서버 목록 보여줌.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-web/trunk@1278 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Chisu Yu
2013-03-04 07:06:29 +00:00
parent acde379e02
commit 5dbeceafae
2 changed files with 20 additions and 2 deletions
@@ -24,15 +24,19 @@ function drawSpringy(graphdata, targetId, width, height) {
for(var i=0; i<aNodes.length; i++){
aoNodes[i] = graph.newNode({
label: aNodes[i].name,
helth : aNodes[i].helth,
serviceType : aNodes[i].serviceType,
width : 100,
height : 80,
server : aNodes[i].agentIds,
onMouseOver : function(e){
$('#console').val('Node onMouseOver : ' + this.id + '\r' + $('#console').val())
},
onMouseClick : function(e){
$('#console').val('Node onMouseClick : ' + this.id + '\r' + $('#console').val())
// $('#console').val('Node onMouseClick : ' + this.id + '\r' + $('#console').val())
if (this.data.server.length > 0) {
var htOffset = $(targetId).offset();
$('#ServerBox').tmpl(this.data).css({'top':e.pageY - htOffset.top, 'left':e.pageX - htOffset.left}).appendTo(targetId);
}
}
});
}
+14
View File
@@ -548,5 +548,19 @@ $(document).ready(function () {
<button style="position:absolute;top:2px;right:2px;" onClick="$(this).parent().remove()">X</button>
</div>
</script>
<script id="ServerBox" type="text/x-jquery-tmpl">
<div class="ServerBox" style="position:absolute;border:1px solid #000;background:#fff;padding:5px 10px;-webkit-border-radius: 5px; ">
<ul style="margin:0;padding:0 0 0 10px;">
Hosts
<ul>
{{each(key, value) server}}
<li>${value}</li>
{{/each}}
</ul>
</li>
</ul>
<button style="position:absolute;top:2px;right:2px;" onClick="$(this).parent().remove()">X</button>
</div>
</script>
</body>
</html>