gocron/templates/host/host_form.html

129 lines
5.0 KiB
Go
Raw Normal View History

2017-04-07 01:13:36 +00:00
{{{ template "common/header" . }}}
<div class="ui grid">
{{{ template "host/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">
2017-04-23 06:11:53 +00:00
<div class="content">
</div>
2017-04-07 09:26:46 +00:00
</h3>
</div>
</div>
2017-04-07 01:13:36 +00:00
<form class="ui form fluid vertical segment">
2017-04-20 01:36:42 +00:00
<input type="hidden" name="id" value="{{{.Host.Id}}}">
<div class="four fields">
2017-04-07 01:13:36 +00:00
<div class="field">
<label> (IP)</label>
2017-04-23 06:11:53 +00:00
<div class="ui small input">
2017-04-20 01:36:42 +00:00
<input type="text" name="name" value="{{{.Host.Name}}}">
2017-04-07 01:13:36 +00:00
</div>
</div>
<div class="field">
<label> (便)</label>
2017-04-23 06:11:53 +00:00
<div class="ui small input">
2017-04-20 01:36:42 +00:00
<input type="text" name="alias" value="{{{.Host.Alias}}}">
2017-04-07 01:13:36 +00:00
</div>
</div>
</div>
2017-04-20 01:36:42 +00:00
<div class="four fields">
2017-04-07 01:13:36 +00:00
<div class="field">
<label>SSH</label>
2017-04-23 06:11:53 +00:00
<div class="ui small input">
2017-04-20 01:36:42 +00:00
<input type="text" name="username" value="{{{.Host.Username}}}">
2017-04-07 01:13:36 +00:00
</div>
</div>
<div class="field">
2017-04-20 01:36:42 +00:00
<label>SSH</label>
2017-04-23 06:11:53 +00:00
<div class="ui small input">
2017-04-20 01:36:42 +00:00
<input type="text" name="port" value="{{{.Host.Port}}}">
</div>
</div>
</div>
2017-05-01 05:59:52 +00:00
<div class="fields">
2017-04-20 01:36:42 +00:00
<div class="field">
2017-05-01 05:59:52 +00:00
<div class="ui blue message">
: gocron/data/ssh/password/<br>
: echo '12345678' > data/ssh/password/127.0.0.1<br><br>
: gocron/data/ssh/private_key/<br>
: cp ~/.ssh/id_rsa data/ssh/private_key/127.0.0.1
</div>
2017-04-20 01:36:42 +00:00
<label></label>
<select name="auth_type" id="authType">
<option value="2" {{{if .Host}}} {{{if eq .Host.AuthType 2}}}selected {{{end}}} {{{end}}} data-validate-type="selectPrivateKey" data-match="private_key"></option>
<option value="1" {{{if .Host}}} {{{if eq .Host.AuthType 1}}}selected {{{end}}} {{{end}}} data-validate-type="selectPassword" data-match="password"></option>
</select>
2017-04-07 01:13:36 +00:00
</div>
</div>
<div class="two fields">
<div class="field">
<label></label>
2017-04-23 06:11:53 +00:00
<div class="ui small input">
2017-04-20 01:36:42 +00:00
<textarea rows="7" name="remark" >{{{.Host.Remark}}}</textarea>
2017-04-07 01:13:36 +00:00
</div>
</div>
</div>
2017-04-17 10:04:30 +00:00
<div class="ui primary submit button"></div>
2017-04-07 01:13:36 +00:00
</form>
</div>
</div>
<script type="text/javascript">
var $uiForm = $('.ui.form');
$($uiForm).form(
2017-04-07 09:26:46 +00:00
{
onSuccess: function(event, fields) {
util.post('/host/store', fields, function(code, message) {
location.href = "/host"
2017-04-07 09:26:46 +00:00
});
2017-04-07 01:13:36 +00:00
2017-04-07 09:26:46 +00:00
return false;
},
fields: {
name: {
identifier : 'name',
rules: [
{
type : 'empty',
prompt : ''
}
]
},
alias: {
identifier : 'alias',
rules: [
{
type : 'empty',
prompt : ''
}
]
},
username: {
identifier : 'username',
rules: [
{
type : 'empty',
prompt : 'SSH'
}
]
},
port: {
identifier : 'port',
rules: [
{
type : 'integer[1..65535]',
prompt : ''
}
]
2017-04-07 09:26:46 +00:00
}
},
inline : true
});
2017-04-07 01:13:36 +00:00
</script>
{{{ template "common/footer" . }}}