pull/32/head
Apex Liu 2017-05-14 17:24:59 +08:00
parent 28ca556551
commit f7b5768155
2 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,36 @@
"use strict";
ywl.on_init = function (cb_stack, cb_args) {
console.log(ywl.page_options);
var dom = {
info: $('#info-kv')
};
var html = [];
// 版本号
var db = ywl.page_options.db;
if (db.type === 1) {
html.push(ywl._make_info('数据库类型', 'SQLite'));
html.push(ywl._make_info('数据库文件', db.file));
} else if(db.type === 2) {
html.push(ywl._make_info('数据库类型', 'MySQL'));
} else {
html.push(ywl._make_info('数据库类型', '未知类型(' + db.type + ''));
}
dom.info.append(html.join(''));
// $("#current-rdp-port").val(core.rdp.port);
// $("#current-ssh-port").val(core.ssh.port);
// $("#current-telnet-port").val(core.telnet.port);
cb_stack.exec();
};
ywl._make_info = function (key, value) {
if (_.isUndefined(value))
value = '<span class="error">未能检测到</span>';
return '<tr><td class="key">' + key + '</td><td class="value">' + value + '</td></tr>';
};

View File

@ -0,0 +1,66 @@
<%!
page_title_ = '数据库管理'
page_menu_ = ['set', 'database']
page_id_ = 'set'
%>
<%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/database.js') }"></script>
</%block>
<%block name="breadcrumb">
<ol class="breadcrumb">
<li><i class="fa fa-cogs fa-fw"></i> ${self.attr.page_title_}</li>
<li>数据库管理</li>
</ol>
</%block>
<%block name="extend_css">
<style type="text/css">
.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>
## Begin Main Body.
<div class="page-content">
<!-- begin box -->
<div class="box">
<div>
<h4><strong>数据库配置信息</strong></h4>
<table id="info-kv" class="table"></table>
</div>
</div>
<!-- end of box -->
</div>
<%block name="extend_content"></%block>
<%block name="embed_js">
<script type="text/javascript">
ywl.add_page_options(${ page_param });
</script>
</%block>