Disable add key button if SSH is disabled (#2873)

This commit is contained in:
Michael Kuhn 2017-11-21 04:49:33 +01:00 committed by Lunny Xiao
parent 1f7aab6e19
commit 420fc8efc2
8 changed files with 39 additions and 8 deletions

View file

@ -37,6 +37,20 @@ func (err ErrNamePatternNotAllowed) Error() string {
return fmt.Sprintf("name pattern is not allowed [pattern: %s]", err.Pattern)
}
// ErrSSHDisabled represents an "SSH disabled" error.
type ErrSSHDisabled struct {
}
// IsErrSSHDisabled checks if an error is a ErrSSHDisabled.
func IsErrSSHDisabled(err error) bool {
_, ok := err.(ErrSSHDisabled)
return ok
}
func (err ErrSSHDisabled) Error() string {
return "SSH is disabled"
}
// ____ ___
// | | \______ ___________
// | | / ___// __ \_ __ \