mirror of
https://github.com/MengMengCode/CLICD.git
synced 2026-08-08 06:24:44 +08:00
Fix some problem.
This commit is contained in:
@@ -128,6 +128,7 @@ type Container struct {
|
||||
IOReadMBps int `json:"io_read_mbps"`
|
||||
IOWriteMBps int `json:"io_write_mbps"`
|
||||
Status string `json:"status"`
|
||||
RestoreOnHostBoot bool `json:"restore_on_host_boot,omitempty"`
|
||||
IP string `json:"ip"`
|
||||
LANIPv4Mode string `json:"lan_ipv4_mode,omitempty"`
|
||||
LANInterface string `json:"lan_interface,omitempty"`
|
||||
@@ -1218,6 +1219,23 @@ func UpdateContainerStatus(id int, status string) {
|
||||
}
|
||||
}
|
||||
|
||||
func UpdateContainerStatusAndRestore(id int, status string, restoreOnHostBoot bool) {
|
||||
c := FindContainer(id)
|
||||
if c != nil {
|
||||
c.Status = status
|
||||
c.RestoreOnHostBoot = restoreOnHostBoot
|
||||
SaveConfig()
|
||||
}
|
||||
}
|
||||
|
||||
func SetContainerRestoreOnHostBoot(id int, restore bool) {
|
||||
c := FindContainer(id)
|
||||
if c != nil {
|
||||
c.RestoreOnHostBoot = restore
|
||||
SaveConfig()
|
||||
}
|
||||
}
|
||||
|
||||
func SetContainerPolicyBlock(id int, blocked bool, reason string) {
|
||||
c := FindContainer(id)
|
||||
if c == nil {
|
||||
|
||||
Reference in New Issue
Block a user