Implement client side enable, disable, edit

This commit is contained in:
bel
2020-03-15 20:14:03 +00:00
parent b7bfee96a3
commit 19d4b645b8
8 changed files with 63 additions and 18 deletions

View File

@@ -25,6 +25,7 @@ type Job struct {
LastOutput string
LastRuntime time.Duration
LastRun time.Time
Disabled bool
}
func NewJob(runner Runner, schedule, raw string) (*Job, error) {
@@ -100,6 +101,7 @@ func (j *Job) Decode(b []byte) error {
k.LastOutput = j.LastOutput
k.LastRuntime = j.LastRuntime
k.LastRun = j.LastRun
k.Disabled = j.Disabled
*j = *k
}
return err

View File

@@ -89,6 +89,9 @@ func TestJobEncodeDecode(t *testing.T) {
if k.Name != j.Name {
t.Error(k.Name, "vs", j.Name)
}
if k.Disabled != j.Disabled {
t.Error(k.Disabled, "vs", j.Disabled)
}
if k.Title != j.Title {
t.Error(k.Title, "vs", j.Title)
}