gocron/templates/install/create.html

174 lines
6.3 KiB
HTML
Raw Normal View History

2017-04-01 09:04:40 +00:00
{{{ template "common/header" . }}}
2017-04-07 01:13:36 +00:00
<div class="ui grid">
{{{ template "install/menu" . }}}
<div class="twelve wide column">
2017-04-07 09:26:46 +00:00
<div class="pageHeader">
<div class="segment">
<h3 class="ui dividing header">
<i class="large add icon"></i>
<div class="content">
安装gocron
</div>
</h3>
</div>
2017-04-07 01:13:36 +00:00
</div>
2017-04-07 09:26:46 +00:00
<form class="ui form">
<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>
2017-04-07 01:13:36 +00:00
</div>
2017-04-07 09:26:46 +00:00
<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>
2017-04-07 01:13:36 +00:00
</div>
2017-04-07 09:26:46 +00:00
<div class="two fields">
<div class="field">
<label>用户名</label>
<input type="text" name="db_username">
</div>
<div class="field">
<label>密码</label>
<input type="text" name="db_password">
</div>
</div>
<div class="two 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="two fields">
<div class="field">
<label>管理员账号</label>
<input type="text" name="admin_username">
</div>
</div>
<div class="two fields">
<div class="field">
<label>管理员密码</label>
<input type="text" name="admin_password">
</div>
</div>
<div class="two fields">
<div class="field">
<label>管理员邮箱</label>
<input type="text" name="admin_email">
</div>
</div>
<div class="ui blue submit button">保存</div>
</form>
2017-04-07 01:13:36 +00:00
</div>
</div>
2017-04-01 09:04:40 +00:00
<script type="text/javascript">
// 表单验证规则
2017-04-07 09:26:46 +00:00
$('.ui.form').form(
{
2017-04-01 09:04:40 +00:00
onSuccess: function(event, fields) {
var util = new Util();
2017-04-07 01:13:36 +00:00
util.post('/install/store', fields, function(code, message) {
2017-04-07 09:26:46 +00:00
swal('安装成功');
location.href = "/";
2017-04-01 09:04:40 +00:00
});
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位'
}
]
},
adminEmail: {
identifier : 'admin_email',
rules: [
{
type : 'email',
prompt : '邮箱格式错误'
}
]
}
},
inline : true
});
</script>
{{{ template "common/footer" . }}}