1
1
$ ( document ) . ready ( function ( ) {
2
+
2
3
function getRootPath ( ) {
3
4
var pathName = window . location . pathname . substring ( 1 ) ;
4
5
var webName = pathName == '' ? '' : pathName . substring ( 0 , pathName . indexOf ( '/' ) ) ;
5
6
return window . location . protocol + '//' + window . location . host + '/' + webName ;
6
7
}
8
+
7
9
var stack_bar_top = { "dir1" : "up" , "dir2" : "left" , "push" : "top" , "spacing1" : 0 , "spacing2" : 15 } ;
8
10
$ ( '.startbtn' ) . click ( function ( ) {
9
11
container_id = $ ( this ) . attr ( 'value' ) ;
10
12
container_name = $ ( this ) . attr ( 'data-name' ) ;
11
13
$ . ajax ( {
12
- url : "/control/container/start_container" , //请求的url地址
13
- dataType : "json" , //返回格式为json
14
- async : true , //请求是否异步,默认为异步,这也是ajax重要特性
15
- data : { "container_id" : container_id , "container_name" : container_name } , //参数值
16
- type : "POST" , //请求方式
14
+ url : "/control/container/start_container" ,
15
+ dataType : "json" ,
16
+ async : true ,
17
+ data : { "container_id" : container_id , "container_name" : container_name } ,
18
+ type : "POST" ,
17
19
success : function ( req ) {
18
20
createPNotify ( req [ 'title' ] , req [ 'text' ] , req [ 'status' ] ) ;
19
21
} , error : function ( req ) {
@@ -26,11 +28,11 @@ $(document).ready(function(){
26
28
container_id = $ ( this ) . attr ( 'value' ) ;
27
29
container_name = $ ( this ) . data ( 'name' ) ;
28
30
$ . ajax ( {
29
- url : "/control/container/stop_container" , //请求的url地址
30
- dataType : "json" , //返回格式为json
31
- async : true , //请求是否异步,默认为异步,这也是ajax重要特性
32
- data : { "container_id" : container_id , "container_name" : container_name } , //参数值
33
- type : "POST" , //请求方式
31
+ url : "/control/container/stop_container" ,
32
+ dataType : "json" ,
33
+ async : true ,
34
+ data : { "container_id" : container_id , "container_name" : container_name } ,
35
+ type : "POST" ,
34
36
success : function ( req ) {
35
37
createPNotify ( req [ 'title' ] , req [ 'text' ] , req [ 'status' ] ) ;
36
38
} , error : function ( req ) {
@@ -44,11 +46,11 @@ $(document).ready(function(){
44
46
shortID = container_id . substring ( 0 , 12 )
45
47
$ ( this ) . children ( 'span' ) . text ( '容器恢复中...' ) ;
46
48
$ . ajax ( {
47
- url : "/container/control/unpause" , //请求的url地址
48
- dataType : "json" , //返回格式为json
49
- async : true , //请求是否异步,默认为异步,这也是ajax重要特性
50
- data : { "container_id" : container_id } , //参数值
51
- type : "POST" , //请求方式
49
+ url : "/container/control/unpause" ,
50
+ dataType : "json" ,
51
+ async : true ,
52
+ data : { "container_id" : container_id } ,
53
+ type : "POST" ,
52
54
success : function ( req ) {
53
55
createPNotify ( req [ 'title' ] , req [ 'text' ] , req [ 'status' ] ) ;
54
56
} , error : function ( req ) {
@@ -62,11 +64,11 @@ $(document).ready(function(){
62
64
shortID = container_id . substring ( 0 , 12 )
63
65
$ ( this ) . children ( 'span' ) . text ( '容器暂停中...' ) ;
64
66
$ . ajax ( {
65
- url : "/container/control/pause" , //请求的url地址
66
- dataType : "json" , //返回格式为json
67
- async : true , //请求是否异步,默认为异步,这也是ajax重要特性
68
- data : { "container_id" : container_id } , //参数值
69
- type : "POST" , //请求方式
67
+ url : "/container/control/pause" ,
68
+ dataType : "json" ,
69
+ async : true ,
70
+ data : { "container_id" : container_id } ,
71
+ type : "POST" ,
70
72
success : function ( req ) {
71
73
createPNotify ( req [ 'title' ] , req [ 'text' ] , req [ 'status' ] ) ;
72
74
} , error : function ( req ) {
@@ -80,11 +82,11 @@ $(document).ready(function(){
80
82
shortID = container_id . substring ( 0 , 12 )
81
83
$ ( this ) . children ( 'span' ) . text ( '容器删除中...' ) ;
82
84
$ . ajax ( {
83
- url : "/container/control/delete" , //请求的url地址
84
- dataType : "json" , //返回格式为json
85
- async : true , //请求是否异步,默认为异步,这也是ajax重要特性
86
- data : { "container_id" : container_id } , //参数值
87
- type : "POST" , //请求方式
85
+ url : "/container/control/delete" ,
86
+ dataType : "json" ,
87
+ async : true ,
88
+ data : { "container_id" : container_id } ,
89
+ type : "POST" ,
88
90
success : function ( req ) {
89
91
createPNotify ( req [ 'title' ] , req [ 'text' ] , req [ 'status' ] ) ;
90
92
} , error : function ( req ) {
@@ -97,11 +99,11 @@ $(document).ready(function(){
97
99
container_id = $ ( this ) . attr ( 'value' ) ;
98
100
container_name = $ ( this ) . attr ( 'data-name' ) ;
99
101
$ . ajax ( {
100
- url : "/control/container/follow" , //请求的url地址
101
- dataType : "json" , //返回格式为json
102
- async : true , //请求是否异步,默认为异步,这也是ajax重要特性
103
- data : { "container_id" : container_id } , //参数值
104
- type : "POST" , //请求方式
102
+ url : "/control/container/follow" ,
103
+ dataType : "json" ,
104
+ async : true ,
105
+ data : { "container_id" : container_id } ,
106
+ type : "POST" ,
105
107
success : function ( req ) {
106
108
createPNotify ( req [ 'title' ] , req [ 'text' ] , req [ 'status' ] ) ;
107
109
}
@@ -130,7 +132,7 @@ $(document).ready(function(){
130
132
} ) ;
131
133
132
134
$ ( '.refreshbtn' ) . click ( function ( ) {
133
- alert ( 'ok' ) ;
135
+
134
136
} ) ;
135
137
136
138
$ ( '#addHost_btn' ) . click ( function ( ) {
0 commit comments