Skip to content

Commit

Permalink
fix:Message recording time filtering will not be reset (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
wzh425 authored Jan 5, 2024
1 parent 1ab58fb commit a15423d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/Services/Masa.Mc.Service/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"IS_DEMO": "false",
"OTLP_URL": "http://otel-collector.masastack:9013",
"ELASTIC": "{\"ESNode\": \"http://10.10.90.189\",\"Index\": \"user_dev\",\"ESPort\":30200}",
"REDIS": "{\"RedisHost\": \"10.130.0.235\", \"RedisPort\": 24615, \"RedisDb\": 0,\"RedisPassword\": \"Hzss@123\"}",
"CONNECTIONSTRING": "{\"Server\": \"10.130.0.235\", \"Port\": 24878,\"Database\":\"pm-dev\",\"UserId\": \"ss\",\"Password\":\"Hzss@123\"}",
"REDIS": "{\"RedisHost\": \"10.130.0.19\", \"RedisPort\": 2135, \"RedisDb\": 3,\"RedisPassword\": \"Hzss@123\"}",
"CONNECTIONSTRING": "{\"Server\": \"10.130.0.19\", \"Port\": 2415,\"Database\":\"pm-dev\",\"UserId\": \"ss\",\"Password\":\"Hzss@123\"}",
"MASA_STACK": "[{\"id\":\"pm\",\"service\":{\"id\":\"pm-service-dev\",\"domain\":\"http://pm-service-dev.masastack.com\"},\"web\":{\"id\":\"pm-web-dev\",\"domain\":\"https://pm-dev.masastack.com\"}},{\"id\":\"dcc\",\"service\":{\"id\":\"dcc-service-dev\",\"domain\":\"http://dcc-service-dev.masastack.com\"},\"web\":{\"id\":\"dcc-web-dev\",\"domain\":\"https://dcc-dev.masastack.com\"}},{\"id\":\"tsc\",\"service\":{\"id\":\"tsc-service-dev\",\"domain\":\"http://tsc-service-dev.masastack.com\"},\"web\":{\"id\":\"tsc-web-dev\",\"domain\":\"https://tsc-dev.masastack.com\"}},{\"id\":\"alert\",\"service\":{\"id\":\"alert-service-dev\",\"domain\":\"http://alert-service-dev.masastack.com\"},\"web\":{\"id\":\"alert-web-dev\",\"domain\":\"https://alert-dev.masastack.com\"}},{\"id\":\"scheduler\",\"service\":{\"id\":\"scheduler-service-dev\",\"domain\":\"http://scheduler-service-dev.masastack.com\"},\"worker\":{\"id\":\"scheduler-worker-dev\",\"domain\":\"http://scheduler-worker-dev.masastack.com\"},\"web\":{\"id\":\"scheduler-web-dev\",\"domain\":\"https://scheduler-dev.masastack.com\"}},{\"id\":\"mc\",\"service\":{\"id\":\"mc-service-dev\",\"domain\":\"http://mc-service-dev.masastack.com\"},\"web\":{\"id\":\"mc-web-dev\",\"domain\":\"https://mc-dev.masastack.com\"}},{\"id\":\"auth\",\"service\":{\"id\":\"auth-service-dev\",\"domain\":\"http://auth-service-dev.masastack.com\"},\"web\":{\"id\":\"auth-web-dev\",\"domain\":\"https://auth-dev.masastack.com\"},\"sso\":{\"id\":\"auth-sso-dev\",\"domain\":\"https://auth-sso-dev.masastack.com\"}}]",
"ADMIN_PWD": "admin_pwd",
"DCC_SECRET": "masastack.com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"MASA_ENVIRONMENT": "Development",
"OTLP_URL": "http://otel-collector.masastack:9013",
"ELASTIC": "{\"Nodes\": [\"http://es-ydy-new.lonsid.cn:9200\"],\"Index\": \"auth_user_development\"}",
"REDIS": "{\"RedisHost\": \"10.130.0.235\", \"RedisPort\": 24615, \"RedisDb\": 0,\"RedisPassword\": \"Hzss@123\"}",
"CONNECTIONSTRING": "{\"Server\": \"10.130.0.235\", \"Port\": 24878,\"Database\":\"mc-dev\",\"UserId\": \"ss\",\"Password\":\"Hzss@123\"}",
"REDIS": "{\"RedisHost\": \"10.130.0.19\", \"RedisPort\": 2135, \"RedisDb\": 3,\"RedisPassword\": \"Hzss@123\"}",
"CONNECTIONSTRING": "{\"Server\": \"10.130.0.19\", \"Port\": 2415,\"Database\":\"mc-dev\",\"UserId\": \"ss\",\"Password\":\"Hzss@123\"}",
"MASA_STACK": "[{\"id\":\"pm\",\"service\":{\"id\":\"pm-service-dev\",\"domain\":\"http://pm-service-dev.masastack.com\"},\"web\":{\"id\":\"pm-web-dev\",\"domain\":\"https://pm-dev.masastack.com\"}},{\"id\":\"dcc\",\"service\":{\"id\":\"dcc-service-dev\",\"domain\":\"http://dcc-service-dev.masastack.com\"},\"web\":{\"id\":\"dcc-web-dev\",\"domain\":\"https://dcc-dev.masastack.com\"}},{\"id\":\"tsc\",\"service\":{\"id\":\"tsc-service-dev\",\"domain\":\"http://tsc-service-dev.masastack.com\"},\"web\":{\"id\":\"tsc-web-dev\",\"domain\":\"https://tsc-dev.masastack.com\"}},{\"id\":\"alert\",\"service\":{\"id\":\"alert-service-dev\",\"domain\":\"http://alert-service-dev.masastack.com\"},\"web\":{\"id\":\"alert-web-dev\",\"domain\":\"https://alert-dev.masastack.com\"}},{\"id\":\"scheduler\",\"service\":{\"id\":\"scheduler-service-dev\",\"domain\":\"http://scheduler-service-dev.masastack.com\"},\"worker\":{\"id\":\"scheduler-worker-dev\",\"domain\":\"http://scheduler-worker-dev.masastack.com\"},\"web\":{\"id\":\"scheduler-web-dev\",\"domain\":\"https://scheduler-dev.masastack.com\"}},{\"id\":\"mc\",\"service\":{\"id\":\"mc-service-dev\",\"domain\":\"http://mc-service-dev.masastack.com\"},\"web\":{\"id\":\"mc-web-dev\",\"domain\":\"https://mc-dev.masastack.com\"}},{\"id\":\"auth\",\"service\":{\"id\":\"auth-service-dev\",\"domain\":\"http://auth-service-dev.masastack.com\"},\"web\":{\"id\":\"auth-web-dev\",\"domain\":\"https://auth-dev.masastack.com\"},\"sso\":{\"id\":\"auth-sso-dev\",\"domain\":\"https://auth-sso-dev.masastack.com\"}}]"
},
"applicationUrl": "https://localhost:19500;http://localhost:19510",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,40 @@ namespace Masa.Mc.Web.Admin.Pages.MessageRecords;
public partial class MessageRecordManagement : AdminCompontentBase
{
private MessageRecordDetailModal _detailModal = default!;
private static GetMessageRecordInputDto defaultQueryParam = new()
{
TimeType = MessageRecordTimeTypes.ExpectSendTime,
StartTime = DateTime.Now.Date,
EndTime = DateTime.Now.Date.AddDays(1)
};
private GetMessageRecordInputDto _queryParam = defaultQueryParam;
private GetMessageRecordInputDto _queryParam = new();
private PaginatedListDto<MessageRecordDto> _entities = new();
private List<ChannelDto> _channelItems = new();
private List<KeyValuePair<string, bool>> _successItems = new();
private ChannelService ChannelService => McCaller.ChannelService;
private MessageRecordService MessageRecordService => McCaller.MessageRecordService;
private DateTimeOffset? _endTime = defaultQueryParam.EndTime;
private DateTimeOffset? _startTime = defaultQueryParam.StartTime;
private DateTimeOffset? _endTime;
private DateTimeOffset? _startTime;

protected override string? PageName { get; set; } = "MessageRecordBlock";

protected async override Task OnInitializedAsync()
{
string prefix = "DisplayName.MessageRecord";
_channelItems = (await ChannelService.GetListAsync(new GetChannelInputDto(99))).Result;
_successItems = new()
{
new(T("Success"), true),
new(T("Failure"), false)
};

SetDefaultParam();
}

private void SetDefaultParam()
{
var defaultQueryParam = new GetMessageRecordInputDto()
{
TimeType = MessageRecordTimeTypes.ExpectSendTime,
StartTime = DateTime.Now.Date,
EndTime = DateTime.Now.Date.AddDays(1)
};
_queryParam = defaultQueryParam;
_endTime = defaultQueryParam.EndTime;
_startTime = defaultQueryParam.StartTime;
}

public List<DataTableHeader<MessageRecordDto>> GetHeaders()
Expand Down Expand Up @@ -102,7 +110,7 @@ private async Task HandlePageSizeChanged(int pageSize)

private async Task HandleClearAsync()
{
_queryParam = defaultQueryParam;
SetDefaultParam();
await LoadData();
}
}

0 comments on commit a15423d

Please sign in to comment.