修正一处手误。

pull/32/head
Apex Liu 2017-04-17 12:16:48 +08:00
parent f9ae8029f2
commit 1db6a66ba1
3 changed files with 8 additions and 7 deletions

View File

@ -73,6 +73,7 @@ class BuilderWin(BuilderBase):
utils.copy_ex(out_path, bin_path, 'tp_web.exe')
utils.copy_ex(out_path, bin_path, 'tp_core.exe')
utils.copy_ex(out_path, bin_path, 'tpssh.dll')
utils.copy_ex(out_path, bin_path, 'tprdp.dll')
utils.copy_ex(os.path.join(env.root_path, 'out', 'pysrt'), bin_path, (ctx.dist_path, 'pysrt'))

View File

@ -900,8 +900,12 @@ class SysUserAdd(TPBaseUserAuthJsonHandler):
args['user_pswd'] = return_data['data']
if host.sys_user_add(args) < 0:
return self.write_json(-1)
user_id = host.sys_user_add(args)
if user_id < 0:
if user_id == -100:
return self.write_json(user_id, '同名账户已经存在!')
else:
return self.write_json(user_id, '数据库操作失败!')
return self.write_json(0)

View File

@ -669,14 +669,11 @@ ywl.create_host_edit_dlg = function (tbl) {
};
dlg_edit_host.on_sys_type_change = function () {
dlg_edit_host.sys_type = parseInt($('#auth-sys-type').val());
console.log('sys-type', dlg_edit_host.sys_type, 'protocol:', dlg_edit_host.protocol);
if (dlg_edit_host.sys_type === OS_TYPE_WINDOWS) {// && dlg_edit_host.protocol === 0) {
dlg_edit_host.protocol = PROTOCOL_TYPE_RDP;
console.log('--1', dlg_edit_host.protocol);
}
else if (dlg_edit_host.sys_type === OS_TYPE_LINUX) {// && dlg_edit_host.protocol === 0) {
dlg_edit_host.protocol = PROTOCOL_TYPE_SSH;
console.log('--2', dlg_edit_host.protocol);
}
$('#host-protocol-type').val(dlg_edit_host.protocol);
@ -686,7 +683,6 @@ ywl.create_host_edit_dlg = function (tbl) {
dlg_edit_host.on_protocol_change = function () {
dlg_edit_host.protocol = parseInt($('#host-protocol-type').val());
console.log('xx', dlg_edit_host.protocol);
if (dlg_edit_host.protocol === PROTOCOL_TYPE_RDP)
$('#dlg-edit-host-protocol-port').val('3389');
else if (dlg_edit_host.protocol === PROTOCOL_TYPE_SSH)
@ -1266,7 +1262,7 @@ ywl.create_sys_user = function (tbl) {
dlg_sys_user.check_args = function () {
dlg_sys_user.auth_mode = parseInt($('#auth-user-type').val());
dlg_sys_user.user_name = parseInt($('#auth-user-host-username').val());
dlg_sys_user.user_name = $('#auth-user-host-username').val();
if (dlg_sys_user.auth_mode !== AUTH_NONE &&
dlg_sys_user.user_name.length === 0) {
ywl.notify_error('请输入系统用户名!');