<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:layout="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" layout:decorator="MasterPage/Layout.Empty">
|
<head>
|
<meta charset="UTF-8" />
|
<title th:text="${systemName}"></title>
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
|
<link rel="stylesheet" th:href="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/portlet/css/portlet.css'}" />
|
<script th:src="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/portlet/portlet.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/jquery.form-3.51.0.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/validation/jquery.validate.min.js'}" type="text/javascript"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/validation/messages_zh.js'}" type="text/javascript"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/validation/additional-methods.min.js'}" type="text/javascript"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/yanzhen.js'}" type="text/javascript"></script>
|
<script src="/js/validator.js"></script>
|
<style>
|
body {
|
background-color: white;
|
box-sizing: border-box;
|
overflow-x: hidden;
|
}
|
|
.form-control {
|
padding: 0.3rem 0.7rem;
|
height: 34px;
|
display: inline-block;
|
}
|
|
.control-label {
|
padding-top: 0 !important;
|
width: 94px;
|
float: left;
|
line-height: 30px;
|
padding-right: 1.2em;
|
text-align: right;
|
}
|
|
.control-group {
|
margin-bottom: 1em;
|
}
|
|
.controls {
|
margin-left: 94px;
|
}
|
|
.row {
|
margin-left: 0;
|
margin-right: 0;
|
}
|
|
.col-sm-3,
|
.col-sm-6,
|
.col-sm-12 {
|
padding-left: 0;
|
padding-right: 0;
|
}
|
|
.fade {
|
display: none;
|
}
|
|
.in.fade {
|
display: block;
|
}
|
|
.control-group error {
|
border-color: #b94a48;
|
}
|
|
#button {
|
color: #fff !important;
|
background-color: #039cfd !important;
|
border-color: #039cfd !important;
|
}
|
|
img {
|
cursor: pointer;
|
}
|
|
.nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus {
|
color: #555;
|
cursor: default;
|
background-color: #fff;
|
border: 1px solid #ddd;
|
border-bottom-color: transparent;
|
}
|
</style>
|
</head>
|
<body layout:fragment="content">
|
<form class="form-horizontal" id="ShuJuYuan" method="post" xmlns:th="http://www.w3.org/1999/xhtml">
|
<input type="hidden" id="datasourceid" name="datasourceid" th:value="${datasource.datasourceid}"/>
|
<div class="portlet box ltblue">
|
<div class="portlet-title">
|
数据源信息
|
<div class="caption">
|
<i class="fa fa-reorder"></i>
|
</div>
|
<div class="tools">
|
<!--<a class="collapse" onclick="portlet_body_ShowOrHide(this);"></a>-->
|
</div>
|
</div>
|
<div class="portlet-body">
|
<div class="row">
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">数据库别名<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input type="text" th:value="${datasource.databasealias}" id="databasealias" name="databasealias" class="form-control col-sm-11" value="" required="" maxchar="25" />
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;margin-left:34px"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
<div class="row">
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">数据库类型<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<!--<input type="text" id="databasetype" name="databasetype" class="form-control col-sm-11" value="" required="" />-->
|
<select id="databasetype" name="databasetype" class="form-control col-sm-11" required="">
|
<option value="">--请选择--</option>
|
<option th:each="item:${databasetype}" th:value="${item.key}" th:text="${item.value}" th:selected="(${item.key} == ${datasource.databasetype})?'true':'false'"></option>
|
</select>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;margin-left:34px"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">数据库名称<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input type="text" th:value="${datasource.databasename}" id="databasename" name="databasename" class="form-control col-sm-11" value="" required="" maxchar="25" />
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;margin-left:34px"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row">
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">用户名<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input type="text" th:value="${datasource.username}" id="username" name="username" class="form-control col-sm-11" value="" required="" maxchar="25" />
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;margin-left:34px"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">密码<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input type="password" th:value="${datasource.password}" id="password" name="password" class="form-control col-sm-11" value="" required="" maxchar="50" />
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;margin-left:34px"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
<div class="row">
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">服务器地址<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input type="text" th:value="${datasource.serveraddress}" id="serveraddress" name="serveraddress" class="form-control col-sm-11" value="" required="" maxchar="25" />
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;margin-left:34px"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">端口<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input type="text" th:value="${datasource.port}" id="port" name="port" class="form-control col-sm-11" value="" isport="true" required="" maxchar="10" diyMsg="这是必填字段,例如:127.0.0.1" />
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;margin-left:34px"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="form-actions navbar-fixed-bottom" style="z-index: 0;">
|
<div style="float: left;">
|
<button class="btn btn-primary" id="addShuJuYuanSave" type="button">
|
<i class="fa fa-check"></i> 保存
|
</button>
|
<button th:if="${not #lists.isEmpty(datasource.datasourceid)}" class="btn btn-danger" id="Delete" type="button">
|
<i class="fa fa-trash-o"></i> 删除
|
</button>
|
<button class="btn btn-warning" id="close" type="button">
|
<i class="fa fa-remove"></i> 关闭
|
</button>
|
</div>
|
</div>
|
</form>
|
|
<script>
|
$(function () {
|
cheackForm("ShuJuYuan");
|
});
|
</script>
|
<script>
|
$("#close").on('click', function () {
|
var index = parent.layer.getFrameIndex(window.name);
|
parent.layer.close(index);
|
});
|
|
$('#addShuJuYuanSave').on('click', function () {
|
if ($('#ShuJuYuan').valid()) {
|
$('#ShuJuYuan').ajaxSubmit({
|
url: '/res/ressubscriptions/SaveDataSource',
|
type: 'post',
|
dataType: 'text',
|
data: {},
|
success: function (data) {
|
var json = eval('('+data+')');
|
if (json.count == "1") {
|
alert("保存成功!");
|
location.href = "AddDataSource?datasourceid=" + json.id;
|
} else {
|
alert("保存失败!");
|
}
|
},
|
error: function (e) {
|
alert(e.message);
|
}
|
});
|
} else {
|
// alert("您输入的信息存在错误,请更正后再提交!");
|
}
|
});
|
//
|
$('#Delete').on('click',function () {
|
var id = $("#datasourceid").val();
|
if(confirm("是否确定删除该数据?")) {
|
$.ajax({
|
url: '/res/ressubscriptions/deleteDataSource?datasourceid=' + id,
|
type: 'post',
|
success: function (data) {
|
if (data == 1) {
|
alert("删除成功,页面即将关闭!");
|
var index = parent.layer.getFrameIndex(window.name);
|
parent.layer.close(index);
|
}
|
else {
|
alert("删除失败!");
|
}
|
},
|
error: function (e) {
|
alert(e.message);
|
}
|
});
|
}
|
});
|
</script>
|
</body>
|
</html>
|