diff --git a/client/tp_assist_win/site/index.html b/client/tp_assist_win/site/index.html
index cb6db67..55af950 100644
--- a/client/tp_assist_win/site/index.html
+++ b/client/tp_assist_win/site/index.html
@@ -23,7 +23,7 @@
@@ -40,6 +40,7 @@
+
此处配置保存到本地计算机上,如果更换计算机,需要重新配置!
注意:命令参数设置中,如需传递主机信息和登录信息,可以用以下变量替换(注意大小写!):
-
-
-
-
-
-
-
@@ -117,12 +111,6 @@
-
-
-
-
-
-
diff --git a/client/tp_assist_win/site/js/config.js b/client/tp_assist_win/site/js/config.js
index a4ac0aa..29a7cac 100644
--- a/client/tp_assist_win/site/js/config.js
+++ b/client/tp_assist_win/site/js/config.js
@@ -5,6 +5,8 @@ var g_url_base = 'http://127.0.0.1:50022';
var g_cfg = null;
var dom = {
+ version: $('#version'),
+
ssh_type: $('#ssh-type'),
ssh_app: $('#ssh-app'),
ssh_cmdline: $('#ssh-cmdline'),
@@ -23,6 +25,27 @@ var dom = {
btn_save: $('#btn-save')
};
+function get_version() {
+ $.ajax({
+ type: 'GET',
+ timeout: 5000,
+ url: g_url_base + '/api/get_version',
+ jsonp: 'callback',
+ dataType: 'json',
+ success: function (ret) {
+ if (ret.code == 0) {
+ dom.version.text('v' + ret.version);
+ } else {
+ alert("获取助手版本信息失败!");
+ }
+ },
+ error: function (jqXhr, _error, _e) {
+ console.log('state:', jqXhr.state());
+ alert("获取助手版本信息失败!");
+ }
+ });
+}
+
function get_config() {
$.ajax({
type: 'GET',
@@ -32,7 +55,6 @@ function get_config() {
dataType: 'json',
success: function (ret) {
if (ret.code == 0) {
- console.log(ret.data);
g_cfg = ret.data;
update_dom();
} else {
@@ -82,8 +104,6 @@ function update_dom() {
}
}
-
-
dom.scp_type.html('');
if (!_.isUndefined(g_cfg.scp)) {
if (_.isUndefined(g_cfg.scp.selected)) {
@@ -215,7 +235,8 @@ var select_local_file = function (callback) {
jsonp: 'callback',
dataType: 'json',
success: function (ret) {
- callback(0, ret.path);
+ if(ret.code === 0)
+ callback(0, ret.path);
},
error: function (jqXhr, _error, _e) {
console.log('state:', jqXhr.state());
@@ -249,6 +270,8 @@ function notify_success(message_, title_) {
};
$(document).ready(function () {
+ get_version();
+
get_config();
dom.ssh_type.change(function () {
@@ -322,81 +345,5 @@ $(document).ready(function () {
dom.btn_save.click(function () {
on_save();
- // var name = $("#ssh-client-type").val();
- // var path = $("#ssh-exec-path").val();
- // if (path == "") {
- // alert("请选择路径");
- // return;
- // }
- // var command_line = $("#ssh-exec-args").val();
- // if (command_line == "") {
- // alert("请输入命令行");
- // return;
- // }
- // set_current_client_config(1, name, path, command_line);
});
-
-
- // $("#sftp-client-type").change(function () {
- // var i = 0;
- // var name = $("#sftp-client-type").val();
- // var item = g_sftp_config_dict[name];
- // init_config_param(2, item.build_in, item.path, item.commandline);
- // g_current_sftp = item.name;
- // });
- // $("#sftp-select-path").click(function () {
- // open_exist_file(function (code, path) {
- // if (code == 0) {
- // $("#sftp-exec-path").val(path);
- // } else {
- // console.log("can not select file.");
- // }
- // });
- // });
- // $("#sftp-btn-save").click(function () {
- // var name = $("#sftp-client-type").val();
- // var path = $("#sftp-exec-path").val();
- // if (path == "") {
- // alert("请选择路径");
- // return;
- // }
- // var command_line = $("#sftp-exec-args").val();
- // if (command_line == "") {
- // alert("请输入命令行");
- // return;
- // }
- // set_current_client_config(2, name, path, command_line);
- // });
- //
- //
- // $("#telnet-client-type").change(function () {
- // var i = 0;
- // var name = $("#telnet-client-type").val();
- // var item = g_telnet_config_dict[name];
- // init_config_param(3, item.build_in, item.path, item.commandline);
- // g_current_telnet = item.name;
- // });
- // $("#telnet-select-path").click(function () {
- // open_exist_file(function (code, path) {
- // if (code == 0) {
- // $("#telnet-exec-path").val(path);
- // } else {
- // console.log("can not select file.");
- // }
- // });
- // });
- // $("#telnet-btn-save").click(function () {
- // var name = $("#telnet-client-type").val();
- // var path = $("#telnet-exec-path").val();
- // if (path == "") {
- // alert("请选择路径");
- // return;
- // }
- // var command_line = $("#telnet-exec-args").val();
- // if (command_line == "") {
- // alert("请输入命令行");
- // return;
- // }
- // set_current_client_config(3, name, path, command_line);
- // });
});
\ No newline at end of file
diff --git a/client/tp_assist_win/ts_http_rpc.cpp b/client/tp_assist_win/ts_http_rpc.cpp
index 12af0ba..8f8614c 100644
--- a/client/tp_assist_win/ts_http_rpc.cpp
+++ b/client/tp_assist_win/ts_http_rpc.cpp
@@ -1331,6 +1331,7 @@ void TsHttpRpc::_rpc_func_file_action(const ex_astr& func_args, ex_astr& buf) {
ex_astr utf8_path;
ex_wstr2astr(wszReturnPath, utf8_path, EX_CODEPAGE_UTF8);
Json::Value root;
+ root["code"] = TPE_OK;
root["path"] = utf8_path;
_create_json_ret(buf, root);
diff --git a/server/tp_core/common/base_record.h b/server/tp_core/common/base_record.h
index d6d1b7c..b7c60bd 100644
--- a/server/tp_core/common/base_record.h
+++ b/server/tp_core/common/base_record.h
@@ -30,8 +30,8 @@ typedef struct TS_RECORD_HEADER_BASIC
ex_u64 timestamp; // ¼ʼʱ䣨UTCʱ
ex_u16 width; // ʼĻߴ磺
ex_u16 height; // ʼĻߴ磺
- char user_username[32]; // teleport˺
- char acc_username[32]; // Զû
+ char user_username[64]; // teleport˺
+ char acc_username[64]; // Զû
char host_ip[40]; // ԶIP
char conn_ip[40]; // ԶIP
@@ -42,7 +42,7 @@ typedef struct TS_RECORD_HEADER_BASIC
// RDPר
ex_u8 rdp_security; // 0 = RDP, 1 = TLS
- ex_u8 reserve[256 - 4 - 2 - 2 - 2 - 8 - 2 - 2 - 32 - 32 - 40 - 2 - 40 - 40 - 1 - 12]; // У12BΪheader-infoĿռ
+ ex_u8 reserve[512 - 4 - 2 - 2 - 2 - 8 - 2 - 2 - 64 - 64 - 40 - 2 - 40 - 40 - 1 - 12]; // У12BΪheader-infoĿռ
}TS_RECORD_HEADER_BASIC;
#define ts_record_header_basic_size sizeof(TS_RECORD_HEADER_BASIC)
@@ -52,7 +52,7 @@ typedef struct TS_RECORD_HEADER
TS_RECORD_HEADER_BASIC basic;
}TS_RECORD_HEADER;
-// header֣header-info + header-basic = 256B
+// header֣header-info + header-basic = 512B
#define ts_record_header_size sizeof(TS_RECORD_HEADER)
diff --git a/server/tp_core/common/protocol_interface.h b/server/tp_core/common/protocol_interface.h
index 49966ce..1a28562 100644
--- a/server/tp_core/common/protocol_interface.h
+++ b/server/tp_core/common/protocol_interface.h
@@ -71,6 +71,7 @@ extern "C"
TPP_API ex_rv tpp_init(TPP_INIT_ARGS* init_args);
TPP_API ex_rv tpp_start(void);
TPP_API ex_rv tpp_stop(void);
+ TPP_API void tpp_timer(void);
#ifdef __cplusplus
}
@@ -78,6 +79,7 @@ extern "C"
typedef ex_rv (*TPP_INIT_FUNC)(TPP_INIT_ARGS* init_args);
typedef ex_rv (*TPP_START_FUNC)(void);
-typedef ex_rv (*TPP_STOP_FUNC)(void);
+typedef ex_rv(*TPP_STOP_FUNC)(void);
+typedef void(*TPP_TIMER_FUNC)(void);
#endif // __TP_PROTOCOL_INTERFACE_H__
diff --git a/server/tp_core/core/main.cpp b/server/tp_core/core/main.cpp
index a212c64..5e89d56 100644
--- a/server/tp_core/core/main.cpp
+++ b/server/tp_core/core/main.cpp
@@ -1,6 +1,7 @@
#include "ts_env.h"
#include "ts_ver.h"
#include "ts_main.h"
+#include "ts_http_client.h"
#include