mirror of https://github.com/tp4a/teleport
fix rdp replay data file re-location.
parent
4c47d82c68
commit
9bce1dbe1d
|
@ -63,7 +63,7 @@ bool TsEnv::init(bool load_config)
|
||||||
#else
|
#else
|
||||||
m_etc_path = L"/etc/teleport";
|
m_etc_path = L"/etc/teleport";
|
||||||
conf_file = L"/etc/teleport/core.ini";
|
conf_file = L"/etc/teleport/core.ini";
|
||||||
m_replay_path = L"/var/lib/teleport/data/replay";
|
m_replay_path = L"/var/lib/teleport/replay";
|
||||||
log_path = L"/var/log/teleport";
|
log_path = L"/var/log/teleport";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,8 @@ controllers = [
|
||||||
# add another path to static-path
|
# add another path to static-path
|
||||||
|
|
||||||
# todo: 重放数据路径是动态从core服务的json-rpc接口获取的,因此这里的数据获取方式需要改变
|
# todo: 重放数据路径是动态从core服务的json-rpc接口获取的,因此这里的数据获取方式需要改变
|
||||||
(r"/log/replay/(.*)", tornado.web.StaticFileHandler, {"path": os.path.join(cfg.data_path, 'replay')}),
|
#(r"/log/replay/(.*)", tornado.web.StaticFileHandler, {"path": os.path.join(cfg.data_path, 'replay')}),
|
||||||
|
(r"/log/replay/(.*)", record.ReplayStaticFileHandler, {"path": os.path.join(cfg.data_path, 'replay')}),
|
||||||
|
|
||||||
(r'/log/list', record.LogList),
|
(r'/log/list', record.LogList),
|
||||||
(r'/log/record/(.*)/(.*)', record.RecordHandler),
|
(r'/log/record/(.*)/(.*)', record.RecordHandler),
|
||||||
|
|
|
@ -9,6 +9,7 @@ from eom_app.app.configs import app_cfg
|
||||||
from eom_app.module import record
|
from eom_app.module import record
|
||||||
from eom_app.module import user
|
from eom_app.module import user
|
||||||
from .base import TPBaseAdminAuthHandler, TPBaseAdminAuthJsonHandler
|
from .base import TPBaseAdminAuthHandler, TPBaseAdminAuthJsonHandler
|
||||||
|
import tornado.web
|
||||||
|
|
||||||
|
|
||||||
def get_free_space_bytes(folder):
|
def get_free_space_bytes(folder):
|
||||||
|
@ -61,6 +62,12 @@ class RecordHandler(TPBaseAdminAuthHandler):
|
||||||
# # pass
|
# # pass
|
||||||
# filename = os.path.join(cfg.core.replay_path, 'replay', 'rdp', '{}'.format(record_id), 'tp-rdp.tpr')
|
# filename = os.path.join(cfg.core.replay_path, 'replay', 'rdp', '{}'.format(record_id), 'tp-rdp.tpr')
|
||||||
|
|
||||||
|
class ReplayStaticFileHandler(tornado.web.StaticFileHandler):
|
||||||
|
def initialize(self, path, default_filename=None):
|
||||||
|
super().initialize(path, default_filename)
|
||||||
|
self.root = app_cfg().core.replay_path
|
||||||
|
# self.default_filename = default_filename
|
||||||
|
|
||||||
|
|
||||||
class ComandLogHandler(TPBaseAdminAuthHandler):
|
class ComandLogHandler(TPBaseAdminAuthHandler):
|
||||||
def get(self, protocol, record_id):
|
def get(self, protocol, record_id):
|
||||||
|
|
Loading…
Reference in New Issue