mirror of
https://github.com/usememos/memos.git
synced 2025-03-04 01:04:38 +08:00
chore: update demo site
This commit is contained in:
parent
47b41bce85
commit
5562282822
3 changed files with 5 additions and 7 deletions
3
proto/api/v1/README.md
Normal file
3
proto/api/v1/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Memos API Design
|
||||
|
||||
This API design should follow the guidelines and best practices outlined in the [Google API Improvement Proposals (AIPs)](https://google.aip.dev/).
|
|
@ -70,12 +70,6 @@ func (s *APIV1Service) SetWorkspaceSetting(ctx context.Context, request *v1pb.Se
|
|||
}
|
||||
|
||||
updateSetting := convertWorkspaceSettingToStore(request.Setting)
|
||||
// Don't allow to update workspace general setting in demo mode.
|
||||
// Such as disallow user registration, disallow password auth, etc.
|
||||
if s.Profile.Mode == "demo" && updateSetting.Key == storepb.WorkspaceSettingKey_GENERAL {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "setting workspace setting is not allowed in demo mode")
|
||||
}
|
||||
|
||||
workspaceSetting, err := s.Store.UpsertWorkspaceSetting(ctx, updateSetting)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "failed to upsert workspace setting: %v", err)
|
||||
|
|
|
@ -120,6 +120,7 @@ const WorkspaceSection = () => {
|
|||
<div className="w-full flex flex-row justify-between items-center">
|
||||
<span>{t("setting.workspace-section.disallow-user-registration")}</span>
|
||||
<Switch
|
||||
disabled={workspaceStore.state.profile.mode === "demo"}
|
||||
checked={workspaceGeneralSetting.disallowUserRegistration}
|
||||
onChange={(event) => updatePartialSetting({ disallowUserRegistration: event.target.checked })}
|
||||
/>
|
||||
|
@ -127,7 +128,7 @@ const WorkspaceSection = () => {
|
|||
<div className="w-full flex flex-row justify-between items-center">
|
||||
<span>{t("setting.workspace-section.disallow-password-auth")}</span>
|
||||
<Switch
|
||||
disabled={identityProviderList.length === 0 ? true : false}
|
||||
disabled={workspaceStore.state.profile.mode === "demo" || identityProviderList.length === 0}
|
||||
checked={workspaceGeneralSetting.disallowPasswordAuth}
|
||||
onChange={(event) => updatePartialSetting({ disallowPasswordAuth: event.target.checked })}
|
||||
/>
|
||||
|
|
Loading…
Reference in a new issue