优化jsite_server.js
This commit is contained in:
parent
5d8e22f579
commit
ea646f4106
@ -108,31 +108,6 @@ function restart_server(frm) {
|
|||||||
args: {
|
args: {
|
||||||
instance_id: frm.pg.instance_id,
|
instance_id: frm.pg.instance_id,
|
||||||
region_id: frm.pg.region
|
region_id: frm.pg.region
|
||||||
},
|
|
||||||
callback: function(r) {
|
|
||||||
if (r.success) {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('成功'),
|
|
||||||
message: __('重启命令已发送,请稍后刷新页面查看状态'),
|
|
||||||
indicator: 'green'
|
|
||||||
});
|
|
||||||
setTimeout(function() {
|
|
||||||
frm.reload_pg();
|
|
||||||
}, 3000);
|
|
||||||
} else {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('重启失败'),
|
|
||||||
message: r.message || r.error || __('未知错误'),
|
|
||||||
indicator: 'red'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: function(err) {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('重启失败'),
|
|
||||||
message: err.message,
|
|
||||||
indicator: 'red'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -144,32 +119,6 @@ function reset_password(frm, new_password) {
|
|||||||
instance_id: frm.pg.instance_id,
|
instance_id: frm.pg.instance_id,
|
||||||
password: new_password,
|
password: new_password,
|
||||||
region_id: frm.pg.region
|
region_id: frm.pg.region
|
||||||
},
|
|
||||||
callback: function(r) {
|
|
||||||
if (r.success) {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('成功'),
|
|
||||||
message: __('密码重置成功,新密码已保存到服务器记录中'),
|
|
||||||
indicator: 'green'
|
|
||||||
});
|
|
||||||
// 刷新页面以显示新密码
|
|
||||||
setTimeout(function() {
|
|
||||||
frm.reload_pg();
|
|
||||||
}, 2000);
|
|
||||||
} else {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('重置失败'),
|
|
||||||
message: r.message || r.error || __('未知错误'),
|
|
||||||
indicator: 'red'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: function(err) {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('重置失败'),
|
|
||||||
message: err.message,
|
|
||||||
indicator: 'red'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -179,32 +128,6 @@ function reset_key_pair(frm) {
|
|||||||
method: 'jcloud.api.aliyun_server_light.reset_server_key_pair',
|
method: 'jcloud.api.aliyun_server_light.reset_server_key_pair',
|
||||||
args: {
|
args: {
|
||||||
instance_id: frm.pg.instance_id
|
instance_id: frm.pg.instance_id
|
||||||
},
|
|
||||||
callback: function(r) {
|
|
||||||
if (r.success) {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('成功'),
|
|
||||||
message: __('密钥对重置成功,新的私钥已保存到服务器记录中'),
|
|
||||||
indicator: 'green'
|
|
||||||
});
|
|
||||||
// 刷新页面以显示新的密钥对信息
|
|
||||||
setTimeout(function() {
|
|
||||||
frm.reload_pg();
|
|
||||||
}, 2000);
|
|
||||||
} else {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('重置失败'),
|
|
||||||
message: r.message || r.error || __('未知错误'),
|
|
||||||
indicator: 'red'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: function(err) {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('重置失败'),
|
|
||||||
message: err.message,
|
|
||||||
indicator: 'red'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -215,32 +138,6 @@ function reset_system(frm) {
|
|||||||
args: {
|
args: {
|
||||||
instance_id: frm.pg.instance_id,
|
instance_id: frm.pg.instance_id,
|
||||||
region_id: frm.pg.region
|
region_id: frm.pg.region
|
||||||
},
|
|
||||||
callback: function(r) {
|
|
||||||
if (r.success) {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('成功'),
|
|
||||||
message: __('系统重置命令已发送,请稍后刷新页面查看状态'),
|
|
||||||
indicator: 'green'
|
|
||||||
});
|
|
||||||
// 刷新页面以显示最新状态
|
|
||||||
setTimeout(function() {
|
|
||||||
frm.reload_pg();
|
|
||||||
}, 3000);
|
|
||||||
} else {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('重置失败'),
|
|
||||||
message: r.message || r.error || __('未知错误'),
|
|
||||||
indicator: 'red'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: function(err) {
|
|
||||||
jingrow.msgprint({
|
|
||||||
title: __('重置失败'),
|
|
||||||
message: err.message,
|
|
||||||
indicator: 'red'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user