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
*/.DS_Store */.DS_Store
*/.idea/% */.idea/%
*/vendor/% */vendor/%
db/*.db
logs/*.log

View File

@ -60,8 +60,8 @@
</thead> </thead>
<tbody id="tableList"> <tbody id="tableList">
{{range $i, $e := .dataList}} {{range $i, $e := .dataList}}
<tr> <tr id="tr{{$e.type}}" data-id="{{$e.id}}">
<td style="font-weight: bold;"><span class="label label-primary">{{$e.setting_name}}</span></td> <td style="font-weight: bold;">{{$e.setting_name}} </td>
<td>{{$e.setting_dis}}</td> <td>{{$e.setting_dis}}</td>
<td>{{$e.update_time}}</td> <td>{{$e.update_time}}</td>
<td>{{if ne $e.info ""}} <td>{{if ne $e.info ""}}
@ -160,6 +160,8 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <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> <button type="submit" class="btn btn-primary" onclick="updateReceiveEmailPost()">保存</button>
</div> </div>
</div> </div>
@ -170,7 +172,7 @@
<script> <script>
function settingSubFunc(id, type) { function settingSubFunc(id, type) {
$("#settingId").val(id) $("#settingId").val(id)
getSettingInfo(id, type) getSettingInfo(id)
switch (type) { switch (type) {
case "mail": case "mail":
$('#myModal').modal('show') $('#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({ $.ajax({
type: "get", type: "get",
url: "/get/setting/info?id=" + id url: "/get/setting/info?id=" + id
@ -210,6 +221,9 @@
var content = emailArr.join("\n") var content = emailArr.join("\n")
$("#receive").text(content) $("#receive").text(content)
} }
if(typeof cb=="function"){
cb()
}
} }
}).fail(function (err) { }).fail(function (err) {
console.log(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/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/gin-gonic/gin v1.4.0 github.com/gin-gonic/gin v1.4.0
github.com/gliderlabs/ssh v0.2.2 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/mattn/go-sqlite3 v1.11.0
github.com/yob/graval v0.0.0-20130908151632-6309660927ac github.com/yob/graval v0.0.0-20130908151632-6309660927ac
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect 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" { if num == 2 && typeStr == "login" {
return true 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" { if num >= 4 && typeStr == "alertMail" {
return true return true
} }