Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增新功能并解决存在的bug #163

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions disconf-web/html/assets/css/project.css
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ th {
.startActivity-form-value {
width: 500px;
height: 30px;
border: 1px solid #D6D6D6 border-radius : 5 px;
border: 1px solid #D6D6D6;
border-radius: 5px;
}

.startActivity-form-value-small {
Expand Down Expand Up @@ -352,7 +353,8 @@ th {
.ticketDiscount-form-value {
width: 500px;
height: 30px;
border: 1px solid #D6D6D6 border-radius : 5 px;
border: 1px solid #D6D6D6;
border-radius: 5px;
}

.ticketDiscount-form-textarea {
Expand Down Expand Up @@ -533,7 +535,8 @@ input.regForm-item-value {
input.question-form-value {
width: 380px;
height: 22px;
border: 1px solid #D6D6D6 border-radius : 5 px;
border: 1px solid #D6D6D6;
border-radius: 5px;
vertical-align: middle;
margin-bottom: 0px;
border-radius: 0 4px 4px 0;
Expand Down Expand Up @@ -714,7 +717,8 @@ input.autoPush-detail-item-input {
.register-item-value {
width: 200px;
height: 30px;
border: 1px solid #D6D6D6 border-radius : 5 px;
border: 1px solid #D6D6D6;
border-radius: 5px;
}

.register-item-value-area {
Expand Down Expand Up @@ -986,13 +990,15 @@ q:before, q:after {
.private-item-value {
width: 300px;
height: 30px;
border: 1px solid #D6D6D6 border-radius : 5 px;
border: 1px solid #D6D6D6;
border-radius: 5px;
text-align: left;
vertical-align: middle;
}

.private-item-value-pre {
border: 1px solid #D6D6D6 border-radius : 5 px;
border: 1px solid #D6D6D6;
border-radius: 5px;
text-align: left;
vertical-align: middle;
}
Expand Down
13 changes: 10 additions & 3 deletions disconf-web/html/assets/js/modify_password.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@ $("#item_submit").on("click", function (e) {
// 验证
if (!old_password || !new_password || !new_password_2) {
$("#error").removeClass("hide");
$("#error").html("表单不能为空或填写格式错误!");
$("#error").html("修改密码失败, 表单不能为空或填写格式错误!");
return;
}

if (new_password != new_password_2) {
$("#error").removeClass("hide");
$("#error").html("修改密码失败, 两次输入的密码不一致!");
return;
}

$.ajax({
type: "PUT",
url: "/api/account/password",
Expand All @@ -25,9 +32,9 @@ $("#item_submit").on("click", function (e) {
"new_password_2": new_password_2
}
}).done(function (data) {
$("#error").removeClass("hide");
if (data.success === "true") {
$("#error").html(data.result);
alert(data.result);
window.location.href = "/login.html";
} else {
Util.input.whiteError($("#error"), data);
}
Expand Down
31 changes: 31 additions & 0 deletions disconf-web/html/assets/js/register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var appId = -1;
var envId = -1;
var version = "";

// 提交
$("#item_submit").on("click", function (e) {
$("#error").addClass("hide");
var user_name = $("#reg_user_name").val();
var pwd = $("#reg_pwd").val();

// 验证
if (!user_name || !pwd) {
$("#error").html("注册失败, 表单不能为空或填写格式错误!");
return;
}
$.ajax({
type: "PUT",
url: "/api/account/register",
data: {
"name": user_name,
"password": pwd
}
}).done(function (data) {
if (data.success === "true") {
alert(data.result);
window.location.href = "/login.html";
} else {
$("#error").html(data.result);
}
});
});
12 changes: 8 additions & 4 deletions disconf-web/html/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@
<div class="login-no" style="padding:10px;">
<li style="display:inline;">
<a href="/login.html"><span class="zu-top-nav-link">登录</span></a>
</li>
</li>
&nbsp;&nbsp;&nbsp;
<li style="display:inline;">
<a href="/register.html"><span class="zu-top-nav-link">注册</span></a>
</li>
</div>

</ul>
Expand All @@ -95,12 +99,12 @@
<div class="container-fluid">

<form class="form-single" id="login-form" style="padding:0px;border:0px">
<div class="well" style="border:2px solid #e3e3e3;width:380;padding:20px 30px;">
<div class="well" style="border:2px solid #e3e3e3;padding:20px 30px;">

<h2>登录</h2>

<div class="form required email">
<label for="account">用户名</label>
<label for="name">用户名</label>
<input id="name" class="input-block-level" type="text" value="" name="useremail">
</div>

Expand All @@ -115,7 +119,7 @@ <h2>登录</h2>
&nbsp;一个月内免登录 </label>

<div class="form-submit">
<a class="btn btn-primary" type="submit"> 登录 </a>
<a id="login" class="btn btn-primary" type="submit"> 登录 </a>
</div>

<br>
Expand Down
2 changes: 1 addition & 1 deletion disconf-web/html/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<div class="row-fluid" style="min-height:400px;">
<div class="sidebar span2" style="float:left;overflow:visible;">

<div class="dropdown" style="margin-top:20px;width:100%">
<div class="dropdown" style="margin-top:20px;width:100%">
<button class="btn btn-default dropdown-toggle" type="button" id="appDropdownMenu" data-toggle="dropdown" style="width:100%;">
<span id="appDropdownMenuTitle">Apps</span>
<span class="caret"></span>
Expand Down
7 changes: 5 additions & 2 deletions disconf-web/html/modifypassword.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@

<div class="content oz">

<form id="form" class="private-form clearfix">
<div style="margin-right: 20%">
<h2 class="autoPush-detail-title">修改密码</h2>
</div>

<form id="form" class="private-form clearfix">

<div class="private-item">
<span class="private-item-key">原密码:</span>
Expand All @@ -132,7 +135,7 @@ <h2 class="autoPush-detail-title">修改密码</h2>
<div id="error" class="alert alert-warning hide" role="alert">
表单选项不能为空或填写格式错误!
</div>
<div class="private-item" style="text-align:center">
<div class="private-item" style="margin-right: 24%; text-align:center">
<a id="item_submit" class="btn btn-primary"> 修改 </a>
</div>
</form>
Expand Down
154 changes: 154 additions & 0 deletions disconf-web/html/register.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<!DOCTYPE html>
<html class="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<title>Disconf - 分布式配置管理平台</title>


<link rel="stylesheet" href="dep/bootstrap/css/bootstrap.css"/>
<!--[if lte IE 6]>
<link rel="stylesheet" href="dep/bootstrap/css/bootstrap-ie6.css"/>
<![endif]-->
<!--[if lte IE 7]>
<link rel="stylesheet" href="dep/bootstrap/css/ie.css"/>
<![endif]-->
<![if !IE]>
<link rel="stylesheet" href="dep/bootstrap/css/noie.css"/>
<![endif]>
<link rel="stylesheet" href="dep/jquery-ui-1.10.4.custom/css/ui-lightness/jquery-ui-1.10.4.custom.css"/>
<link rel="stylesheet" type="text/css" href="assets/css/project.css"/>
</head>

<body>

<div class="navbar navbar-fixed-top clearfix">
<div class="navbar-inner zu-top">
<div class="container">
<button type="button" class="btn btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="nav-collapse collapse">

<a id="brand_url" href="/main.html" class="brand" style="margin-left:0px;padding:8px;"> <span
class="zu-top-nav-link">Disconf</span> </a>

<span class="span2"> </span>
<form class="navbar-form pull-left">
<button class="btn btn-warning" title="GitHub" type="button" style=""
onclick="window.open('https://github.com/knightliao/disconf', '_blank');">
<i class="icon-circle-arrow-up icon-white"></i> <b>GitHub</b>
</button>
</form>

<ul class="nav pull-right">

<div class="login-no" style="padding:10px;">
<li style="display:inline;">
<a href="/login.html"><span class="zu-top-nav-link">退出</span></a>
</li>
</div>

</ul>
</div>
</div>

</div>
</div>


<div id="Wrapper" class="clearfix">
<div id="Main" style="margin-top:50px;">
<div class="container-fluid">

<div class="row-fluid">
<ul class="breadcrumb" style="background-color:#fff;">
<li class="active">
注册
</li>
</ul>
</div>

<div class="row-fluid">

<div class="span12">

<div class="content oz">

<div style="margin-right: 20%">
<h2 class="autoPush-detail-title">注册</h2>
</div>

<form id="form" class="private-form clearfix">

<div class="private-item">
<span class="private-item-key">用户名:</span>
<input id="reg_user_name" type="text" class="private-item-value"/>
</div>

<div class="private-item">
<span class="private-item-key">密码:</span>
<input id="reg_pwd" type="password" class="private-item-value"/>
</div>

<div id="error" class="alert alert-warning hide" role="alert">
表单选项不能为空或填写格式错误!
</div>
<div class="private-item" style="margin-right: 24%;text-align:center">
<a id="item_submit" class="btn btn-primary"> 注册 </a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>


<div id="footer">
<div id="BottomMain">
<div class="inner">
<strong>
<a href="#" class="dark">关于</a> &nbsp;
</strong>
<strong>
<a href="#" class="dark">升级</a> &nbsp;
</strong>
<div class="sep10"></div>
<span>分布式配置管理平台</span>
<div class="sep10"></div>
<span class="myfade">Theme by <a href="http://sov5.com/" target="_blank">Sov5搜索</a>,
Power by 百度程序化广告交易工程平台技术部,
Copyright &copy; 2014~2016 </span>
</div>
</div>
</div>

<script src="assets/js/jquery-1.11.0.js"></script>
<script src="dep/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js"></script>
<script src="dep/bootstrap/js/bootstrap.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/common.js"></script>

<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c4578bda90040ec19ded56112b82246f";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>


<script src="assets/js/register.js"></script>

<script src="assets/js/footer.js"></script>

</body>
</html>

12 changes: 12 additions & 0 deletions disconf-web/sql/0-init_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CREATE TABLE `app` (
CREATE TABLE `config` (
`config_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '唯一的ID(没有啥意义,主键,自增长而已)',
`type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '配置文件/配置项',
`status` int(11) NOT NULL DEFAULT '1' COMMENT '状态:1是正常 0是删除',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '配置文件名/配置项KeY名',
`value` text NOT NULL COMMENT '0 配置文件:文件的内容,1 配置项:配置值',
`app_id` bigint(20) NOT NULL COMMENT 'appid',
Expand All @@ -24,6 +25,17 @@ CREATE TABLE `config` (
PRIMARY KEY (`config_id`)
) ENGINE=InnoDB AUTO_INCREMENT=150 DEFAULT CHARSET=utf8 COMMENT='配置';

CREATE TABLE `config_history` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`config_id` bigint(20) NOT NULL,
`old_value` longtext NOT NULL,
`new_value` longtext NOT NULL,
`create_time` varchar(14) NOT NULL DEFAULT '99991231235959',
`update_by` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;


CREATE TABLE `env` (
`env_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '环境ID(主键,自增长)',
`name` varchar(255) NOT NULL DEFAULT 'DEFAULT_ENV' COMMENT '环境名字',
Expand Down
19 changes: 6 additions & 13 deletions disconf-web/sql/1-init_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,12 @@ VALUES
(71, 2, '/api/web/config/filetext/{configId}', 'update', '0100', '99991231235959'),
(72, 3, '/api/web/config/filetext/{configId}', 'update', '0000', '99991231235959');

/* testUser1 MhxzKhl9209*/
/* testUser2 MhxzKhl167*/
/* testUser3 MhxzKhl783*/
/* testUser4 MhxzKhl8758*/
/* testUser5 MhxzKhl112*/
INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
(1,'/api/account/password' , '修改密码' , '0100'),
(2,'/api/account/password' , '修改密码' , '0100'),
(3,'/api/account/password' , '修改密码' , '0000');

/* admin admin*/
INSERT INTO `user` (`user_id`, `name`, `password`, `token`, `ownapps`, `role_id`)
VALUES
(1, 'testUser1', '5eec8499597a115c88e0a9580ae1562ab85d0b1a', 'b9070d385a13357efa09e50e080607c2b299241b', '2', 1),
(2, 'testUser2', '71e9dc667eefa5a3a4840cb4f1ce22bc246f22f0', 'b169dec42f61ec6cbad88d70e7c4c6b89630ccfb', '2', 1),
(3, 'testUser3', 'e2cdc4a9195030543e38e19a923f075d54471cc4', 'a1a20b0e03a5191c530cbfc064eda3c16254df64', '2', 1),
(4, 'testUser4', '5cef2d7e4ada5a615f03e12b569d80aedfb056fc', '007b07fccbc1c82c987f7b8e4651e85cca01cf2b', '2', 1),
(5, 'testUser5', 'f996eeaa224abe0037d99adbce73c315e13238f9', 'c9dfdcb50a3d84f2b6a4771dcb7c2ceb19e7d281', '2', 1),
(6, 'admin', 'd033e22ae348aeb5660fc2140aec35850c4da997', 'f28d164d23291c732f64134e6b7d92be3ff8b1b3', '', 2),
(7, 'admin_read', 'b76f3e20d1c8d0bc17d40158e44097d5eeee8640', '2022ab9c2754d62f9ddba5fded91e4238247ebaf', '2', 3),
(8, 'mobiledsp', '0855b44a368e44dc6e6825532073b29a368584af', '132069654193f802203d1c6c86e753ecede698f6', '4', 1);
(1, 'admin', 'd033e22ae348aeb5660fc2140aec35850c4da997', 'f28d164d23291c732f64134e6b7d92be3ff8b1b3', '', 2)
Loading