mirror of https://github.com/ouqiang/gocron
152 lines
5.4 KiB
HTML
152 lines
5.4 KiB
HTML
{{{ template "common/header" . }}}
|
|
|
|
<h1 class="ui header center aligned">安装</h1>
|
|
<form class="ui form">
|
|
<div class="ui grey inverted segment center aligned">数据库配置</div>
|
|
<div class="field">
|
|
<label>数据库(目前只支持MySQL)</label>
|
|
<select class="ui search dropdown" name="db_type">
|
|
<option value="mysql">MySQL</option>
|
|
</select>
|
|
</div>
|
|
<div class="field">
|
|
<label>主机名</label>
|
|
<input type="text" placeholder="主机名" name="db_host" value="127.0.0.1">
|
|
</div>
|
|
<div class="field">
|
|
<label>端口</label>
|
|
<input type="text" placeholder="端口" name="db_port" value="3306">
|
|
</div>
|
|
<div class="field">
|
|
<label>用户名</label>
|
|
<input type="text" placeholder="用户名" name="db_username">
|
|
</div>
|
|
<div class="field">
|
|
<label>密码</label>
|
|
<input type="text" placeholder="密码" name="db_password">
|
|
</div>
|
|
<div class="field">
|
|
<label>数据库名称</label>
|
|
<input type="text" placeholder="数据库名称" name="db_name">
|
|
</div>
|
|
<div class="field">
|
|
<label>表前缀</label>
|
|
<input type="text" placeholder="cron_" name="db_table_prefix" value="cron_">
|
|
</div>
|
|
|
|
<div class="ui grey inverted segment center aligned">管理员账号配置</div>
|
|
<div class="field">
|
|
<label>管理员账号</label>
|
|
<input type="text" placeholder="管理员账号" name="admin_username">
|
|
</div>
|
|
<div class="field">
|
|
<label>管理员密码</label>
|
|
<input type="text" placeholder="管理员密码" name="admin_password">
|
|
</div>
|
|
<div class="field">
|
|
<label>管理员邮箱</label>
|
|
<input type="text" placeholder="管理员邮箱" name="admin_email">
|
|
</div>
|
|
<div class="ui primary submit button">提交</div>
|
|
</form>
|
|
|
|
<script type="text/javascript">
|
|
// 表单验证规则
|
|
$('.ui.form')
|
|
.form({
|
|
onSuccess: function(event, fields) {
|
|
var util = new Util();
|
|
util.post('/install', fields, function(code, message) {
|
|
|
|
});
|
|
return false;
|
|
},
|
|
fields: {
|
|
dbType: {
|
|
identifier : 'db_type',
|
|
rules: [
|
|
{
|
|
type : 'empty',
|
|
prompt : '请选择数据库'
|
|
}
|
|
]
|
|
},
|
|
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" . }}} |