mirror of
https://github.com/usememos/memos.git
synced 2025-04-13 17:12:07 +02:00
chore: retire legacy setting api
This commit is contained in:
parent
3088cabe10
commit
755d5b83c6
@ -21,14 +21,6 @@ message WorkspaceProfile {
|
|||||||
string version = 2;
|
string version = 2;
|
||||||
// mode is the instance mode (e.g. "prod", "dev" or "demo").
|
// mode is the instance mode (e.g. "prod", "dev" or "demo").
|
||||||
string mode = 3;
|
string mode = 3;
|
||||||
// disallow_signup is whether the signup is disallowed.
|
|
||||||
bool disallow_signup = 4;
|
|
||||||
// disable_password_login is whether the password login is disabled.
|
|
||||||
bool disable_password_login = 5;
|
|
||||||
// additional_script is the additional script.
|
|
||||||
string additional_script = 6;
|
|
||||||
// additional_style is the additional style.
|
|
||||||
string additional_style = 7;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetWorkspaceProfileRequest {}
|
message GetWorkspaceProfileRequest {}
|
||||||
|
@ -9,6 +9,10 @@ import "google/api/field_behavior.proto";
|
|||||||
option go_package = "gen/api/v2";
|
option go_package = "gen/api/v2";
|
||||||
|
|
||||||
service WorkspaceSettingService {
|
service WorkspaceSettingService {
|
||||||
|
// ListWorkspaceSetting returns the list of settings.
|
||||||
|
rpc ListWorkspaceSettings(ListWorkspaceSettingsRequest) returns (ListWorkspaceSettingsResponse) {
|
||||||
|
option (google.api.http) = {get: "/api/v2/workspace/settings"};
|
||||||
|
}
|
||||||
// GetWorkspaceSetting returns the setting by name.
|
// GetWorkspaceSetting returns the setting by name.
|
||||||
rpc GetWorkspaceSetting(GetWorkspaceSettingRequest) returns (GetWorkspaceSettingResponse) {
|
rpc GetWorkspaceSetting(GetWorkspaceSettingRequest) returns (GetWorkspaceSettingResponse) {
|
||||||
option (google.api.http) = {get: "/api/v2/workspace/{name=settings/*}"};
|
option (google.api.http) = {get: "/api/v2/workspace/{name=settings/*}"};
|
||||||
@ -24,6 +28,12 @@ service WorkspaceSettingService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message ListWorkspaceSettingsRequest {}
|
||||||
|
|
||||||
|
message ListWorkspaceSettingsResponse {
|
||||||
|
repeated WorkspaceSetting settings = 1;
|
||||||
|
}
|
||||||
|
|
||||||
message GetWorkspaceSettingRequest {
|
message GetWorkspaceSettingRequest {
|
||||||
// The resource name of the workspace setting.
|
// The resource name of the workspace setting.
|
||||||
// Format: settings/{setting}
|
// Format: settings/{setting}
|
||||||
@ -63,19 +73,31 @@ message WorkspaceGeneralSetting {
|
|||||||
// disallow_password_login is the flag to disallow password login.
|
// disallow_password_login is the flag to disallow password login.
|
||||||
bool disallow_password_login = 3;
|
bool disallow_password_login = 3;
|
||||||
// additional_script is the additional script.
|
// additional_script is the additional script.
|
||||||
string additional_script = 5;
|
string additional_script = 4;
|
||||||
// additional_style is the additional style.
|
// additional_style is the additional style.
|
||||||
string additional_style = 6;
|
string additional_style = 5;
|
||||||
|
// custom_profile is the custom profile.
|
||||||
|
WorkspaceCustomProfile custom_profile = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
message WorkspaceCustomProfile {
|
||||||
|
string title = 1;
|
||||||
|
string description = 2;
|
||||||
|
string logo_url = 3;
|
||||||
|
string locale = 4;
|
||||||
|
string appearance = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message WorkspaceStorageSetting {
|
message WorkspaceStorageSetting {
|
||||||
// storage_type is the storage type.
|
// storage_type is the storage type.
|
||||||
StorageType storage_type = 1;
|
StorageType storage_type = 1;
|
||||||
|
// The id of actived external storage.
|
||||||
|
optional int32 actived_external_storage_id = 2;
|
||||||
// The local storage path for STORAGE_TYPE_LOCAL.
|
// The local storage path for STORAGE_TYPE_LOCAL.
|
||||||
// e.g. assets/{timestamp}_{filename}
|
// e.g. assets/{timestamp}_{filename}
|
||||||
string local_storage_path = 2;
|
string local_storage_path = 3;
|
||||||
// The max upload size in megabytes.
|
// The max upload size in megabytes.
|
||||||
int64 upload_size_limit_mb = 3;
|
int64 upload_size_limit_mb = 4;
|
||||||
|
|
||||||
enum StorageType {
|
enum StorageType {
|
||||||
STORAGE_TYPE_UNSPECIFIED = 0;
|
STORAGE_TYPE_UNSPECIFIED = 0;
|
||||||
|
@ -215,8 +215,11 @@
|
|||||||
- [api/v2/workspace_setting_service.proto](#api_v2_workspace_setting_service-proto)
|
- [api/v2/workspace_setting_service.proto](#api_v2_workspace_setting_service-proto)
|
||||||
- [GetWorkspaceSettingRequest](#memos-api-v2-GetWorkspaceSettingRequest)
|
- [GetWorkspaceSettingRequest](#memos-api-v2-GetWorkspaceSettingRequest)
|
||||||
- [GetWorkspaceSettingResponse](#memos-api-v2-GetWorkspaceSettingResponse)
|
- [GetWorkspaceSettingResponse](#memos-api-v2-GetWorkspaceSettingResponse)
|
||||||
|
- [ListWorkspaceSettingsRequest](#memos-api-v2-ListWorkspaceSettingsRequest)
|
||||||
|
- [ListWorkspaceSettingsResponse](#memos-api-v2-ListWorkspaceSettingsResponse)
|
||||||
- [SetWorkspaceSettingRequest](#memos-api-v2-SetWorkspaceSettingRequest)
|
- [SetWorkspaceSettingRequest](#memos-api-v2-SetWorkspaceSettingRequest)
|
||||||
- [SetWorkspaceSettingResponse](#memos-api-v2-SetWorkspaceSettingResponse)
|
- [SetWorkspaceSettingResponse](#memos-api-v2-SetWorkspaceSettingResponse)
|
||||||
|
- [WorkspaceCustomProfile](#memos-api-v2-WorkspaceCustomProfile)
|
||||||
- [WorkspaceGeneralSetting](#memos-api-v2-WorkspaceGeneralSetting)
|
- [WorkspaceGeneralSetting](#memos-api-v2-WorkspaceGeneralSetting)
|
||||||
- [WorkspaceMemoRelatedSetting](#memos-api-v2-WorkspaceMemoRelatedSetting)
|
- [WorkspaceMemoRelatedSetting](#memos-api-v2-WorkspaceMemoRelatedSetting)
|
||||||
- [WorkspaceSetting](#memos-api-v2-WorkspaceSetting)
|
- [WorkspaceSetting](#memos-api-v2-WorkspaceSetting)
|
||||||
@ -2880,10 +2883,6 @@ Used internally for obfuscating the page token.
|
|||||||
| owner | [string](#string) | | The name of intance owner. Format: "users/{id}" |
|
| owner | [string](#string) | | The name of intance owner. Format: "users/{id}" |
|
||||||
| version | [string](#string) | | version is the current version of instance |
|
| version | [string](#string) | | version is the current version of instance |
|
||||||
| mode | [string](#string) | | mode is the instance mode (e.g. "prod", "dev" or "demo"). |
|
| mode | [string](#string) | | mode is the instance mode (e.g. "prod", "dev" or "demo"). |
|
||||||
| disallow_signup | [bool](#bool) | | disallow_signup is whether the signup is disallowed. |
|
|
||||||
| disable_password_login | [bool](#bool) | | disable_password_login is whether the password login is disabled. |
|
|
||||||
| additional_script | [string](#string) | | additional_script is the additional script. |
|
|
||||||
| additional_style | [string](#string) | | additional_style is the additional style. |
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -2946,6 +2945,31 @@ Used internally for obfuscating the page token.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="memos-api-v2-ListWorkspaceSettingsRequest"></a>
|
||||||
|
|
||||||
|
### ListWorkspaceSettingsRequest
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="memos-api-v2-ListWorkspaceSettingsResponse"></a>
|
||||||
|
|
||||||
|
### ListWorkspaceSettingsResponse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
| Field | Type | Label | Description |
|
||||||
|
| ----- | ---- | ----- | ----------- |
|
||||||
|
| settings | [WorkspaceSetting](#memos-api-v2-WorkspaceSetting) | repeated | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="memos-api-v2-SetWorkspaceSettingRequest"></a>
|
<a name="memos-api-v2-SetWorkspaceSettingRequest"></a>
|
||||||
|
|
||||||
### SetWorkspaceSettingRequest
|
### SetWorkspaceSettingRequest
|
||||||
@ -2976,6 +3000,25 @@ Used internally for obfuscating the page token.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="memos-api-v2-WorkspaceCustomProfile"></a>
|
||||||
|
|
||||||
|
### WorkspaceCustomProfile
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
| Field | Type | Label | Description |
|
||||||
|
| ----- | ---- | ----- | ----------- |
|
||||||
|
| title | [string](#string) | | |
|
||||||
|
| description | [string](#string) | | |
|
||||||
|
| logo_url | [string](#string) | | |
|
||||||
|
| locale | [string](#string) | | |
|
||||||
|
| appearance | [string](#string) | | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="memos-api-v2-WorkspaceGeneralSetting"></a>
|
<a name="memos-api-v2-WorkspaceGeneralSetting"></a>
|
||||||
|
|
||||||
### WorkspaceGeneralSetting
|
### WorkspaceGeneralSetting
|
||||||
@ -2989,6 +3032,7 @@ Used internally for obfuscating the page token.
|
|||||||
| disallow_password_login | [bool](#bool) | | disallow_password_login is the flag to disallow password login. |
|
| disallow_password_login | [bool](#bool) | | disallow_password_login is the flag to disallow password login. |
|
||||||
| additional_script | [string](#string) | | additional_script is the additional script. |
|
| additional_script | [string](#string) | | additional_script is the additional script. |
|
||||||
| additional_style | [string](#string) | | additional_style is the additional style. |
|
| additional_style | [string](#string) | | additional_style is the additional style. |
|
||||||
|
| custom_profile | [WorkspaceCustomProfile](#memos-api-v2-WorkspaceCustomProfile) | | custom_profile is the custom profile. |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -3039,6 +3083,7 @@ Used internally for obfuscating the page token.
|
|||||||
| Field | Type | Label | Description |
|
| Field | Type | Label | Description |
|
||||||
| ----- | ---- | ----- | ----------- |
|
| ----- | ---- | ----- | ----------- |
|
||||||
| storage_type | [WorkspaceStorageSetting.StorageType](#memos-api-v2-WorkspaceStorageSetting-StorageType) | | storage_type is the storage type. |
|
| storage_type | [WorkspaceStorageSetting.StorageType](#memos-api-v2-WorkspaceStorageSetting-StorageType) | | storage_type is the storage type. |
|
||||||
|
| actived_external_storage_id | [int32](#int32) | optional | The id of actived external storage. |
|
||||||
| local_storage_path | [string](#string) | | The local storage path for STORAGE_TYPE_LOCAL. e.g. assets/{timestamp}_{filename} |
|
| local_storage_path | [string](#string) | | The local storage path for STORAGE_TYPE_LOCAL. e.g. assets/{timestamp}_{filename} |
|
||||||
| upload_size_limit_mb | [int64](#int64) | | The max upload size in megabytes. |
|
| upload_size_limit_mb | [int64](#int64) | | The max upload size in megabytes. |
|
||||||
|
|
||||||
@ -3089,6 +3134,7 @@ Used internally for obfuscating the page token.
|
|||||||
|
|
||||||
| Method Name | Request Type | Response Type | Description |
|
| Method Name | Request Type | Response Type | Description |
|
||||||
| ----------- | ------------ | ------------- | ------------|
|
| ----------- | ------------ | ------------- | ------------|
|
||||||
|
| ListWorkspaceSettings | [ListWorkspaceSettingsRequest](#memos-api-v2-ListWorkspaceSettingsRequest) | [ListWorkspaceSettingsResponse](#memos-api-v2-ListWorkspaceSettingsResponse) | ListWorkspaceSetting returns the list of settings. |
|
||||||
| GetWorkspaceSetting | [GetWorkspaceSettingRequest](#memos-api-v2-GetWorkspaceSettingRequest) | [GetWorkspaceSettingResponse](#memos-api-v2-GetWorkspaceSettingResponse) | GetWorkspaceSetting returns the setting by name. |
|
| GetWorkspaceSetting | [GetWorkspaceSettingRequest](#memos-api-v2-GetWorkspaceSettingRequest) | [GetWorkspaceSettingResponse](#memos-api-v2-GetWorkspaceSettingResponse) | GetWorkspaceSetting returns the setting by name. |
|
||||||
| SetWorkspaceSetting | [SetWorkspaceSettingRequest](#memos-api-v2-SetWorkspaceSettingRequest) | [SetWorkspaceSettingResponse](#memos-api-v2-SetWorkspaceSettingResponse) | SetWorkspaceSetting updates the setting. |
|
| SetWorkspaceSetting | [SetWorkspaceSettingRequest](#memos-api-v2-SetWorkspaceSettingRequest) | [SetWorkspaceSettingResponse](#memos-api-v2-SetWorkspaceSettingResponse) | SetWorkspaceSetting updates the setting. |
|
||||||
|
|
||||||
|
@ -33,14 +33,6 @@ type WorkspaceProfile struct {
|
|||||||
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
|
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
|
||||||
// mode is the instance mode (e.g. "prod", "dev" or "demo").
|
// mode is the instance mode (e.g. "prod", "dev" or "demo").
|
||||||
Mode string `protobuf:"bytes,3,opt,name=mode,proto3" json:"mode,omitempty"`
|
Mode string `protobuf:"bytes,3,opt,name=mode,proto3" json:"mode,omitempty"`
|
||||||
// disallow_signup is whether the signup is disallowed.
|
|
||||||
DisallowSignup bool `protobuf:"varint,4,opt,name=disallow_signup,json=disallowSignup,proto3" json:"disallow_signup,omitempty"`
|
|
||||||
// disable_password_login is whether the password login is disabled.
|
|
||||||
DisablePasswordLogin bool `protobuf:"varint,5,opt,name=disable_password_login,json=disablePasswordLogin,proto3" json:"disable_password_login,omitempty"`
|
|
||||||
// additional_script is the additional script.
|
|
||||||
AdditionalScript string `protobuf:"bytes,6,opt,name=additional_script,json=additionalScript,proto3" json:"additional_script,omitempty"`
|
|
||||||
// additional_style is the additional style.
|
|
||||||
AdditionalStyle string `protobuf:"bytes,7,opt,name=additional_style,json=additionalStyle,proto3" json:"additional_style,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WorkspaceProfile) Reset() {
|
func (x *WorkspaceProfile) Reset() {
|
||||||
@ -96,34 +88,6 @@ func (x *WorkspaceProfile) GetMode() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WorkspaceProfile) GetDisallowSignup() bool {
|
|
||||||
if x != nil {
|
|
||||||
return x.DisallowSignup
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *WorkspaceProfile) GetDisablePasswordLogin() bool {
|
|
||||||
if x != nil {
|
|
||||||
return x.DisablePasswordLogin
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *WorkspaceProfile) GetAdditionalScript() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.AdditionalScript
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *WorkspaceProfile) GetAdditionalStyle() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.AdditionalStyle
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetWorkspaceProfileRequest struct {
|
type GetWorkspaceProfileRequest struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@ -216,55 +180,43 @@ var file_api_v2_workspace_service_proto_rawDesc = []byte{
|
|||||||
0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a, 0x1c,
|
0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a, 0x1c,
|
||||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
|
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
|
||||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x02, 0x0a,
|
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x10,
|
||||||
0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c,
|
|
||||||
0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
|
||||||
0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
|
|
||||||
0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
|
|
||||||
0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
|
||||||
0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f,
|
|
||||||
0x77, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e,
|
|
||||||
0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x12, 0x34,
|
|
||||||
0x0a, 0x16, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f,
|
|
||||||
0x72, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14,
|
|
||||||
0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4c,
|
|
||||||
0x6f, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,
|
|
||||||
0x61, 0x6c, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
|
|
||||||
0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70,
|
|
||||||
0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f,
|
|
||||||
0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x64, 0x64,
|
|
||||||
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x22, 0x1c, 0x0a, 0x1a,
|
|
||||||
0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66,
|
|
||||||
0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6a, 0x0a, 0x1b, 0x47, 0x65,
|
|
||||||
0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c,
|
|
||||||
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x11, 0x77, 0x6f, 0x72,
|
|
||||||
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01,
|
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
|
|
||||||
0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f,
|
|
||||||
0x66, 0x69, 0x6c, 0x65, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50,
|
|
||||||
0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x32, 0xa2, 0x01, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73,
|
|
||||||
0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x13,
|
|
||||||
0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66,
|
|
||||||
0x69, 0x6c, 0x65, 0x12, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
|
||||||
0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50,
|
|
||||||
0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e,
|
|
||||||
0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74,
|
|
||||||
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65,
|
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65,
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b,
|
0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70,
|
0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
|
||||||
0x61, 0x63, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x42, 0xad, 0x01, 0x0a, 0x10,
|
0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||||
0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
|
0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
||||||
0x42, 0x15, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69,
|
0x6d, 0x6f, 0x64, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73,
|
||||||
0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75,
|
0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d,
|
0x73, 0x74, 0x22, 0x6a, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
|
||||||
0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61,
|
0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41,
|
0x65, 0x12, 0x4b, 0x0a, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x70,
|
||||||
0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32,
|
0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d,
|
||||||
0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2,
|
0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b,
|
||||||
0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47,
|
0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x10, 0x77, 0x6f,
|
||||||
0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d,
|
0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x32, 0xa2,
|
||||||
0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
0x01, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76,
|
||||||
0x74, 0x6f, 0x33,
|
0x69, 0x63, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73,
|
||||||
|
0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x28, 0x2e, 0x6d, 0x65,
|
||||||
|
0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f,
|
||||||
|
0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65,
|
||||||
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
||||||
|
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
|
||||||
|
0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
|
0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
|
||||||
|
0x32, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x66,
|
||||||
|
0x69, 0x6c, 0x65, 0x42, 0xad, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f,
|
||||||
|
0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x15, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
|
||||||
|
0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
|
||||||
|
0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73,
|
||||||
|
0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70,
|
||||||
|
0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f,
|
||||||
|
0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73,
|
||||||
|
0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c,
|
||||||
|
0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
|
||||||
|
0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a,
|
||||||
|
0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -73,7 +73,92 @@ func (x WorkspaceStorageSetting_StorageType) Number() protoreflect.EnumNumber {
|
|||||||
|
|
||||||
// Deprecated: Use WorkspaceStorageSetting_StorageType.Descriptor instead.
|
// Deprecated: Use WorkspaceStorageSetting_StorageType.Descriptor instead.
|
||||||
func (WorkspaceStorageSetting_StorageType) EnumDescriptor() ([]byte, []int) {
|
func (WorkspaceStorageSetting_StorageType) EnumDescriptor() ([]byte, []int) {
|
||||||
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{6, 0}
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{9, 0}
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListWorkspaceSettingsRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListWorkspaceSettingsRequest) Reset() {
|
||||||
|
*x = ListWorkspaceSettingsRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListWorkspaceSettingsRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListWorkspaceSettingsRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListWorkspaceSettingsRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ListWorkspaceSettingsRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListWorkspaceSettingsRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListWorkspaceSettingsResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Settings []*WorkspaceSetting `protobuf:"bytes,1,rep,name=settings,proto3" json:"settings,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListWorkspaceSettingsResponse) Reset() {
|
||||||
|
*x = ListWorkspaceSettingsResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListWorkspaceSettingsResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListWorkspaceSettingsResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListWorkspaceSettingsResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[1]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ListWorkspaceSettingsResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListWorkspaceSettingsResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListWorkspaceSettingsResponse) GetSettings() []*WorkspaceSetting {
|
||||||
|
if x != nil {
|
||||||
|
return x.Settings
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetWorkspaceSettingRequest struct {
|
type GetWorkspaceSettingRequest struct {
|
||||||
@ -89,7 +174,7 @@ type GetWorkspaceSettingRequest struct {
|
|||||||
func (x *GetWorkspaceSettingRequest) Reset() {
|
func (x *GetWorkspaceSettingRequest) Reset() {
|
||||||
*x = GetWorkspaceSettingRequest{}
|
*x = GetWorkspaceSettingRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[0]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[2]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -102,7 +187,7 @@ func (x *GetWorkspaceSettingRequest) String() string {
|
|||||||
func (*GetWorkspaceSettingRequest) ProtoMessage() {}
|
func (*GetWorkspaceSettingRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetWorkspaceSettingRequest) ProtoReflect() protoreflect.Message {
|
func (x *GetWorkspaceSettingRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[0]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[2]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -115,7 +200,7 @@ func (x *GetWorkspaceSettingRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetWorkspaceSettingRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetWorkspaceSettingRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*GetWorkspaceSettingRequest) Descriptor() ([]byte, []int) {
|
func (*GetWorkspaceSettingRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{0}
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{2}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetWorkspaceSettingRequest) GetName() string {
|
func (x *GetWorkspaceSettingRequest) GetName() string {
|
||||||
@ -136,7 +221,7 @@ type GetWorkspaceSettingResponse struct {
|
|||||||
func (x *GetWorkspaceSettingResponse) Reset() {
|
func (x *GetWorkspaceSettingResponse) Reset() {
|
||||||
*x = GetWorkspaceSettingResponse{}
|
*x = GetWorkspaceSettingResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[1]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[3]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -149,7 +234,7 @@ func (x *GetWorkspaceSettingResponse) String() string {
|
|||||||
func (*GetWorkspaceSettingResponse) ProtoMessage() {}
|
func (*GetWorkspaceSettingResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetWorkspaceSettingResponse) ProtoReflect() protoreflect.Message {
|
func (x *GetWorkspaceSettingResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[1]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[3]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -162,7 +247,7 @@ func (x *GetWorkspaceSettingResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetWorkspaceSettingResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetWorkspaceSettingResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*GetWorkspaceSettingResponse) Descriptor() ([]byte, []int) {
|
func (*GetWorkspaceSettingResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{1}
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetWorkspaceSettingResponse) GetSetting() *WorkspaceSetting {
|
func (x *GetWorkspaceSettingResponse) GetSetting() *WorkspaceSetting {
|
||||||
@ -184,7 +269,7 @@ type SetWorkspaceSettingRequest struct {
|
|||||||
func (x *SetWorkspaceSettingRequest) Reset() {
|
func (x *SetWorkspaceSettingRequest) Reset() {
|
||||||
*x = SetWorkspaceSettingRequest{}
|
*x = SetWorkspaceSettingRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[2]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[4]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -197,7 +282,7 @@ func (x *SetWorkspaceSettingRequest) String() string {
|
|||||||
func (*SetWorkspaceSettingRequest) ProtoMessage() {}
|
func (*SetWorkspaceSettingRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *SetWorkspaceSettingRequest) ProtoReflect() protoreflect.Message {
|
func (x *SetWorkspaceSettingRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[2]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[4]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -210,7 +295,7 @@ func (x *SetWorkspaceSettingRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use SetWorkspaceSettingRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use SetWorkspaceSettingRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*SetWorkspaceSettingRequest) Descriptor() ([]byte, []int) {
|
func (*SetWorkspaceSettingRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{2}
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{4}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SetWorkspaceSettingRequest) GetSetting() *WorkspaceSetting {
|
func (x *SetWorkspaceSettingRequest) GetSetting() *WorkspaceSetting {
|
||||||
@ -231,7 +316,7 @@ type SetWorkspaceSettingResponse struct {
|
|||||||
func (x *SetWorkspaceSettingResponse) Reset() {
|
func (x *SetWorkspaceSettingResponse) Reset() {
|
||||||
*x = SetWorkspaceSettingResponse{}
|
*x = SetWorkspaceSettingResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[3]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[5]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -244,7 +329,7 @@ func (x *SetWorkspaceSettingResponse) String() string {
|
|||||||
func (*SetWorkspaceSettingResponse) ProtoMessage() {}
|
func (*SetWorkspaceSettingResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *SetWorkspaceSettingResponse) ProtoReflect() protoreflect.Message {
|
func (x *SetWorkspaceSettingResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[3]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[5]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -257,7 +342,7 @@ func (x *SetWorkspaceSettingResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use SetWorkspaceSettingResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use SetWorkspaceSettingResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*SetWorkspaceSettingResponse) Descriptor() ([]byte, []int) {
|
func (*SetWorkspaceSettingResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{3}
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SetWorkspaceSettingResponse) GetSetting() *WorkspaceSetting {
|
func (x *SetWorkspaceSettingResponse) GetSetting() *WorkspaceSetting {
|
||||||
@ -287,7 +372,7 @@ type WorkspaceSetting struct {
|
|||||||
func (x *WorkspaceSetting) Reset() {
|
func (x *WorkspaceSetting) Reset() {
|
||||||
*x = WorkspaceSetting{}
|
*x = WorkspaceSetting{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[4]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[6]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -300,7 +385,7 @@ func (x *WorkspaceSetting) String() string {
|
|||||||
func (*WorkspaceSetting) ProtoMessage() {}
|
func (*WorkspaceSetting) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *WorkspaceSetting) ProtoReflect() protoreflect.Message {
|
func (x *WorkspaceSetting) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[4]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[6]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -313,7 +398,7 @@ func (x *WorkspaceSetting) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use WorkspaceSetting.ProtoReflect.Descriptor instead.
|
// Deprecated: Use WorkspaceSetting.ProtoReflect.Descriptor instead.
|
||||||
func (*WorkspaceSetting) Descriptor() ([]byte, []int) {
|
func (*WorkspaceSetting) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{4}
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{6}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WorkspaceSetting) GetName() string {
|
func (x *WorkspaceSetting) GetName() string {
|
||||||
@ -398,15 +483,17 @@ type WorkspaceGeneralSetting struct {
|
|||||||
// disallow_password_login is the flag to disallow password login.
|
// disallow_password_login is the flag to disallow password login.
|
||||||
DisallowPasswordLogin bool `protobuf:"varint,3,opt,name=disallow_password_login,json=disallowPasswordLogin,proto3" json:"disallow_password_login,omitempty"`
|
DisallowPasswordLogin bool `protobuf:"varint,3,opt,name=disallow_password_login,json=disallowPasswordLogin,proto3" json:"disallow_password_login,omitempty"`
|
||||||
// additional_script is the additional script.
|
// additional_script is the additional script.
|
||||||
AdditionalScript string `protobuf:"bytes,5,opt,name=additional_script,json=additionalScript,proto3" json:"additional_script,omitempty"`
|
AdditionalScript string `protobuf:"bytes,4,opt,name=additional_script,json=additionalScript,proto3" json:"additional_script,omitempty"`
|
||||||
// additional_style is the additional style.
|
// additional_style is the additional style.
|
||||||
AdditionalStyle string `protobuf:"bytes,6,opt,name=additional_style,json=additionalStyle,proto3" json:"additional_style,omitempty"`
|
AdditionalStyle string `protobuf:"bytes,5,opt,name=additional_style,json=additionalStyle,proto3" json:"additional_style,omitempty"`
|
||||||
|
// custom_profile is the custom profile.
|
||||||
|
CustomProfile *WorkspaceCustomProfile `protobuf:"bytes,6,opt,name=custom_profile,json=customProfile,proto3" json:"custom_profile,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WorkspaceGeneralSetting) Reset() {
|
func (x *WorkspaceGeneralSetting) Reset() {
|
||||||
*x = WorkspaceGeneralSetting{}
|
*x = WorkspaceGeneralSetting{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[5]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[7]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -419,7 +506,7 @@ func (x *WorkspaceGeneralSetting) String() string {
|
|||||||
func (*WorkspaceGeneralSetting) ProtoMessage() {}
|
func (*WorkspaceGeneralSetting) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *WorkspaceGeneralSetting) ProtoReflect() protoreflect.Message {
|
func (x *WorkspaceGeneralSetting) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[5]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[7]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -432,7 +519,7 @@ func (x *WorkspaceGeneralSetting) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use WorkspaceGeneralSetting.ProtoReflect.Descriptor instead.
|
// Deprecated: Use WorkspaceGeneralSetting.ProtoReflect.Descriptor instead.
|
||||||
func (*WorkspaceGeneralSetting) Descriptor() ([]byte, []int) {
|
func (*WorkspaceGeneralSetting) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{5}
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{7}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WorkspaceGeneralSetting) GetInstanceUrl() string {
|
func (x *WorkspaceGeneralSetting) GetInstanceUrl() string {
|
||||||
@ -470,6 +557,92 @@ func (x *WorkspaceGeneralSetting) GetAdditionalStyle() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *WorkspaceGeneralSetting) GetCustomProfile() *WorkspaceCustomProfile {
|
||||||
|
if x != nil {
|
||||||
|
return x.CustomProfile
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type WorkspaceCustomProfile struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
|
||||||
|
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
||||||
|
LogoUrl string `protobuf:"bytes,3,opt,name=logo_url,json=logoUrl,proto3" json:"logo_url,omitempty"`
|
||||||
|
Locale string `protobuf:"bytes,4,opt,name=locale,proto3" json:"locale,omitempty"`
|
||||||
|
Appearance string `protobuf:"bytes,5,opt,name=appearance,proto3" json:"appearance,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WorkspaceCustomProfile) Reset() {
|
||||||
|
*x = WorkspaceCustomProfile{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[8]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WorkspaceCustomProfile) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*WorkspaceCustomProfile) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *WorkspaceCustomProfile) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[8]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use WorkspaceCustomProfile.ProtoReflect.Descriptor instead.
|
||||||
|
func (*WorkspaceCustomProfile) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{8}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WorkspaceCustomProfile) GetTitle() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Title
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WorkspaceCustomProfile) GetDescription() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Description
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WorkspaceCustomProfile) GetLogoUrl() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.LogoUrl
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WorkspaceCustomProfile) GetLocale() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Locale
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *WorkspaceCustomProfile) GetAppearance() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Appearance
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
type WorkspaceStorageSetting struct {
|
type WorkspaceStorageSetting struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@ -477,17 +650,19 @@ type WorkspaceStorageSetting struct {
|
|||||||
|
|
||||||
// storage_type is the storage type.
|
// storage_type is the storage type.
|
||||||
StorageType WorkspaceStorageSetting_StorageType `protobuf:"varint,1,opt,name=storage_type,json=storageType,proto3,enum=memos.api.v2.WorkspaceStorageSetting_StorageType" json:"storage_type,omitempty"`
|
StorageType WorkspaceStorageSetting_StorageType `protobuf:"varint,1,opt,name=storage_type,json=storageType,proto3,enum=memos.api.v2.WorkspaceStorageSetting_StorageType" json:"storage_type,omitempty"`
|
||||||
|
// The id of actived external storage.
|
||||||
|
ActivedExternalStorageId *int32 `protobuf:"varint,2,opt,name=actived_external_storage_id,json=activedExternalStorageId,proto3,oneof" json:"actived_external_storage_id,omitempty"`
|
||||||
// The local storage path for STORAGE_TYPE_LOCAL.
|
// The local storage path for STORAGE_TYPE_LOCAL.
|
||||||
// e.g. assets/{timestamp}_{filename}
|
// e.g. assets/{timestamp}_{filename}
|
||||||
LocalStoragePath string `protobuf:"bytes,2,opt,name=local_storage_path,json=localStoragePath,proto3" json:"local_storage_path,omitempty"`
|
LocalStoragePath string `protobuf:"bytes,3,opt,name=local_storage_path,json=localStoragePath,proto3" json:"local_storage_path,omitempty"`
|
||||||
// The max upload size in megabytes.
|
// The max upload size in megabytes.
|
||||||
UploadSizeLimitMb int64 `protobuf:"varint,3,opt,name=upload_size_limit_mb,json=uploadSizeLimitMb,proto3" json:"upload_size_limit_mb,omitempty"`
|
UploadSizeLimitMb int64 `protobuf:"varint,4,opt,name=upload_size_limit_mb,json=uploadSizeLimitMb,proto3" json:"upload_size_limit_mb,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WorkspaceStorageSetting) Reset() {
|
func (x *WorkspaceStorageSetting) Reset() {
|
||||||
*x = WorkspaceStorageSetting{}
|
*x = WorkspaceStorageSetting{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[6]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[9]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -500,7 +675,7 @@ func (x *WorkspaceStorageSetting) String() string {
|
|||||||
func (*WorkspaceStorageSetting) ProtoMessage() {}
|
func (*WorkspaceStorageSetting) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *WorkspaceStorageSetting) ProtoReflect() protoreflect.Message {
|
func (x *WorkspaceStorageSetting) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[6]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[9]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -513,7 +688,7 @@ func (x *WorkspaceStorageSetting) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use WorkspaceStorageSetting.ProtoReflect.Descriptor instead.
|
// Deprecated: Use WorkspaceStorageSetting.ProtoReflect.Descriptor instead.
|
||||||
func (*WorkspaceStorageSetting) Descriptor() ([]byte, []int) {
|
func (*WorkspaceStorageSetting) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{6}
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{9}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WorkspaceStorageSetting) GetStorageType() WorkspaceStorageSetting_StorageType {
|
func (x *WorkspaceStorageSetting) GetStorageType() WorkspaceStorageSetting_StorageType {
|
||||||
@ -523,6 +698,13 @@ func (x *WorkspaceStorageSetting) GetStorageType() WorkspaceStorageSetting_Stora
|
|||||||
return WorkspaceStorageSetting_STORAGE_TYPE_UNSPECIFIED
|
return WorkspaceStorageSetting_STORAGE_TYPE_UNSPECIFIED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *WorkspaceStorageSetting) GetActivedExternalStorageId() int32 {
|
||||||
|
if x != nil && x.ActivedExternalStorageId != nil {
|
||||||
|
return *x.ActivedExternalStorageId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
func (x *WorkspaceStorageSetting) GetLocalStoragePath() string {
|
func (x *WorkspaceStorageSetting) GetLocalStoragePath() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.LocalStoragePath
|
return x.LocalStoragePath
|
||||||
@ -551,7 +733,7 @@ type WorkspaceMemoRelatedSetting struct {
|
|||||||
func (x *WorkspaceMemoRelatedSetting) Reset() {
|
func (x *WorkspaceMemoRelatedSetting) Reset() {
|
||||||
*x = WorkspaceMemoRelatedSetting{}
|
*x = WorkspaceMemoRelatedSetting{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[7]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[10]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -564,7 +746,7 @@ func (x *WorkspaceMemoRelatedSetting) String() string {
|
|||||||
func (*WorkspaceMemoRelatedSetting) ProtoMessage() {}
|
func (*WorkspaceMemoRelatedSetting) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *WorkspaceMemoRelatedSetting) ProtoReflect() protoreflect.Message {
|
func (x *WorkspaceMemoRelatedSetting) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[7]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[10]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -577,7 +759,7 @@ func (x *WorkspaceMemoRelatedSetting) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use WorkspaceMemoRelatedSetting.ProtoReflect.Descriptor instead.
|
// Deprecated: Use WorkspaceMemoRelatedSetting.ProtoReflect.Descriptor instead.
|
||||||
func (*WorkspaceMemoRelatedSetting) Descriptor() ([]byte, []int) {
|
func (*WorkspaceMemoRelatedSetting) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{7}
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{10}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WorkspaceMemoRelatedSetting) GetDisallowPublicVisible() bool {
|
func (x *WorkspaceMemoRelatedSetting) GetDisallowPublicVisible() bool {
|
||||||
@ -606,7 +788,7 @@ type WorkspaceTelegramIntegrationSetting struct {
|
|||||||
func (x *WorkspaceTelegramIntegrationSetting) Reset() {
|
func (x *WorkspaceTelegramIntegrationSetting) Reset() {
|
||||||
*x = WorkspaceTelegramIntegrationSetting{}
|
*x = WorkspaceTelegramIntegrationSetting{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[8]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[11]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -619,7 +801,7 @@ func (x *WorkspaceTelegramIntegrationSetting) String() string {
|
|||||||
func (*WorkspaceTelegramIntegrationSetting) ProtoMessage() {}
|
func (*WorkspaceTelegramIntegrationSetting) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *WorkspaceTelegramIntegrationSetting) ProtoReflect() protoreflect.Message {
|
func (x *WorkspaceTelegramIntegrationSetting) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[8]
|
mi := &file_api_v2_workspace_setting_service_proto_msgTypes[11]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -632,7 +814,7 @@ func (x *WorkspaceTelegramIntegrationSetting) ProtoReflect() protoreflect.Messag
|
|||||||
|
|
||||||
// Deprecated: Use WorkspaceTelegramIntegrationSetting.ProtoReflect.Descriptor instead.
|
// Deprecated: Use WorkspaceTelegramIntegrationSetting.ProtoReflect.Descriptor instead.
|
||||||
func (*WorkspaceTelegramIntegrationSetting) Descriptor() ([]byte, []int) {
|
func (*WorkspaceTelegramIntegrationSetting) Descriptor() ([]byte, []int) {
|
||||||
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{8}
|
return file_api_v2_workspace_setting_service_proto_rawDescGZIP(), []int{11}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WorkspaceTelegramIntegrationSetting) GetBotToken() string {
|
func (x *WorkspaceTelegramIntegrationSetting) GetBotToken() string {
|
||||||
@ -653,139 +835,177 @@ var file_api_v2_workspace_setting_service_proto_rawDesc = []byte{
|
|||||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
|
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
|
||||||
0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
|
0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
|
||||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f,
|
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f,
|
||||||
0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x35,
|
0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1e,
|
||||||
0x0a, 0x1a, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65,
|
0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53,
|
||||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04,
|
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5b,
|
||||||
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
|
0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53,
|
||||||
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x57, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b,
|
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||||
0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70,
|
0x3a, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18,
|
0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||||
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65,
|
0x67, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x35, 0x0a, 0x1a, 0x47,
|
||||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x56,
|
0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69,
|
||||||
0x0a, 0x1a, 0x53, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65,
|
0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
|
||||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x07,
|
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61,
|
||||||
0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e,
|
0x6d, 0x65, 0x22, 0x57, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
|
||||||
0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72,
|
0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73,
|
0x65, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x57, 0x0a, 0x1b, 0x53, 0x65, 0x74, 0x57, 0x6f, 0x72,
|
0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
|
||||||
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73,
|
0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69,
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
|
0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x56, 0x0a, 0x1a, 0x53,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61,
|
0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69,
|
||||||
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53,
|
0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x74,
|
||||||
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22,
|
0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d,
|
||||||
0xa9, 0x03, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74,
|
|
||||||
0x74, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
|
|
||||||
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x67, 0x65, 0x6e, 0x65,
|
|
||||||
0x72, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28,
|
|
||||||
0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
|
|
||||||
0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61,
|
|
||||||
0x6c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0e, 0x67, 0x65, 0x6e, 0x65,
|
|
||||||
0x72, 0x61, 0x6c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x50, 0x0a, 0x0f, 0x73, 0x74,
|
|
||||||
0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20,
|
|
||||||
0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
|
||||||
0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72,
|
|
||||||
0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x74,
|
|
||||||
0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x5d, 0x0a, 0x14,
|
|
||||||
0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x74,
|
|
||||||
0x74, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6d, 0x65, 0x6d,
|
|
||||||
0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
|
0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
|
||||||
0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65,
|
0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74,
|
||||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x12, 0x6d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c,
|
0x69, 0x6e, 0x67, 0x22, 0x57, 0x0a, 0x1b, 0x53, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
|
||||||
0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x75, 0x0a, 0x1c, 0x74,
|
0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74,
|
0x73, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20,
|
||||||
0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28,
|
0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
||||||
0x0b, 0x32, 0x31, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
|
0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74,
|
||||||
0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6c, 0x65, 0x67, 0x72,
|
0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0xa9, 0x03, 0x0a,
|
||||||
0x61, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74,
|
0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||||
0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x1a, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d,
|
0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69,
|
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
|
||||||
0x6e, 0x67, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xf5, 0x01, 0x0a, 0x17,
|
0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25,
|
||||||
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
|
0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f,
|
||||||
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61,
|
0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x53, 0x65,
|
||||||
0x6e, 0x63, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69,
|
0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c,
|
||||||
0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69,
|
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x50, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x61,
|
||||||
0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x02, 0x20,
|
0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x01, 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x69, 0x67,
|
0x32, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
|
||||||
0x6e, 0x75, 0x70, 0x12, 0x36, 0x0a, 0x17, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f,
|
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65,
|
||||||
0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x03,
|
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x61,
|
||||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x50, 0x61,
|
0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x5d, 0x0a, 0x14, 0x6d, 0x65, 0x6d,
|
||||||
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x61,
|
0x6f, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||||
0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
|
0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
|
||||||
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,
|
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
|
||||||
0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x64, 0x64, 0x69,
|
0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69,
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01,
|
0x6e, 0x67, 0x48, 0x00, 0x52, 0x12, 0x6d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65,
|
||||||
0x28, 0x09, 0x52, 0x0f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74,
|
0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x75, 0x0a, 0x1c, 0x74, 0x65, 0x6c, 0x65,
|
||||||
0x79, 0x6c, 0x65, 0x22, 0xc9, 0x02, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
|
0x67, 0x72, 0x61, 0x6d, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
|
0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31,
|
||||||
|
0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f,
|
||||||
|
0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x49,
|
||||||
|
0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||||
|
0x67, 0x48, 0x00, 0x52, 0x1a, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x49, 0x6e, 0x74,
|
||||||
|
0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x42,
|
||||||
|
0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xc2, 0x02, 0x0a, 0x17, 0x57, 0x6f, 0x72,
|
||||||
|
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x53, 0x65, 0x74,
|
||||||
|
0x74, 0x69, 0x6e, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
|
||||||
|
0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74,
|
||||||
|
0x61, 0x6e, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x6c,
|
||||||
|
0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
|
||||||
|
0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70,
|
||||||
|
0x12, 0x36, 0x0a, 0x17, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x70, 0x61, 0x73,
|
||||||
|
0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
|
0x08, 0x52, 0x15, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77,
|
||||||
|
0x6f, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x64, 0x64, 0x69,
|
||||||
|
0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x04, 0x20,
|
||||||
|
0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53,
|
||||||
|
0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f,
|
||||||
|
0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
|
0x0f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65,
|
||||||
|
0x12, 0x4b, 0x0a, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69,
|
||||||
|
0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
|
||||||
|
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
|
||||||
|
0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0d,
|
||||||
|
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0xa3, 0x01,
|
||||||
|
0x0a, 0x16, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f,
|
||||||
|
0x6d, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c,
|
||||||
|
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20,
|
||||||
|
0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20,
|
||||||
|
0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
|
0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x6f, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01,
|
||||||
|
0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x6f, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6c,
|
||||||
|
0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x63,
|
||||||
|
0x61, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x61, 0x6e, 0x63,
|
||||||
|
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x61,
|
||||||
|
0x6e, 0x63, 0x65, 0x22, 0xad, 0x03, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
|
||||||
0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12,
|
0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12,
|
||||||
0x54, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18,
|
0x54, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
||||||
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74,
|
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74,
|
||||||
0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x6f,
|
0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x6f,
|
||||||
0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67,
|
0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67,
|
||||||
0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x73,
|
0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x42, 0x0a, 0x1b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64,
|
||||||
0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28,
|
0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67,
|
||||||
0x09, 0x52, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50,
|
0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x18, 0x61, 0x63,
|
||||||
0x61, 0x74, 0x68, 0x12, 0x2f, 0x0a, 0x14, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x69,
|
0x74, 0x69, 0x76, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x6f,
|
||||||
0x7a, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x6d, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28,
|
0x72, 0x61, 0x67, 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x6f, 0x63,
|
||||||
0x03, 0x52, 0x11, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d,
|
0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18,
|
||||||
0x69, 0x74, 0x4d, 0x62, 0x22, 0x79, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54,
|
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x53, 0x74, 0x6f, 0x72,
|
||||||
0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54,
|
0x61, 0x67, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2f, 0x0a, 0x14, 0x75, 0x70, 0x6c, 0x6f, 0x61,
|
||||||
0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
|
0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x6d, 0x62, 0x18,
|
||||||
0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50,
|
0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, 0x7a,
|
||||||
0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12,
|
0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4d, 0x62, 0x22, 0x79, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72,
|
||||||
0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x43,
|
0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x54, 0x4f, 0x52, 0x41,
|
||||||
0x41, 0x4c, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f,
|
0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
|
||||||
0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x03, 0x22,
|
0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45,
|
||||||
0x8e, 0x01, 0x0a, 0x1b, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d,
|
0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x10, 0x01,
|
||||||
0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12,
|
0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45,
|
||||||
0x36, 0x0a, 0x17, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x70, 0x75, 0x62, 0x6c,
|
0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x4f, 0x52,
|
||||||
0x69, 0x63, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
|
0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41,
|
||||||
0x52, 0x15, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
|
0x4c, 0x10, 0x03, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64, 0x5f,
|
||||||
0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x70, 0x6c,
|
0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65,
|
||||||
0x61, 0x79, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74,
|
0x5f, 0x69, 0x64, 0x22, 0x8e, 0x01, 0x0a, 0x1b, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
|
||||||
0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x64, 0x69, 0x73, 0x70, 0x6c,
|
0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x74, 0x74,
|
||||||
0x61, 0x79, 0x57, 0x69, 0x74, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65,
|
0x69, 0x6e, 0x67, 0x12, 0x36, 0x0a, 0x17, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f,
|
||||||
0x22, 0x42, 0x0a, 0x23, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6c,
|
0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x01,
|
||||||
0x65, 0x67, 0x72, 0x61, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x50, 0x75,
|
||||||
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x5f, 0x74,
|
0x62, 0x6c, 0x69, 0x63, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x18, 0x64,
|
||||||
0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x6f, 0x74, 0x54,
|
0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x75, 0x70, 0x64, 0x61,
|
||||||
0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xef, 0x02, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
|
0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x64,
|
||||||
0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x57, 0x69, 0x74, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||||
0x12, 0x9e, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
|
0x54, 0x69, 0x6d, 0x65, 0x22, 0x42, 0x0a, 0x23, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
|
||||||
0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
|
0x65, 0x54, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61,
|
||||||
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73,
|
0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x62,
|
||||||
0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x6f, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
|
||||||
0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
|
0x62, 0x6f, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x86, 0x04, 0x0a, 0x17, 0x57, 0x6f, 0x72,
|
||||||
0x32, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65,
|
|
||||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0xda,
|
|
||||||
0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x61,
|
|
||||||
0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f,
|
|
||||||
0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a,
|
|
||||||
0x7d, 0x12, 0xb2, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
|
|
||||||
0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f,
|
|
||||||
0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b,
|
|
||||||
0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75,
|
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
|
||||||
0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53,
|
|
||||||
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x46,
|
|
||||||
0xda, 0x41, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36,
|
|
||||||
0x3a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0x2b, 0x2f, 0x61, 0x70, 0x69, 0x2f,
|
|
||||||
0x76, 0x32, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x73, 0x65,
|
|
||||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x73, 0x65, 0x74, 0x74, 0x69,
|
|
||||||
0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0xb4, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d,
|
|
||||||
0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x1c, 0x57, 0x6f, 0x72,
|
|
||||||
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72,
|
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72,
|
||||||
0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74,
|
0x76, 0x69, 0x63, 0x65, 0x12, 0x94, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72,
|
||||||
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
|
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2a,
|
||||||
0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e,
|
0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69,
|
||||||
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03,
|
0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69,
|
||||||
0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e,
|
0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, 0x65, 0x6d,
|
||||||
0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56,
|
0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f,
|
||||||
0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32,
|
0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52,
|
||||||
0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d,
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12,
|
||||||
0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70,
|
0x1a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x63, 0x65, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x13,
|
||||||
|
0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74,
|
||||||
|
0x69, 0x6e, 0x67, 0x12, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
||||||
|
0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53,
|
||||||
|
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e,
|
||||||
|
0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74,
|
||||||
|
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
|
||||||
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d,
|
||||||
|
0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32,
|
||||||
|
0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
|
0x3d, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xb2, 0x01, 0x0a,
|
||||||
|
0x13, 0x53, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74,
|
||||||
|
0x74, 0x69, 0x6e, 0x67, 0x12, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
|
||||||
|
0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
|
||||||
|
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29,
|
||||||
|
0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65,
|
||||||
|
0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||||
|
0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x46, 0xda, 0x41, 0x07, 0x73, 0x65,
|
||||||
|
0x74, 0x74, 0x69, 0x6e, 0x67, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x3a, 0x07, 0x73, 0x65, 0x74,
|
||||||
|
0x74, 0x69, 0x6e, 0x67, 0x32, 0x2b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x77, 0x6f,
|
||||||
|
0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
|
||||||
|
0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a,
|
||||||
|
0x7d, 0x42, 0xb4, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
|
||||||
|
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x1c, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
|
||||||
|
0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
|
||||||
|
0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f,
|
||||||
|
0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f,
|
||||||
|
0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02,
|
||||||
|
0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c,
|
||||||
|
0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d,
|
||||||
|
0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d,
|
||||||
|
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a,
|
||||||
|
0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -801,37 +1021,44 @@ func file_api_v2_workspace_setting_service_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_api_v2_workspace_setting_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
var file_api_v2_workspace_setting_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
var file_api_v2_workspace_setting_service_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
var file_api_v2_workspace_setting_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
|
||||||
var file_api_v2_workspace_setting_service_proto_goTypes = []interface{}{
|
var file_api_v2_workspace_setting_service_proto_goTypes = []interface{}{
|
||||||
(WorkspaceStorageSetting_StorageType)(0), // 0: memos.api.v2.WorkspaceStorageSetting.StorageType
|
(WorkspaceStorageSetting_StorageType)(0), // 0: memos.api.v2.WorkspaceStorageSetting.StorageType
|
||||||
(*GetWorkspaceSettingRequest)(nil), // 1: memos.api.v2.GetWorkspaceSettingRequest
|
(*ListWorkspaceSettingsRequest)(nil), // 1: memos.api.v2.ListWorkspaceSettingsRequest
|
||||||
(*GetWorkspaceSettingResponse)(nil), // 2: memos.api.v2.GetWorkspaceSettingResponse
|
(*ListWorkspaceSettingsResponse)(nil), // 2: memos.api.v2.ListWorkspaceSettingsResponse
|
||||||
(*SetWorkspaceSettingRequest)(nil), // 3: memos.api.v2.SetWorkspaceSettingRequest
|
(*GetWorkspaceSettingRequest)(nil), // 3: memos.api.v2.GetWorkspaceSettingRequest
|
||||||
(*SetWorkspaceSettingResponse)(nil), // 4: memos.api.v2.SetWorkspaceSettingResponse
|
(*GetWorkspaceSettingResponse)(nil), // 4: memos.api.v2.GetWorkspaceSettingResponse
|
||||||
(*WorkspaceSetting)(nil), // 5: memos.api.v2.WorkspaceSetting
|
(*SetWorkspaceSettingRequest)(nil), // 5: memos.api.v2.SetWorkspaceSettingRequest
|
||||||
(*WorkspaceGeneralSetting)(nil), // 6: memos.api.v2.WorkspaceGeneralSetting
|
(*SetWorkspaceSettingResponse)(nil), // 6: memos.api.v2.SetWorkspaceSettingResponse
|
||||||
(*WorkspaceStorageSetting)(nil), // 7: memos.api.v2.WorkspaceStorageSetting
|
(*WorkspaceSetting)(nil), // 7: memos.api.v2.WorkspaceSetting
|
||||||
(*WorkspaceMemoRelatedSetting)(nil), // 8: memos.api.v2.WorkspaceMemoRelatedSetting
|
(*WorkspaceGeneralSetting)(nil), // 8: memos.api.v2.WorkspaceGeneralSetting
|
||||||
(*WorkspaceTelegramIntegrationSetting)(nil), // 9: memos.api.v2.WorkspaceTelegramIntegrationSetting
|
(*WorkspaceCustomProfile)(nil), // 9: memos.api.v2.WorkspaceCustomProfile
|
||||||
|
(*WorkspaceStorageSetting)(nil), // 10: memos.api.v2.WorkspaceStorageSetting
|
||||||
|
(*WorkspaceMemoRelatedSetting)(nil), // 11: memos.api.v2.WorkspaceMemoRelatedSetting
|
||||||
|
(*WorkspaceTelegramIntegrationSetting)(nil), // 12: memos.api.v2.WorkspaceTelegramIntegrationSetting
|
||||||
}
|
}
|
||||||
var file_api_v2_workspace_setting_service_proto_depIdxs = []int32{
|
var file_api_v2_workspace_setting_service_proto_depIdxs = []int32{
|
||||||
5, // 0: memos.api.v2.GetWorkspaceSettingResponse.setting:type_name -> memos.api.v2.WorkspaceSetting
|
7, // 0: memos.api.v2.ListWorkspaceSettingsResponse.settings:type_name -> memos.api.v2.WorkspaceSetting
|
||||||
5, // 1: memos.api.v2.SetWorkspaceSettingRequest.setting:type_name -> memos.api.v2.WorkspaceSetting
|
7, // 1: memos.api.v2.GetWorkspaceSettingResponse.setting:type_name -> memos.api.v2.WorkspaceSetting
|
||||||
5, // 2: memos.api.v2.SetWorkspaceSettingResponse.setting:type_name -> memos.api.v2.WorkspaceSetting
|
7, // 2: memos.api.v2.SetWorkspaceSettingRequest.setting:type_name -> memos.api.v2.WorkspaceSetting
|
||||||
6, // 3: memos.api.v2.WorkspaceSetting.general_setting:type_name -> memos.api.v2.WorkspaceGeneralSetting
|
7, // 3: memos.api.v2.SetWorkspaceSettingResponse.setting:type_name -> memos.api.v2.WorkspaceSetting
|
||||||
7, // 4: memos.api.v2.WorkspaceSetting.storage_setting:type_name -> memos.api.v2.WorkspaceStorageSetting
|
8, // 4: memos.api.v2.WorkspaceSetting.general_setting:type_name -> memos.api.v2.WorkspaceGeneralSetting
|
||||||
8, // 5: memos.api.v2.WorkspaceSetting.memo_related_setting:type_name -> memos.api.v2.WorkspaceMemoRelatedSetting
|
10, // 5: memos.api.v2.WorkspaceSetting.storage_setting:type_name -> memos.api.v2.WorkspaceStorageSetting
|
||||||
9, // 6: memos.api.v2.WorkspaceSetting.telegram_integration_setting:type_name -> memos.api.v2.WorkspaceTelegramIntegrationSetting
|
11, // 6: memos.api.v2.WorkspaceSetting.memo_related_setting:type_name -> memos.api.v2.WorkspaceMemoRelatedSetting
|
||||||
0, // 7: memos.api.v2.WorkspaceStorageSetting.storage_type:type_name -> memos.api.v2.WorkspaceStorageSetting.StorageType
|
12, // 7: memos.api.v2.WorkspaceSetting.telegram_integration_setting:type_name -> memos.api.v2.WorkspaceTelegramIntegrationSetting
|
||||||
1, // 8: memos.api.v2.WorkspaceSettingService.GetWorkspaceSetting:input_type -> memos.api.v2.GetWorkspaceSettingRequest
|
9, // 8: memos.api.v2.WorkspaceGeneralSetting.custom_profile:type_name -> memos.api.v2.WorkspaceCustomProfile
|
||||||
3, // 9: memos.api.v2.WorkspaceSettingService.SetWorkspaceSetting:input_type -> memos.api.v2.SetWorkspaceSettingRequest
|
0, // 9: memos.api.v2.WorkspaceStorageSetting.storage_type:type_name -> memos.api.v2.WorkspaceStorageSetting.StorageType
|
||||||
2, // 10: memos.api.v2.WorkspaceSettingService.GetWorkspaceSetting:output_type -> memos.api.v2.GetWorkspaceSettingResponse
|
1, // 10: memos.api.v2.WorkspaceSettingService.ListWorkspaceSettings:input_type -> memos.api.v2.ListWorkspaceSettingsRequest
|
||||||
4, // 11: memos.api.v2.WorkspaceSettingService.SetWorkspaceSetting:output_type -> memos.api.v2.SetWorkspaceSettingResponse
|
3, // 11: memos.api.v2.WorkspaceSettingService.GetWorkspaceSetting:input_type -> memos.api.v2.GetWorkspaceSettingRequest
|
||||||
10, // [10:12] is the sub-list for method output_type
|
5, // 12: memos.api.v2.WorkspaceSettingService.SetWorkspaceSetting:input_type -> memos.api.v2.SetWorkspaceSettingRequest
|
||||||
8, // [8:10] is the sub-list for method input_type
|
2, // 13: memos.api.v2.WorkspaceSettingService.ListWorkspaceSettings:output_type -> memos.api.v2.ListWorkspaceSettingsResponse
|
||||||
8, // [8:8] is the sub-list for extension type_name
|
4, // 14: memos.api.v2.WorkspaceSettingService.GetWorkspaceSetting:output_type -> memos.api.v2.GetWorkspaceSettingResponse
|
||||||
8, // [8:8] is the sub-list for extension extendee
|
6, // 15: memos.api.v2.WorkspaceSettingService.SetWorkspaceSetting:output_type -> memos.api.v2.SetWorkspaceSettingResponse
|
||||||
0, // [0:8] is the sub-list for field type_name
|
13, // [13:16] is the sub-list for method output_type
|
||||||
|
10, // [10:13] is the sub-list for method input_type
|
||||||
|
10, // [10:10] is the sub-list for extension type_name
|
||||||
|
10, // [10:10] is the sub-list for extension extendee
|
||||||
|
0, // [0:10] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_api_v2_workspace_setting_service_proto_init() }
|
func init() { file_api_v2_workspace_setting_service_proto_init() }
|
||||||
@ -841,7 +1068,7 @@ func file_api_v2_workspace_setting_service_proto_init() {
|
|||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_api_v2_workspace_setting_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_workspace_setting_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*GetWorkspaceSettingRequest); i {
|
switch v := v.(*ListWorkspaceSettingsRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -853,7 +1080,7 @@ func file_api_v2_workspace_setting_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_workspace_setting_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_workspace_setting_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*GetWorkspaceSettingResponse); i {
|
switch v := v.(*ListWorkspaceSettingsResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -865,7 +1092,7 @@ func file_api_v2_workspace_setting_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_workspace_setting_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_workspace_setting_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*SetWorkspaceSettingRequest); i {
|
switch v := v.(*GetWorkspaceSettingRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -877,7 +1104,7 @@ func file_api_v2_workspace_setting_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_workspace_setting_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_workspace_setting_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*SetWorkspaceSettingResponse); i {
|
switch v := v.(*GetWorkspaceSettingResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -889,7 +1116,7 @@ func file_api_v2_workspace_setting_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_workspace_setting_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_workspace_setting_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*WorkspaceSetting); i {
|
switch v := v.(*SetWorkspaceSettingRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -901,7 +1128,7 @@ func file_api_v2_workspace_setting_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_workspace_setting_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_workspace_setting_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*WorkspaceGeneralSetting); i {
|
switch v := v.(*SetWorkspaceSettingResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -913,7 +1140,7 @@ func file_api_v2_workspace_setting_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_workspace_setting_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_workspace_setting_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*WorkspaceStorageSetting); i {
|
switch v := v.(*WorkspaceSetting); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -925,7 +1152,7 @@ func file_api_v2_workspace_setting_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_workspace_setting_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_workspace_setting_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*WorkspaceMemoRelatedSetting); i {
|
switch v := v.(*WorkspaceGeneralSetting); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -937,6 +1164,42 @@ func file_api_v2_workspace_setting_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_workspace_setting_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
file_api_v2_workspace_setting_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*WorkspaceCustomProfile); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_api_v2_workspace_setting_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*WorkspaceStorageSetting); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_api_v2_workspace_setting_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*WorkspaceMemoRelatedSetting); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_api_v2_workspace_setting_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*WorkspaceTelegramIntegrationSetting); i {
|
switch v := v.(*WorkspaceTelegramIntegrationSetting); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@ -949,19 +1212,20 @@ func file_api_v2_workspace_setting_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_api_v2_workspace_setting_service_proto_msgTypes[4].OneofWrappers = []interface{}{
|
file_api_v2_workspace_setting_service_proto_msgTypes[6].OneofWrappers = []interface{}{
|
||||||
(*WorkspaceSetting_GeneralSetting)(nil),
|
(*WorkspaceSetting_GeneralSetting)(nil),
|
||||||
(*WorkspaceSetting_StorageSetting)(nil),
|
(*WorkspaceSetting_StorageSetting)(nil),
|
||||||
(*WorkspaceSetting_MemoRelatedSetting)(nil),
|
(*WorkspaceSetting_MemoRelatedSetting)(nil),
|
||||||
(*WorkspaceSetting_TelegramIntegrationSetting)(nil),
|
(*WorkspaceSetting_TelegramIntegrationSetting)(nil),
|
||||||
}
|
}
|
||||||
|
file_api_v2_workspace_setting_service_proto_msgTypes[9].OneofWrappers = []interface{}{}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_api_v2_workspace_setting_service_proto_rawDesc,
|
RawDescriptor: file_api_v2_workspace_setting_service_proto_rawDesc,
|
||||||
NumEnums: 1,
|
NumEnums: 1,
|
||||||
NumMessages: 9,
|
NumMessages: 12,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
@ -31,6 +31,24 @@ var _ = runtime.String
|
|||||||
var _ = utilities.NewDoubleArray
|
var _ = utilities.NewDoubleArray
|
||||||
var _ = metadata.Join
|
var _ = metadata.Join
|
||||||
|
|
||||||
|
func request_WorkspaceSettingService_ListWorkspaceSettings_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceSettingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq ListWorkspaceSettingsRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
msg, err := client.ListWorkspaceSettings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_WorkspaceSettingService_ListWorkspaceSettings_0(ctx context.Context, marshaler runtime.Marshaler, server WorkspaceSettingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq ListWorkspaceSettingsRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
msg, err := server.ListWorkspaceSettings(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func request_WorkspaceSettingService_GetWorkspaceSetting_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceSettingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func request_WorkspaceSettingService_GetWorkspaceSetting_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceSettingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var protoReq GetWorkspaceSettingRequest
|
var protoReq GetWorkspaceSettingRequest
|
||||||
var metadata runtime.ServerMetadata
|
var metadata runtime.ServerMetadata
|
||||||
@ -157,6 +175,31 @@ func local_request_WorkspaceSettingService_SetWorkspaceSetting_0(ctx context.Con
|
|||||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWorkspaceSettingServiceHandlerFromEndpoint instead.
|
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWorkspaceSettingServiceHandlerFromEndpoint instead.
|
||||||
func RegisterWorkspaceSettingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WorkspaceSettingServiceServer) error {
|
func RegisterWorkspaceSettingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WorkspaceSettingServiceServer) error {
|
||||||
|
|
||||||
|
mux.Handle("GET", pattern_WorkspaceSettingService_ListWorkspaceSettings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
var err error
|
||||||
|
var annotatedContext context.Context
|
||||||
|
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.WorkspaceSettingService/ListWorkspaceSettings", runtime.WithHTTPPathPattern("/api/v2/workspace/settings"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_WorkspaceSettingService_ListWorkspaceSettings_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_WorkspaceSettingService_ListWorkspaceSettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
mux.Handle("GET", pattern_WorkspaceSettingService_GetWorkspaceSetting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_WorkspaceSettingService_GetWorkspaceSetting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@ -248,6 +291,28 @@ func RegisterWorkspaceSettingServiceHandler(ctx context.Context, mux *runtime.Se
|
|||||||
// "WorkspaceSettingServiceClient" to call the correct interceptors.
|
// "WorkspaceSettingServiceClient" to call the correct interceptors.
|
||||||
func RegisterWorkspaceSettingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorkspaceSettingServiceClient) error {
|
func RegisterWorkspaceSettingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorkspaceSettingServiceClient) error {
|
||||||
|
|
||||||
|
mux.Handle("GET", pattern_WorkspaceSettingService_ListWorkspaceSettings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
var err error
|
||||||
|
var annotatedContext context.Context
|
||||||
|
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.WorkspaceSettingService/ListWorkspaceSettings", runtime.WithHTTPPathPattern("/api/v2/workspace/settings"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := request_WorkspaceSettingService_ListWorkspaceSettings_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||||
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_WorkspaceSettingService_ListWorkspaceSettings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
mux.Handle("GET", pattern_WorkspaceSettingService_GetWorkspaceSetting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_WorkspaceSettingService_GetWorkspaceSetting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@ -296,12 +361,16 @@ func RegisterWorkspaceSettingServiceHandlerClient(ctx context.Context, mux *runt
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
pattern_WorkspaceSettingService_ListWorkspaceSettings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "workspace", "settings"}, ""))
|
||||||
|
|
||||||
pattern_WorkspaceSettingService_GetWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 2, 5, 4}, []string{"api", "v2", "workspace", "settings", "name"}, ""))
|
pattern_WorkspaceSettingService_GetWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 2, 5, 4}, []string{"api", "v2", "workspace", "settings", "name"}, ""))
|
||||||
|
|
||||||
pattern_WorkspaceSettingService_SetWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 2, 5, 4}, []string{"api", "v2", "workspace", "settings", "setting.name"}, ""))
|
pattern_WorkspaceSettingService_SetWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 2, 5, 4}, []string{"api", "v2", "workspace", "settings", "setting.name"}, ""))
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
forward_WorkspaceSettingService_ListWorkspaceSettings_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
forward_WorkspaceSettingService_GetWorkspaceSetting_0 = runtime.ForwardResponseMessage
|
forward_WorkspaceSettingService_GetWorkspaceSetting_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
forward_WorkspaceSettingService_SetWorkspaceSetting_0 = runtime.ForwardResponseMessage
|
forward_WorkspaceSettingService_SetWorkspaceSetting_0 = runtime.ForwardResponseMessage
|
||||||
|
@ -19,14 +19,17 @@ import (
|
|||||||
const _ = grpc.SupportPackageIsVersion7
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
const (
|
const (
|
||||||
WorkspaceSettingService_GetWorkspaceSetting_FullMethodName = "/memos.api.v2.WorkspaceSettingService/GetWorkspaceSetting"
|
WorkspaceSettingService_ListWorkspaceSettings_FullMethodName = "/memos.api.v2.WorkspaceSettingService/ListWorkspaceSettings"
|
||||||
WorkspaceSettingService_SetWorkspaceSetting_FullMethodName = "/memos.api.v2.WorkspaceSettingService/SetWorkspaceSetting"
|
WorkspaceSettingService_GetWorkspaceSetting_FullMethodName = "/memos.api.v2.WorkspaceSettingService/GetWorkspaceSetting"
|
||||||
|
WorkspaceSettingService_SetWorkspaceSetting_FullMethodName = "/memos.api.v2.WorkspaceSettingService/SetWorkspaceSetting"
|
||||||
)
|
)
|
||||||
|
|
||||||
// WorkspaceSettingServiceClient is the client API for WorkspaceSettingService service.
|
// WorkspaceSettingServiceClient is the client API for WorkspaceSettingService service.
|
||||||
//
|
//
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
type WorkspaceSettingServiceClient interface {
|
type WorkspaceSettingServiceClient interface {
|
||||||
|
// ListWorkspaceSetting returns the list of settings.
|
||||||
|
ListWorkspaceSettings(ctx context.Context, in *ListWorkspaceSettingsRequest, opts ...grpc.CallOption) (*ListWorkspaceSettingsResponse, error)
|
||||||
// GetWorkspaceSetting returns the setting by name.
|
// GetWorkspaceSetting returns the setting by name.
|
||||||
GetWorkspaceSetting(ctx context.Context, in *GetWorkspaceSettingRequest, opts ...grpc.CallOption) (*GetWorkspaceSettingResponse, error)
|
GetWorkspaceSetting(ctx context.Context, in *GetWorkspaceSettingRequest, opts ...grpc.CallOption) (*GetWorkspaceSettingResponse, error)
|
||||||
// SetWorkspaceSetting updates the setting.
|
// SetWorkspaceSetting updates the setting.
|
||||||
@ -41,6 +44,15 @@ func NewWorkspaceSettingServiceClient(cc grpc.ClientConnInterface) WorkspaceSett
|
|||||||
return &workspaceSettingServiceClient{cc}
|
return &workspaceSettingServiceClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *workspaceSettingServiceClient) ListWorkspaceSettings(ctx context.Context, in *ListWorkspaceSettingsRequest, opts ...grpc.CallOption) (*ListWorkspaceSettingsResponse, error) {
|
||||||
|
out := new(ListWorkspaceSettingsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, WorkspaceSettingService_ListWorkspaceSettings_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (c *workspaceSettingServiceClient) GetWorkspaceSetting(ctx context.Context, in *GetWorkspaceSettingRequest, opts ...grpc.CallOption) (*GetWorkspaceSettingResponse, error) {
|
func (c *workspaceSettingServiceClient) GetWorkspaceSetting(ctx context.Context, in *GetWorkspaceSettingRequest, opts ...grpc.CallOption) (*GetWorkspaceSettingResponse, error) {
|
||||||
out := new(GetWorkspaceSettingResponse)
|
out := new(GetWorkspaceSettingResponse)
|
||||||
err := c.cc.Invoke(ctx, WorkspaceSettingService_GetWorkspaceSetting_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, WorkspaceSettingService_GetWorkspaceSetting_FullMethodName, in, out, opts...)
|
||||||
@ -63,6 +75,8 @@ func (c *workspaceSettingServiceClient) SetWorkspaceSetting(ctx context.Context,
|
|||||||
// All implementations must embed UnimplementedWorkspaceSettingServiceServer
|
// All implementations must embed UnimplementedWorkspaceSettingServiceServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
type WorkspaceSettingServiceServer interface {
|
type WorkspaceSettingServiceServer interface {
|
||||||
|
// ListWorkspaceSetting returns the list of settings.
|
||||||
|
ListWorkspaceSettings(context.Context, *ListWorkspaceSettingsRequest) (*ListWorkspaceSettingsResponse, error)
|
||||||
// GetWorkspaceSetting returns the setting by name.
|
// GetWorkspaceSetting returns the setting by name.
|
||||||
GetWorkspaceSetting(context.Context, *GetWorkspaceSettingRequest) (*GetWorkspaceSettingResponse, error)
|
GetWorkspaceSetting(context.Context, *GetWorkspaceSettingRequest) (*GetWorkspaceSettingResponse, error)
|
||||||
// SetWorkspaceSetting updates the setting.
|
// SetWorkspaceSetting updates the setting.
|
||||||
@ -74,6 +88,9 @@ type WorkspaceSettingServiceServer interface {
|
|||||||
type UnimplementedWorkspaceSettingServiceServer struct {
|
type UnimplementedWorkspaceSettingServiceServer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (UnimplementedWorkspaceSettingServiceServer) ListWorkspaceSettings(context.Context, *ListWorkspaceSettingsRequest) (*ListWorkspaceSettingsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListWorkspaceSettings not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedWorkspaceSettingServiceServer) GetWorkspaceSetting(context.Context, *GetWorkspaceSettingRequest) (*GetWorkspaceSettingResponse, error) {
|
func (UnimplementedWorkspaceSettingServiceServer) GetWorkspaceSetting(context.Context, *GetWorkspaceSettingRequest) (*GetWorkspaceSettingResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetWorkspaceSetting not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetWorkspaceSetting not implemented")
|
||||||
}
|
}
|
||||||
@ -94,6 +111,24 @@ func RegisterWorkspaceSettingServiceServer(s grpc.ServiceRegistrar, srv Workspac
|
|||||||
s.RegisterService(&WorkspaceSettingService_ServiceDesc, srv)
|
s.RegisterService(&WorkspaceSettingService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _WorkspaceSettingService_ListWorkspaceSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListWorkspaceSettingsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(WorkspaceSettingServiceServer).ListWorkspaceSettings(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: WorkspaceSettingService_ListWorkspaceSettings_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(WorkspaceSettingServiceServer).ListWorkspaceSettings(ctx, req.(*ListWorkspaceSettingsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
func _WorkspaceSettingService_GetWorkspaceSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _WorkspaceSettingService_GetWorkspaceSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetWorkspaceSettingRequest)
|
in := new(GetWorkspaceSettingRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -137,6 +172,10 @@ var WorkspaceSettingService_ServiceDesc = grpc.ServiceDesc{
|
|||||||
ServiceName: "memos.api.v2.WorkspaceSettingService",
|
ServiceName: "memos.api.v2.WorkspaceSettingService",
|
||||||
HandlerType: (*WorkspaceSettingServiceServer)(nil),
|
HandlerType: (*WorkspaceSettingServiceServer)(nil),
|
||||||
Methods: []grpc.MethodDesc{
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "ListWorkspaceSettings",
|
||||||
|
Handler: _WorkspaceSettingService_ListWorkspaceSettings_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetWorkspaceSetting",
|
MethodName: "GetWorkspaceSetting",
|
||||||
Handler: _WorkspaceSettingService_GetWorkspaceSetting_Handler,
|
Handler: _WorkspaceSettingService_GetWorkspaceSetting_Handler,
|
||||||
|
@ -336,11 +336,11 @@ type WorkspaceGeneralSetting struct {
|
|||||||
// disallow_password_login is the flag to disallow password login.
|
// disallow_password_login is the flag to disallow password login.
|
||||||
DisallowPasswordLogin bool `protobuf:"varint,3,opt,name=disallow_password_login,json=disallowPasswordLogin,proto3" json:"disallow_password_login,omitempty"`
|
DisallowPasswordLogin bool `protobuf:"varint,3,opt,name=disallow_password_login,json=disallowPasswordLogin,proto3" json:"disallow_password_login,omitempty"`
|
||||||
// additional_script is the additional script.
|
// additional_script is the additional script.
|
||||||
AdditionalScript string `protobuf:"bytes,5,opt,name=additional_script,json=additionalScript,proto3" json:"additional_script,omitempty"`
|
AdditionalScript string `protobuf:"bytes,4,opt,name=additional_script,json=additionalScript,proto3" json:"additional_script,omitempty"`
|
||||||
// additional_style is the additional style.
|
// additional_style is the additional style.
|
||||||
AdditionalStyle string `protobuf:"bytes,6,opt,name=additional_style,json=additionalStyle,proto3" json:"additional_style,omitempty"`
|
AdditionalStyle string `protobuf:"bytes,5,opt,name=additional_style,json=additionalStyle,proto3" json:"additional_style,omitempty"`
|
||||||
// custom_profile is the custom profile.
|
// custom_profile is the custom profile.
|
||||||
CustomProfile *WorkspaceCustomProfile `protobuf:"bytes,4,opt,name=custom_profile,json=customProfile,proto3" json:"custom_profile,omitempty"`
|
CustomProfile *WorkspaceCustomProfile `protobuf:"bytes,6,opt,name=custom_profile,json=customProfile,proto3" json:"custom_profile,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WorkspaceGeneralSetting) Reset() {
|
func (x *WorkspaceGeneralSetting) Reset() {
|
||||||
@ -732,12 +732,12 @@ var file_store_workspace_setting_proto_rawDesc = []byte{
|
|||||||
0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x64,
|
0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x64,
|
||||||
0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4c,
|
0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4c,
|
||||||
0x6f, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,
|
0x6f, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
0x61, 0x6c, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x61, 0x6c, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70,
|
0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70,
|
||||||
0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f,
|
0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f,
|
||||||
0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x64, 0x64,
|
0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x64, 0x64,
|
||||||
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x4a, 0x0a, 0x0e,
|
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x4a, 0x0a, 0x0e,
|
||||||
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04,
|
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x06,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f,
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f,
|
||||||
0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74,
|
0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74,
|
||||||
0x6f, 0x6d, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f,
|
0x6f, 0x6d, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f,
|
||||||
|
@ -42,11 +42,11 @@ message WorkspaceGeneralSetting {
|
|||||||
// disallow_password_login is the flag to disallow password login.
|
// disallow_password_login is the flag to disallow password login.
|
||||||
bool disallow_password_login = 3;
|
bool disallow_password_login = 3;
|
||||||
// additional_script is the additional script.
|
// additional_script is the additional script.
|
||||||
string additional_script = 5;
|
string additional_script = 4;
|
||||||
// additional_style is the additional style.
|
// additional_style is the additional style.
|
||||||
string additional_style = 6;
|
string additional_style = 5;
|
||||||
// custom_profile is the custom profile.
|
// custom_profile is the custom profile.
|
||||||
WorkspaceCustomProfile custom_profile = 4;
|
WorkspaceCustomProfile custom_profile = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message WorkspaceCustomProfile {
|
message WorkspaceCustomProfile {
|
||||||
|
@ -1,22 +1,23 @@
|
|||||||
package v2
|
package v2
|
||||||
|
|
||||||
var authenticationAllowlistMethods = map[string]bool{
|
var authenticationAllowlistMethods = map[string]bool{
|
||||||
"/memos.api.v2.WorkspaceService/GetWorkspaceProfile": true,
|
"/memos.api.v2.WorkspaceService/GetWorkspaceProfile": true,
|
||||||
"/memos.api.v2.WorkspaceSettingService/GetWorkspaceSetting": true,
|
"/memos.api.v2.WorkspaceSettingService/GetWorkspaceSetting": true,
|
||||||
"/memos.api.v2.AuthService/GetAuthStatus": true,
|
"/memos.api.v2.WorkspaceSettingService/ListWorkspaceSettings": true,
|
||||||
"/memos.api.v2.AuthService/SignIn": true,
|
"/memos.api.v2.AuthService/GetAuthStatus": true,
|
||||||
"/memos.api.v2.AuthService/SignInWithSSO": true,
|
"/memos.api.v2.AuthService/SignIn": true,
|
||||||
"/memos.api.v2.AuthService/SignOut": true,
|
"/memos.api.v2.AuthService/SignInWithSSO": true,
|
||||||
"/memos.api.v2.AuthService/SignUp": true,
|
"/memos.api.v2.AuthService/SignOut": true,
|
||||||
"/memos.api.v2.UserService/GetUser": true,
|
"/memos.api.v2.AuthService/SignUp": true,
|
||||||
"/memos.api.v2.UserService/SearchUsers": true,
|
"/memos.api.v2.UserService/GetUser": true,
|
||||||
"/memos.api.v2.MemoService/ListMemos": true,
|
"/memos.api.v2.UserService/SearchUsers": true,
|
||||||
"/memos.api.v2.MemoService/GetMemo": true,
|
"/memos.api.v2.MemoService/ListMemos": true,
|
||||||
"/memos.api.v2.MemoService/SearchMemos": true,
|
"/memos.api.v2.MemoService/GetMemo": true,
|
||||||
"/memos.api.v2.MemoService/ListMemoResources": true,
|
"/memos.api.v2.MemoService/SearchMemos": true,
|
||||||
"/memos.api.v2.MemoService/ListMemoRelations": true,
|
"/memos.api.v2.MemoService/ListMemoResources": true,
|
||||||
"/memos.api.v2.MemoService/ListMemoComments": true,
|
"/memos.api.v2.MemoService/ListMemoRelations": true,
|
||||||
"/memos.api.v2.LinkService/GetLinkMetadata": true,
|
"/memos.api.v2.MemoService/ListMemoComments": true,
|
||||||
|
"/memos.api.v2.LinkService/GetLinkMetadata": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// isUnauthorizeAllowedMethod returns whether the method is exempted from authentication.
|
// isUnauthorizeAllowedMethod returns whether the method is exempted from authentication.
|
||||||
|
@ -851,6 +851,21 @@ paths:
|
|||||||
$ref: '#/definitions/googlerpcStatus'
|
$ref: '#/definitions/googlerpcStatus'
|
||||||
tags:
|
tags:
|
||||||
- WorkspaceService
|
- WorkspaceService
|
||||||
|
/api/v2/workspace/settings:
|
||||||
|
get:
|
||||||
|
summary: ListWorkspaceSetting returns the list of settings.
|
||||||
|
operationId: WorkspaceSettingService_ListWorkspaceSettings
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: A successful response.
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/v2ListWorkspaceSettingsResponse'
|
||||||
|
default:
|
||||||
|
description: An unexpected error response.
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/googlerpcStatus'
|
||||||
|
tags:
|
||||||
|
- WorkspaceSettingService
|
||||||
/api/v2/workspace/{name}:
|
/api/v2/workspace/{name}:
|
||||||
get:
|
get:
|
||||||
summary: GetWorkspaceSetting returns the setting by name.
|
summary: GetWorkspaceSetting returns the setting by name.
|
||||||
@ -1985,6 +2000,19 @@ definitions:
|
|||||||
type: string
|
type: string
|
||||||
url:
|
url:
|
||||||
type: string
|
type: string
|
||||||
|
apiv2WorkspaceCustomProfile:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
logoUrl:
|
||||||
|
type: string
|
||||||
|
locale:
|
||||||
|
type: string
|
||||||
|
appearance:
|
||||||
|
type: string
|
||||||
apiv2WorkspaceGeneralSetting:
|
apiv2WorkspaceGeneralSetting:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@ -2003,6 +2031,9 @@ definitions:
|
|||||||
additionalStyle:
|
additionalStyle:
|
||||||
type: string
|
type: string
|
||||||
description: additional_style is the additional style.
|
description: additional_style is the additional style.
|
||||||
|
customProfile:
|
||||||
|
$ref: '#/definitions/apiv2WorkspaceCustomProfile'
|
||||||
|
description: custom_profile is the custom profile.
|
||||||
apiv2WorkspaceMemoRelatedSetting:
|
apiv2WorkspaceMemoRelatedSetting:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@ -2034,6 +2065,10 @@ definitions:
|
|||||||
storageType:
|
storageType:
|
||||||
$ref: '#/definitions/apiv2WorkspaceStorageSettingStorageType'
|
$ref: '#/definitions/apiv2WorkspaceStorageSettingStorageType'
|
||||||
description: storage_type is the storage type.
|
description: storage_type is the storage type.
|
||||||
|
activedExternalStorageId:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
description: The id of actived external storage.
|
||||||
localStoragePath:
|
localStoragePath:
|
||||||
type: string
|
type: string
|
||||||
title: |-
|
title: |-
|
||||||
@ -2418,6 +2453,14 @@ definitions:
|
|||||||
items:
|
items:
|
||||||
type: object
|
type: object
|
||||||
$ref: '#/definitions/apiv2Webhook'
|
$ref: '#/definitions/apiv2Webhook'
|
||||||
|
v2ListWorkspaceSettingsResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
settings:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
$ref: '#/definitions/apiv2WorkspaceSetting'
|
||||||
v2Memo:
|
v2Memo:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@ -2714,15 +2757,3 @@ definitions:
|
|||||||
mode:
|
mode:
|
||||||
type: string
|
type: string
|
||||||
description: mode is the instance mode (e.g. "prod", "dev" or "demo").
|
description: mode is the instance mode (e.g. "prod", "dev" or "demo").
|
||||||
disallowSignup:
|
|
||||||
type: boolean
|
|
||||||
description: disallow_signup is whether the signup is disallowed.
|
|
||||||
disablePasswordLogin:
|
|
||||||
type: boolean
|
|
||||||
description: disable_password_login is whether the password login is disabled.
|
|
||||||
additionalScript:
|
|
||||||
type: string
|
|
||||||
description: additional_script is the additional script.
|
|
||||||
additionalStyle:
|
|
||||||
type: string
|
|
||||||
description: additional_style is the additional style.
|
|
||||||
|
@ -25,14 +25,6 @@ func (s *APIV2Service) GetWorkspaceProfile(ctx context.Context, _ *apiv2pb.GetWo
|
|||||||
if owner != nil {
|
if owner != nil {
|
||||||
workspaceProfile.Owner = owner.Name
|
workspaceProfile.Owner = owner.Name
|
||||||
}
|
}
|
||||||
generalSetting, err := s.Store.GetWorkspaceGeneralSetting(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return nil, status.Errorf(codes.Internal, "failed to get workspace general setting: %v", err)
|
|
||||||
}
|
|
||||||
workspaceProfile.DisallowSignup = generalSetting.DisallowSignup
|
|
||||||
workspaceProfile.DisablePasswordLogin = generalSetting.DisallowPasswordLogin
|
|
||||||
workspaceProfile.AdditionalStyle = generalSetting.AdditionalStyle
|
|
||||||
workspaceProfile.AdditionalScript = generalSetting.AdditionalScript
|
|
||||||
return &apiv2pb.GetWorkspaceProfileResponse{
|
return &apiv2pb.GetWorkspaceProfileResponse{
|
||||||
WorkspaceProfile: workspaceProfile,
|
WorkspaceProfile: workspaceProfile,
|
||||||
}, nil
|
}, nil
|
||||||
|
@ -12,6 +12,24 @@ import (
|
|||||||
"github.com/usememos/memos/store"
|
"github.com/usememos/memos/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (s *APIV2Service) ListWorkspaceSettings(ctx context.Context, request *apiv2pb.ListWorkspaceSettingsRequest) (*apiv2pb.ListWorkspaceSettingsResponse, error) {
|
||||||
|
workspaceSettings, err := s.Store.ListWorkspaceSettingsV1(ctx, &store.FindWorkspaceSetting{})
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Errorf(codes.Internal, "failed to get workspace setting: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
response := &apiv2pb.ListWorkspaceSettingsResponse{
|
||||||
|
Settings: []*apiv2pb.WorkspaceSetting{},
|
||||||
|
}
|
||||||
|
for _, workspaceSetting := range workspaceSettings {
|
||||||
|
if workspaceSetting.Key == storepb.WorkspaceSettingKey_WORKSPACE_SETTING_BASIC {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
response.Settings = append(response.Settings, convertWorkspaceSettingFromStore(workspaceSetting))
|
||||||
|
}
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (s *APIV2Service) GetWorkspaceSetting(ctx context.Context, request *apiv2pb.GetWorkspaceSettingRequest) (*apiv2pb.GetWorkspaceSettingResponse, error) {
|
func (s *APIV2Service) GetWorkspaceSetting(ctx context.Context, request *apiv2pb.GetWorkspaceSettingRequest) (*apiv2pb.GetWorkspaceSettingResponse, error) {
|
||||||
settingKeyString, err := ExtractWorkspaceSettingKeyFromName(request.Name)
|
settingKeyString, err := ExtractWorkspaceSettingKeyFromName(request.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -111,26 +129,46 @@ func convertWorkspaceGeneralSettingFromStore(setting *storepb.WorkspaceGeneralSe
|
|||||||
if setting == nil {
|
if setting == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return &apiv2pb.WorkspaceGeneralSetting{
|
generalSetting := &apiv2pb.WorkspaceGeneralSetting{
|
||||||
InstanceUrl: setting.InstanceUrl,
|
InstanceUrl: setting.InstanceUrl,
|
||||||
DisallowSignup: setting.DisallowSignup,
|
DisallowSignup: setting.DisallowSignup,
|
||||||
DisallowPasswordLogin: setting.DisallowPasswordLogin,
|
DisallowPasswordLogin: setting.DisallowPasswordLogin,
|
||||||
AdditionalScript: setting.AdditionalScript,
|
AdditionalScript: setting.AdditionalScript,
|
||||||
AdditionalStyle: setting.AdditionalStyle,
|
AdditionalStyle: setting.AdditionalStyle,
|
||||||
}
|
}
|
||||||
|
if setting.CustomProfile != nil {
|
||||||
|
generalSetting.CustomProfile = &apiv2pb.WorkspaceCustomProfile{
|
||||||
|
Title: setting.CustomProfile.Title,
|
||||||
|
Description: setting.CustomProfile.Description,
|
||||||
|
LogoUrl: setting.CustomProfile.LogoUrl,
|
||||||
|
Locale: setting.CustomProfile.Locale,
|
||||||
|
Appearance: setting.CustomProfile.Appearance,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return generalSetting
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertWorkspaceGeneralSettingToStore(setting *apiv2pb.WorkspaceGeneralSetting) *storepb.WorkspaceGeneralSetting {
|
func convertWorkspaceGeneralSettingToStore(setting *apiv2pb.WorkspaceGeneralSetting) *storepb.WorkspaceGeneralSetting {
|
||||||
if setting == nil {
|
if setting == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return &storepb.WorkspaceGeneralSetting{
|
generalSetting := &storepb.WorkspaceGeneralSetting{
|
||||||
InstanceUrl: setting.InstanceUrl,
|
InstanceUrl: setting.InstanceUrl,
|
||||||
DisallowSignup: setting.DisallowSignup,
|
DisallowSignup: setting.DisallowSignup,
|
||||||
DisallowPasswordLogin: setting.DisallowPasswordLogin,
|
DisallowPasswordLogin: setting.DisallowPasswordLogin,
|
||||||
AdditionalScript: setting.AdditionalScript,
|
AdditionalScript: setting.AdditionalScript,
|
||||||
AdditionalStyle: setting.AdditionalStyle,
|
AdditionalStyle: setting.AdditionalStyle,
|
||||||
}
|
}
|
||||||
|
if setting.CustomProfile != nil {
|
||||||
|
generalSetting.CustomProfile = &storepb.WorkspaceCustomProfile{
|
||||||
|
Title: setting.CustomProfile.Title,
|
||||||
|
Description: setting.CustomProfile.Description,
|
||||||
|
LogoUrl: setting.CustomProfile.LogoUrl,
|
||||||
|
Locale: setting.CustomProfile.Locale,
|
||||||
|
Appearance: setting.CustomProfile.Appearance,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return generalSetting
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertWorkspaceStorageSettingFromStore(setting *storepb.WorkspaceStorageSetting) *apiv2pb.WorkspaceStorageSetting {
|
func convertWorkspaceStorageSettingFromStore(setting *storepb.WorkspaceStorageSetting) *apiv2pb.WorkspaceStorageSetting {
|
||||||
|
@ -4,8 +4,9 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
storepb "github.com/usememos/memos/proto/gen/store"
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
|
storepb "github.com/usememos/memos/proto/gen/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Storage struct {
|
type Storage struct {
|
||||||
|
@ -5,7 +5,7 @@ import { Outlet } from "react-router-dom";
|
|||||||
import storage from "./helpers/storage";
|
import storage from "./helpers/storage";
|
||||||
import { getSystemColorScheme } from "./helpers/utils";
|
import { getSystemColorScheme } from "./helpers/utils";
|
||||||
import useNavigateTo from "./hooks/useNavigateTo";
|
import useNavigateTo from "./hooks/useNavigateTo";
|
||||||
import { useGlobalStore } from "./store/module";
|
import { useCommonContext } from "./layouts/CommonContextProvider";
|
||||||
import { useUserStore, useWorkspaceSettingStore } from "./store/v1";
|
import { useUserStore, useWorkspaceSettingStore } from "./store/v1";
|
||||||
import { WorkspaceGeneralSetting, WorkspaceSettingKey } from "./types/proto/store/workspace_setting";
|
import { WorkspaceGeneralSetting, WorkspaceSettingKey } from "./types/proto/store/workspace_setting";
|
||||||
|
|
||||||
@ -13,16 +13,16 @@ const App = () => {
|
|||||||
const { i18n } = useTranslation();
|
const { i18n } = useTranslation();
|
||||||
const navigateTo = useNavigateTo();
|
const navigateTo = useNavigateTo();
|
||||||
const { mode, setMode } = useColorScheme();
|
const { mode, setMode } = useColorScheme();
|
||||||
const globalStore = useGlobalStore();
|
|
||||||
const workspaceSettingStore = useWorkspaceSettingStore();
|
const workspaceSettingStore = useWorkspaceSettingStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const { appearance, locale, systemStatus, workspaceProfile } = globalStore.state;
|
const commonContext = useCommonContext();
|
||||||
|
const workspaceProfile = commonContext.profile;
|
||||||
const userSetting = userStore.userSetting;
|
const userSetting = userStore.userSetting;
|
||||||
const workspaceGeneralSetting =
|
const workspaceGeneralSetting =
|
||||||
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL).generalSetting ||
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL).generalSetting ||
|
||||||
WorkspaceGeneralSetting.fromPartial({});
|
WorkspaceGeneralSetting.fromPartial({});
|
||||||
|
|
||||||
// Redirect to sign up page if no host.
|
// Redirect to sign up page if no instance owner.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!workspaceProfile.owner) {
|
if (!workspaceProfile.owner) {
|
||||||
navigateTo("/auth/signup");
|
navigateTo("/auth/signup");
|
||||||
@ -32,7 +32,7 @@ const App = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
||||||
const handleColorSchemeChange = (e: MediaQueryListEvent) => {
|
const handleColorSchemeChange = (e: MediaQueryListEvent) => {
|
||||||
if (globalStore.getState().appearance === "system") {
|
if (commonContext.appearance === "system") {
|
||||||
const mode = e.matches ? "dark" : "light";
|
const mode = e.matches ? "dark" : "light";
|
||||||
setMode(mode);
|
setMode(mode);
|
||||||
}
|
}
|
||||||
@ -68,23 +68,17 @@ const App = () => {
|
|||||||
|
|
||||||
// Dynamic update metadata with customized profile.
|
// Dynamic update metadata with customized profile.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.title = systemStatus.customizedProfile.name;
|
if (!workspaceGeneralSetting.customProfile) {
|
||||||
const link = document.querySelector("link[rel~='icon']") as HTMLLinkElement;
|
|
||||||
link.href = systemStatus.customizedProfile.logoUrl || "/logo.webp";
|
|
||||||
}, [systemStatus.customizedProfile]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!userSetting) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
globalStore.setLocale(userSetting.locale);
|
document.title = workspaceGeneralSetting.customProfile.title;
|
||||||
globalStore.setAppearance(userSetting.appearance as Appearance);
|
const link = document.querySelector("link[rel~='icon']") as HTMLLinkElement;
|
||||||
}, [userSetting?.locale, userSetting?.appearance]);
|
link.href = workspaceGeneralSetting.customProfile.logoUrl || "/logo.webp";
|
||||||
|
}, [workspaceGeneralSetting.customProfile]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const { locale: storageLocale } = storage.get(["locale"]);
|
const currentLocale = commonContext.locale;
|
||||||
const currentLocale = storageLocale || locale;
|
|
||||||
i18n.changeLanguage(currentLocale);
|
i18n.changeLanguage(currentLocale);
|
||||||
document.documentElement.setAttribute("lang", currentLocale);
|
document.documentElement.setAttribute("lang", currentLocale);
|
||||||
if (currentLocale === "ar") {
|
if (currentLocale === "ar") {
|
||||||
@ -95,11 +89,10 @@ const App = () => {
|
|||||||
storage.set({
|
storage.set({
|
||||||
locale: currentLocale,
|
locale: currentLocale,
|
||||||
});
|
});
|
||||||
}, [locale]);
|
}, [commonContext.locale]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const { appearance: storageAppearance } = storage.get(["appearance"]);
|
let currentAppearance = commonContext.appearance as Appearance;
|
||||||
let currentAppearance = (storageAppearance || appearance) as Appearance;
|
|
||||||
if (currentAppearance === "system") {
|
if (currentAppearance === "system") {
|
||||||
currentAppearance = getSystemColorScheme();
|
currentAppearance = getSystemColorScheme();
|
||||||
}
|
}
|
||||||
@ -107,7 +100,7 @@ const App = () => {
|
|||||||
storage.set({
|
storage.set({
|
||||||
appearance: currentAppearance,
|
appearance: currentAppearance,
|
||||||
});
|
});
|
||||||
}, [appearance]);
|
}, [commonContext.appearance]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const root = document.documentElement;
|
const root = document.documentElement;
|
||||||
@ -118,6 +111,15 @@ const App = () => {
|
|||||||
}
|
}
|
||||||
}, [mode]);
|
}, [mode]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!userSetting) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
commonContext.setLocale(userSetting.locale);
|
||||||
|
commonContext.setAppearance(userSetting.appearance);
|
||||||
|
}, [userSetting?.locale, userSetting?.appearance]);
|
||||||
|
|
||||||
return <Outlet />;
|
return <Outlet />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import { Button, IconButton, Input } from "@mui/joy";
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { useCommonContext } from "@/layouts/CommonContextProvider";
|
||||||
import { useUserStore } from "@/store/v1";
|
import { useUserStore } from "@/store/v1";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
@ -12,15 +12,14 @@ type Props = DialogProps;
|
|||||||
|
|
||||||
const ChangePasswordDialog: React.FC<Props> = ({ destroy }: Props) => {
|
const ChangePasswordDialog: React.FC<Props> = ({ destroy }: Props) => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
const commonContext = useCommonContext();
|
||||||
const currentUser = useCurrentUser();
|
const currentUser = useCurrentUser();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const globalStore = useGlobalStore();
|
|
||||||
const profile = globalStore.state.workspaceProfile;
|
|
||||||
const [newPassword, setNewPassword] = useState("");
|
const [newPassword, setNewPassword] = useState("");
|
||||||
const [newPasswordAgain, setNewPasswordAgain] = useState("");
|
const [newPasswordAgain, setNewPasswordAgain] = useState("");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (profile.mode === "demo") {
|
if (commonContext.profile.mode === "demo") {
|
||||||
toast.error("Demo mode does not support this operation.");
|
toast.error("Demo mode does not support this operation.");
|
||||||
destroy();
|
destroy();
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import { useEffect, useRef } from "react";
|
|||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import { Provider } from "react-redux";
|
import { Provider } from "react-redux";
|
||||||
import { ANIMATION_DURATION } from "@/helpers/consts";
|
import { ANIMATION_DURATION } from "@/helpers/consts";
|
||||||
|
import CommonContextProvider from "@/layouts/CommonContextProvider";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { useDialogStore } from "@/store/module";
|
import { useDialogStore } from "@/store/module";
|
||||||
import theme from "@/theme";
|
import theme from "@/theme";
|
||||||
@ -103,9 +104,11 @@ export function generateDialog<T extends DialogProps>(
|
|||||||
const Fragment = (
|
const Fragment = (
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<CssVarsProvider theme={theme}>
|
<CssVarsProvider theme={theme}>
|
||||||
<BaseDialog destroy={cbs.destroy} hide={cbs.hide} clickSpaceDestroy={true} {...config}>
|
<CommonContextProvider>
|
||||||
<DialogComponent {...dialogProps} />
|
<BaseDialog destroy={cbs.destroy} hide={cbs.hide} clickSpaceDestroy={true} {...config}>
|
||||||
</BaseDialog>
|
<DialogComponent {...dialogProps} />
|
||||||
|
</BaseDialog>
|
||||||
|
</CommonContextProvider>
|
||||||
</CssVarsProvider>
|
</CssVarsProvider>
|
||||||
</Provider>
|
</Provider>
|
||||||
);
|
);
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { Button, IconButton, Input } from "@mui/joy";
|
import { Button, IconButton, Input } from "@mui/joy";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import * as api from "@/helpers/api";
|
import { WorkspaceSettingPrefix, useWorkspaceSettingStore } from "@/store/v1";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { WorkspaceGeneralSetting } from "@/types/proto/api/v2/workspace_setting_service";
|
||||||
|
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
@ -15,10 +16,12 @@ interface State {
|
|||||||
|
|
||||||
const DisablePasswordLoginDialog: React.FC<Props> = ({ destroy }: Props) => {
|
const DisablePasswordLoginDialog: React.FC<Props> = ({ destroy }: Props) => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const globalStore = useGlobalStore();
|
const workspaceSettingStore = useWorkspaceSettingStore();
|
||||||
const systemStatus = globalStore.state.systemStatus;
|
const workspaceGeneralSetting =
|
||||||
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL).generalSetting ||
|
||||||
|
WorkspaceGeneralSetting.fromPartial({});
|
||||||
const [state, setState] = useState<State>({
|
const [state, setState] = useState<State>({
|
||||||
disablePasswordLogin: systemStatus.disablePasswordLogin,
|
disablePasswordLogin: workspaceGeneralSetting.disallowPasswordLogin,
|
||||||
});
|
});
|
||||||
const [confirmedOnce, setConfirmedOnce] = useState(false);
|
const [confirmedOnce, setConfirmedOnce] = useState(false);
|
||||||
const [typingConfirmation, setTypingConfirmation] = useState("");
|
const [typingConfirmation, setTypingConfirmation] = useState("");
|
||||||
@ -36,11 +39,13 @@ const DisablePasswordLoginDialog: React.FC<Props> = ({ destroy }: Props) => {
|
|||||||
setConfirmedOnce(true);
|
setConfirmedOnce(true);
|
||||||
} else {
|
} else {
|
||||||
setState({ ...state, disablePasswordLogin: true });
|
setState({ ...state, disablePasswordLogin: true });
|
||||||
globalStore.setSystemStatus({ disablePasswordLogin: true });
|
|
||||||
try {
|
try {
|
||||||
await api.upsertSystemSetting({
|
await workspaceSettingStore.setWorkspaceSetting({
|
||||||
name: "disable-password-login",
|
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`,
|
||||||
value: JSON.stringify(true),
|
generalSetting: {
|
||||||
|
...workspaceGeneralSetting,
|
||||||
|
disallowPasswordLogin: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
handleCloseBtnClick();
|
handleCloseBtnClick();
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { IconButton } from "@mui/joy";
|
import { IconButton } from "@mui/joy";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useGlobalStore, useTagStore } from "@/store/module";
|
import { useTagStore } from "@/store/module";
|
||||||
import { MemoRelation } from "@/types/proto/api/v2/memo_relation_service";
|
import { MemoRelation } from "@/types/proto/api/v2/memo_relation_service";
|
||||||
import MemoEditor from ".";
|
import MemoEditor from ".";
|
||||||
import { generateDialog } from "../Dialog";
|
import { generateDialog } from "../Dialog";
|
||||||
@ -13,9 +13,7 @@ interface Props extends DialogProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const MemoEditorDialog: React.FC<Props> = ({ memoName: memo, cacheKey, relationList, destroy }: Props) => {
|
const MemoEditorDialog: React.FC<Props> = ({ memoName: memo, cacheKey, relationList, destroy }: Props) => {
|
||||||
const globalStore = useGlobalStore();
|
|
||||||
const tagStore = useTagStore();
|
const tagStore = useTagStore();
|
||||||
const { systemStatus } = globalStore.state;
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
tagStore.fetchTags();
|
tagStore.fetchTags();
|
||||||
@ -29,8 +27,8 @@ const MemoEditorDialog: React.FC<Props> = ({ memoName: memo, cacheKey, relationL
|
|||||||
<>
|
<>
|
||||||
<div className="w-full flex flex-row justify-between items-center mb-2">
|
<div className="w-full flex flex-row justify-between items-center mb-2">
|
||||||
<div className="flex flex-row justify-start items-center">
|
<div className="flex flex-row justify-start items-center">
|
||||||
<img className="w-6 h-auto rounded-full shadow" src={systemStatus.customizedProfile.logoUrl || "/full-logo.webp"} alt="" />
|
<img className="w-6 h-auto rounded-full shadow" src={"/full-logo.webp"} alt="" />
|
||||||
<p className="ml-1 text-lg opacity-80 dark:text-gray-300">{systemStatus.customizedProfile.name}</p>
|
<p className="ml-1 text-lg opacity-80 dark:text-gray-300">Memos</p>
|
||||||
</div>
|
</div>
|
||||||
<IconButton size="sm" onClick={handleCloseBtnClick}>
|
<IconButton size="sm" onClick={handleCloseBtnClick}>
|
||||||
<Icon.X className="w-5 h-auto" />
|
<Icon.X className="w-5 h-auto" />
|
||||||
|
@ -7,12 +7,14 @@ import { memoServiceClient } from "@/grpcweb";
|
|||||||
import { TAB_SPACE_WIDTH } from "@/helpers/consts";
|
import { TAB_SPACE_WIDTH } from "@/helpers/consts";
|
||||||
import { isValidUrl } from "@/helpers/utils";
|
import { isValidUrl } from "@/helpers/utils";
|
||||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||||
import { useGlobalStore, useTagStore } from "@/store/module";
|
import { useTagStore } from "@/store/module";
|
||||||
import { useMemoStore, useResourceStore, useUserStore } from "@/store/v1";
|
import { useMemoStore, useResourceStore, useUserStore, useWorkspaceSettingStore } from "@/store/v1";
|
||||||
import { MemoRelation, MemoRelation_Type } from "@/types/proto/api/v2/memo_relation_service";
|
import { MemoRelation, MemoRelation_Type } from "@/types/proto/api/v2/memo_relation_service";
|
||||||
import { Memo, Visibility } from "@/types/proto/api/v2/memo_service";
|
import { Memo, Visibility } from "@/types/proto/api/v2/memo_service";
|
||||||
import { Resource } from "@/types/proto/api/v2/resource_service";
|
import { Resource } from "@/types/proto/api/v2/resource_service";
|
||||||
import { UserSetting } from "@/types/proto/api/v2/user_service";
|
import { UserSetting } from "@/types/proto/api/v2/user_service";
|
||||||
|
import { WorkspaceMemoRelatedSetting } from "@/types/proto/api/v2/workspace_setting_service";
|
||||||
|
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { convertVisibilityFromString, convertVisibilityToString } from "@/utils/memo";
|
import { convertVisibilityFromString, convertVisibilityToString } from "@/utils/memo";
|
||||||
import { extractTagsFromContent } from "@/utils/tag";
|
import { extractTagsFromContent } from "@/utils/tag";
|
||||||
@ -51,11 +53,9 @@ interface State {
|
|||||||
|
|
||||||
const MemoEditor = (props: Props) => {
|
const MemoEditor = (props: Props) => {
|
||||||
const { className, cacheKey, memoName, parentMemoName, autoFocus, onConfirm } = props;
|
const { className, cacheKey, memoName, parentMemoName, autoFocus, onConfirm } = props;
|
||||||
const { i18n } = useTranslation();
|
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const {
|
const { i18n } = useTranslation();
|
||||||
state: { systemStatus },
|
const workspaceSettingStore = useWorkspaceSettingStore();
|
||||||
} = useGlobalStore();
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const memoStore = useMemoStore();
|
const memoStore = useMemoStore();
|
||||||
const resourceStore = useResourceStore();
|
const resourceStore = useResourceStore();
|
||||||
@ -79,6 +79,9 @@ const MemoEditor = (props: Props) => {
|
|||||||
(relation) => relation.memo === memoName && relation.relatedMemo !== memoName && relation.type === MemoRelation_Type.REFERENCE,
|
(relation) => relation.memo === memoName && relation.relatedMemo !== memoName && relation.type === MemoRelation_Type.REFERENCE,
|
||||||
)
|
)
|
||||||
: state.relationList.filter((relation) => relation.type === MemoRelation_Type.REFERENCE);
|
: state.relationList.filter((relation) => relation.type === MemoRelation_Type.REFERENCE);
|
||||||
|
const workspaceMemoRelatedSetting =
|
||||||
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_MEMO_RELATED)?.memoRelatedSetting ||
|
||||||
|
WorkspaceMemoRelatedSetting.fromPartial({});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
editorRef.current?.setContent(contentCache || "");
|
editorRef.current?.setContent(contentCache || "");
|
||||||
@ -92,14 +95,14 @@ const MemoEditor = (props: Props) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let visibility = userSetting.memoVisibility;
|
let visibility = userSetting.memoVisibility;
|
||||||
if (systemStatus.disablePublicMemos && visibility === "PUBLIC") {
|
if (workspaceMemoRelatedSetting.disallowPublicVisible && visibility === "PUBLIC") {
|
||||||
visibility = "PRIVATE";
|
visibility = "PRIVATE";
|
||||||
}
|
}
|
||||||
setState((prevState) => ({
|
setState((prevState) => ({
|
||||||
...prevState,
|
...prevState,
|
||||||
memoVisibility: convertVisibilityFromString(visibility),
|
memoVisibility: convertVisibilityFromString(visibility),
|
||||||
}));
|
}));
|
||||||
}, [userSetting.memoVisibility, systemStatus.disablePublicMemos]);
|
}, [userSetting.memoVisibility, workspaceMemoRelatedSetting.disallowPublicVisible]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (memoName) {
|
if (memoName) {
|
||||||
|
@ -2,7 +2,6 @@ import classNames from "classnames";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import useWindowScroll from "react-use/lib/useWindowScroll";
|
import useWindowScroll from "react-use/lib/useWindowScroll";
|
||||||
import useResponsiveWidth from "@/hooks/useResponsiveWidth";
|
import useResponsiveWidth from "@/hooks/useResponsiveWidth";
|
||||||
import { useGlobalStore } from "@/store/module";
|
|
||||||
import NavigationDrawer from "./NavigationDrawer";
|
import NavigationDrawer from "./NavigationDrawer";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@ -11,8 +10,6 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const MobileHeader = (props: Props) => {
|
const MobileHeader = (props: Props) => {
|
||||||
const globalStore = useGlobalStore();
|
|
||||||
const { systemStatus } = globalStore.state;
|
|
||||||
const { className, children } = props;
|
const { className, children } = props;
|
||||||
const { sm } = useResponsiveWidth();
|
const { sm } = useResponsiveWidth();
|
||||||
const [titleText] = useState("Memos");
|
const [titleText] = useState("Memos");
|
||||||
@ -32,7 +29,7 @@ const MobileHeader = (props: Props) => {
|
|||||||
className="font-bold text-lg leading-10 mr-1 text-ellipsis shrink-0 cursor-pointer overflow-hidden text-gray-700 dark:text-gray-300"
|
className="font-bold text-lg leading-10 mr-1 text-ellipsis shrink-0 cursor-pointer overflow-hidden text-gray-700 dark:text-gray-300"
|
||||||
onDoubleClick={() => location.reload()}
|
onDoubleClick={() => location.reload()}
|
||||||
>
|
>
|
||||||
{systemStatus.customizedProfile.name || titleText}
|
{titleText}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row justify-end items-center">{children}</div>
|
<div className="flex flex-row justify-end items-center">{children}</div>
|
||||||
|
@ -2,7 +2,7 @@ import { Button, Divider, Input, Option, Select } from "@mui/joy";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { useCommonContext } from "@/layouts/CommonContextProvider";
|
||||||
import { useUserStore } from "@/store/v1";
|
import { useUserStore } from "@/store/v1";
|
||||||
import { Visibility } from "@/types/proto/api/v2/memo_service";
|
import { Visibility } from "@/types/proto/api/v2/memo_service";
|
||||||
import { UserSetting } from "@/types/proto/api/v2/user_service";
|
import { UserSetting } from "@/types/proto/api/v2/user_service";
|
||||||
@ -16,29 +16,29 @@ import WebhookSection from "./WebhookSection";
|
|||||||
|
|
||||||
const PreferencesSection = () => {
|
const PreferencesSection = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const globalStore = useGlobalStore();
|
const commonContext = useCommonContext();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const setting = userStore.userSetting as UserSetting;
|
const setting = userStore.userSetting as UserSetting;
|
||||||
const [telegramUserId, setTelegramUserId] = useState<string>(setting.telegramUserId);
|
const [telegramUserId, setTelegramUserId] = useState<string>(setting.telegramUserId);
|
||||||
|
|
||||||
const handleLocaleSelectChange = async (locale: Locale) => {
|
const handleLocaleSelectChange = async (locale: Locale) => {
|
||||||
|
commonContext.setLocale(locale);
|
||||||
await userStore.updateUserSetting(
|
await userStore.updateUserSetting(
|
||||||
{
|
{
|
||||||
locale,
|
locale,
|
||||||
},
|
},
|
||||||
["locale"],
|
["locale"],
|
||||||
);
|
);
|
||||||
globalStore.setLocale(locale);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAppearanceSelectChange = async (appearance: Appearance) => {
|
const handleAppearanceSelectChange = async (appearance: Appearance) => {
|
||||||
|
commonContext.setAppearance(appearance);
|
||||||
await userStore.updateUserSetting(
|
await userStore.updateUserSetting(
|
||||||
{
|
{
|
||||||
appearance,
|
appearance,
|
||||||
},
|
},
|
||||||
["appearance"],
|
["appearance"],
|
||||||
);
|
);
|
||||||
globalStore.setAppearance(appearance);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDefaultMemoVisibilityChanged = async (value: string) => {
|
const handleDefaultMemoVisibilityChanged = async (value: string) => {
|
||||||
|
@ -1,9 +1,25 @@
|
|||||||
import { Button, Divider, Dropdown, IconButton, List, ListItem, Menu, MenuButton, MenuItem, Radio, RadioGroup } from "@mui/joy";
|
import {
|
||||||
|
Button,
|
||||||
|
Divider,
|
||||||
|
Dropdown,
|
||||||
|
IconButton,
|
||||||
|
Input,
|
||||||
|
List,
|
||||||
|
ListItem,
|
||||||
|
Menu,
|
||||||
|
MenuButton,
|
||||||
|
MenuItem,
|
||||||
|
Radio,
|
||||||
|
RadioGroup,
|
||||||
|
Tooltip,
|
||||||
|
} from "@mui/joy";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import * as api from "@/helpers/api";
|
import * as api from "@/helpers/api";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { WorkspaceSettingPrefix, useWorkspaceSettingStore } from "@/store/v1";
|
||||||
|
import { WorkspaceStorageSetting, WorkspaceStorageSetting_StorageType } from "@/types/proto/api/v2/workspace_setting_service";
|
||||||
|
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import showCreateStorageServiceDialog from "../CreateStorageServiceDialog";
|
import showCreateStorageServiceDialog from "../CreateStorageServiceDialog";
|
||||||
import { showCommonDialog } from "../Dialog/CommonDialog";
|
import { showCommonDialog } from "../Dialog/CommonDialog";
|
||||||
@ -13,10 +29,13 @@ import showUpdateLocalStorageDialog from "../UpdateLocalStorageDialog";
|
|||||||
|
|
||||||
const StorageSection = () => {
|
const StorageSection = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const globalStore = useGlobalStore();
|
const workspaceSettingStore = useWorkspaceSettingStore();
|
||||||
const systemStatus = globalStore.state.systemStatus;
|
|
||||||
const [storageServiceId, setStorageServiceId] = useState(systemStatus.storageServiceId);
|
|
||||||
const [storageList, setStorageList] = useState<ObjectStorage[]>([]);
|
const [storageList, setStorageList] = useState<ObjectStorage[]>([]);
|
||||||
|
const [workspaceStorageSetting, setWorkspaceStorageSetting] = useState<WorkspaceStorageSetting>(
|
||||||
|
WorkspaceStorageSetting.fromPartial(
|
||||||
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_STORAGE)?.storageSetting || {},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchStorageList();
|
fetchStorageList();
|
||||||
@ -27,17 +46,44 @@ const StorageSection = () => {
|
|||||||
setStorageList(storageList);
|
setStorageList(storageList);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleActiveStorageServiceChanged = async (storageId: StorageId) => {
|
const handleMaxUploadSizeChanged = async (event: React.FocusEvent<HTMLInputElement>) => {
|
||||||
await api.upsertSystemSetting({
|
let num = parseInt(event.target.value);
|
||||||
name: "storage-service-id",
|
if (Number.isNaN(num)) {
|
||||||
value: JSON.stringify(storageId),
|
num = 0;
|
||||||
});
|
|
||||||
try {
|
|
||||||
await globalStore.fetchSystemStatus();
|
|
||||||
} catch (error: any) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
}
|
||||||
setStorageServiceId(storageId);
|
const update: WorkspaceStorageSetting = {
|
||||||
|
...workspaceStorageSetting,
|
||||||
|
uploadSizeLimitMb: num,
|
||||||
|
};
|
||||||
|
setWorkspaceStorageSetting(update);
|
||||||
|
workspaceSettingStore.setWorkspaceSetting({
|
||||||
|
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_STORAGE}`,
|
||||||
|
storageSetting: update,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleStorageTypeChanged = async (storageType: WorkspaceStorageSetting_StorageType) => {
|
||||||
|
const update: WorkspaceStorageSetting = {
|
||||||
|
...workspaceStorageSetting,
|
||||||
|
storageType: storageType,
|
||||||
|
};
|
||||||
|
setWorkspaceStorageSetting(update);
|
||||||
|
await workspaceSettingStore.setWorkspaceSetting({
|
||||||
|
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_STORAGE}`,
|
||||||
|
storageSetting: update,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleActivedExternalStorageIdChanged = async (activedExternalStorageId: number) => {
|
||||||
|
const update: WorkspaceStorageSetting = {
|
||||||
|
...workspaceStorageSetting,
|
||||||
|
activedExternalStorageId: activedExternalStorageId,
|
||||||
|
};
|
||||||
|
setWorkspaceStorageSetting(update);
|
||||||
|
await workspaceSettingStore.setWorkspaceSetting({
|
||||||
|
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_STORAGE}`,
|
||||||
|
storageSetting: update,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDeleteStorage = (storage: ObjectStorage) => {
|
const handleDeleteStorage = (storage: ObjectStorage) => {
|
||||||
@ -65,22 +111,47 @@ const StorageSection = () => {
|
|||||||
</div>
|
</div>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
className="w-full"
|
className="w-full"
|
||||||
value={storageServiceId}
|
value={workspaceStorageSetting.storageType}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
handleActiveStorageServiceChanged(Number(event.target.value));
|
handleStorageTypeChanged(event.target.value as WorkspaceStorageSetting_StorageType);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Radio value={"0"} label={t("setting.storage-section.type-database")} />
|
<Radio value={WorkspaceStorageSetting_StorageType.STORAGE_TYPE_DATABASE} label={t("setting.storage-section.type-database")} />
|
||||||
<div className="w-full mt-2 flex flex-row justify-start items-center gap-x-2">
|
<div>
|
||||||
<Radio value={"-1"} label={t("setting.storage-section.type-local")} />
|
<Radio value={WorkspaceStorageSetting_StorageType.STORAGE_TYPE_LOCAL} label={t("setting.storage-section.type-local")} />
|
||||||
<IconButton size="sm" onClick={() => showUpdateLocalStorageDialog(systemStatus.localStoragePath)}>
|
<IconButton size="sm" onClick={() => showUpdateLocalStorageDialog()}>
|
||||||
<Icon.PenBox className="w-4 h-auto" />
|
<Icon.PenBox className="w-4 h-auto" />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
|
<Radio value={WorkspaceStorageSetting_StorageType.STORAGE_TYPE_EXTERNAL} label={"S3"} />
|
||||||
|
</RadioGroup>
|
||||||
|
<RadioGroup
|
||||||
|
className="w-full"
|
||||||
|
value={workspaceStorageSetting.activedExternalStorageId}
|
||||||
|
onChange={(event) => {
|
||||||
|
handleActivedExternalStorageIdChanged(Number(event.target.value));
|
||||||
|
}}
|
||||||
|
>
|
||||||
{storageList.map((storage) => (
|
{storageList.map((storage) => (
|
||||||
<Radio key={storage.id} value={storage.id} label={storage.name} />
|
<Radio key={storage.id} value={storage.id} label={storage.name} />
|
||||||
))}
|
))}
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
<div className="w-full flex flex-row justify-between items-center">
|
||||||
|
<div className="flex flex-row items-center">
|
||||||
|
<span className="mr-1">{t("setting.system-section.max-upload-size")}</span>
|
||||||
|
<Tooltip title={t("setting.system-section.max-upload-size-hint")} placement="top">
|
||||||
|
<Icon.HelpCircle className="w-4 h-auto" />
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
<Input
|
||||||
|
className="w-16"
|
||||||
|
sx={{
|
||||||
|
fontFamily: "monospace",
|
||||||
|
}}
|
||||||
|
defaultValue={workspaceStorageSetting.uploadSizeLimitMb}
|
||||||
|
onChange={handleMaxUploadSizeChanged}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<Divider className="!my-2" />
|
<Divider className="!my-2" />
|
||||||
<div className="mb-2 w-full flex flex-row justify-between items-center gap-1">
|
<div className="mb-2 w-full flex flex-row justify-between items-center gap-1">
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
|
@ -1,65 +1,39 @@
|
|||||||
import { Button, Divider, Input, Switch, Textarea, Tooltip } from "@mui/joy";
|
import { Button, Divider, Input, Switch, Textarea } from "@mui/joy";
|
||||||
import { useEffect, useState } from "react";
|
import { useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { workspaceSettingServiceClient } from "@/grpcweb";
|
import { workspaceSettingServiceClient } from "@/grpcweb";
|
||||||
import * as api from "@/helpers/api";
|
import { WorkspaceSettingPrefix, useWorkspaceSettingStore } from "@/store/v1";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import {
|
||||||
import { WorkspaceSettingPrefix } from "@/store/v1";
|
WorkspaceGeneralSetting,
|
||||||
import { WorkspaceGeneralSetting } from "@/types/proto/api/v2/workspace_setting_service";
|
WorkspaceMemoRelatedSetting,
|
||||||
|
WorkspaceTelegramIntegrationSetting,
|
||||||
|
} from "@/types/proto/api/v2/workspace_setting_service";
|
||||||
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
|
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { showCommonDialog } from "../Dialog/CommonDialog";
|
import { showCommonDialog } from "../Dialog/CommonDialog";
|
||||||
import Icon from "../Icon";
|
import Icon from "../Icon";
|
||||||
import showUpdateCustomizedProfileDialog from "../UpdateCustomizedProfileDialog";
|
import showUpdateCustomizedProfileDialog from "../UpdateCustomizedProfileDialog";
|
||||||
|
|
||||||
interface State {
|
const WorkspaceSection = () => {
|
||||||
disablePublicMemos: boolean;
|
|
||||||
maxUploadSizeMiB: number;
|
|
||||||
memoDisplayWithUpdatedTs: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const SystemSection = () => {
|
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const globalStore = useGlobalStore();
|
const workspaceSettingStore = useWorkspaceSettingStore();
|
||||||
const systemStatus = globalStore.state.systemStatus;
|
const [workspaceGeneralSetting, setWorkspaceGeneralSetting] = useState<WorkspaceGeneralSetting>(
|
||||||
const [state, setState] = useState<State>({
|
WorkspaceGeneralSetting.fromPartial(
|
||||||
disablePublicMemos: systemStatus.disablePublicMemos,
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL)?.generalSetting || {},
|
||||||
maxUploadSizeMiB: systemStatus.maxUploadSizeMiB,
|
),
|
||||||
memoDisplayWithUpdatedTs: systemStatus.memoDisplayWithUpdatedTs,
|
);
|
||||||
});
|
const [workspaceMemoRelatedSetting, setWorkspaceMemoRelatedSetting] = useState<WorkspaceMemoRelatedSetting>(
|
||||||
const [workspaceGeneralSetting, setWorkspaceGeneralSetting] = useState<WorkspaceGeneralSetting>(WorkspaceGeneralSetting.fromPartial({}));
|
WorkspaceMemoRelatedSetting.fromPartial(
|
||||||
const [telegramBotToken, setTelegramBotToken] = useState<string>("");
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_MEMO_RELATED)?.memoRelatedSetting || {},
|
||||||
|
),
|
||||||
useEffect(() => {
|
);
|
||||||
(async () => {
|
const [workspaceTelegramIntegrationSetting, setWorkspaceTelegramIntegrationSetting] = useState<WorkspaceTelegramIntegrationSetting>(
|
||||||
await globalStore.fetchSystemStatus();
|
WorkspaceTelegramIntegrationSetting.fromPartial(
|
||||||
const { setting } = await workspaceSettingServiceClient.getWorkspaceSetting({
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_TELEGRAM_INTEGRATION)
|
||||||
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`,
|
?.telegramIntegrationSetting || {},
|
||||||
});
|
),
|
||||||
if (setting && setting.generalSetting) {
|
);
|
||||||
setWorkspaceGeneralSetting(WorkspaceGeneralSetting.fromPartial(setting.generalSetting));
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
api.getSystemSetting().then(({ data: systemSettings }) => {
|
|
||||||
const telegramBotSetting = systemSettings.find((setting) => setting.name === "telegram-bot-token");
|
|
||||||
if (telegramBotSetting) {
|
|
||||||
setTelegramBotToken(telegramBotSetting.value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setState({
|
|
||||||
...state,
|
|
||||||
disablePublicMemos: systemStatus.disablePublicMemos,
|
|
||||||
maxUploadSizeMiB: systemStatus.maxUploadSizeMiB,
|
|
||||||
memoDisplayWithUpdatedTs: systemStatus.memoDisplayWithUpdatedTs,
|
|
||||||
});
|
|
||||||
}, [systemStatus]);
|
|
||||||
|
|
||||||
const handleAllowSignUpChanged = async (value: boolean) => {
|
const handleAllowSignUpChanged = async (value: boolean) => {
|
||||||
const setting = { ...workspaceGeneralSetting, disallowSignup: !value };
|
const setting = { ...workspaceGeneralSetting, disallowSignup: !value };
|
||||||
@ -123,21 +97,20 @@ const SystemSection = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleTelegramBotTokenChanged = (value: string) => {
|
const handleTelegramBotTokenChanged = (value: string) => {
|
||||||
setTelegramBotToken(value);
|
setWorkspaceTelegramIntegrationSetting({ ...workspaceTelegramIntegrationSetting, botToken: value });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSaveTelegramBotToken = async () => {
|
const handleSaveTelegramBotToken = async () => {
|
||||||
try {
|
try {
|
||||||
await api.upsertSystemSetting({
|
await workspaceSettingStore.setWorkspaceSetting({
|
||||||
name: "telegram-bot-token",
|
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_TELEGRAM_INTEGRATION}`,
|
||||||
value: telegramBotToken,
|
telegramIntegrationSetting: workspaceTelegramIntegrationSetting,
|
||||||
});
|
});
|
||||||
|
toast.success("Telegram Bot Token updated");
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
toast.error(error.response.data.message);
|
toast.error(error.details);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
toast.success("Telegram Bot Token updated");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAdditionalStyleChanged = (value: string) => {
|
const handleAdditionalStyleChanged = (value: string) => {
|
||||||
@ -181,51 +154,21 @@ const SystemSection = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleDisablePublicMemosChanged = async (value: boolean) => {
|
const handleDisablePublicMemosChanged = async (value: boolean) => {
|
||||||
setState({
|
const update: WorkspaceMemoRelatedSetting = { ...workspaceMemoRelatedSetting, disallowPublicVisible: value };
|
||||||
...state,
|
setWorkspaceMemoRelatedSetting(update);
|
||||||
disablePublicMemos: value,
|
await workspaceSettingStore.setWorkspaceSetting({
|
||||||
});
|
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_MEMO_RELATED}`,
|
||||||
globalStore.setSystemStatus({ disablePublicMemos: value });
|
memoRelatedSetting: update,
|
||||||
await api.upsertSystemSetting({
|
|
||||||
name: "disable-public-memos",
|
|
||||||
value: JSON.stringify(value),
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleMemoDisplayWithUpdatedTs = async (value: boolean) => {
|
const handleMemoDisplayWithUpdatedTs = async (value: boolean) => {
|
||||||
setState({
|
const update: WorkspaceMemoRelatedSetting = { ...workspaceMemoRelatedSetting, displayWithUpdateTime: value };
|
||||||
...state,
|
setWorkspaceMemoRelatedSetting(update);
|
||||||
memoDisplayWithUpdatedTs: value,
|
await workspaceSettingStore.setWorkspaceSetting({
|
||||||
|
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_MEMO_RELATED}`,
|
||||||
|
memoRelatedSetting: update,
|
||||||
});
|
});
|
||||||
globalStore.setSystemStatus({ memoDisplayWithUpdatedTs: value });
|
|
||||||
await api.upsertSystemSetting({
|
|
||||||
name: "memo-display-with-updated-ts",
|
|
||||||
value: JSON.stringify(value),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleMaxUploadSizeChanged = async (event: React.FocusEvent<HTMLInputElement>) => {
|
|
||||||
// fixes cursor skipping position on mobile
|
|
||||||
event.target.selectionEnd = event.target.value.length;
|
|
||||||
|
|
||||||
let num = parseInt(event.target.value);
|
|
||||||
if (Number.isNaN(num)) {
|
|
||||||
num = 0;
|
|
||||||
}
|
|
||||||
setState({
|
|
||||||
...state,
|
|
||||||
maxUploadSizeMiB: num,
|
|
||||||
});
|
|
||||||
event.target.value = num.toString();
|
|
||||||
globalStore.setSystemStatus({ maxUploadSizeMiB: num });
|
|
||||||
await api.upsertSystemSetting({
|
|
||||||
name: "max-upload-size-mib",
|
|
||||||
value: JSON.stringify(num),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleMaxUploadSizeFocus = (event: React.FocusEvent<HTMLInputElement>) => {
|
|
||||||
event.target.select();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -233,7 +176,8 @@ const SystemSection = () => {
|
|||||||
<p className="font-medium text-gray-700 dark:text-gray-500">{t("common.basic")}</p>
|
<p className="font-medium text-gray-700 dark:text-gray-500">{t("common.basic")}</p>
|
||||||
<div className="w-full flex flex-row justify-between items-center">
|
<div className="w-full flex flex-row justify-between items-center">
|
||||||
<div>
|
<div>
|
||||||
{t("setting.system-section.server-name")}: <span className="font-mono font-bold">{systemStatus.customizedProfile.name}</span>
|
{t("setting.system-section.server-name")}:{" "}
|
||||||
|
<span className="font-mono font-bold">{workspaceGeneralSetting.customProfile?.title || "Memos"}</span>
|
||||||
</div>
|
</div>
|
||||||
<Button onClick={handleUpdateCustomizedProfileButtonClick}>{t("common.edit")}</Button>
|
<Button onClick={handleUpdateCustomizedProfileButtonClick}>{t("common.edit")}</Button>
|
||||||
</div>
|
</div>
|
||||||
@ -331,32 +275,23 @@ const SystemSection = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Divider className="!my-3" />
|
<Divider className="!my-3" />
|
||||||
<p className="font-medium text-gray-700 dark:text-gray-500">Others</p>
|
<p className="font-medium text-gray-700 dark:text-gray-500">Memo related settings</p>
|
||||||
<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.system-section.disable-public-memos")}</span>
|
<span>{t("setting.system-section.disable-public-memos")}</span>
|
||||||
<Switch checked={state.disablePublicMemos} onChange={(event) => handleDisablePublicMemosChanged(event.target.checked)} />
|
<Switch
|
||||||
|
checked={workspaceMemoRelatedSetting.disallowPublicVisible}
|
||||||
|
onChange={(event) => handleDisablePublicMemosChanged(event.target.checked)}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<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.system-section.display-with-updated-time")}</span>
|
<span>{t("setting.system-section.display-with-updated-time")}</span>
|
||||||
<Switch checked={state.memoDisplayWithUpdatedTs} onChange={(event) => handleMemoDisplayWithUpdatedTs(event.target.checked)} />
|
<Switch
|
||||||
</div>
|
checked={workspaceMemoRelatedSetting.displayWithUpdateTime}
|
||||||
<div className="w-full flex flex-row justify-between items-center">
|
onChange={(event) => handleMemoDisplayWithUpdatedTs(event.target.checked)}
|
||||||
<div className="flex flex-row items-center">
|
|
||||||
<span className="mr-1">{t("setting.system-section.max-upload-size")}</span>
|
|
||||||
<Tooltip title={t("setting.system-section.max-upload-size-hint")} placement="top">
|
|
||||||
<Icon.HelpCircle className="w-4 h-auto" />
|
|
||||||
</Tooltip>
|
|
||||||
</div>
|
|
||||||
<Input
|
|
||||||
className="w-16"
|
|
||||||
sx={{
|
|
||||||
fontFamily: "monospace",
|
|
||||||
}}
|
|
||||||
defaultValue={state.maxUploadSizeMiB}
|
|
||||||
onFocus={handleMaxUploadSizeFocus}
|
|
||||||
onChange={handleMaxUploadSizeChanged}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<Divider className="!my-3" />
|
||||||
|
<p className="font-medium text-gray-700 dark:text-gray-500">Integrations</p>
|
||||||
<div className="space-y-2 border rounded-md py-2 px-3 dark:border-zinc-700">
|
<div className="space-y-2 border rounded-md py-2 px-3 dark:border-zinc-700">
|
||||||
<div className="w-full flex flex-row justify-between items-center">
|
<div className="w-full flex flex-row justify-between items-center">
|
||||||
<div className="flex flex-row items-center">
|
<div className="flex flex-row items-center">
|
||||||
@ -375,7 +310,7 @@ const SystemSection = () => {
|
|||||||
fontSize: "14px",
|
fontSize: "14px",
|
||||||
}}
|
}}
|
||||||
placeholder={t("setting.system-section.telegram-bot-token-placeholder")}
|
placeholder={t("setting.system-section.telegram-bot-token-placeholder")}
|
||||||
value={telegramBotToken}
|
value={workspaceTelegramIntegrationSetting.botToken}
|
||||||
onChange={(event) => handleTelegramBotTokenChanged(event.target.value)}
|
onChange={(event) => handleTelegramBotTokenChanged(event.target.value)}
|
||||||
/>
|
/>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
@ -393,4 +328,4 @@ const SystemSection = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SystemSection;
|
export default WorkspaceSection;
|
@ -2,8 +2,9 @@ import { Button, IconButton, Input } from "@mui/joy";
|
|||||||
import Textarea from "@mui/joy/Textarea/Textarea";
|
import Textarea from "@mui/joy/Textarea/Textarea";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import * as api from "@/helpers/api";
|
import { WorkspaceSettingPrefix, useWorkspaceSettingStore } from "@/store/v1";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { WorkspaceCustomProfile, WorkspaceGeneralSetting } from "@/types/proto/api/v2/workspace_setting_service";
|
||||||
|
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import AppearanceSelect from "./AppearanceSelect";
|
import AppearanceSelect from "./AppearanceSelect";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
@ -14,15 +15,20 @@ type Props = DialogProps;
|
|||||||
|
|
||||||
const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
|
const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const globalStore = useGlobalStore();
|
const workspaceSettingStore = useWorkspaceSettingStore();
|
||||||
const [state, setState] = useState<CustomizedProfile>(globalStore.state.systemStatus.customizedProfile);
|
const workspaceGeneralSetting = WorkspaceGeneralSetting.fromPartial(
|
||||||
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL)?.generalSetting || {},
|
||||||
|
);
|
||||||
|
const [customProfile, setCustomProfile] = useState<WorkspaceCustomProfile>(
|
||||||
|
WorkspaceCustomProfile.fromPartial(workspaceGeneralSetting.customProfile || {}),
|
||||||
|
);
|
||||||
|
|
||||||
const handleCloseButtonClick = () => {
|
const handleCloseButtonClick = () => {
|
||||||
destroy();
|
destroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
const setPartialState = (partialState: Partial<CustomizedProfile>) => {
|
const setPartialState = (partialState: Partial<WorkspaceCustomProfile>) => {
|
||||||
setState((state) => {
|
setCustomProfile((state) => {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
...partialState,
|
...partialState,
|
||||||
@ -32,7 +38,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
|
|||||||
|
|
||||||
const handleNameChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleNameChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
setPartialState({
|
setPartialState({
|
||||||
name: e.target.value as string,
|
title: e.target.value as string,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -62,7 +68,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
|
|||||||
|
|
||||||
const handleRestoreButtonClick = () => {
|
const handleRestoreButtonClick = () => {
|
||||||
setPartialState({
|
setPartialState({
|
||||||
name: "Memos",
|
title: "Memos",
|
||||||
logoUrl: "/logo.webp",
|
logoUrl: "/logo.webp",
|
||||||
description: "",
|
description: "",
|
||||||
locale: "en",
|
locale: "en",
|
||||||
@ -71,17 +77,19 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSaveButtonClick = async () => {
|
const handleSaveButtonClick = async () => {
|
||||||
if (state.name === "") {
|
if (customProfile.title === "") {
|
||||||
toast.error(t("message.fill-server-name"));
|
toast.error(t("message.fill-server-name"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await api.upsertSystemSetting({
|
await workspaceSettingStore.setWorkspaceSetting({
|
||||||
name: "customized-profile",
|
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`,
|
||||||
value: JSON.stringify(state),
|
generalSetting: {
|
||||||
|
...workspaceGeneralSetting,
|
||||||
|
customProfile: customProfile,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
await globalStore.fetchSystemStatus();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return;
|
return;
|
||||||
@ -100,15 +108,15 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="dialog-content-container min-w-[16rem]">
|
<div className="dialog-content-container min-w-[16rem]">
|
||||||
<p className="text-sm mb-1">{t("setting.system-section.server-name")}</p>
|
<p className="text-sm mb-1">{t("setting.system-section.server-name")}</p>
|
||||||
<Input className="w-full" type="text" value={state.name} onChange={handleNameChanged} />
|
<Input className="w-full" type="text" value={customProfile.title} onChange={handleNameChanged} />
|
||||||
<p className="text-sm mb-1 mt-2">{t("setting.system-section.customize-server.icon-url")}</p>
|
<p className="text-sm mb-1 mt-2">{t("setting.system-section.customize-server.icon-url")}</p>
|
||||||
<Input className="w-full" type="text" value={state.logoUrl} onChange={handleLogoUrlChanged} />
|
<Input className="w-full" type="text" value={customProfile.logoUrl} onChange={handleLogoUrlChanged} />
|
||||||
<p className="text-sm mb-1 mt-2">{t("setting.system-section.customize-server.description")}</p>
|
<p className="text-sm mb-1 mt-2">{t("setting.system-section.customize-server.description")}</p>
|
||||||
<Textarea className="w-full" minRows="2" maxRows="4" value={state.description} onChange={handleDescriptionChanged} />
|
<Textarea className="w-full" minRows="2" maxRows="4" value={customProfile.description} onChange={handleDescriptionChanged} />
|
||||||
<p className="text-sm mb-1 mt-2">{t("setting.system-section.customize-server.locale")}</p>
|
<p className="text-sm mb-1 mt-2">{t("setting.system-section.customize-server.locale")}</p>
|
||||||
<LocaleSelect className="!w-full" value={state.locale} onChange={handleLocaleSelectChange} />
|
<LocaleSelect className="!w-full" value={customProfile.locale} onChange={handleLocaleSelectChange} />
|
||||||
<p className="text-sm mb-1 mt-2">{t("setting.system-section.customize-server.appearance")}</p>
|
<p className="text-sm mb-1 mt-2">{t("setting.system-section.customize-server.appearance")}</p>
|
||||||
<AppearanceSelect className="!w-full" value={state.appearance} onChange={handleAppearanceSelectChange} />
|
<AppearanceSelect className="!w-full" value={customProfile.appearance as Appearance} onChange={handleAppearanceSelectChange} />
|
||||||
<div className="mt-4 w-full flex flex-row justify-between items-center space-x-2">
|
<div className="mt-4 w-full flex flex-row justify-between items-center space-x-2">
|
||||||
<div className="flex flex-row justify-start items-center">
|
<div className="flex flex-row justify-start items-center">
|
||||||
<Button variant="outlined" onClick={handleRestoreButtonClick}>
|
<Button variant="outlined" onClick={handleRestoreButtonClick}>
|
||||||
|
@ -1,23 +1,26 @@
|
|||||||
import { Button, IconButton, Input } from "@mui/joy";
|
import { Button, IconButton, Input } from "@mui/joy";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import * as api from "@/helpers/api";
|
import { WorkspaceSettingPrefix, useWorkspaceSettingStore } from "@/store/v1";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { WorkspaceSettingKey, WorkspaceStorageSetting } from "@/types/proto/store/workspace_setting";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import LearnMore from "./LearnMore";
|
import LearnMore from "./LearnMore";
|
||||||
|
|
||||||
interface Props extends DialogProps {
|
interface Props extends DialogProps {
|
||||||
localStoragePath?: string;
|
|
||||||
confirmCallback?: () => void;
|
confirmCallback?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const UpdateLocalStorageDialog: React.FC<Props> = (props: Props) => {
|
const UpdateLocalStorageDialog: React.FC<Props> = (props: Props) => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const { destroy, localStoragePath, confirmCallback } = props;
|
const { destroy, confirmCallback } = props;
|
||||||
const globalStore = useGlobalStore();
|
const workspaceSettingStore = useWorkspaceSettingStore();
|
||||||
const [path, setPath] = useState(localStoragePath || "");
|
const [workspaceStorageSetting, setWorkspaceStorageSetting] = useState<WorkspaceStorageSetting>(
|
||||||
|
WorkspaceStorageSetting.fromPartial(
|
||||||
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_STORAGE)?.storageSetting || {},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const handleCloseBtnClick = () => {
|
const handleCloseBtnClick = () => {
|
||||||
destroy();
|
destroy();
|
||||||
@ -25,23 +28,13 @@ const UpdateLocalStorageDialog: React.FC<Props> = (props: Props) => {
|
|||||||
|
|
||||||
const handleConfirmBtnClick = async () => {
|
const handleConfirmBtnClick = async () => {
|
||||||
try {
|
try {
|
||||||
await api.upsertSystemSetting({
|
await workspaceSettingStore.setWorkspaceSetting({
|
||||||
name: "local-storage-path",
|
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_STORAGE}`,
|
||||||
value: JSON.stringify(path.trim()),
|
storageSetting: workspaceStorageSetting,
|
||||||
});
|
});
|
||||||
await globalStore.fetchSystemStatus();
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
if (error.response.data.error) {
|
toast.error(error.details);
|
||||||
const errorText = error.response.data.error as string;
|
|
||||||
const internalIndex = errorText.indexOf("internal=");
|
|
||||||
if (internalIndex !== -1) {
|
|
||||||
const internalError = errorText.substring(internalIndex + 9);
|
|
||||||
toast.error(internalError);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
toast.error(error.response.data.message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (confirmCallback) {
|
if (confirmCallback) {
|
||||||
confirmCallback();
|
confirmCallback();
|
||||||
@ -67,8 +60,8 @@ const UpdateLocalStorageDialog: React.FC<Props> = (props: Props) => {
|
|||||||
className="mb-2"
|
className="mb-2"
|
||||||
placeholder={t("setting.storage-section.local-storage-path")}
|
placeholder={t("setting.storage-section.local-storage-path")}
|
||||||
fullWidth
|
fullWidth
|
||||||
value={path}
|
value={workspaceStorageSetting.localStoragePath}
|
||||||
onChange={(e) => setPath(e.target.value)}
|
onChange={(e) => setWorkspaceStorageSetting({ ...workspaceStorageSetting, localStoragePath: e.target.value })}
|
||||||
/>
|
/>
|
||||||
<div className="mt-2 w-full flex flex-row justify-end items-center space-x-1">
|
<div className="mt-2 w-full flex flex-row justify-end items-center space-x-1">
|
||||||
<Button variant="plain" color="neutral" onClick={handleCloseBtnClick}>
|
<Button variant="plain" color="neutral" onClick={handleCloseBtnClick}>
|
||||||
@ -81,14 +74,14 @@ const UpdateLocalStorageDialog: React.FC<Props> = (props: Props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
function showUpdateLocalStorageDialog(localStoragePath?: string, confirmCallback?: () => void) {
|
function showUpdateLocalStorageDialog(confirmCallback?: () => void) {
|
||||||
generateDialog(
|
generateDialog(
|
||||||
{
|
{
|
||||||
className: "update-local-storage-dialog",
|
className: "update-local-storage-dialog",
|
||||||
dialogName: "update-local-storage-dialog",
|
dialogName: "update-local-storage-dialog",
|
||||||
},
|
},
|
||||||
UpdateLocalStorageDialog,
|
UpdateLocalStorageDialog,
|
||||||
{ localStoragePath, confirmCallback },
|
{ confirmCallback },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import { authServiceClient } from "@/grpcweb";
|
|||||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||||
import useNavigateTo from "@/hooks/useNavigateTo";
|
import useNavigateTo from "@/hooks/useNavigateTo";
|
||||||
import { Routes } from "@/router";
|
import { Routes } from "@/router";
|
||||||
import { useGlobalStore } from "@/store/module";
|
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import UserAvatar from "./UserAvatar";
|
import UserAvatar from "./UserAvatar";
|
||||||
@ -17,10 +16,8 @@ const UserBanner = (props: Props) => {
|
|||||||
const { collapsed } = props;
|
const { collapsed } = props;
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const navigateTo = useNavigateTo();
|
const navigateTo = useNavigateTo();
|
||||||
const globalStore = useGlobalStore();
|
|
||||||
const { systemStatus } = globalStore.state;
|
|
||||||
const user = useCurrentUser();
|
const user = useCurrentUser();
|
||||||
const title = user ? user.nickname || user.username : systemStatus.customizedProfile.name || "memos";
|
const title = user ? user.nickname || user.username : "memos";
|
||||||
const avatarUrl = user ? user.avatarUrl : "/full-logo.webp";
|
const avatarUrl = user ? user.avatarUrl : "/full-logo.webp";
|
||||||
|
|
||||||
const handleSignOut = async () => {
|
const handleSignOut = async () => {
|
||||||
|
@ -3,18 +3,6 @@ import axios from "axios";
|
|||||||
axios.defaults.baseURL = import.meta.env.VITE_API_BASE_URL || "";
|
axios.defaults.baseURL = import.meta.env.VITE_API_BASE_URL || "";
|
||||||
axios.defaults.withCredentials = true;
|
axios.defaults.withCredentials = true;
|
||||||
|
|
||||||
export function getSystemStatus() {
|
|
||||||
return axios.get<SystemStatus>("/api/v1/status");
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getSystemSetting() {
|
|
||||||
return axios.get<SystemSetting[]>("/api/v1/system/setting");
|
|
||||||
}
|
|
||||||
|
|
||||||
export function upsertSystemSetting(systemSetting: SystemSetting) {
|
|
||||||
return axios.post<SystemSetting>("/api/v1/system/setting", systemSetting);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getStorageList() {
|
export function getStorageList() {
|
||||||
return axios.get<ObjectStorage[]>(`/api/v1/storage`);
|
return axios.get<ObjectStorage[]>(`/api/v1/storage`);
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,54 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { createContext, useContext, useEffect, useState } from "react";
|
||||||
import { initialGlobalState } from "@/store/module";
|
import { workspaceServiceClient } from "@/grpcweb";
|
||||||
|
import storage from "@/helpers/storage";
|
||||||
import { useUserStore, useWorkspaceSettingStore } from "@/store/v1";
|
import { useUserStore, useWorkspaceSettingStore } from "@/store/v1";
|
||||||
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
|
import { WorkspaceProfile } from "@/types/proto/api/v2/workspace_service";
|
||||||
|
import { WorkspaceGeneralSetting, WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
|
||||||
|
|
||||||
interface Props {
|
interface Context {
|
||||||
children: React.ReactNode;
|
locale: string;
|
||||||
|
appearance: string;
|
||||||
|
profile: WorkspaceProfile;
|
||||||
|
setLocale: (locale: string) => void;
|
||||||
|
setAppearance: (appearance: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CommonContextProvider = (props: Props) => {
|
const CommonContext = createContext<Context>({
|
||||||
|
locale: "en",
|
||||||
|
appearance: "system",
|
||||||
|
profile: WorkspaceProfile.fromPartial({}),
|
||||||
|
setLocale: () => {},
|
||||||
|
setAppearance: () => {},
|
||||||
|
});
|
||||||
|
|
||||||
|
const CommonContextProvider = ({ children }: { children: React.ReactNode }) => {
|
||||||
const workspaceSettingStore = useWorkspaceSettingStore();
|
const workspaceSettingStore = useWorkspaceSettingStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [commonContext, setCommonContext] = useState<Pick<Context, "locale" | "appearance" | "profile">>({
|
||||||
|
locale: "en",
|
||||||
|
appearance: "system",
|
||||||
|
profile: WorkspaceProfile.fromPartial({}),
|
||||||
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const initialState = async () => {
|
const initialWorkspace = async () => {
|
||||||
await initialGlobalState();
|
const { workspaceProfile } = await workspaceServiceClient.getWorkspaceProfile({});
|
||||||
await workspaceSettingStore.fetchWorkspaceSetting(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL);
|
await workspaceSettingStore.listWorkspaceSettings();
|
||||||
|
|
||||||
|
const workspaceGeneralSetting =
|
||||||
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL).generalSetting ||
|
||||||
|
WorkspaceGeneralSetting.fromPartial({});
|
||||||
|
const { locale } = storage.get(["locale"]);
|
||||||
|
const { appearance } = storage.get(["appearance"]);
|
||||||
|
setCommonContext({
|
||||||
|
locale: locale || workspaceGeneralSetting.customProfile?.locale || "en",
|
||||||
|
appearance: appearance || workspaceGeneralSetting.customProfile?.appearance || "system",
|
||||||
|
profile: WorkspaceProfile.fromPartial(workspaceProfile || {}),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const initialUser = async () => {
|
||||||
try {
|
try {
|
||||||
await userStore.fetchCurrentUser();
|
await userStore.fetchCurrentUser();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -23,10 +56,24 @@ const CommonContextProvider = (props: Props) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Promise.all([initialState()]).then(() => setLoading(false));
|
Promise.all([initialWorkspace(), initialUser()]).then(() => setLoading(false));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return loading ? null : <>{props.children}</>;
|
return (
|
||||||
|
<CommonContext.Provider
|
||||||
|
value={{
|
||||||
|
...commonContext,
|
||||||
|
setLocale: (locale: string) => setCommonContext({ ...commonContext, locale }),
|
||||||
|
setAppearance: (appearance: string) => setCommonContext({ ...commonContext, appearance }),
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{loading ? null : <>{children}</>}
|
||||||
|
</CommonContext.Provider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const useCommonContext = () => {
|
||||||
|
return useContext(CommonContext);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CommonContextProvider;
|
export default CommonContextProvider;
|
||||||
|
@ -9,9 +9,9 @@ import PreferencesSection from "@/components/Settings/PreferencesSection";
|
|||||||
import SSOSection from "@/components/Settings/SSOSection";
|
import SSOSection from "@/components/Settings/SSOSection";
|
||||||
import SectionMenuItem from "@/components/Settings/SectionMenuItem";
|
import SectionMenuItem from "@/components/Settings/SectionMenuItem";
|
||||||
import StorageSection from "@/components/Settings/StorageSection";
|
import StorageSection from "@/components/Settings/StorageSection";
|
||||||
import SystemSection from "@/components/Settings/SystemSection";
|
import WorkspaceSection from "@/components/Settings/WorkspaceSection";
|
||||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { useCommonContext } from "@/layouts/CommonContextProvider";
|
||||||
import { User_Role } from "@/types/proto/api/v2/user_service";
|
import { User_Role } from "@/types/proto/api/v2/user_service";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
|
||||||
@ -35,8 +35,8 @@ const SECTION_ICON_MAP: Record<SettingSection, LucideIcon> = {
|
|||||||
|
|
||||||
const Setting = () => {
|
const Setting = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
const commonContext = useCommonContext();
|
||||||
const user = useCurrentUser();
|
const user = useCurrentUser();
|
||||||
const globalStore = useGlobalStore();
|
|
||||||
const [state, setState] = useState<State>({
|
const [state, setState] = useState<State>({
|
||||||
selectedSection: "my-account",
|
selectedSection: "my-account",
|
||||||
});
|
});
|
||||||
@ -88,7 +88,7 @@ const Setting = () => {
|
|||||||
onClick={() => handleSectionSelectorItemClick(item)}
|
onClick={() => handleSectionSelectorItemClick(item)}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
<span className="px-3 mt-2 opacity-70 text-sm">Version: v{globalStore.state.workspaceProfile.version}</span>
|
<span className="px-3 mt-2 opacity-70 text-sm">Version: v{commonContext.profile.version}</span>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
@ -110,7 +110,7 @@ const Setting = () => {
|
|||||||
) : state.selectedSection === "member" ? (
|
) : state.selectedSection === "member" ? (
|
||||||
<MemberSection />
|
<MemberSection />
|
||||||
) : state.selectedSection === "system" ? (
|
) : state.selectedSection === "system" ? (
|
||||||
<SystemSection />
|
<WorkspaceSection />
|
||||||
) : state.selectedSection === "storage" ? (
|
) : state.selectedSection === "storage" ? (
|
||||||
<StorageSection />
|
<StorageSection />
|
||||||
) : state.selectedSection === "sso" ? (
|
) : state.selectedSection === "sso" ? (
|
||||||
|
@ -10,7 +10,7 @@ import * as api from "@/helpers/api";
|
|||||||
import { absolutifyLink } from "@/helpers/utils";
|
import { absolutifyLink } from "@/helpers/utils";
|
||||||
import useLoading from "@/hooks/useLoading";
|
import useLoading from "@/hooks/useLoading";
|
||||||
import useNavigateTo from "@/hooks/useNavigateTo";
|
import useNavigateTo from "@/hooks/useNavigateTo";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { useCommonContext } from "@/layouts/CommonContextProvider";
|
||||||
import { useUserStore, useWorkspaceSettingStore } from "@/store/v1";
|
import { useUserStore, useWorkspaceSettingStore } from "@/store/v1";
|
||||||
import { WorkspaceGeneralSetting } from "@/types/proto/api/v2/workspace_setting_service";
|
import { WorkspaceGeneralSetting } from "@/types/proto/api/v2/workspace_setting_service";
|
||||||
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
|
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
|
||||||
@ -19,11 +19,10 @@ import { useTranslate } from "@/utils/i18n";
|
|||||||
const SignIn = () => {
|
const SignIn = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const navigateTo = useNavigateTo();
|
const navigateTo = useNavigateTo();
|
||||||
const globalStore = useGlobalStore();
|
const commonContext = useCommonContext();
|
||||||
const workspaceSettingStore = useWorkspaceSettingStore();
|
const workspaceSettingStore = useWorkspaceSettingStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const actionBtnLoadingState = useLoading(false);
|
const actionBtnLoadingState = useLoading(false);
|
||||||
const { appearance, locale, systemStatus, workspaceProfile } = globalStore.state;
|
|
||||||
const [username, setUsername] = useState("");
|
const [username, setUsername] = useState("");
|
||||||
const [password, setPassword] = useState("");
|
const [password, setPassword] = useState("");
|
||||||
const [remember, setRemember] = useState(true);
|
const [remember, setRemember] = useState(true);
|
||||||
@ -41,11 +40,11 @@ const SignIn = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (workspaceProfile.mode === "demo") {
|
if (commonContext.profile.mode === "demo") {
|
||||||
setUsername("memos-demo");
|
setUsername("memos-demo");
|
||||||
setPassword("secret");
|
setPassword("secret");
|
||||||
}
|
}
|
||||||
}, [workspaceProfile.mode]);
|
}, [commonContext.profile.mode]);
|
||||||
|
|
||||||
const handleUsernameInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleUsernameInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const text = e.target.value as string;
|
const text = e.target.value as string;
|
||||||
@ -58,11 +57,11 @@ const SignIn = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleLocaleSelectChange = (locale: Locale) => {
|
const handleLocaleSelectChange = (locale: Locale) => {
|
||||||
globalStore.setLocale(locale);
|
commonContext.setLocale(locale);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAppearanceSelectChange = (appearance: Appearance) => {
|
const handleAppearanceSelectChange = (appearance: Appearance) => {
|
||||||
globalStore.setAppearance(appearance);
|
commonContext.setAppearance(appearance);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFormSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
const handleFormSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
@ -113,8 +112,10 @@ const SignIn = () => {
|
|||||||
<div className="py-4 sm:py-8 w-80 max-w-full min-h-[100svh] mx-auto flex flex-col justify-start items-center">
|
<div className="py-4 sm:py-8 w-80 max-w-full min-h-[100svh] mx-auto flex flex-col justify-start items-center">
|
||||||
<div className="w-full py-4 grow flex flex-col justify-center items-center">
|
<div className="w-full py-4 grow flex flex-col justify-center items-center">
|
||||||
<div className="w-full flex flex-row justify-center items-center mb-6">
|
<div className="w-full flex flex-row justify-center items-center mb-6">
|
||||||
<img className="h-14 w-auto rounded-full shadow" src={systemStatus.customizedProfile.logoUrl} alt="" />
|
<img className="h-14 w-auto rounded-full shadow" src={workspaceGeneralSetting.customProfile?.logoUrl || "/logo.webp"} alt="" />
|
||||||
<p className="ml-2 text-5xl text-black opacity-80 dark:text-gray-200">{systemStatus.customizedProfile.name}</p>
|
<p className="ml-2 text-5xl text-black opacity-80 dark:text-gray-200">
|
||||||
|
{workspaceGeneralSetting.customProfile?.title || "Memos"}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{!workspaceGeneralSetting.disallowPasswordLogin && (
|
{!workspaceGeneralSetting.disallowPasswordLogin && (
|
||||||
<>
|
<>
|
||||||
@ -199,8 +200,8 @@ const SignIn = () => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-4 flex flex-row items-center justify-center w-full gap-2">
|
<div className="mt-4 flex flex-row items-center justify-center w-full gap-2">
|
||||||
<LocaleSelect value={locale} onChange={handleLocaleSelectChange} />
|
<LocaleSelect value={commonContext.locale} onChange={handleLocaleSelectChange} />
|
||||||
<AppearanceSelect value={appearance} onChange={handleAppearanceSelectChange} />
|
<AppearanceSelect value={commonContext.appearance as Appearance} onChange={handleAppearanceSelectChange} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -8,19 +8,24 @@ import LocaleSelect from "@/components/LocaleSelect";
|
|||||||
import { authServiceClient } from "@/grpcweb";
|
import { authServiceClient } from "@/grpcweb";
|
||||||
import useLoading from "@/hooks/useLoading";
|
import useLoading from "@/hooks/useLoading";
|
||||||
import useNavigateTo from "@/hooks/useNavigateTo";
|
import useNavigateTo from "@/hooks/useNavigateTo";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { useCommonContext } from "@/layouts/CommonContextProvider";
|
||||||
import { useUserStore } from "@/store/v1";
|
import { useUserStore, useWorkspaceSettingStore } from "@/store/v1";
|
||||||
|
import { WorkspaceGeneralSetting } from "@/types/proto/api/v2/workspace_setting_service";
|
||||||
|
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
|
|
||||||
const SignUp = () => {
|
const SignUp = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const navigateTo = useNavigateTo();
|
const navigateTo = useNavigateTo();
|
||||||
const globalStore = useGlobalStore();
|
const commonContext = useCommonContext();
|
||||||
|
const workspaceSettingStore = useWorkspaceSettingStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const actionBtnLoadingState = useLoading(false);
|
const actionBtnLoadingState = useLoading(false);
|
||||||
const { appearance, locale, systemStatus, workspaceProfile } = globalStore.state;
|
|
||||||
const [username, setUsername] = useState("");
|
const [username, setUsername] = useState("");
|
||||||
const [password, setPassword] = useState("");
|
const [password, setPassword] = useState("");
|
||||||
|
const workspaceGeneralSetting =
|
||||||
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL).generalSetting ||
|
||||||
|
WorkspaceGeneralSetting.fromPartial({});
|
||||||
|
|
||||||
const handleUsernameInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleUsernameInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const text = e.target.value as string;
|
const text = e.target.value as string;
|
||||||
@ -33,11 +38,11 @@ const SignUp = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleLocaleSelectChange = (locale: Locale) => {
|
const handleLocaleSelectChange = (locale: Locale) => {
|
||||||
globalStore.setLocale(locale);
|
commonContext.setLocale(locale);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAppearanceSelectChange = (appearance: Appearance) => {
|
const handleAppearanceSelectChange = (appearance: Appearance) => {
|
||||||
globalStore.setAppearance(appearance);
|
commonContext.setAppearance(appearance);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFormSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
const handleFormSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
@ -74,8 +79,10 @@ const SignUp = () => {
|
|||||||
<div className="py-4 sm:py-8 w-80 max-w-full min-h-[100svh] mx-auto flex flex-col justify-start items-center">
|
<div className="py-4 sm:py-8 w-80 max-w-full min-h-[100svh] mx-auto flex flex-col justify-start items-center">
|
||||||
<div className="w-full py-4 grow flex flex-col justify-center items-center">
|
<div className="w-full py-4 grow flex flex-col justify-center items-center">
|
||||||
<div className="w-full flex flex-row justify-center items-center mb-6">
|
<div className="w-full flex flex-row justify-center items-center mb-6">
|
||||||
<img className="h-14 w-auto rounded-full shadow" src={systemStatus.customizedProfile.logoUrl} alt="" />
|
<img className="h-14 w-auto rounded-full shadow" src={workspaceGeneralSetting.customProfile?.logoUrl || "/logo.webp"} alt="" />
|
||||||
<p className="ml-2 text-5xl text-black opacity-80 dark:text-gray-200">{systemStatus.customizedProfile.name}</p>
|
<p className="ml-2 text-5xl text-black opacity-80 dark:text-gray-200">
|
||||||
|
{workspaceGeneralSetting.customProfile?.title || "Memos"}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p className="w-full text-2xl mt-2 dark:text-gray-500">{t("auth.create-your-account")}</p>
|
<p className="w-full text-2xl mt-2 dark:text-gray-500">{t("auth.create-your-account")}</p>
|
||||||
<form className="w-full mt-2" onSubmit={handleFormSubmit}>
|
<form className="w-full mt-2" onSubmit={handleFormSubmit}>
|
||||||
@ -120,7 +127,7 @@ const SignUp = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{!workspaceProfile.owner && <p className="w-full mt-4 text-sm font-medium dark:text-gray-500">{t("auth.host-tip")}</p>}
|
{!commonContext.profile.owner && <p className="w-full mt-4 text-sm font-medium dark:text-gray-500">{t("auth.host-tip")}</p>}
|
||||||
<p className="w-full mt-4 text-sm">
|
<p className="w-full mt-4 text-sm">
|
||||||
<span className="dark:text-gray-500">{t("auth.sign-in-tip")}</span>
|
<span className="dark:text-gray-500">{t("auth.sign-in-tip")}</span>
|
||||||
<Link to="/auth" className="cursor-pointer ml-2 text-blue-600 hover:underline" unstable_viewTransition>
|
<Link to="/auth" className="cursor-pointer ml-2 text-blue-600 hover:underline" unstable_viewTransition>
|
||||||
@ -129,8 +136,8 @@ const SignUp = () => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-4 flex flex-row items-center justify-center w-full gap-2">
|
<div className="mt-4 flex flex-row items-center justify-center w-full gap-2">
|
||||||
<LocaleSelect value={locale} onChange={handleLocaleSelectChange} />
|
<LocaleSelect value={commonContext.locale} onChange={handleLocaleSelectChange} />
|
||||||
<AppearanceSelect value={appearance} onChange={handleAppearanceSelectChange} />
|
<AppearanceSelect value={commonContext.appearance as Appearance} onChange={handleAppearanceSelectChange} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -2,13 +2,11 @@ import { configureStore } from "@reduxjs/toolkit";
|
|||||||
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
|
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
|
||||||
import dialogReducer from "./reducer/dialog";
|
import dialogReducer from "./reducer/dialog";
|
||||||
import filterReducer from "./reducer/filter";
|
import filterReducer from "./reducer/filter";
|
||||||
import globalReducer from "./reducer/global";
|
|
||||||
import resourceReducer from "./reducer/resource";
|
import resourceReducer from "./reducer/resource";
|
||||||
import tagReducer from "./reducer/tag";
|
import tagReducer from "./reducer/tag";
|
||||||
|
|
||||||
const store = configureStore({
|
const store = configureStore({
|
||||||
reducer: {
|
reducer: {
|
||||||
global: globalReducer,
|
|
||||||
tag: tagReducer,
|
tag: tagReducer,
|
||||||
filter: filterReducer,
|
filter: filterReducer,
|
||||||
resource: resourceReducer,
|
resource: resourceReducer,
|
||||||
|
@ -1,105 +0,0 @@
|
|||||||
import { workspaceServiceClient } from "@/grpcweb";
|
|
||||||
import * as api from "@/helpers/api";
|
|
||||||
import storage from "@/helpers/storage";
|
|
||||||
import i18n from "@/i18n";
|
|
||||||
import { WorkspaceProfile } from "@/types/proto/api/v2/workspace_service";
|
|
||||||
import { findNearestMatchedLanguage } from "@/utils/i18n";
|
|
||||||
import store, { useAppSelector } from "../";
|
|
||||||
import { setAppearance, setGlobalState, setLocale } from "../reducer/global";
|
|
||||||
|
|
||||||
export const initialGlobalState = async () => {
|
|
||||||
const defaultGlobalState = {
|
|
||||||
locale: "en" as Locale,
|
|
||||||
appearance: "system" as Appearance,
|
|
||||||
systemStatus: {
|
|
||||||
disablePasswordLogin: false,
|
|
||||||
disablePublicMemos: false,
|
|
||||||
maxUploadSizeMiB: 0,
|
|
||||||
memoDisplayWithUpdatedTs: false,
|
|
||||||
customizedProfile: {
|
|
||||||
name: "Memos",
|
|
||||||
logoUrl: "/logo.webp",
|
|
||||||
description: "",
|
|
||||||
locale: "en",
|
|
||||||
appearance: "system",
|
|
||||||
},
|
|
||||||
} as SystemStatus,
|
|
||||||
workspaceProfile: WorkspaceProfile.fromPartial({}),
|
|
||||||
};
|
|
||||||
|
|
||||||
const { workspaceProfile } = await workspaceServiceClient.getWorkspaceProfile({});
|
|
||||||
if (workspaceProfile) {
|
|
||||||
defaultGlobalState.workspaceProfile = workspaceProfile;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { data } = await api.getSystemStatus();
|
|
||||||
if (data) {
|
|
||||||
const customizedProfile = data.customizedProfile;
|
|
||||||
defaultGlobalState.systemStatus = {
|
|
||||||
...data,
|
|
||||||
customizedProfile: {
|
|
||||||
name: customizedProfile.name || "Memos",
|
|
||||||
logoUrl: customizedProfile.logoUrl || "/logo.webp",
|
|
||||||
description: customizedProfile.description,
|
|
||||||
locale: customizedProfile.locale || "en",
|
|
||||||
appearance: customizedProfile.appearance || "system",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
// Use storageLocale > userLocale > customizedProfile.locale (server's default locale)
|
|
||||||
// Initially, storageLocale is undefined and user is not logged in, so use server's default locale.
|
|
||||||
// User can change locale in login/sign up page, set storageLocale and override userLocale after logged in.
|
|
||||||
// Otherwise, storageLocale remains undefined and if userLocale has value after user logged in, set to storageLocale and re-render.
|
|
||||||
// Otherwise, use server's default locale, set to storageLocale.
|
|
||||||
const { locale: storageLocale, appearance: storageAppearance } = storage.get(["locale", "appearance"]);
|
|
||||||
defaultGlobalState.locale =
|
|
||||||
storageLocale || defaultGlobalState.systemStatus.customizedProfile.locale || findNearestMatchedLanguage(i18n.language);
|
|
||||||
defaultGlobalState.appearance = storageAppearance || defaultGlobalState.systemStatus.customizedProfile.appearance;
|
|
||||||
}
|
|
||||||
store.dispatch(setGlobalState(defaultGlobalState));
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useGlobalStore = () => {
|
|
||||||
const state = useAppSelector((state) => state.global);
|
|
||||||
|
|
||||||
return {
|
|
||||||
state,
|
|
||||||
getState: () => {
|
|
||||||
return store.getState().global;
|
|
||||||
},
|
|
||||||
getDisablePublicMemos: () => {
|
|
||||||
return store.getState().global.systemStatus.disablePublicMemos;
|
|
||||||
},
|
|
||||||
isDev: () => {
|
|
||||||
return state.workspaceProfile.mode !== "prod";
|
|
||||||
},
|
|
||||||
fetchSystemStatus: async () => {
|
|
||||||
const { data: systemStatus } = await api.getSystemStatus();
|
|
||||||
store.dispatch(setGlobalState({ systemStatus: systemStatus }));
|
|
||||||
return systemStatus;
|
|
||||||
},
|
|
||||||
setSystemStatus: (systemStatus: Partial<SystemStatus>) => {
|
|
||||||
store.dispatch(
|
|
||||||
setGlobalState({
|
|
||||||
systemStatus: {
|
|
||||||
...state.systemStatus,
|
|
||||||
...systemStatus,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
setLocale: (locale: Locale) => {
|
|
||||||
// Set storageLocale to user selected locale.
|
|
||||||
storage.set({
|
|
||||||
locale: locale,
|
|
||||||
});
|
|
||||||
store.dispatch(setLocale(locale));
|
|
||||||
},
|
|
||||||
setAppearance: (appearance: Appearance) => {
|
|
||||||
// Set storageAppearance to user selected appearance.
|
|
||||||
storage.set({
|
|
||||||
appearance: appearance,
|
|
||||||
});
|
|
||||||
store.dispatch(setAppearance(appearance));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
@ -1,4 +1,3 @@
|
|||||||
export * from "./global";
|
|
||||||
export * from "./filter";
|
export * from "./filter";
|
||||||
export * from "./tag";
|
export * from "./tag";
|
||||||
export * from "./dialog";
|
export * from "./dialog";
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
|
||||||
import { WorkspaceProfile } from "@/types/proto/api/v2/workspace_service";
|
|
||||||
|
|
||||||
interface State {
|
|
||||||
locale: Locale;
|
|
||||||
appearance: Appearance;
|
|
||||||
systemStatus: SystemStatus;
|
|
||||||
workspaceProfile: WorkspaceProfile;
|
|
||||||
}
|
|
||||||
|
|
||||||
const globalSlice = createSlice({
|
|
||||||
name: "global",
|
|
||||||
initialState: {
|
|
||||||
locale: "en",
|
|
||||||
appearance: "system",
|
|
||||||
systemStatus: {
|
|
||||||
disablePasswordLogin: false,
|
|
||||||
disablePublicMemos: false,
|
|
||||||
memoDisplayWithUpdatedTs: false,
|
|
||||||
customizedProfile: {
|
|
||||||
name: "Memos",
|
|
||||||
logoUrl: "/logo.webp",
|
|
||||||
description: "",
|
|
||||||
locale: "en",
|
|
||||||
appearance: "system",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
workspaceProfile: WorkspaceProfile.fromPartial({}),
|
|
||||||
} as State,
|
|
||||||
reducers: {
|
|
||||||
setGlobalState: (state, action: PayloadAction<Partial<State>>) => {
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
...action.payload,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
setLocale: (state, action: PayloadAction<Locale>) => {
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
locale: action.payload,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
setAppearance: (state, action: PayloadAction<Appearance>) => {
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
appearance: action.payload,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const { setGlobalState, setLocale, setAppearance } = globalSlice.actions;
|
|
||||||
|
|
||||||
export default globalSlice.reducer;
|
|
@ -15,6 +15,13 @@ const getDefaultState = (): State => ({
|
|||||||
|
|
||||||
export const useWorkspaceSettingStore = create(
|
export const useWorkspaceSettingStore = create(
|
||||||
combine(getDefaultState(), (set, get) => ({
|
combine(getDefaultState(), (set, get) => ({
|
||||||
|
getState: () => {
|
||||||
|
return get();
|
||||||
|
},
|
||||||
|
listWorkspaceSettings: async () => {
|
||||||
|
const { settings } = await workspaceSettingServiceClient.listWorkspaceSettings({});
|
||||||
|
set({ workspaceSettingByName: settings.reduce((acc, setting) => ({ ...acc, [setting.name]: setting }), {}) });
|
||||||
|
},
|
||||||
fetchWorkspaceSetting: async (key: WorkspaceSettingKey) => {
|
fetchWorkspaceSetting: async (key: WorkspaceSettingKey) => {
|
||||||
const { setting } = await workspaceSettingServiceClient.getWorkspaceSetting({ name: `${WorkspaceSettingPrefix}${key}` });
|
const { setting } = await workspaceSettingServiceClient.getWorkspaceSetting({ name: `${WorkspaceSettingPrefix}${key}` });
|
||||||
if (!setting) {
|
if (!setting) {
|
||||||
@ -25,5 +32,9 @@ export const useWorkspaceSettingStore = create(
|
|||||||
getWorkspaceSettingByKey: (key: WorkspaceSettingKey): WorkspaceSetting => {
|
getWorkspaceSettingByKey: (key: WorkspaceSettingKey): WorkspaceSetting => {
|
||||||
return get().workspaceSettingByName[`${WorkspaceSettingPrefix}${key}`] || WorkspaceSetting.fromPartial({});
|
return get().workspaceSettingByName[`${WorkspaceSettingPrefix}${key}`] || WorkspaceSetting.fromPartial({});
|
||||||
},
|
},
|
||||||
|
setWorkspaceSetting: async (setting: WorkspaceSetting) => {
|
||||||
|
await workspaceSettingServiceClient.setWorkspaceSetting({ setting });
|
||||||
|
set({ workspaceSettingByName: { ...get().workspaceSettingByName, [setting.name]: setting } });
|
||||||
|
},
|
||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
|
23
web/src/types/modules/system.d.ts
vendored
23
web/src/types/modules/system.d.ts
vendored
@ -1,23 +0,0 @@
|
|||||||
interface CustomizedProfile {
|
|
||||||
name: string;
|
|
||||||
logoUrl: string;
|
|
||||||
description: string;
|
|
||||||
locale: Locale;
|
|
||||||
appearance: Appearance;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SystemStatus {
|
|
||||||
// System settings
|
|
||||||
disablePasswordLogin: boolean;
|
|
||||||
disablePublicMemos: boolean;
|
|
||||||
maxUploadSizeMiB: number;
|
|
||||||
customizedProfile: CustomizedProfile;
|
|
||||||
storageServiceId: number;
|
|
||||||
localStoragePath: string;
|
|
||||||
memoDisplayWithUpdatedTs: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SystemSetting {
|
|
||||||
name: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user