gocron/templates/install/create.html

189 lines
7.0 KiB
Go

{{{ template "common/header" . }}}
<div class="ui grid">
{{{ template "install/menu" . }}}
<div class="ten wide column">
<form class="ui form">
<div class="ui blue center aligned segment">
<p></p>
</div>
<br>
<div class="three fields">
<div class="field">
<label>(MySQL)</label>
<div class="ui dropdown selection">
<input type="hidden" name="db_type" value="mysql">
<div class="default text">MySQL</div>
<i class="dropdown icon"></i>
<div class="menu">
<div class="item active" data-value="mysql">MySQL</div>
</div>
</div>
</div>
</div>
<div class="three fields">
<div class="field">
<label></label>
<input type="text" name="db_host" value="127.0.0.1">
</div>
<div class="field">
<label></label>
<input type="text" name="db_port" value="3306">
</div>
</div>
<div class="three fields">
<div class="field">
<label></label>
<input type="text" name="db_username">
</div>
<div class="field">
<label></label>
<input type="password" name="db_password">
</div>
</div>
<div class="three fields">
<div class="field">
<label></label>
<input type="text" name="db_name">
</div>
<div class="field">
<label></label>
<input type="text" name="db_table_prefix" value="cron_">
</div>
</div>
<div class="ui divider"></div>
<div class="ui blue center aligned segment">
<p></p>
</div>
<br>
<div class="three fields">
<div class="field">
<label></label>
<input type="text" name="admin_username">
</div>
</div>
<div class="three fields">
<div class="field">
<label></label>
<input type="password" name="admin_password">
</div>
</div>
<div class="three fields">
<div class="field">
<label></label>
<input type="password" name="confirm_admin_password">
</div>
</div>
<div class="three fields">
<div class="field">
<label></label>
<input type="text" name="admin_email">
</div>
</div>
<div class="ui blue submit button"></div>
</form>
</div>
</div>
<script type="text/javascript">
// 表单验证规则
$('.ui.form').form(
{
onSuccess: function(event, fields) {
util.post('/install/store', fields, function(code, message) {
swal('');
setTimeout(function() {
location.href = "/";
}, 2000)
});
return false;
},
fields: {
dbHost: {
identifier : 'db_host',
rules: [
{
type : 'empty',
prompt : ''
}
]
},
dbPort: {
identifier : 'db_port',
rules: [
{
type : 'integer',
prompt : ''
}
]
},
dbUsername: {
identifier : 'db_username',
rules: [
{
type : 'empty',
prompt : ''
}
]
},
dbPassword: {
identifier : 'db_password',
rules: [
{
type : 'empty',
prompt : ''
}
]
},
dbName: {
identifier : 'db_name',
rules: [
{
type : 'empty',
prompt : ''
}
]
},
adminUsername: {
identifier : 'admin_username',
rules: [
{
type : 'minLength[3]',
prompt : '3'
}
]
},
adminPassword: {
identifier : 'admin_password',
rules: [
{
type : 'minLength[6]',
prompt : '6'
}
]
},
confirmAdminPassword: {
identifier : 'confirm_admin_password',
rules: [
{
type : 'match[admin_password]',
prompt : ''
}
]
},
adminEmail: {
identifier : 'admin_email',
rules: [
{
type : 'email',
prompt : ''
}
]
}
},
inline : true
});
</script>
{{{ template "common/footer" . }}}