1
|
<
input
enabled
=
""
onclick
=
"confirmAction('xxxxxxxxxx', 'xxxxxxxx', 'kill', true, 30)"
type
=
"button"
value
=
"Kill"
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
function
confirmAction(id, name, action, wait, defaultWait) {
var
opts = {
type:
'POST'
,
url:
'/topology/'
+ id +
'/'
+ action
};
if
(wait) {
var
waitSecs = prompt(
'Do you really want to '
+ action +
' topology "'
+ name +
'"? '
+
'If yes, please, specify wait time in seconds:'
,
defaultWait);
if
(waitSecs !=
null
&& waitSecs !=
""
&& ensureInt(waitSecs)) {
opts.url +=
'/'
+ waitSecs;
}
else
{
return
false
;
}
}
else
if
(!confirm(
'Do you really want to '
+ action +
' topology "'
+ name +
'"?'
)) {
return
false
;
}
$(
"input[type=button]"
).attr(
"disabled"
,
"disabled"
);
$.ajax(opts).always(
function
() {
window.location.reload();
}).fail(
function
() {
alert(
"Error while communicating with Nimbus."
)
});
return
false
;
}
|
1
|
/topology/xxxxx/kill/xxxx
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
upstream storm {
server 127.0.0.1:8888 weight=3 max_fails=3 fail_timeout=5s;
}
server {
server_name storm.xxx.com;
listen 80;
proxy_set_header Host $host;
proxy_read_timeout 3600;
proxy_set_header X-Forwarded-For $remote_addr;
access_log
/var/log/nginx/storm
.access.log main;
error_log
/var/log/nginx/storm
.error.log debug;
location ~*
/topology/
(.*)
/kill/
(.*) {
return
403;
}
location / {
proxy_pass http:
//storm
;
}
}
|
1
2
3
4
5
|
<
div
id
=
"topology-actions"
>
<
h2
class
=
"js-only"
>Topology actions</
h2
>
<
p
id
=
"topology-actions"
class
=
"js-only"
>
</
p
>
</
div
>
|