Implement client side enable, disable, edit
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user