Commit 071116aa by 赵天增

success

parent 3e04856a
......@@ -55,12 +55,13 @@
</b></font>
</#if>
<#list instanceInfo.instances as instance>
<span hidden>${app.name}</span>
<#if instance.isHref>
<a href="${instance.url}" target="_blank">${instance.id}</a>
<#else>
${instance.id}
</#if>
<button class="cc" type="button" onclick="close()">关闭</button>
<button class="cc" type="button">关闭</button>
<#if instance_has_next>,</#if>
</#list>
</#list>
......@@ -123,12 +124,43 @@
<script type="text/javascript" src="eureka/js/wro.js"></script>
<script type="text/javascript">
$(document).ready(function () {
function domainURI(str) {
var durl = /http:\/\/([^\/]+)\//i;
domain = str.match(durl);
return domain[1];
}
$('.cc').click(function () {
debugger;
/*alert("弹出成功")*/
var str = $(this).prev().text();
console.log(str);
var instance = $(this).prev().text();
console.log(instance);
var appName = $(this).prev().prev().text();
console.log(appName);
var stopUrl = domainURI($(this).prev().attr("href"));
console.log(stopUrl);
var host = window.location.href;
$.ajax({
url: host + 'eureka/apps/' + appName + '/' + instance,
type: 'DELETE',
success: function () {
alert("从eureka删除实例成功");
},
error: function () {
alert("删除失败")
}
});
$.ajax({
url: "http://"+stopUrl+'/actuator/shutdown',
type: 'POST',
success: function () {
alert("停止实例成功");
},
error: function () {
alert("删除失败")
}
});
});
$('table.stripeable tr:odd').addClass('odd');
$('table.stripeable tr:even').addClass('even');
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment