fixed message notify time - added messages to export json settings

pull/105/head
Hunter Long 2018-11-25 18:19:07 +01:00
parent 76d56d5856
commit 3e433ea8bf
3 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,4 @@
VERSION=0.79.88
VERSION=0.79.89
BINARY_NAME=statup
GOPATH:=$(GOPATH)
GOCMD=go

View File

@ -48,7 +48,7 @@ func ExportChartsJs() string {
type ExportData struct {
Core *types.Core `json:"core"`
Services []types.ServiceInterface `json:"services"`
Messages []*types.Message `json:"messages"`
Messages []*Message `json:"messages"`
Checkins []*Checkin `json:"checkins"`
Users []*User `json:"users"`
Notifiers []types.AllNotifiers `json:"notifiers"`
@ -56,6 +56,7 @@ type ExportData struct {
func ExportSettings() ([]byte, error) {
users, err := SelectAllUsers()
messages, err := SelectMessages()
if err != nil {
return nil, err
}
@ -65,6 +66,7 @@ func ExportSettings() ([]byte, error) {
Checkins: AllCheckins(),
Users: users,
Services: CoreApp.Services,
Messages: messages,
}
export, err := json.Marshal(data)
return export, err

View File

@ -60,11 +60,11 @@
<label for="notify_before" class="col-sm-4 col-form-label">Notify Before</label>
<div class="col-sm-8">
<div class="form-inline">
<input type="number" name="notify_before_scale" class="col-4 form-control" id="notify_before" value="{{.NotifyBefore.Int64}}" >
<input type="number" name="notify_before" class="col-4 form-control" id="notify_before" value="{{.NotifyBefore.Int64}}">
<select class="ml-2 col-7 form-control" name="notify_before_scale" id="notify_before_scale">
<option value="minute"{{if ne .Id 0}} selected{{end}}>Minutes</option>
<option value="hour">Hours</option>
<option value="day">Days</option>
<option value="minute"{{if ne .Id 0}} selected{{else}}{{if eq .NotifyBeforeScale "minute"}}selected{{end}}{{end}}>Minutes</option>
<option value="hour"{{if eq .NotifyBeforeScale "hour"}} selected{{end}}>Hours</option>
<option value="day"{{if eq .NotifyBeforeScale "day"}} selected{{end}}>Days</option>
</select>
</div>
</div>