server_form.hbs
6.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<div class="pageheader">
<div class="media">
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">服务器管理</a></li>
<li>服务器信息</li>
</ul>
<h4>服务器信息</h4>
</div>
</div>
<!-- media -->
</div>
<!-- pageheader -->
<div class="panel panel-default">
<div class="panel-heading">
<p>请配置服务器连接信息,请确保配置的部署目录有读写权限.</p>
</div>
<form id="server-form" action="/servers/save" method="POST" data-pjax>
<input type="hidden" name="_id" value="{{_id}}">
<div class="panel-body">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="control-label">Host</label>
<input type="text" name="host" value="{{host}}" class="form-control" placeholder="服务器地址">
</div>
<!-- form-group -->
</div>
<!-- col-sm-6 -->
<div class="col-sm-6">
<div class="form-group">
<label class="control-label">Username</label>
<input type="text" name="username" value="{{username}}" class="form-control" placeholder="用户名">
</div>
<!-- form-group -->
</div>
<!-- col-sm-6 -->
</div>
<!-- row -->
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="control-label">Password</label>
<input type="text" name="password" value="{{password}}" class="form-control" placeholder="密码">
</div>
<!-- form-group -->
</div>
<!-- col-sm-6 -->
<div class="col-sm-6">
<div class="form-group">
<label class="control-label">Port</label>
<input type="text" name="port" value="{{port}}" class="form-control" value="22" placeholder="端口">
</div>
<!-- form-group -->
</div>
<!-- col-sm-6 -->
</div>
<div class="row">
<div class="col-sm-2">
<div class="form-group">
<label class="control-label">Env</label>
<div class="rdio rdio-primary">
<input type="radio" name="env" id="proEnv" value="production" {{#equals env 'production'}}checked="checked"{{/equals}}>
<label for="proEnv">线上环境</label>
</div>
</div>
</div>
<div class="col-sm-2">
<label class="control-label"> </label>
<div class="rdio rdio-primary">
<input type="radio" name="env" id="previewEnv" value="preview" {{#equals env 'preview'}}checked="checked"{{/equals}}>
<label for="previewEnv">灰度环境</label>
</div>
</div>
<div class="col-sm-2">
<label class="control-label"> </label>
<div class="rdio rdio-primary">
<input type="radio" name="env" id="testEnv" value="test" {{#equals env 'test'}}checked="checked"{{/equals}}>
<label for="testEnv">测试环境</label>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<label class="control-label">Cloud</label>
<div class="rdio rdio-primary">
<input type="radio" name="cloud" id="cloudAws" value="aws" {{#equals cloud 'aws'}}checked="checked"{{/equals}}>
<label for="cloudAws">AWS</label>
</div>
</div>
</div>
<div class="col-sm-2">
<label class="control-label"> </label>
<div class="rdio rdio-primary">
<input type="radio" name="cloud" id="cloudQQ" value="qcloud" {{#equals cloud 'qcloud'}}checked="checked"{{/equals}}>
<label for="cloudQQ">QCloud</label>
</div>
</div>
<div class="col-sm-2">
<label class="control-label"> </label>
<div class="rdio rdio-primary">
<input type="radio" name="cloud" id="cloudLocal" value="local" {{#equals cloud 'local'}}checked="checked"{{/equals}}>
<label for="cloudLocal">测试环境</label>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="control-label">Deploy Path</label>
<input type="text" name="deployDir" class="form-control" placeholder="部署目录" value="{{deployDir}}">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="control-label">密钥</label>
<textarea name="privateKey" placeholder="私钥" class="form-control" style="height: 100px">{{privateKey}}</textarea>
</div>
</div>
</div>
<!-- row -->
</div>
<!-- panel-body -->
<div class="panel-footer">
<button type="submit" class="btn btn-primary">保存</button>
</div>
</form>
<!-- panel-footer -->
</div>
<script>
$(document).on('ready pjax:success', function() {
$('#server-form').ajaxForm(function() {
location.href = '/servers/setting';
});
});
</script>