mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-27 06:22:56 +08:00
setup html
This commit is contained in:
62
public/setup.html
Normal file
62
public/setup.html
Normal file
@@ -0,0 +1,62 @@
|
||||
<!doctype html>
|
||||
<html xmlns:fb="http://ogp.me/ns/fb#">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Deployd :: Dashboard</title>
|
||||
<link rel="stylesheet" media="all" href="/dashboard/css/dashboard.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="nav">
|
||||
<div class="row">
|
||||
<div class="three columns">
|
||||
<h1>Deployd</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- container -->
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<form class="nice three columns centered">
|
||||
<h3>Setup</h3>
|
||||
<p>Your app needs a root user!</p>
|
||||
<label>Root User Email</label>
|
||||
<input id="email" type="text" class="oversize input-text" />
|
||||
<label>Root User Password</label>
|
||||
<input id="password" type="password" class="oversize input-text" />
|
||||
<a id="register-btn" class="small radius nice white button">Register</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
||||
<script src="/deployd.js"></script>
|
||||
|
||||
<script>
|
||||
$('#login-btn, #register-btn').click(function() {
|
||||
var email = $('#email').val(),
|
||||
password = $('#password').val(),
|
||||
user = {email: email, password: password};
|
||||
|
||||
if(email && password) {
|
||||
if($(this).attr('id') == 'register-btn') {
|
||||
d('/users', user, function(res) {
|
||||
if(!res.errors) {
|
||||
d('/users/login', user, function(res) {
|
||||
if(res.errors) {
|
||||
alert(res.errors[0].message);
|
||||
} else {
|
||||
window.location = '/dashboard';
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert(res.errors[0].message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user