mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update demo site
This commit is contained in:
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)
|
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)
|
workspaceSetting, err := s.Store.UpsertWorkspaceSetting(ctx, updateSetting)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Errorf(codes.Internal, "failed to upsert workspace setting: %v", err)
|
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">
|
<div className="w-full flex flex-row justify-between items-center">
|
||||||
<span>{t("setting.workspace-section.disallow-user-registration")}</span>
|
<span>{t("setting.workspace-section.disallow-user-registration")}</span>
|
||||||
<Switch
|
<Switch
|
||||||
|
disabled={workspaceStore.state.profile.mode === "demo"}
|
||||||
checked={workspaceGeneralSetting.disallowUserRegistration}
|
checked={workspaceGeneralSetting.disallowUserRegistration}
|
||||||
onChange={(event) => updatePartialSetting({ disallowUserRegistration: event.target.checked })}
|
onChange={(event) => updatePartialSetting({ disallowUserRegistration: event.target.checked })}
|
||||||
/>
|
/>
|
||||||
@@ -127,7 +128,7 @@ const WorkspaceSection = () => {
|
|||||||
<div className="w-full flex flex-row justify-between items-center">
|
<div className="w-full flex flex-row justify-between items-center">
|
||||||
<span>{t("setting.workspace-section.disallow-password-auth")}</span>
|
<span>{t("setting.workspace-section.disallow-password-auth")}</span>
|
||||||
<Switch
|
<Switch
|
||||||
disabled={identityProviderList.length === 0 ? true : false}
|
disabled={workspaceStore.state.profile.mode === "demo" || identityProviderList.length === 0}
|
||||||
checked={workspaceGeneralSetting.disallowPasswordAuth}
|
checked={workspaceGeneralSetting.disallowPasswordAuth}
|
||||||
onChange={(event) => updatePartialSetting({ disallowPasswordAuth: event.target.checked })}
|
onChange={(event) => updatePartialSetting({ disallowPasswordAuth: event.target.checked })}
|
||||||
/>
|
/>
|
||||||
|
Reference in New Issue
Block a user