Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	db/hfish.db
#	logs/hfish.log
This commit is contained in:
SanJin 2019-08-12 14:15:47 +08:00
commit 0c03843ffa
4 changed files with 22 additions and 15 deletions

4
.gitignore vendored
View File

@ -16,4 +16,6 @@ vendor
.DS_Store
*/.DS_Store
*/.idea/%
*/vendor/%
*/vendor/%
db/*.db
logs/*.log

View File

@ -60,8 +60,8 @@
</thead>
<tbody id="tableList">
{{range $i, $e := .dataList}}
<tr>
<td style="font-weight: bold;"><span class="label label-primary">{{$e.setting_name}}</span></td>
<tr id="tr{{$e.type}}" data-id="{{$e.id}}">
<td style="font-weight: bold;">{{$e.setting_name}} </td>
<td>{{$e.setting_dis}}</td>
<td>{{$e.update_time}}</td>
<td>{{if ne $e.info ""}}
@ -160,6 +160,8 @@
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" onclick="syncStmpConfig()">同步stmp配置</button>
<button type="submit" class="btn btn-primary" onclick="updateReceiveEmailPost()">保存</button>
</div>
</div>
@ -170,7 +172,7 @@
<script>
function settingSubFunc(id, type) {
$("#settingId").val(id)
getSettingInfo(id, type)
getSettingInfo(id)
switch (type) {
case "mail":
$('#myModal').modal('show')
@ -186,7 +188,16 @@
}
}
var getSettingInfo = function (id, type) {
var syncStmpConfig = function () {
var id = $("#trmail ").data("id")
getSettingInfo(id,function () {
$("#alertEmail").val($("#email").val())
$("#alertPass").val($("#pass").val())
$("#alertHost").val($("#host").val())
$("#alertPort").val($("#port").val())
})
}
var getSettingInfo = function (id,cb) {
$.ajax({
type: "get",
url: "/get/setting/info?id=" + id
@ -210,6 +221,9 @@
var content = emailArr.join("\n")
$("#receive").text(content)
}
if(typeof cb=="function"){
cb()
}
}
}).fail(function (err) {
console.log(err)

2
go.mod
View File

@ -8,7 +8,7 @@ require (
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/gin-gonic/gin v1.4.0
github.com/gliderlabs/ssh v0.2.2
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869
github.com/mattn/go-sqlite3 v1.11.0
github.com/yob/graval v0.0.0-20130908151632-6309660927ac
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect

View File

@ -38,15 +38,6 @@ func checkInfo(id string) bool {
if num == 2 && typeStr == "login" {
return true
}
if num == 2 && typeStr == "alertOver" {
return true
}
if num == 1 && typeStr == "pushBullet" {
return true
}
if num == 1 && typeStr == "fangTang" {
return true
}
if num >= 4 && typeStr == "alertMail" {
return true
}