mirror of https://github.com/tp4a/teleport
temp: add dashboard.
parent
750df290c8
commit
b485eb7857
|
@ -210,6 +210,7 @@
|
|||
<ClInclude Include="..\common\ts_const.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="ts_crypto.h" />
|
||||
<ClInclude Include="ts_ver.h" />
|
||||
<ClInclude Include="ts_web_rpc.h" />
|
||||
<ClInclude Include="ts_env.h" />
|
||||
<ClInclude Include="ts_http_client.h" />
|
||||
|
|
|
@ -177,6 +177,9 @@
|
|||
<ClInclude Include="ts_web_rpc.h">
|
||||
<Filter>main app</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ts_ver.h">
|
||||
<Filter>main app</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="tp_core.rc">
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "ts_http_rpc.h"
|
||||
#include "ts_ver.h"
|
||||
#include "ts_env.h"
|
||||
#include "ts_session.h"
|
||||
#include "ts_crypto.h"
|
||||
|
@ -287,6 +288,12 @@ void TsHttpRpc::_rpc_func_get_config(const Json::Value& json_param, ex_astr& buf
|
|||
ex_wstr2astr(g_env.m_replay_path, _replay_name);
|
||||
jr_data["replay-path"] = _replay_name;
|
||||
|
||||
jr_data["web-server-rpc"] = g_env.web_server_rpc;
|
||||
|
||||
ex_astr _version;
|
||||
ex_wstr2astr(TP_SERVER_VER, _version);
|
||||
jr_data["version"] = _version;
|
||||
|
||||
ExIniFile& ini = g_env.get_ini();
|
||||
ex_ini_sections& secs = ini.GetAllSections();
|
||||
ex_ini_sections::iterator it = secs.begin();
|
||||
|
|
|
@ -28,15 +28,16 @@ class ConfigFile(AttrDict):
|
|||
super().__init__(**kwargs)
|
||||
|
||||
self['core'] = AttrDict()
|
||||
self['core']['ssh'] = AttrDict()
|
||||
self['core']['ssh']['enable'] = False
|
||||
self['core']['ssh']['port'] = 0 # 52189
|
||||
self['core']['rdp'] = AttrDict()
|
||||
self['core']['rdp']['enable'] = False
|
||||
self['core']['rdp']['port'] = 0 # 52089
|
||||
self['core']['telnet'] = AttrDict()
|
||||
self['core']['telnet']['enable'] = False
|
||||
self['core']['telnet']['port'] = 0 # 52389
|
||||
self['core']['detected'] = False
|
||||
# self['core']['ssh'] = AttrDict()
|
||||
# self['core']['ssh']['enable'] = False
|
||||
# self['core']['ssh']['port'] = 0 # 52189
|
||||
# self['core']['rdp'] = AttrDict()
|
||||
# self['core']['rdp']['enable'] = False
|
||||
# self['core']['rdp']['port'] = 0 # 52089
|
||||
# self['core']['telnet'] = AttrDict()
|
||||
# self['core']['telnet']['enable'] = False
|
||||
# self['core']['telnet']['port'] = 0 # 52389
|
||||
|
||||
def load(self, cfg_file):
|
||||
if not os.path.exists(cfg_file):
|
||||
|
@ -87,9 +88,15 @@ class ConfigFile(AttrDict):
|
|||
return True
|
||||
|
||||
def update_core(self, conf_data):
|
||||
try:
|
||||
log.d('update core server config info.\n')
|
||||
self['core'] = AttrDict()
|
||||
|
||||
if conf_data is None:
|
||||
log.w('core server config info is empty.\n')
|
||||
self['core']['detected'] = False
|
||||
return True
|
||||
|
||||
try:
|
||||
self['core']['ssh'] = AttrDict()
|
||||
self['core']['ssh']['enable'] = False
|
||||
self['core']['ssh']['port'] = 52189
|
||||
|
@ -111,11 +118,15 @@ class ConfigFile(AttrDict):
|
|||
self['core']['telnet']['enable'] = conf_data['telnet']['enable']
|
||||
self['core']['telnet']['port'] = conf_data['telnet']['port']
|
||||
|
||||
if 'replay-path' in conf_data:
|
||||
self['core']['replay_path'] = conf_data['replay-path']
|
||||
|
||||
# TODO: ...
|
||||
if 'web_server_rpc' in conf_data:
|
||||
self['core']['web_server_rpc'] = conf_data['web_server_rpc']
|
||||
if 'web-server-rpc' in conf_data:
|
||||
self['core']['web_server_rpc'] = conf_data['web-server-rpc']
|
||||
if 'version' in conf_data:
|
||||
self['core']['version'] = conf_data['version']
|
||||
|
||||
self['core']['detected'] = True
|
||||
|
||||
except IndexError:
|
||||
log.e('invalid core config.\n')
|
||||
|
|
|
@ -80,7 +80,7 @@ class WebServerCore:
|
|||
x = json.loads(body)
|
||||
cfg.update_core(x['data'])
|
||||
except:
|
||||
log.w('can not connect to core server for get config, maybe it not start yet, ignore.\n')
|
||||
log.w('can not connect to core server to get config, maybe it not start yet, ignore.\n')
|
||||
|
||||
def run(self):
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
from . import dashboard
|
||||
from . import rpc
|
||||
from . import auth
|
||||
from . import host
|
||||
|
@ -21,6 +22,8 @@ cfg = app_cfg()
|
|||
__all__ = ['controllers']
|
||||
|
||||
controllers = [
|
||||
(r'/dashboard', dashboard.IndexHandler),
|
||||
|
||||
(r'/', index.IndexHandler),
|
||||
|
||||
(r'/maintenance/install', maintenance.InstallHandler),
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import tornado.ioloop
|
||||
from .base import TPBaseAdminAuthHandler
|
||||
|
||||
|
||||
class IndexHandler(TPBaseAdminAuthHandler):
|
||||
def get(self):
|
||||
self.render('dashboard/index.mako')
|
|
@ -30,11 +30,18 @@ class IndexHandler(TPBaseUserAuthHandler):
|
|||
|
||||
param = dict()
|
||||
|
||||
if cfg.core.detected:
|
||||
param['core'] = {
|
||||
'ssh_port': cfg.core.ssh.port,
|
||||
'rdp_port': cfg.core.rdp.port,
|
||||
'telnet_port': cfg.core.telnet.port
|
||||
}
|
||||
else:
|
||||
param['core'] = {
|
||||
'ssh_port': 0,
|
||||
'rdp_port': 0,
|
||||
'telnet_port': 0
|
||||
}
|
||||
|
||||
param['group_list'] = host.get_group_list()
|
||||
|
||||
|
|
|
@ -68,8 +68,6 @@ class RpcHandler(TPBaseJsonHandler):
|
|||
return self.write_json(0, data=x)
|
||||
elif authid < 0:
|
||||
x = web_session().taken('tmp-auth-info-{}'.format(authid), None)
|
||||
log.d("[rpc] get_auth_info(): ", x)
|
||||
log.d("\n")
|
||||
return self.write_json(0, data=x)
|
||||
else:
|
||||
return self.write_json(-1, message='invalid auth id.')
|
||||
|
|
|
@ -1,51 +1,39 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import json
|
||||
import os
|
||||
import platform
|
||||
# import re
|
||||
# import socket
|
||||
# import subprocess
|
||||
import threading
|
||||
import time
|
||||
import tornado.gen
|
||||
import tornado.httpclient
|
||||
|
||||
from eom_ver import *
|
||||
from eom_app.app.configs import app_cfg
|
||||
# from eom_app.module import host
|
||||
from eom_app.module import set
|
||||
from eom_app.app.util import *
|
||||
from .base import TPBaseAdminAuthHandler, TPBaseAdminAuthJsonHandler
|
||||
|
||||
cfg = app_cfg()
|
||||
|
||||
|
||||
# def get_local_ip():
|
||||
# iplist = []
|
||||
# PLATFORM = platform.system().lower()
|
||||
# try:
|
||||
# if PLATFORM == "windows":
|
||||
# ip_info = socket.gethostbyname_ex(socket.gethostname())
|
||||
# return ip_info[2]
|
||||
# else:
|
||||
# ipstr = '([0-9]{1,3}\.){3}[0-9]{1,3}'
|
||||
# ipconfig_process = subprocess.Popen("ifconfig", stdout=subprocess.PIPE)
|
||||
# output = ipconfig_process.stdout.read()
|
||||
# ip_pattern = re.compile('(inet addr:%s)' % ipstr)
|
||||
# pattern = re.compile(ipstr)
|
||||
#
|
||||
# for ipaddr in re.finditer(ip_pattern, str(output)):
|
||||
# ip = pattern.search(ipaddr.group())
|
||||
# if ip.group() != "127.0.0.1":
|
||||
# iplist.append(ip.group())
|
||||
# return iplist
|
||||
# except Exception:
|
||||
# return iplist
|
||||
|
||||
|
||||
class InfoHandler(TPBaseAdminAuthHandler):
|
||||
@tornado.gen.coroutine
|
||||
def get(self):
|
||||
core_detected = False
|
||||
req = {'method': 'get_config', 'param': []}
|
||||
_yr = async_post_http(req)
|
||||
return_data = yield _yr
|
||||
if return_data is not None:
|
||||
if 'code' in return_data:
|
||||
_code = return_data['code']
|
||||
if _code == 0:
|
||||
# core['detected'] = True
|
||||
cfg.update_core(return_data['data'])
|
||||
core_detected = True
|
||||
|
||||
if not core_detected:
|
||||
cfg.update_core(None)
|
||||
|
||||
param = {
|
||||
'core': cfg.core,
|
||||
'web': {
|
||||
'version': TS_VER,
|
||||
'core_server_rpc': cfg['core_server_rpc']
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +45,6 @@ class DatabaseHandler(TPBaseAdminAuthHandler):
|
|||
param = {'core_server': cfg.core}
|
||||
self.render('set/database.mako', page_param=json.dumps(param))
|
||||
|
||||
|
||||
# def _restart_func():
|
||||
# time.sleep(1)
|
||||
#
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
@charset "utf-8";.page-content{padding:15px 30px 15px 30px}.stats{overflow:hidden;padding:15px;color:#686868;background-color:#fff;border-radius:3px;margin-bottom:10px}.stats span.sub-name{font-size:11px;font-weight:300}.stats.stats-warning{position:relative;background-color:#c86124}.stats.stats-warning .stats-content{text-align:center;font-size:24px}.stats .loading{color:#fff;font-size:14px}.stats.stats-id-host{border-top:5px solid #407deb}.stats.stats-id-user{border-top:5px solid #eba61e}.stats.stats-id-connect{border-top:5px solid #14c13c}.stats.stats-box{position:relative;height:116px}.stats.stats-box .stats-content{padding-left:100px}.stats.stats-box .stats-icon{font-size:130px;line-height:130px;left:20px;text-align:center;position:absolute;color:rgba(0,0,0,0.05)}.stats.stats-box .stats-name{font-size:18px;font-weight:500;color:rgba(0,0,0,0.6)}.stats.stats-box .stats-value{margin-top:5px;color:rgba(0,0,0,0.6);font-size:48px;line-height:52px;font-weight:300;white-space:nowrap;padding-left:20px}.stats.stats-bar{position:relative;height:320px}.stats.stats-bar .stats-name{font-size:16px;font-weight:500;color:rgba(0,0,0,0.6)}.stats.stats-bar .stats-value{margin-top:5px;color:rgba(0,0,0,0.6);font-size:48px;line-height:52px;font-weight:300;white-space:nowrap;padding-left:20px}.stats.stats-first{border-left:none}.stats a{color:#eee;color:rgba(255,255,255,0.7)}.stats a:hover{color:#fff}
|
File diff suppressed because one or more lines are too long
|
@ -8,12 +8,23 @@ ywl.on_init = function (cb_stack, cb_args) {
|
|||
};
|
||||
|
||||
var html = [];
|
||||
html.push(ywl._make_info('核心服务通讯', ywl.page_options.web.core_server_rpc));
|
||||
html.push(ywl._make_info('WEB服务通讯', ywl.page_options.core.web_server_rpc));
|
||||
|
||||
// 版本号
|
||||
html.push(ywl._make_info('WEB服务版本', ywl.page_options.web.version));
|
||||
if (!ywl.page_options.core.detected) {
|
||||
html.push(ywl._make_info('核心服务版本', '<span class="error">未能连接到核心服务</span>'));
|
||||
} else {
|
||||
html.push(ywl._make_info('核心服务版本', ywl.page_options.core.version));
|
||||
}
|
||||
|
||||
html.push(ywl._make_info('核心服务通讯地址', ywl.page_options.web.core_server_rpc));
|
||||
if (ywl.page_options.core.detected) {
|
||||
html.push(ywl._make_info('WEB服务通讯地址', ywl.page_options.core.web_server_rpc));
|
||||
html.push(ywl._make_protocol_info('RDP 端口', ywl.page_options.core.rdp));
|
||||
html.push(ywl._make_protocol_info('SSH 端口', ywl.page_options.core.ssh));
|
||||
html.push(ywl._make_protocol_info('TELNET 端口', ywl.page_options.core.telnet));
|
||||
html.push(ywl._make_info('录像文件路径', ywl.page_options.core.replay_path));
|
||||
}
|
||||
|
||||
dom.info.append(html.join(''));
|
||||
|
||||
|
@ -28,16 +39,16 @@ ywl._make_protocol_info = function (name, p) {
|
|||
if (_.isUndefined(p))
|
||||
return ywl._make_info(name, '未能检测到');
|
||||
// <tr><td class="key">RDP 端口:</td><td class="value">52089</td></tr>
|
||||
var key = name;
|
||||
var val = p.port;
|
||||
if (!p.enable) {
|
||||
key += '(未启用)';
|
||||
val = '<span class="disabled">' + val + '(未启用)</span>';
|
||||
}
|
||||
|
||||
return ywl._make_info(key, p.port);
|
||||
return ywl._make_info(name, val);
|
||||
};
|
||||
|
||||
ywl._make_info = function (key, value) {
|
||||
if (_.isUndefined(value))
|
||||
value = '未能检测到';
|
||||
value = '<span class="error">未能检测到</span>';
|
||||
return '<tr><td class="key">' + key + ':</td><td class="value">' + value + '</td></tr>';
|
||||
};
|
||||
|
|
|
@ -0,0 +1,367 @@
|
|||
@charset "utf-8";
|
||||
@import "_color";
|
||||
|
||||
//@bg-color: #2c2c2c;
|
||||
//
|
||||
//body {
|
||||
// background-color: @bg-color;
|
||||
// color: #dfdfdf;
|
||||
//}
|
||||
//
|
||||
//.sidebar .nav-menu>li>a.active:after {
|
||||
// color: @bg-color;
|
||||
//}
|
||||
//
|
||||
//.navbar-default {
|
||||
// background: @bg-color;
|
||||
//
|
||||
// .breadcrumb {
|
||||
// color:#fff;
|
||||
// }
|
||||
//}
|
||||
|
||||
.page-content {
|
||||
padding: 15px 30px 15px 30px;
|
||||
|
||||
//.col-sm-3, .col-sm-4, .col-sm-6 {
|
||||
// //padding: 0;
|
||||
//}
|
||||
}
|
||||
|
||||
.stats {
|
||||
overflow: hidden;
|
||||
padding: 15px;
|
||||
color: #686868;
|
||||
background-color: #fff;
|
||||
border-radius: 3px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
//border-left: 1px solid lighten(@toolbar-bg, 20%);
|
||||
//border-bottom: 1px solid lighten(@toolbar-bg, 20%);
|
||||
|
||||
span.sub-name {
|
||||
font-size: 11px;
|
||||
font-weight: 300;
|
||||
//color: #fff;
|
||||
//color: rgba(255, 255, 255, .4);
|
||||
}
|
||||
|
||||
&.stats-warning {
|
||||
position: relative;
|
||||
background-color: #c86124;
|
||||
|
||||
.stats-content {
|
||||
//padding-left: 86px;
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
//color: #eee;
|
||||
}
|
||||
}
|
||||
|
||||
.loading {
|
||||
color: lighten(@page-bg, 60%);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
&.stats-id-host {
|
||||
border-top: 5px solid #407deb;
|
||||
}
|
||||
&.stats-id-user {
|
||||
border-top: 5px solid #eba61e;
|
||||
}
|
||||
&.stats-id-connect {
|
||||
border-top: 5px solid #14c13c;
|
||||
}
|
||||
|
||||
&.stats-box {
|
||||
position: relative;
|
||||
height: 116px;
|
||||
|
||||
.stats-content {
|
||||
padding-left: 100px;
|
||||
}
|
||||
|
||||
.stats-icon {
|
||||
font-size: 130px;
|
||||
line-height: 130px;
|
||||
left: 20px;
|
||||
text-align: center;
|
||||
//color: #000000;
|
||||
position: absolute;
|
||||
//opacity: .05;
|
||||
color: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.stats-name {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
//color: #1f1f1f;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.stats-value {
|
||||
margin-top: 5px;
|
||||
//color: #000000;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
font-size: 48px;
|
||||
line-height: 52px;
|
||||
font-weight: 300;
|
||||
white-space: nowrap;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
//.loading {
|
||||
// color: lighten(@page-bg, 60%);
|
||||
// font-size: 18px;
|
||||
//}
|
||||
|
||||
//@media all and (min-width: 768px) and (max-width: 1024px) {
|
||||
// .stats-icon {
|
||||
// left: 10px;
|
||||
// }
|
||||
//
|
||||
// .stats-content {
|
||||
// padding-left: 36px;
|
||||
// }
|
||||
//
|
||||
// .stats-value {
|
||||
// font-size: 36px;
|
||||
// }
|
||||
//}
|
||||
//@media all and (min-width: 1025px) and (max-width: 1366px) {
|
||||
// .stats-icon {
|
||||
// left: 15px;
|
||||
// }
|
||||
//
|
||||
// .stats-content {
|
||||
// padding-left: 48px;
|
||||
// }
|
||||
//
|
||||
// .stats-value {
|
||||
// font-size: 46px;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
&.stats-bar {
|
||||
position: relative;
|
||||
height: 320px;
|
||||
|
||||
.stats-content {
|
||||
//padding-left: 100px;
|
||||
}
|
||||
|
||||
.stats-name {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
//color: #1f1f1f;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.stats-value {
|
||||
margin-top: 5px;
|
||||
//color: #000000;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
font-size: 48px;
|
||||
line-height: 52px;
|
||||
font-weight: 300;
|
||||
white-space: nowrap;
|
||||
padding-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
//&.widget-info {
|
||||
// position: relative;
|
||||
// padding-top: 8px;
|
||||
// padding-bottom: 8px;
|
||||
//
|
||||
// .stats-icon, .stats-name {
|
||||
// float: left;
|
||||
// line-height: 24px;
|
||||
// color: #fff;
|
||||
// color: rgba(255, 255, 255, .6);
|
||||
// }
|
||||
//
|
||||
// .stats-icon {
|
||||
// font-size: 24px;
|
||||
// margin-right: 5px;
|
||||
// }
|
||||
//
|
||||
// .stats-name {
|
||||
// font-size: 14px;
|
||||
// font-weight: bold;
|
||||
// }
|
||||
// .stats-value {
|
||||
// float: right;
|
||||
// font-size: 16px;
|
||||
// font-weight: 300;
|
||||
// margin-right: 10px;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//&.widget-bar {
|
||||
// position: relative;
|
||||
// padding-top: 8px;
|
||||
// padding-bottom: 8px;
|
||||
//
|
||||
// .stats-name {
|
||||
// font-size: 14px;
|
||||
// font-weight: bold;
|
||||
// color: #fff;
|
||||
// color: rgba(255, 255, 255, .6);
|
||||
// }
|
||||
// .stats-value {
|
||||
// //width: 390px;
|
||||
// width: 100%;
|
||||
// height: 128px;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//&.widget-box, &.widget-block-list {
|
||||
// position: relative;
|
||||
// padding-top: 8px;
|
||||
// padding-bottom: 8px;
|
||||
//
|
||||
// .stats-name {
|
||||
// font-size: 14px;
|
||||
// font-weight: bold;
|
||||
// color: #fff;
|
||||
// color: rgba(255, 255, 255, .6);
|
||||
//
|
||||
// span {
|
||||
// font-size: 11px;
|
||||
// font-weight: 300;
|
||||
// color: #fff;
|
||||
// color: rgba(255, 255, 255, .4);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// .stats-value {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
//
|
||||
// #box-tpm, #box-dfs {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// //.dfs-icon-upload, #val-tpm-upload, .dfs-icon-download, #val-tpm-download {
|
||||
// // font-size: 36px;
|
||||
// //}
|
||||
//
|
||||
// .io-rate-box {
|
||||
// height: 50%;
|
||||
// width:100%;
|
||||
// display: table;
|
||||
// padding-left: 20px;
|
||||
// font-size: 24px;
|
||||
//
|
||||
// .io-rate-box-inner {
|
||||
// display: table-cell;
|
||||
// text-align: center;
|
||||
// width:100%;
|
||||
//
|
||||
// &.dfs-upload {
|
||||
// vertical-align: bottom;
|
||||
// padding-bottom: 20px;
|
||||
// color: #1e8a13;
|
||||
// }
|
||||
//
|
||||
// &.dfs-download {
|
||||
// vertical-align: top;
|
||||
// //padding-top: 20px;
|
||||
// color: #ff914d;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @media all and (min-width: 768px) and (max-width: 1367px) {
|
||||
// .io-rate-box {
|
||||
// font-size: 24px;
|
||||
// }
|
||||
// }
|
||||
// @media all and (min-width: 1367px) {
|
||||
// .io-rate-box {
|
||||
// font-size: 28px;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//}
|
||||
//
|
||||
//&.widget-block-list {
|
||||
// .stats-value {
|
||||
// padding-top: 5px;
|
||||
// width: 100%;
|
||||
// height: 800px;
|
||||
// overflow: hidden;
|
||||
// }
|
||||
//
|
||||
// .block-info {
|
||||
// font-size: 11px;
|
||||
// border-top: 1px dotted rgba(255, 255, 255, .1);;
|
||||
// clear: both;
|
||||
//
|
||||
// & > ul {
|
||||
// margin: 0;
|
||||
// padding: 0;
|
||||
// list-style: none;
|
||||
//
|
||||
// & > li {
|
||||
// float: left;
|
||||
// position: relative;
|
||||
// display: inline-block;
|
||||
// line-height: 24px;
|
||||
// margin-left: 10px;
|
||||
// &:first-child {
|
||||
// margin-left: 0;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// .rollback {
|
||||
// color: #ee5752;
|
||||
// }
|
||||
//
|
||||
// .time, .hash {
|
||||
// //font-family: @font-family-mono;
|
||||
// }
|
||||
// .time {
|
||||
// //color: lighten(@page-bg, 50%);
|
||||
// color: #7793b7;
|
||||
// white-space: nowrap;
|
||||
// //width: 142px;
|
||||
// width: 106px;
|
||||
// }
|
||||
// .hash {
|
||||
// color: #70b051;
|
||||
// //width: 256px;
|
||||
// //width: 236px;
|
||||
// white-space: nowrap;
|
||||
// }
|
||||
// .trans {
|
||||
// color: #449dbe;
|
||||
// white-space: nowrap;
|
||||
// width: 52px;
|
||||
// }
|
||||
// .data {
|
||||
// color: #919191;
|
||||
// white-space: nowrap;
|
||||
// //display: block;
|
||||
// width: 10px;
|
||||
// //text-overflow: ellipsis;
|
||||
// //overflow:hidden;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
&.stats-first {
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #eee;
|
||||
color: rgba(255, 255, 255, .7);
|
||||
&:hover {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -38,6 +38,7 @@
|
|||
padding-top: 6px;
|
||||
}
|
||||
.breadcrumb {
|
||||
background-color: transparent;
|
||||
padding-left: 20px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
@ -817,9 +818,11 @@
|
|||
textarea.textarea-resize-y {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
textarea.textarea-resize-none {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
textarea.textarea-code {
|
||||
font-family: @font-family-mono;
|
||||
}
|
||||
|
@ -831,7 +834,6 @@ textarea.cert_pub {
|
|||
background-color: #e4ffe5;
|
||||
}
|
||||
|
||||
|
||||
@import "_mimetype";
|
||||
@import "_gritter";
|
||||
|
||||
|
|
|
@ -3,6 +3,13 @@
|
|||
%>
|
||||
<%
|
||||
_sidebar = [
|
||||
{
|
||||
'require_type': 100,
|
||||
'id': 'dashboard',
|
||||
'link': '/dashboard',
|
||||
'name': '信息总览',
|
||||
'icon': 'fa-dashboard',
|
||||
},
|
||||
{
|
||||
'require_type': 1,
|
||||
'id': 'host',
|
||||
|
@ -17,13 +24,6 @@
|
|||
'name': '用户管理',
|
||||
'icon': 'fa-user',
|
||||
},
|
||||
## {
|
||||
## 'require_type': 1,
|
||||
## 'id': 'auth',
|
||||
## 'link': '/auth',
|
||||
## 'name': '授权管理',
|
||||
## 'icon': 'fa-user-secret',
|
||||
## },
|
||||
{
|
||||
'require_type': 100,
|
||||
'id': 'cert',
|
||||
|
@ -66,20 +66,6 @@
|
|||
'name': '日志查询',
|
||||
'icon': 'fa-database',
|
||||
},
|
||||
## {
|
||||
## 'require_type': 1,
|
||||
## 'id': 'pwd',
|
||||
## 'link': '/pwd',
|
||||
## 'name': '密码修改',
|
||||
## 'icon': 'fa-pencil-square-o',
|
||||
## },
|
||||
## {
|
||||
## 'require_type': 1,
|
||||
## 'id': 'exit',
|
||||
## 'link': '/exit',
|
||||
## 'name': '安全退出',
|
||||
## 'icon': 'fa-sign-out',
|
||||
## },
|
||||
{
|
||||
'separator': true,
|
||||
'require_type': 1,
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
<%!
|
||||
page_title_ = '系统总览'
|
||||
page_menu_ = ['dashboard']
|
||||
page_id_ = 'dashboard'
|
||||
%>
|
||||
<%inherit file="../page_base.mako"/>
|
||||
|
||||
<%block name="extend_js">
|
||||
## <script type="text/javascript" src="${ static_url('js/ui/teleport.js') }"></script>
|
||||
|
||||
## <script type="text/javascript" src="${ static_url('js/ui/config/info.js') }"></script>
|
||||
</%block>
|
||||
|
||||
<%block name="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li><i class="fa fa-dashboard fa-fw"></i> ${self.attr.page_title_}</li>
|
||||
</ol>
|
||||
</%block>
|
||||
|
||||
<%block name="extend_css">
|
||||
<link href="${ static_url('css/dashboard.css') }" rel="stylesheet" type="text/css"/>
|
||||
</%block>
|
||||
|
||||
## Begin Main Body.
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="stats stats-box stats-id-host">
|
||||
<div class="stats-icon">
|
||||
<i class="fa fa-server"></i>
|
||||
</div>
|
||||
<div class="stats-content">
|
||||
<div class="stats-name">主机</div>
|
||||
<div class="stats-value">128</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="stats stats-box stats-id-user">
|
||||
<div class="stats-icon">
|
||||
<i class="fa fa-user"></i>
|
||||
</div>
|
||||
<div class="stats-content">
|
||||
<div class="stats-name">用户</div>
|
||||
<div class="stats-value">21</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="stats stats-box stats-id-connect">
|
||||
<div class="stats-icon">
|
||||
<i class="fa fa-link"></i>
|
||||
</div>
|
||||
<div class="stats-content">
|
||||
<div class="stats-name">当前连接</div>
|
||||
<div class="stats-value">18</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="stats stats-bar">
|
||||
<div class="stats-name">CPU负载</div>
|
||||
<div class="stats-value">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="stats stats-bar">
|
||||
<div class="stats-name">内存使用</div>
|
||||
<div class="stats-value">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="stats stats-bar">
|
||||
<div class="stats-name">网络流量</div>
|
||||
<div class="stats-value">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="stats stats-bar">
|
||||
<div class="stats-name">网络连接</div>
|
||||
<div class="stats-value">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<%block name="extend_content"></%block>
|
||||
|
||||
|
||||
<%block name="embed_js">
|
||||
<script type="text/javascript">
|
||||
## ywl.add_page_options(${ page_param });
|
||||
</script>
|
||||
</%block>
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
<%block name="extend_js">
|
||||
## <script type="text/javascript" src="${ static_url('js/ui/teleport.js') }"></script>
|
||||
|
||||
<script type="text/javascript" src="${ static_url('js/ui/config/info.js') }"></script>
|
||||
</%block>
|
||||
|
||||
|
@ -22,10 +23,19 @@
|
|||
.table .key {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.table .value {
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.table .value .error {
|
||||
color: #ff4c4c;
|
||||
}
|
||||
|
||||
.table .value .disabled {
|
||||
color: #ffa861;
|
||||
}
|
||||
</style>
|
||||
</%block>
|
||||
|
||||
|
@ -36,123 +46,21 @@
|
|||
<!-- begin box -->
|
||||
<div class="box">
|
||||
|
||||
<div style="width:640px">
|
||||
|
||||
<div class="form-horizontal">
|
||||
|
||||
<div>
|
||||
<h4><strong>服务器配置信息</strong></h4>
|
||||
|
||||
<table id="info-kv" class="table">
|
||||
## <tr><td class="key">RDP 端口:</td><td class="value">52089</td></tr>
|
||||
## <tr><td class="key">SSH 端口:</td><td class="value">52189</td></tr>
|
||||
## <tr><td class="key">TELNET 端口:</td><td class="value">52389</td></tr>
|
||||
## <tr><td class="key">录像文件路径:</td><td class="value">C:\teleport-server\data\replay</td></tr>
|
||||
</table>
|
||||
|
||||
##
|
||||
## <div class="form-group form-group-sm">
|
||||
## <label for="current-rdp-port" class="col-sm-2 control-label"><strong>RDP 端口:</strong></label>
|
||||
## <div class="col-sm-6">
|
||||
## <input id="current-rdp-port" type="text" class="form-control" placeholder="默认值 52089" disabled/>
|
||||
## </div>
|
||||
## ## <div class="col-sm-4 control-label" style="text-align: left;">可以用默认值</div>
|
||||
## </div>
|
||||
##
|
||||
## <div class="form-group form-group-sm">
|
||||
## <label for="current-ssh-port" class="col-sm-2 control-label"><strong>SSH 端口:</strong></label>
|
||||
## <div class="col-sm-6">
|
||||
## <input id="current-ssh-port" type="text" class="form-control" placeholder="默认值 52189" disabled/>
|
||||
## </div>
|
||||
## ## <div class="col-sm-4 control-label" style="text-align: left;">可以用默认值</div>
|
||||
## </div>
|
||||
##
|
||||
##
|
||||
## <div class="form-group form-group-sm">
|
||||
## <label for="current-telnet-port" class="col-sm-2 control-label"><strong>TELENT 端口:</strong></label>
|
||||
## <div class="col-sm-6">
|
||||
## <input id="current-telnet-port" type="text" class="form-control" placeholder="默认值 52389" disabled/>
|
||||
## </div>
|
||||
## ## <div class="col-sm-4 control-label" style="text-align: left;">可以用默认值</div>
|
||||
## </div>
|
||||
##
|
||||
##
|
||||
## <div class="form-group form-group-sm">
|
||||
## <div class="col-sm-2"></div>
|
||||
## <div class="col-sm-6">
|
||||
## 注意:要修改端口号,请直接修改配置文件。修改后需要重启服务方能生效!
|
||||
## </div>
|
||||
## </div>
|
||||
|
||||
|
||||
## <hr/>
|
||||
##
|
||||
## <p><strong>Teleport核心服务设置</strong></p>
|
||||
## <p>用于与teleport核心服务进行通讯,需要将WEB后台与核心服务部署在同一台主机上。</p>
|
||||
## <p>如果您需要将核心服务部署在单独的主机上,建议您为RPC访问端口设置防火墙规则,仅允许WEB后台主机访问此RPC端口,以增强安全性。</p>
|
||||
##
|
||||
## <div class="form-group form-group-sm">
|
||||
## <label for="current-rpc-ip" class="col-sm-2 control-label"><strong>IP地址:</strong></label>
|
||||
## <div class="col-sm-6">
|
||||
## <input id="current-rpc-ip" type="text" class="form-control" readonly="readonly" placeholder="默认值 127.0.0.1"/>
|
||||
## </div>
|
||||
## </div>
|
||||
##
|
||||
## <div class="form-group form-group-sm">
|
||||
## <label for="current-rpc-port" class="col-sm-2 control-label"><strong>端口:</strong></label>
|
||||
## <div class="col-sm-6">
|
||||
## <input id="current-rpc-port" type="text" class="form-control" readonly="readonly" placeholder="默认值 52080"/>
|
||||
## </div>
|
||||
## </div>
|
||||
|
||||
## <hr/>
|
||||
## <div class="form-group form-group-sm">
|
||||
## <div class="col-sm-2"></div>
|
||||
## <div class="col-sm-2">
|
||||
## <a href="javascript:" id="btn-check" class="btn btn-success"><i class="fa fa-cog fa-fw"></i> 一键测试</a>
|
||||
## </div>
|
||||
## <div class="col-sm-4" style="text-align: right;">
|
||||
## <a href="javascript:" id="btn-save-config" class="btn btn-primary"><i class="fa fa-check fa-fw"></i> 保存配置</a>
|
||||
## </div>
|
||||
## </div>
|
||||
|
||||
<table id="info-kv" class="table"></table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end of box -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<%block name="extend_content">
|
||||
|
||||
## <div class="modal fade" id="dlg_restart_service" tabindex="-1" role="dialog">
|
||||
## <div class="modal-dialog" role="document">
|
||||
## <div class="modal-content">
|
||||
## <div class="modal-header">
|
||||
## <h3 class="modal-title" style="text-align: center;">服务重启中...</h3>
|
||||
## </div>
|
||||
## <div class="modal-body">
|
||||
## <p style="text-align: center; font-size:36px;"><i class="fa fa-cog fa-spin"></i></p>
|
||||
## <p style="text-align: center;">配置已保存,正在重启teleport服务,请稍候...</p>
|
||||
## <p style="text-align: center;"><span id="reboot_time"></span></p>
|
||||
## </div>
|
||||
##
|
||||
## <div class="modal-footer">
|
||||
## </div>
|
||||
## </div>
|
||||
## </div>
|
||||
## </div>
|
||||
|
||||
|
||||
</%block>
|
||||
<%block name="extend_content"></%block>
|
||||
|
||||
|
||||
<%block name="embed_js">
|
||||
<script type="text/javascript">
|
||||
## ywl.add_page_options({
|
||||
## config_list: ${config_list}
|
||||
## });
|
||||
ywl.add_page_options(${ page_param });
|
||||
</script>
|
||||
</%block>
|
||||
|
|
Loading…
Reference in New Issue