File tree Expand file tree Collapse file tree 4 files changed +31
-11
lines changed Expand file tree Collapse file tree 4 files changed +31
-11
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,19 @@ function batchUpgrade() {
4242
4343 <BatchUpgrader ref =" refUpgrader" />
4444
45- <FooterToolBar v-if = " selectedNodes?.length > 0 " >
46- <AButton
47- type = " primary "
48- @click = " batchUpgrade "
45+ <FooterToolBar >
46+ <ATooltip
47+ :title = " $gettext('Please select at least one node to upgrade') "
48+ placement = " topLeft "
4949 >
50- {{ $gettext('Upgrade') }}
51- </AButton >
50+ <AButton
51+ :disabled =" selectedNodeIds.length === 0"
52+ type =" primary"
53+ @click =" batchUpgrade"
54+ >
55+ {{ $gettext('Upgrade') }}
56+ </AButton >
57+ </ATooltip >
5258 </FooterToolBar >
5359 </div >
5460</template >
Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ async function handlePasskeyLogin() {
229229 :two-f-a-status =" {
230230 enabled: true,
231231 otp_status: true,
232- passkey_status: true ,
232+ passkey_status: false ,
233233 }"
234234 @submit-o-t-p =" handleOTPSubmit"
235235 />
Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ func (c *ConfigPayload) mkCertificateDir() (err error) {
6060 }
6161 }
6262
63+ if _ , err = os .Stat (c .CertificateDir ); os .IsNotExist (err ) {
64+ err = os .MkdirAll (c .CertificateDir , 0755 )
65+ if err == nil {
66+ return nil
67+ }
68+ }
69+
6370 // For windows, replace * with # (issue #403)
6471 c .CertificateDir = strings .ReplaceAll (c .CertificateDir , "*" , "#" )
6572 if _ , err = os .Stat (c .CertificateDir ); os .IsNotExist (err ) {
Original file line number Diff line number Diff line change @@ -3,15 +3,17 @@ package model
33import (
44 "github.com/go-webauthn/webauthn/webauthn"
55 "github.com/spf13/cast"
6+ "gorm.io/gorm"
67)
78
89type User struct {
910 Model
1011
11- Name string `json:"name"`
12- Password string `json:"-"`
13- Status bool `json:"status" gorm:"default:1"`
14- OTPSecret []byte `json:"-" gorm:"type:blob"`
12+ Name string `json:"name"`
13+ Password string `json:"-"`
14+ Status bool `json:"status" gorm:"default:1"`
15+ OTPSecret []byte `json:"-" gorm:"type:blob"`
16+ EnabledTwoFA bool `json:"enabled_2fa" gorm:"-"`
1517}
1618
1719type AuthToken struct {
@@ -24,6 +26,11 @@ func (u *User) TableName() string {
2426 return "auths"
2527}
2628
29+ func (u * User ) AfterFind (_ * gorm.DB ) error {
30+ u .EnabledTwoFA = u .Enabled2FA ()
31+ return nil
32+ }
33+
2734func (u * User ) EnabledOTP () bool {
2835 return len (u .OTPSecret ) != 0
2936}
You can’t perform that action at this time.
0 commit comments