|
|
@ -11,6 +11,14 @@ import "../models/routine", "../shared" |
|
|
|
viewable RoutineList: |
|
|
|
viewable RoutineList: |
|
|
|
routineModel: RoutineModel |
|
|
|
routineModel: RoutineModel |
|
|
|
runStatus: string |
|
|
|
runStatus: string |
|
|
|
|
|
|
|
selected: seq[RoutineId] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# hey, hook. |
|
|
|
|
|
|
|
hooks: |
|
|
|
|
|
|
|
# yes, you, the build hook. |
|
|
|
|
|
|
|
build: |
|
|
|
|
|
|
|
# i love you. :) |
|
|
|
|
|
|
|
state.selected = selectedPreload() |
|
|
|
|
|
|
|
|
|
|
|
proc changed(state: bool) |
|
|
|
proc changed(state: bool) |
|
|
|
|
|
|
|
|
|
|
@ -33,8 +41,7 @@ proc rsyncThread(list: RoutineListState) {.thread.} = |
|
|
|
var routineRunCount: int |
|
|
|
var routineRunCount: int |
|
|
|
routineRunCount = 0 |
|
|
|
routineRunCount = 0 |
|
|
|
for routine in list.routineModel.routineSeq(): |
|
|
|
for routine in list.routineModel.routineSeq(): |
|
|
|
#using this as "selected" for now. |
|
|
|
if routine.id in list.selected: |
|
|
|
if routine.selByDef == true: |
|
|
|
|
|
|
|
#skip routines that don't have at least one source and one destination. |
|
|
|
#skip routines that don't have at least one source and one destination. |
|
|
|
if routine.sources.len != 0 and routine.destinations.len != 0: |
|
|
|
if routine.sources.len != 0 and routine.destinations.len != 0: |
|
|
|
list.runStatus = "<span color=\"#FFE97B\" size=\"large\">Horses, please to be holding...</span>" |
|
|
|
list.runStatus = "<span color=\"#FFE97B\" size=\"large\">Horses, please to be holding...</span>" |
|
|
@ -77,7 +84,7 @@ method view(list: RoutineListState): Widget {.locks: "unknown".} = |
|
|
|
orient = OrientY |
|
|
|
orient = OrientY |
|
|
|
if list.routineModel.routineSeq().len() > 0: |
|
|
|
if list.routineModel.routineSeq().len() > 0: |
|
|
|
ListBox: |
|
|
|
ListBox: |
|
|
|
for it, routine in list.routineModel.routineSeq(): |
|
|
|
for it, routine in list.routineModel.routineSeq(): |
|
|
|
Box: |
|
|
|
Box: |
|
|
|
orient = OrientY |
|
|
|
orient = OrientY |
|
|
|
margin = 6 |
|
|
|
margin = 6 |
|
|
@ -85,7 +92,20 @@ method view(list: RoutineListState): Widget {.locks: "unknown".} = |
|
|
|
Box: |
|
|
|
Box: |
|
|
|
orient = OrientX |
|
|
|
orient = OrientX |
|
|
|
margin = 6 |
|
|
|
margin = 6 |
|
|
|
spacing = 6 |
|
|
|
spacing = 6 |
|
|
|
|
|
|
|
Switch {.expand: false, vAlign: AlignCenter.}: |
|
|
|
|
|
|
|
state = routine.selByDef |
|
|
|
|
|
|
|
tooltip = "Enable/Disable this Routine for the current Bkup run." |
|
|
|
|
|
|
|
proc changed(state: bool) = |
|
|
|
|
|
|
|
if state == true: |
|
|
|
|
|
|
|
list.selected.add(routine.id) |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
let index = list.selected.find(routine.id) |
|
|
|
|
|
|
|
if index != -1: |
|
|
|
|
|
|
|
list.selected.delete(index) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not list.changed.isNil: |
|
|
|
|
|
|
|
list.changed.callback(true) |
|
|
|
Label: |
|
|
|
Label: |
|
|
|
text = "<span size=\"large\">" & routine.name & "</span>" |
|
|
|
text = "<span size=\"large\">" & routine.name & "</span>" |
|
|
|
xAlign = 0 |
|
|
|
xAlign = 0 |
|
|
@ -110,7 +130,7 @@ method view(list: RoutineListState): Widget {.locks: "unknown".} = |
|
|
|
tooltip = "Delete this Routine. Warning: will not ask you to confirm." |
|
|
|
tooltip = "Delete this Routine. Warning: will not ask you to confirm." |
|
|
|
proc clicked() = |
|
|
|
proc clicked() = |
|
|
|
list.routineModel.delete(routine.id) |
|
|
|
list.routineModel.delete(routine.id) |
|
|
|
if routine.selByDef: |
|
|
|
if routine.id in list.selected: |
|
|
|
Box: |
|
|
|
Box: |
|
|
|
orient = OrientY |
|
|
|
orient = OrientY |
|
|
|
margin = 6 |
|
|
|
margin = 6 |
|
|
@ -192,7 +212,6 @@ method view(list: RoutineListState): Widget {.locks: "unknown".} = |
|
|
|
xAlign = 0 |
|
|
|
xAlign = 0 |
|
|
|
useMarkup = true |
|
|
|
useMarkup = true |
|
|
|
proc clicked() = |
|
|
|
proc clicked() = |
|
|
|
#list.runStatus = "<span color=\"#FFE97B\" size=\"large\">Running Bkup...</span>" |
|
|
|
|
|
|
|
createThread(thread, rsyncThread, list) |
|
|
|
createThread(thread, rsyncThread, list) |
|
|
|
else: |
|
|
|
else: |
|
|
|
Box {.expand: false.}: |
|
|
|
Box {.expand: false.}: |
|
|
|