-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MFW-4232: Added support for any type in captive portal conditions (#345)
version: bug
- Loading branch information
Showing
10 changed files
with
233 additions
and
621 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
package captiveportal | ||
|
||
// Captive portal condition | ||
type CpRuleCondition struct { | ||
Op string `json:"Op,omitempty"` | ||
Type string `json:"Type,omitempty"` | ||
Value any `json:"Value,omitempty"` | ||
} | ||
|
||
// Captive portal action | ||
|
||
type CpRulesAction struct { | ||
Type string `json:"Type,omitempty"` | ||
} | ||
|
||
//Captive portal rules | ||
|
||
type CpRules struct { | ||
RuleId string `json:"RuleId,omitempty"` | ||
Enabled bool `json:"Enabled,omitempty"` | ||
Description string `json:"Description,omitempty"` | ||
Conditions []*CpRuleCondition `json:"Conditions,omitempty"` | ||
Action *CpRulesAction `json:"Action,omitempty"` | ||
} | ||
|
||
type ImageDetails struct { | ||
ImageName string `json:"imageName,omitempty"` | ||
} | ||
|
||
func (x *ImageDetails) GetImageName() string { | ||
if x != nil { | ||
return x.ImageName | ||
} | ||
return "" | ||
} | ||
|
||
type CpSettingType struct { | ||
Enabled bool `json:"Enabled,omitempty"` | ||
TimeoutValue int32 `json:"TimeoutValue,omitempty"` | ||
TimeoutPeriod string `json:"TimeoutPeriod,omitempty"` | ||
AcceptText string `json:"AcceptText,omitempty"` | ||
AcceptButtonText string `json:"AcceptButtonText,omitempty"` | ||
MessageHeading string `json:"MessageHeading,omitempty"` | ||
MessageText string `json:"MessageText,omitempty"` | ||
WelcomeText string `json:"WelcomeText,omitempty"` | ||
PageTitle string `json:"PageTitle,omitempty"` | ||
Logo *ImageDetails `json:"logo,omitempty"` | ||
Rules []*CpRules `json:"Rules,omitempty"` | ||
} | ||
|
||
func (x *CpSettingType) GetEnabled() bool { | ||
if x != nil { | ||
return x.Enabled | ||
} | ||
return false | ||
} | ||
|
||
func (x *CpSettingType) GetTimeoutValue() int32 { | ||
if x != nil { | ||
return x.TimeoutValue | ||
} | ||
return 0 | ||
} | ||
|
||
func (x *CpSettingType) GetTimeoutPeriod() string { | ||
if x != nil { | ||
return x.TimeoutPeriod | ||
} | ||
return "" | ||
} | ||
|
||
func (x *CpSettingType) GetAcceptText() string { | ||
if x != nil { | ||
return x.AcceptText | ||
} | ||
return "" | ||
} | ||
|
||
func (x *CpSettingType) GetAcceptButtonText() string { | ||
if x != nil { | ||
return x.AcceptButtonText | ||
} | ||
return "" | ||
} | ||
|
||
func (x *CpSettingType) GetMessageHeading() string { | ||
if x != nil { | ||
return x.MessageHeading | ||
} | ||
return "" | ||
} | ||
|
||
func (x *CpSettingType) GetMessageText() string { | ||
if x != nil { | ||
return x.MessageText | ||
} | ||
return "" | ||
} | ||
|
||
func (x *CpSettingType) GetWelcomeText() string { | ||
if x != nil { | ||
return x.WelcomeText | ||
} | ||
return "" | ||
} | ||
|
||
func (x *CpSettingType) GetPageTitle() string { | ||
if x != nil { | ||
return x.PageTitle | ||
} | ||
return "" | ||
} | ||
|
||
func (x *CpSettingType) GetLogo() *ImageDetails { | ||
if x != nil { | ||
return x.Logo | ||
} | ||
return nil | ||
} | ||
|
||
func (x *CpSettingType) GetRules() []*CpRules { | ||
if x != nil { | ||
return x.Rules | ||
} | ||
return nil | ||
} |
26 changes: 18 additions & 8 deletions
26
structs/protocolbuffers/ActiveSessions/ActiveSessions.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.