├── .dockerignore ├── .editorconfig ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── pull_request_template.md └── workflows │ └── mirror-gitlab.yml ├── .gitignore ├── .gitlab-ci.yml ├── Directory.Build.props ├── LICENSE ├── MASA.Scheduler.sln ├── README.md ├── dapr └── components │ ├── masa-scheduler-pubsub.yaml │ └── masa-scheduler-statestore.yaml ├── docker-compose.dcproj ├── docker-compose.override.yml ├── docker-compose.yml ├── power.ps1 └── src ├── ApiGateways └── Caller │ └── Masa.Scheduler.ApiGateways.Caller │ ├── Masa.Scheduler.ApiGateways.Caller.csproj │ ├── SchedulerApiOptions.cs │ ├── SchedulerResponseMessage.cs │ ├── SchedulerServerCaller.cs │ ├── ServiceCollectionExtensions.cs │ ├── Services │ ├── AuthService.cs │ ├── OssService.cs │ ├── PmService.cs │ ├── SchedulerJobService.cs │ ├── SchedulerResourceService.cs │ ├── SchedulerServerManagerService.cs │ ├── SchedulerTaskService.cs │ └── ServiceBase.cs │ └── _Imports.cs ├── Contracts └── Masa.Scheduler.Contracts.Server │ ├── Dtos │ ├── AuditedEntityDto.cs │ ├── PaginationDto.cs │ ├── ProjectAppDto.cs │ ├── ProjectDto.cs │ ├── SchedulerJobAppConfigDto.cs │ ├── SchedulerJobDaprServiceInvocationConfigDto.cs │ ├── SchedulerJobDto.cs │ ├── SchedulerJobHttpConfigDto.cs │ ├── SchedulerResourceDto.cs │ ├── SchedulerTaskDto.cs │ ├── SecurityTokenDto.cs │ ├── TeamDto.cs │ └── UserDto.cs │ ├── Helper │ └── RegularHelper.cs │ ├── Infrastructure │ ├── Consts │ │ ├── ConstStrings.cs │ │ ├── SignalRMethodConsts.cs │ │ ├── TempCurrentUserConsts.cs │ │ └── UserFriendlyExceptionCodes.cs │ ├── Enums │ │ ├── ConfirmDialogTypes.cs │ │ ├── FailedStrategyTypes.cs │ │ ├── HttpMethods.cs │ │ ├── HttpParameterTypes.cs │ │ ├── HttpVerifyTypes.cs │ │ ├── JobCreateTypes.cs │ │ ├── JobNotifyStatus.cs │ │ ├── JobQueryTimeTypes.cs │ │ ├── JobTypes.cs │ │ ├── LoggerTypes.cs │ │ ├── ProjectAppTypes.cs │ │ ├── ResourceVersionTypes.cs │ │ ├── RoutingStrategyTypes.cs │ │ ├── RunTimeoutStrategyTypes.cs │ │ ├── ScheduleBlockStrategyTypes.cs │ │ ├── ScheduleExpiredStrategyTypes.cs │ │ ├── ScheduleTypes.cs │ │ ├── ServiceStatus.cs │ │ ├── TaskRunResultStatus.cs │ │ ├── TaskRunStatus.cs │ │ └── WriterTypes.cs │ ├── Extensions │ │ ├── DnsHelper.cs │ │ └── MasaStackConfigExtensions.cs │ ├── IntegrationEvents │ │ ├── BaseIntegrationEvent.cs │ │ ├── NotifyTaskRunResultIntegrationEvent.cs │ │ ├── NotifyTaskStartIntegrationEvent.cs │ │ ├── OnlineIntegrationEvent.cs │ │ ├── SchedulerServerOnlineIntegrationEvent.cs │ │ ├── SchedulerWorkerOnlineIntegrationEvent.cs │ │ ├── StartTaskIntegrationEvent.cs │ │ ├── StartWaitingTaskIntergrationEvent.cs │ │ └── StopTaskIntegrationEvent.cs │ ├── Isolation │ │ └── MultiEnvironment.cs │ ├── Logger │ │ ├── SchedulerLogger.cs │ │ └── SchedulerLoggerServiceCollectionExtensions.cs │ ├── Managers │ │ ├── BaseSchedulerManager.cs │ │ ├── BaseSchedulerManagerData.cs │ │ └── IScopedProcessingService.cs │ ├── SignalRClients │ │ ├── MasaSignalRClient.cs │ │ ├── MasaSignalRClientServiceCollectionExtensions.cs │ │ └── MasaSignalROptions.cs │ └── Utils │ │ ├── HttpUtils.cs │ │ └── ProcessUtils.cs │ ├── Masa.Scheduler.Contracts.Server.csproj │ ├── Messages │ └── BaseMessage.cs │ ├── Model │ ├── BaseServiceModel.cs │ ├── JobShellRunResult.cs │ ├── OssOptions.cs │ ├── ServerModel.cs │ ├── TaskAssignModel.cs │ └── WorkerModel.cs │ ├── Requests │ ├── BaseRequest.cs │ ├── PaginationRequest.cs │ ├── SchedulerJobs │ │ ├── AddSchedulerJobRequest.cs │ │ ├── AddSchedulerJobSdkRequest.cs │ │ ├── ChangeEnabledStatusRequest.cs │ │ ├── GetSchedulerJobByIdentityRequest.cs │ │ ├── RemoveSchedulerJobRequest.cs │ │ ├── SchedulerJobListRequest.cs │ │ ├── StartSchedulerJobRequest.cs │ │ ├── UpdateCronJobRequest.cs │ │ ├── UpdateSchedulerJobBySdkRequest.cs │ │ └── UpdateSchedulerJobRequest.cs │ ├── SchedulerResources │ │ ├── AddSchedulerResourceRequest.cs │ │ ├── RemoveSchedulerResourceRequest.cs │ │ ├── SchedulerResourceListRequest.cs │ │ └── UpdateSchedulerResourceRequest.cs │ ├── SchedulerTasks │ │ ├── AddSchedulerTaskRequest.cs │ │ ├── NotifySchedulerTaskRunResultBySdkRequest.cs │ │ ├── NotifySchedulerTaskRunResultRequest.cs │ │ ├── NotifyTaskStartRequest.cs │ │ ├── RemoveSchedulerTaskRequest.cs │ │ ├── SchedulerTaskListRequest.cs │ │ ├── StartSchedulerTaskRequest.cs │ │ └── StopSchedulerTaskRequest.cs │ └── SchedulerWorker │ │ ├── AssignTaskRequest.cs │ │ ├── StartTaskRequest.cs │ │ └── StopTaskRequest.cs │ ├── Responses │ ├── BasePaginationResponse.cs │ ├── BaseResponse.cs │ ├── ProjectListResponse.cs │ ├── SchedulerJobListResponse.cs │ ├── SchedulerResourceListResponse.cs │ ├── SchedulerTaskListResponse.cs │ └── TeamListResponse.cs │ ├── Validator │ ├── SchedulerJobAppConfigDtoValidator.cs │ ├── SchedulerJobDaprServiceInvocationConfigDtoValidator.cs │ ├── SchedulerJobDtoValidator.cs │ ├── SchedulerJobHttpConfigDtoValidator.cs │ └── SchedulerResourceDtoValidator.cs │ └── _Import.cs ├── Domain └── Masa.Scheduler.Domain │ ├── Aggregates │ ├── Jobs │ │ ├── Configs │ │ │ ├── SchedulerJobAppConfig.cs │ │ │ ├── SchedulerJobDaprServiceInvocationConfig.cs │ │ │ └── SchedulerJobHttpConfig.cs │ │ └── SchedulerJob.cs │ ├── Resources │ │ └── SchedulerResource.cs │ └── Tasks │ │ └── SchedulerTask.cs │ ├── Events │ ├── NotifyJobStatusDomainEvent.cs │ ├── NotifyTaskRunResultDomainEvent.cs │ ├── RemoveSchedulerJobDomainEvent.cs │ ├── StartJobDomainEvent.cs │ ├── StartTaskDomainEvent.cs │ ├── StopTaskDomainEvent.cs │ └── UpdateCronJobDomainEvent.cs │ ├── Masa.Scheduler.Domain.csproj │ ├── Repositories │ ├── ISchedulerJobRepository.cs │ └── ISchedulerTaskRepository.cs │ └── _Imports.cs ├── Infrastructure ├── Masa.Scheduler.EntityFrameworkCore.PostgreSql │ ├── Masa.Scheduler.EntityFrameworkCore.PostgreSql.csproj │ ├── Migrations │ │ ├── 20241204084817_InitialCreate.Designer.cs │ │ ├── 20241204084817_InitialCreate.cs │ │ └── SchedulerDbContextModelSnapshot.cs │ ├── SchedulerPostgreSqlDbContextFactory.cs │ ├── SeedData.cs │ ├── _Imports.cs │ ├── appsettings.PostgreSql.json │ └── qrtz-postgres-sql.txt ├── Masa.Scheduler.EntityFrameworkCore.SqlServer │ ├── Masa.Scheduler.EntityFrameworkCore.SqlServer.csproj │ ├── Migrations │ │ ├── 20220517060233_init.Designer.cs │ │ ├── 20220517060233_init.cs │ │ ├── 20220517072811_upgradeSchedulerTask.Designer.cs │ │ ├── 20220517072811_upgradeSchedulerTask.cs │ │ ├── 20220517072915_UpgradeSchedulerJob.Designer.cs │ │ ├── 20220517072915_UpgradeSchedulerJob.cs │ │ ├── 20220518091801_UpgradeSchedulerTaskV2.Designer.cs │ │ ├── 20220518091801_UpgradeSchedulerTaskV2.cs │ │ ├── 20220526022547_RemoveNameUniqueIndex.Designer.cs │ │ ├── 20220526022547_RemoveNameUniqueIndex.cs │ │ ├── 20220530104317_ChangeHttpConfig.Designer.cs │ │ ├── 20220530104317_ChangeHttpConfig.cs │ │ ├── 20220614014120_UpgradeSchedulerResourceTable.Designer.cs │ │ ├── 20220614014120_UpgradeSchedulerResourceTable.cs │ │ ├── 20220622095650_SchedulerTaskAddExcuteTime.Designer.cs │ │ ├── 20220622095650_SchedulerTaskAddExcuteTime.cs │ │ ├── 20220623052420_SchedulerJobAddUpdateExpiredStrategyTime.Designer.cs │ │ ├── 20220623052420_SchedulerJobAddUpdateExpiredStrategyTime.cs │ │ ├── 20220623091948_RemoveExcuteTime.Designer.cs │ │ ├── 20220623091948_RemoveExcuteTime.cs │ │ ├── 20220629015722_UpgradeSdk.Designer.cs │ │ ├── 20220629015722_UpgradeSdk.cs │ │ ├── 20220725072548_add OwnerId.Designer.cs │ │ ├── 20220725072548_add OwnerId.cs │ │ ├── 20220813055646_AddJobIdentity.Designer.cs │ │ ├── 20220813055646_AddJobIdentity.cs │ │ ├── 20230316050722_SchedulerJobNotifyUrl.Designer.cs │ │ ├── 20230316050722_SchedulerJobNotifyUrl.cs │ │ ├── 20230320055332_SchedulerJobAlarmRuleId.Designer.cs │ │ ├── 20230320055332_SchedulerJobAlarmRuleId.cs │ │ ├── 20230322094627_AddSchedulerTaskTraceId.Designer.cs │ │ ├── 20230322094627_AddSchedulerTaskTraceId.cs │ │ ├── 20230329130658_AddSchedulerTaskIndex.Designer.cs │ │ ├── 20230329130658_AddSchedulerTaskIndex.cs │ │ ├── 20230507133253_TaskMessage.Designer.cs │ │ ├── 20230507133253_TaskMessage.cs │ │ ├── 20230518032756_IntegrationEventLog.Designer.cs │ │ ├── 20230518032756_IntegrationEventLog.cs │ │ ├── 20240721155717_SchedulerTaskIndex.Designer.cs │ │ ├── 20240721155717_SchedulerTaskIndex.cs │ │ └── SchedulerDbContextModelSnapshot.cs │ ├── SchedulerSqlServerDbContextFactory.cs │ ├── SeedData.cs │ ├── _Imports.cs │ ├── appsettings.SqlServer.json │ └── qrtz-sqlserver-sql.txt ├── Masa.Scheduler.EntityFrameworkCore │ ├── EntityConfigurations │ │ ├── Jobs │ │ │ └── SchedulerJobEntityTypeConfiguraion.cs │ │ ├── Resources │ │ │ └── SchedulerResourceEntityTypeConfiguration.cs │ │ ├── Tasks │ │ │ └── SchedulerTaskEntityTypeConfiguration.cs │ │ └── ValueConverts │ │ │ └── JsonValueConverter.cs │ ├── Masa.Scheduler.EntityFrameworkCore.csproj │ ├── QueryWithNoLockDbCommandInterceptor.cs │ ├── Repositories │ │ ├── SchedulerJobRepository.cs │ │ └── SchedulerTaskRepository.cs │ ├── SchedulerDbContext.cs │ ├── ValueConverters │ │ ├── DateTimeUtcConverter.cs │ │ └── NullableDateTimeUtcConverter.cs │ └── _Imports.cs └── Masa.Scheduler.Infrastructure.Cache │ ├── CacheContext.cs │ ├── ICacheContext.cs │ ├── Masa.Scheduler.Infrastructure.Cache.csproj │ ├── ServiceCollectionExtensions.cs │ └── _Imports.cs ├── Services ├── Masa.Scheduler.Services.Server │ ├── Application │ │ ├── Auths │ │ │ ├── AuthQueryHandler.cs │ │ │ └── Queries │ │ │ │ ├── TeamQuery.cs │ │ │ │ └── UserQuery.cs │ │ ├── Jobs │ │ │ ├── Commands │ │ │ │ ├── AddSchedulerJobBySdkCommand.cs │ │ │ │ ├── AddSchedulerJobCommand.cs │ │ │ │ ├── AddSchedulerJobCommandValidator.cs │ │ │ │ ├── ChangeEnableStatusSchedulerJobCommand.cs │ │ │ │ ├── RemoveSchedulerJobCommand.cs │ │ │ │ ├── StartSchedulerJobCommand.cs │ │ │ │ ├── UpdateSchedulerJobBySdkCommand.cs │ │ │ │ ├── UpdateSchedulerJobCommand.cs │ │ │ │ ├── UpdateSchedulerJobCommandValidator.cs │ │ │ │ └── UpsertAlarmRuleCommand.cs │ │ │ ├── NotifyJobStatusEventHandler.cs │ │ │ ├── Queries │ │ │ │ ├── GetSchedulerJobQuery.cs │ │ │ │ ├── SchedulerJobQuery.cs │ │ │ │ └── SchedulerJobQueryByIdentity.cs │ │ │ ├── SchedulerJobCommandHandler.cs │ │ │ └── SchedulerJobQueryHandler.cs │ │ ├── Projects │ │ │ ├── ProjectQueryHandler.cs │ │ │ └── Queries │ │ │ │ ├── ProjectDetailsQuery.cs │ │ │ │ └── ProjectQuery.cs │ │ ├── Resources │ │ │ ├── Commands │ │ │ │ ├── AddSchedulerResourceCommand.cs │ │ │ │ ├── AddSchedulerResourceCommandValidator.cs │ │ │ │ ├── RemoveSchedulerResourceCommand.cs │ │ │ │ ├── UpdateSchedulerResourceCommand.cs │ │ │ │ └── UpdateSchedulerResourceCommandValidator.cs │ │ │ ├── Queries │ │ │ │ └── SchedulerResourceListQuery.cs │ │ │ ├── SchedulerResourceCommandHandler.cs │ │ │ └── SchedulerResourceQueryHandler.cs │ │ └── Tasks │ │ │ ├── Commands │ │ │ ├── AddSchedulerTaskCommand.cs │ │ │ ├── NotifySchedulerTaskRunResultBySdkCommand.cs │ │ │ ├── NotifySchedulerTaskRunResultCommand.cs │ │ │ ├── NotifyTaskStartRequest.cs │ │ │ ├── RemoveSchedulerTaskCommand.cs │ │ │ ├── StartSchedulerTaskCommand.cs │ │ │ └── StopSchedulerTaskCommand.cs │ │ │ ├── Queries │ │ │ └── SchedulerTaskQuery.cs │ │ │ ├── SchedulerTaskCommandHandler.cs │ │ │ └── SchedulerTaskQueryHandler.cs │ ├── Assets │ │ └── I18n │ │ │ ├── en-US.json │ │ │ ├── supportedCultures.json │ │ │ └── zh-CN.json │ ├── Dockerfile │ ├── Domain │ │ ├── EventHandler │ │ │ ├── NotifyTaskRunResultDomainEventHandler.cs │ │ │ ├── RemoveSchedulerJobDomainEventHandler.cs │ │ │ ├── StartJobDomainEventHandler.cs │ │ │ ├── StartTaskDomainEventHandler.cs │ │ │ ├── StopTaskDomainEventHandler.cs │ │ │ └── UpdateCronJobDomainEventHandler.cs │ │ ├── Managers │ │ │ └── Servers │ │ │ │ ├── Data │ │ │ │ └── SchedulerServerManagerData.cs │ │ │ │ ├── SchedulerServerManager.cs │ │ │ │ ├── SchedulerServerManagerHostService.cs │ │ │ │ ├── SchedulerServerManagerServiceCollectionExtensions.cs │ │ │ │ └── ServerScopedProcessingService.cs │ │ ├── QuartzJob │ │ │ ├── StartSchedulerJobQuartzJob.cs │ │ │ └── StartSchedulerTaskQuartzJob.cs │ │ └── Services │ │ │ ├── SchedulerJobDomainService.cs │ │ │ └── SchedulerTaskDomainService.cs │ ├── Infrastructure │ │ ├── Common │ │ │ └── CacheKeys.cs │ │ ├── Extensions │ │ │ ├── Extensions.cs │ │ │ └── MasaDbContextBuilderExtensions.cs │ │ ├── Middleware │ │ │ └── ValidatorMiddleware.cs │ │ ├── Quartz │ │ │ ├── QuartzUtils.cs │ │ │ └── QuartzUtilsServiceCollectionExtensions.cs │ │ └── SignalR │ │ │ ├── Hubs │ │ │ └── NotificationsHub.cs │ │ │ ├── MasaUserIdProvider.cs │ │ │ ├── SignalRServiceCollectionExtensions.cs │ │ │ └── SignalRUtils.cs │ ├── Masa.Scheduler.Services.Server.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Services │ │ ├── AuthService.cs │ │ ├── OssService.cs │ │ ├── PMService.cs │ │ ├── SchedulerJobService.cs │ │ ├── SchedulerResourceService.cs │ │ ├── SchedulerServerManagerService.cs │ │ └── SchedulerTaskService.cs │ ├── _Imports.cs │ ├── appsettings.Develop.json │ ├── appsettings.Development.json │ ├── appsettings.Staging.json │ └── appsettings.json └── Masa.Scheduler.Services.Worker │ ├── Dockerfile │ ├── Domain │ └── Managers │ │ └── Workers │ │ ├── Data │ │ ├── SchedulerWorkerManagerData.cs │ │ └── TaskRunModel.cs │ │ ├── SchedulerWorkerManager.cs │ │ ├── SchedulerWorkerManagerHostService.cs │ │ ├── SchedulerWorkerManagerServiceCollectionExtensions.cs │ │ ├── TaskHandlers │ │ ├── DaprServiceInvocationTaskHanlder.cs │ │ ├── HttpTaskHandler.cs │ │ ├── ITaskHandler.cs │ │ ├── JobAppTaskHandler.cs │ │ └── TaskHanlderFactory.cs │ │ └── WorkerScopedProcessingService.cs │ ├── Infrastructure │ ├── Extensions │ │ └── MasaDbContextBuilderExtensions.cs │ ├── Middleware │ │ └── ValidatorMiddleware.cs │ └── SchedulerDbContext.cs │ ├── Masa.Scheduler.Services.Worker.csproj │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Services │ └── SchedulerWorkerManagerService.cs │ ├── _Imports.cs │ ├── appsettings.Develop.json │ ├── appsettings.Development.json │ ├── appsettings.Staging.json │ └── appsettings.json ├── Shells ├── Masa.Scheduler.Shells.JobShell.Shared │ ├── Masa.Scheduler.Shells.JobShell.Shared.csproj │ ├── RunResult.cs │ ├── ShellCommandModel.cs │ └── _Imports.cs └── Masa.Scheduler.Shells.JobShell │ ├── Masa.Scheduler.Shells.JobShell.csproj │ ├── Program.cs │ ├── ShellHelper.cs │ └── _Imports.cs └── Web ├── Masa.Scheduler.Web.Admin.Server ├── Certificates │ └── 7348307__lonsid.cn.pfx ├── Dockerfile ├── Masa.Scheduler.Web.Admin.Server.csproj ├── Pages │ ├── Error.cshtml │ ├── Error.cshtml.cs │ ├── Login.cshtml │ ├── Login.cshtml.cs │ ├── Logout.cshtml │ ├── Logout.cshtml.cs │ ├── _Host.cshtml │ └── _Layout.cshtml ├── Program.cs ├── Properties │ └── launchSettings.json ├── _Imports.cs ├── appsettings.Develop.json ├── appsettings.Development.json ├── appsettings.Staging.json ├── appsettings.json ├── ssl │ ├── tls.crt │ └── tls.key └── wwwroot │ ├── css │ └── error.css │ ├── favicon.ico │ └── nav │ └── nav.json ├── Masa.Scheduler.Web.Admin.WebAssembly ├── Masa.Scheduler.Web.Admin.WebAssembly.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── TestAuthStateProvider.cs └── wwwroot │ ├── css │ ├── app.css │ └── spinkit.min.css │ ├── decode.min.js │ ├── favicon.ico │ ├── i18n │ ├── en-US.json │ ├── supportedCultures.json │ └── zh-CN.json │ ├── img │ ├── analytics │ │ ├── json.png │ │ ├── left.png │ │ └── right.png │ ├── auth │ │ ├── forgot-password-v2.9faba3c1.svg │ │ └── register-v2.0a9e487c.svg │ ├── avatar │ │ ├── 1.svg │ │ ├── 10.svg │ │ ├── 11.svg │ │ ├── 12.svg │ │ ├── 13.svg │ │ ├── 14.svg │ │ ├── 2.svg │ │ ├── 3.svg │ │ ├── 4.svg │ │ ├── 7.svg │ │ ├── 8.svg │ │ └── 9.svg │ ├── login │ │ ├── 2873.png │ │ ├── Gxwd.png │ │ └── left.svg │ ├── mainLayout │ │ ├── logo-en.svg │ │ └── logo.svg │ └── status │ │ ├── 401.png │ │ ├── 404.png │ │ └── 500.png │ ├── index.html │ └── nav │ └── nav.json └── Masa.Scheduler.Web.Admin ├── App.razor ├── Components ├── AlarmRules │ ├── AlarmRuleSetting.razor │ ├── LogAlarmRuleUpsertModal.razor │ ├── LogAlarmRuleUpsertModal.razor.cs │ ├── Validator │ │ ├── AlarmRuleItemViewModelValidator.cs │ │ ├── AlarmRuleUpsertViewModelValidator.cs │ │ ├── CheckFrequencyViewModelValidator.cs │ │ ├── LogMonitorItemViewModelValidator.cs │ │ ├── SilenceCycleViewModelValidator.cs │ │ └── TimeIntervalViewModelValidator.cs │ └── ViewModel │ │ ├── AlarmRuleUpsertViewModel.cs │ │ ├── CheckFrequencyViewModel.cs │ │ ├── SilenceCycleViewModel.cs │ │ └── TimeIntervalViewModel.cs ├── AuditedInfo.razor ├── AutoHeight.razor ├── DateTimeFormat.razor ├── DateTimeFormat.razor.cs ├── DefaultTitle.razor ├── DefaultTooltip.razor ├── MenuTooltip.razor ├── Notification │ └── NotificationConfig.razor ├── OutlinedSearchTextField.cs ├── Subjects │ ├── UserAutoComplete.razor │ └── UserAutoComplete.razor.cs └── Tsc │ ├── ApmJwtBearaToken.razor │ ├── ApmJwtBearaToken.razor.cs │ ├── ApmSamplePage.razor │ ├── ApmSamplePage.razor.cs │ ├── ApmSearchComponent.razor │ ├── ApmSearchComponent.razor.cs │ ├── ApmTraceView.razor │ ├── ApmTraceView.razor.cs │ ├── ApmTraceView.razor.css │ ├── MonacoEditor.razor │ └── MonacoEditor.razor.cs ├── Data └── Base │ ├── GlobalVariables.cs │ └── PagingData.cs ├── Extensitions ├── I18nExtensions.cs ├── ObjectExtensions.cs ├── TimeExtentions.cs └── TraceResponseDtoExtenistion.cs ├── Global └── ServiceCollectionExtensions.cs ├── Masa.Scheduler.Web.Admin.csproj ├── Model ├── SideBarItem.cs └── TscModels.cs ├── Pages ├── SchedulerResources │ ├── AppResourceViewModel.cs │ ├── Components │ │ ├── AddSchedulerResourceFiles.razor │ │ ├── AddSchedulerResourceFiles.razor.cs │ │ ├── AddSchedulerResourceFiles.razor.css │ │ ├── SchedulerResourceFilesInformation.razor │ │ └── SchedulerResourceFilesInformation.razor.cs │ ├── SchedulerResourceFiles.razor │ └── SchedulerResourceFiles.razor.cs ├── Teams │ └── Components │ │ ├── JobModal.razor │ │ ├── JobModal.razor.cs │ │ ├── Projects.razor │ │ ├── SchedulerJobs.razor │ │ ├── SchedulerJobs.razor.cs │ │ ├── SchedulerTasks.razor │ │ ├── SchedulerTasks.razor.cs │ │ └── SubComponents │ │ └── DynamicKeyValueComponent.razor └── Tsc │ ├── EChartConst.cs │ ├── ErrorDetail.razor │ ├── ErrorDetail.razor.cs │ ├── ErrorDetail.razor.css │ ├── ErrorDetail.razor.js │ ├── LogList.razor │ ├── LogList.razor.cs │ ├── Trace │ ├── ServiceErrors.razor │ ├── ServiceErrors.razor.cs │ ├── ServiceLogs.razor │ ├── ServiceLogs.razor.cs │ ├── TimeLine.razor │ ├── TimeLine.razor.cs │ └── TimeLine.razor.css │ ├── TraceDetail.razor │ ├── TraceDetail.razor.cs │ └── TreeLineDto.cs ├── Shared ├── EmptyLayout.razor ├── MainLayout.razor ├── ProComponentBase.cs └── TscComponentBase.cs ├── Store └── SchedulerJobsState.cs ├── _Imports.cs ├── _Imports.razor └── wwwroot ├── css ├── masa-blazor-pro.css └── masa-scheduler.css ├── i18n ├── en-US.json ├── supportedCultures.json └── zh-CN.json ├── img ├── analytics │ ├── json.png │ ├── left.png │ └── right.png ├── auth │ ├── forgot-password-v2.9faba3c1.svg │ └── register-v2.0a9e487c.svg ├── avatar │ ├── 1.svg │ ├── 10.svg │ ├── 11.svg │ ├── 12.svg │ ├── 13.svg │ ├── 14.svg │ ├── 2.svg │ ├── 3.svg │ ├── 4.svg │ ├── 7.svg │ ├── 8.svg │ └── 9.svg ├── login │ ├── 2873.png │ ├── Gxwd.png │ └── left.svg ├── mainLayout │ ├── logo-en.svg │ └── logo.svg ├── status │ ├── 401.png │ ├── 404.png │ └── 500.png └── upload │ ├── upload-active.png │ ├── upload-complete.png │ ├── upload-error.png │ └── upload.png └── js └── download-file.js /.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | _Please explain the changes you've made_ 4 | 5 | ## Issue reference 6 | 7 | We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation. 8 | 9 | Please reference the issue this PR will close: #_[issue number]_ 10 | 11 | ## Checklist 12 | 13 | Please make sure you've completed the relevant tasks for this PR, out of the following list: 14 | 15 | * [ ] Code compiles correctly 16 | * [ ] Created/updated tests 17 | * [ ] Extended the documentation 18 | -------------------------------------------------------------------------------- /.github/workflows/mirror-gitlab.yml: -------------------------------------------------------------------------------- 1 | name: Mirror to Giltab 2 | 3 | on: [push, delete, create] 4 | 5 | jobs: 6 | to_gitlab: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | with: 11 | fetch-depth: 0 12 | - uses: yesolutions/mirror-action@master 13 | with: 14 | REMOTE: '${{ secrets.GITLAB_ADDER }}/cicd/masa.scheduler.git' 15 | GIT_USERNAME: ${{ secrets.GIT_USERNAME }} 16 | GIT_PASSWORD: ${{ secrets.GIT_PASSWORD }} 17 | PUSH_ALL_REFS: "false" 18 | -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | net6.0 4 | enable 5 | 6 | $(WarningsAsErrors);CS8600;CS8601;CS8602;CS8603;CS8604;CS8609;CS8610;CS8614;CS8616;CS8618;CS8619;CS8620;CS8622;CS8625 7 | 8 | 1.2.0-preview.* 9 | 1.2.1-preview.* 10 | 1.2.1-preview.20 11 | 6.* 12 | 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | Logo 4 | 5 |

6 | 7 | ## 介绍 8 | 9 | Scheduler是MASA Stack 1.0推出的一款辅助性软件产品,主要负责处理应用程序任务执行的调度,以及自动重试等相关操作。在MASA Stack产品中,与MASA MC、MASA TSC、MASA Alert 3款产品结合,发挥最大的调度价值。当然Scheduler并不只是给MASA Stack产品使用,它同样可以为业务创造价值。 10 | ![Scheduler](http://cdn.masastack.com/stack/doc/scheduler/introduce.png) 11 | 12 | ## MASA Stack 概览 13 | [传送门](https://github.com/masastack/MASA.Stack) 14 | 15 | ## 特性 16 | - 待补充 17 | 18 | ## 安装 19 | - 待补充 20 | 21 | 22 | ## 本地开发 23 | - 待补充 24 | 25 | ## 开发路线 26 | - 待补充 27 | 28 | ## 贡献者 29 | 30 | 感谢所有为本项目做出过贡献的朋友。 31 | 32 | 33 | 34 | 35 | 36 | ## 行为准则 37 | 38 | 本项目采用了《贡献者公约》所定义的行为准则,以明确我们社区的预期行为。 39 | 更多信息请见 [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). 40 | 41 | -------------------------------------------------------------------------------- /dapr/components/masa-scheduler-pubsub.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: pubsub 5 | namespace: default 6 | spec: 7 | type: pubsub.redis 8 | version: v1 9 | metadata: 10 | - name: redisHost 11 | value: redis:6379 12 | - name: redisPassword 13 | value: "" -------------------------------------------------------------------------------- /dapr/components/masa-scheduler-statestore.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: masa-scheduler-statestore.yaml 5 | namespace: default 6 | spec: 7 | type: state.redis 8 | version: v1 9 | metadata: 10 | - name: redisHost 11 | value: redis:6379 12 | - name: redisPassword 13 | value: "" 14 | - name: actorStateStore 15 | value: "true" -------------------------------------------------------------------------------- /docker-compose.dcproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2.1 5 | Linux 6 | f17cc0a5-e77b-48a8-907c-90cb0020f869 7 | LaunchBrowser 8 | {Scheme}://localhost:{ServicePort}/swagger 9 | Masa.auth.service.order 10 | 11 | 12 | 13 | docker-compose.yml 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.4' 2 | 3 | services: 4 | 5 | redis: 6 | image: redis:alpine 7 | 8 | masa.scheduler.database: 9 | image: mcr.microsoft.com/mssql/server:2019-latest 10 | ports: 11 | - "14333:1433" 12 | environment: 13 | - SA_PASSWORD=P@ssw0rd 14 | - ACCEPT_EULA=Y 15 | 16 | masa.scheduler.web.admin: 17 | image: ${DOCKER_REGISTRY-}masaschedulerwebadmin 18 | build: 19 | context: . 20 | dockerfile: src/Web/Masa.Scheduler.Web.Admin.Server/Dockerfile 21 | 22 | masa.scheduler.service.server: 23 | image: ${DOCKER_REGISTRY-}masaschedulerserver 24 | build: 25 | context: . 26 | dockerfile: src/Services/Masa.Scheduler.Services.Server/Dockerfile 27 | 28 | masa.scheduler.service.worker: 29 | image: ${DOCKER_REGISTRY-}masaschedulerworker 30 | build: 31 | context: . 32 | dockerfile: src/Services/Masa.Scheduler.Services.Worker/Dockerfile 33 | 34 | dapr-placement: 35 | image: "daprio/dapr:1.5.1" -------------------------------------------------------------------------------- /power.ps1: -------------------------------------------------------------------------------- 1 | param($t,$u,$p) 2 | 3 | #docker build 4 | #Write-Host "Hello.$args" 5 | Write-Host "Hello $t" 6 | 7 | docker login --username=$u registry.cn-hangzhou.aliyuncs.com --password=$p 8 | 9 | $WorkerDockerfilePath="./src/Services/Masa.Scheduler.Services.Worker/Dockerfile" 10 | $WorkerServerName="masa-scheduler-services-worker" 11 | $ServiceDockerfilePath="./src/Services/Masa.Scheduler.Services.Server/Dockerfile" 12 | $ServiceServerName="masa-scheduler-services-server" 13 | $WebDockerfilePath="./src/Web/Masa.Scheduler.Web.Admin.Server/Dockerfile" 14 | $WebServerName="masa-scheduler-web-admin" 15 | 16 | docker build -t registry.cn-hangzhou.aliyuncs.com/masastack/${WorkerServerName}:$t -f $WorkerDockerfilePath . 17 | docker push registry.cn-hangzhou.aliyuncs.com/masastack/${WorkerServerName}:$t 18 | 19 | docker build -t registry.cn-hangzhou.aliyuncs.com/masastack/${ServiceServerName}:$t -f $ServiceDockerfilePath . 20 | docker push registry.cn-hangzhou.aliyuncs.com/masastack/${ServiceServerName}:$t 21 | 22 | docker build -t registry.cn-hangzhou.aliyuncs.com/masastack/${WebServerName}:$t -f $WebDockerfilePath . 23 | docker push registry.cn-hangzhou.aliyuncs.com/masastack/${WebServerName}:$t -------------------------------------------------------------------------------- /src/ApiGateways/Caller/Masa.Scheduler.ApiGateways.Caller/Masa.Scheduler.ApiGateways.Caller.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | enable 5 | enable 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/ApiGateways/Caller/Masa.Scheduler.ApiGateways.Caller/SchedulerApiOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.ApiGateways.Caller; 5 | 6 | public class SchedulerApiOptions 7 | { 8 | public string SchedulerServerBaseAddress { get; set; } = string.Empty; 9 | 10 | public string AuthorityEndpoint { get; set; } = string.Empty; 11 | 12 | public string ClientId { get; set; } = string.Empty; 13 | 14 | public string ClientSecret { get; set; } = string.Empty; 15 | } 16 | -------------------------------------------------------------------------------- /src/ApiGateways/Caller/Masa.Scheduler.ApiGateways.Caller/SchedulerResponseMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.ApiGateways.Caller; 5 | 6 | public class SchedulerResponseMessage : JsonResponseMessage 7 | { 8 | public SchedulerResponseMessage(ILoggerFactory? loggerFactory = null) : base(default, loggerFactory) 9 | { 10 | } 11 | 12 | public override async Task ProcessCustomException(HttpResponseMessage response) 13 | { 14 | switch (response.StatusCode) 15 | { 16 | case (HttpStatusCode)293: 17 | throw new UserFriendlyException(await response.Content.ReadAsStringAsync()); 18 | default: 19 | break; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/ApiGateways/Caller/Masa.Scheduler.ApiGateways.Caller/ServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.ApiGateways.Caller; 5 | 6 | public static class ServiceCollectionExtensions 7 | { 8 | public static IServiceCollection AddSchedulerApiGateways(this IServiceCollection services, Action configs) 9 | { 10 | services.AddSingleton(); 11 | var options = new SchedulerApiOptions(); 12 | configs?.Invoke(options); 13 | services.AddSingleton(options); 14 | services.AddStackCaller(Assembly.Load("Masa.Scheduler.ApiGateways.Caller"), jwtTokenValidatorOptions => 15 | { 16 | jwtTokenValidatorOptions.AuthorityEndpoint = options.AuthorityEndpoint; 17 | }, clientRefreshTokenOptions => 18 | { 19 | clientRefreshTokenOptions.ClientId = options.ClientId; 20 | clientRefreshTokenOptions.ClientSecret = options.ClientSecret; 21 | }); 22 | return services; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/ApiGateways/Caller/Masa.Scheduler.ApiGateways.Caller/Services/AuthService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.ApiGateways.Caller.Services; 5 | 6 | public class AuthService : ServiceBase 7 | { 8 | protected override string BaseUrl { get; set; } 9 | 10 | public AuthService(ICaller caller) : base(caller) 11 | { 12 | BaseUrl = "api/auth"; 13 | } 14 | public async Task GetTeamListAsync() 15 | { 16 | var result = await GetAsync>(nameof(GetTeamListAsync)); 17 | 18 | var response = new TeamListResponse() 19 | { 20 | Data = result ?? new() 21 | }; 22 | 23 | return response; 24 | } 25 | 26 | public async Task GetUserInfoAsync(Guid userId) 27 | { 28 | var result = await GetAsync($"UserInfo?userId=" + userId); 29 | 30 | return result; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/ApiGateways/Caller/Masa.Scheduler.ApiGateways.Caller/Services/OssService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.ApiGateways.Caller.Services; 5 | 6 | public class OssService : ServiceBase 7 | { 8 | protected override string BaseUrl { get; set; } 9 | 10 | public OssService(ICaller caller) : base(caller) 11 | { 12 | BaseUrl = "api/oss"; 13 | } 14 | 15 | public async Task GetSecurityTokenAsync() 16 | { 17 | return await GetAsync(nameof(GetSecurityTokenAsync)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/ApiGateways/Caller/Masa.Scheduler.ApiGateways.Caller/Services/PmService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.ApiGateways.Caller.Services; 5 | 6 | public class PmService: ServiceBase 7 | { 8 | protected override string BaseUrl { get; set; } 9 | 10 | public PmService(ICaller caller) : base(caller) 11 | { 12 | BaseUrl = "api/pm"; 13 | } 14 | public async Task GetProjectListAsync(Guid? teamId, string environment = "") 15 | { 16 | var requestUrl = $"ProjectList?environment={environment}"; 17 | 18 | if (teamId.HasValue) 19 | { 20 | requestUrl += $"&teamId={teamId.Value}"; 21 | } 22 | 23 | var result = await GetAsync>(requestUrl); 24 | 25 | var response = new ProjectListResponse() 26 | { 27 | Data = result ?? new List() 28 | }; 29 | 30 | return response; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/ApiGateways/Caller/Masa.Scheduler.ApiGateways.Caller/Services/SchedulerServerManagerService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.ApiGateways.Caller.Services; 5 | 6 | public class SchedulerServerManagerService : ServiceBase 7 | { 8 | protected override string BaseUrl { get; set; } 9 | 10 | public SchedulerServerManagerService(ICaller caller) : base(caller) 11 | { 12 | BaseUrl = "api/scheduler-server-manager/"; 13 | } 14 | 15 | public async Task> GetWorkerListAsync() 16 | { 17 | var result = await GetAsync>(nameof(GetWorkerListAsync)); 18 | return result ?? new(); 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /src/ApiGateways/Caller/Masa.Scheduler.ApiGateways.Caller/Services/SchedulerTaskService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.ApiGateways.Caller.Services; 5 | 6 | public class SchedulerTaskService: ServiceBase 7 | { 8 | protected override string BaseUrl { get; set; } 9 | 10 | public SchedulerTaskService(ICaller caller) : base(caller) 11 | { 12 | BaseUrl = "api/scheduler-task/"; 13 | } 14 | 15 | public async Task GetListAsync(SchedulerTaskListRequest request) 16 | { 17 | var result = await GetAsync(nameof(GetListAsync), request); 18 | return result ?? new(); 19 | } 20 | 21 | public async Task StartAsync(StartSchedulerTaskRequest request) 22 | { 23 | await PutAsync(nameof(StartAsync), request); 24 | } 25 | 26 | public async Task StopAsync(StopSchedulerTaskRequest request) 27 | { 28 | await PutAsync(nameof(StopAsync), request); 29 | } 30 | 31 | public async Task RemoveAsync(RemoveSchedulerTaskRequest request) 32 | { 33 | await DeleteAsync(string.Empty, request); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/ApiGateways/Caller/Masa.Scheduler.ApiGateways.Caller/_Imports.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | global using Masa.BuildingBlocks.Service.Caller; 5 | global using Masa.Contrib.StackSdks.Caller; 6 | global using Masa.Scheduler.ApiGateways.Caller.Services; 7 | global using Masa.Scheduler.Contracts.Server.Dtos; 8 | global using Masa.Scheduler.Contracts.Server.Model; 9 | global using Masa.Scheduler.Contracts.Server.Requests.SchedulerJobs; 10 | global using Masa.Scheduler.Contracts.Server.Requests.SchedulerResources; 11 | global using Masa.Scheduler.Contracts.Server.Requests.SchedulerTasks; 12 | global using Masa.Scheduler.Contracts.Server.Responses; 13 | global using Microsoft.Extensions.DependencyInjection; 14 | global using Microsoft.Extensions.Logging; 15 | global using System.Net; 16 | global using System.Reflection; 17 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Dtos/AuditedEntityDto.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Dtos; 5 | 6 | public class AuditedEntityDto 7 | { 8 | public DateTime CreationTime { get; set; } 9 | 10 | public Guid Creator { get; set; } 11 | 12 | public string CreatorName { get; set; } = string.Empty; 13 | 14 | public DateTime ModificationTime { get; set; } 15 | 16 | public Guid Modifier { get; set; } 17 | 18 | public string ModifierName { get; set; } = string.Empty; 19 | } 20 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Dtos/PaginationDto.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Dtos; 5 | 6 | public class PaginationDto 7 | { 8 | public long Total { get; set; } 9 | 10 | public int TotalPages { get; set; } 11 | 12 | public List Items { get; set; } = default!; 13 | 14 | public PaginationDto() 15 | { 16 | Items = new List(); 17 | } 18 | 19 | public PaginationDto(long total, int totalPages, List result) 20 | { 21 | Total = total; 22 | TotalPages = totalPages; 23 | Items = result; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Dtos/ProjectAppDto.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Dtos; 5 | 6 | public class ProjectAppDto 7 | { 8 | public int Id { get; set; } 9 | 10 | public string Name { get; set; } = string.Empty; 11 | 12 | public string Identity { get; set; } = string.Empty; 13 | 14 | public int ProjectId { get; set; } 15 | 16 | public ProjectAppTypes Type { get; set; } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Dtos/ProjectDto.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Dtos; 5 | 6 | public class ProjectDto 7 | { 8 | public int Id { get; set; } 9 | 10 | public List TeamIds { get; set; } = new List(); 11 | 12 | [Obsolete] 13 | public Guid TeamId => TeamIds.Count > 0 ? TeamIds[0] : Guid.Empty; 14 | 15 | public string Identity { get; set; } = ""; 16 | 17 | public string Name { get; set; } = ""; 18 | 19 | public string Description { get; set; } = ""; 20 | 21 | public int LabelId { get; set; } 22 | 23 | public string LabelName { get; set; } = ""; 24 | 25 | public Guid Modifier { get; set; } 26 | 27 | public DateTime ModificationTime { get; set; } 28 | 29 | public List ProjectApps { get; set; } = new List(); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Dtos/SchedulerJobAppConfigDto.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Dtos; 5 | 6 | public class SchedulerJobAppConfigDto 7 | { 8 | public string JobAppIdentity { get; set; } = string.Empty; 9 | 10 | public string JobEntryAssembly { get; set; } = string.Empty; 11 | 12 | public string JobEntryClassName { get; set; } = string.Empty; 13 | 14 | public string JobParams { get; set; } = string.Empty; 15 | 16 | public string Version { get; set; } = string.Empty; 17 | 18 | public SchedulerResourceDto? SchedulerResourceDto { get; set; } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Dtos/SchedulerJobDaprServiceInvocationConfigDto.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Dtos; 5 | 6 | public class SchedulerJobDaprServiceInvocationConfigDto 7 | { 8 | public string MethodName { get; set; } = string.Empty; 9 | 10 | public HttpMethods HttpMethod { get; set; } 11 | 12 | public string Data { get; set; } = string.Empty; 13 | 14 | public string DaprServiceIdentity { get; set; } = string.Empty; 15 | 16 | public string Namespace { get; set; } = string.Empty; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Dtos/SchedulerJobHttpConfigDto.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Dtos; 5 | 6 | public class SchedulerJobHttpConfigDto 7 | { 8 | public HttpMethods HttpMethod { get; set; } 9 | 10 | public string RequestUrl { get; set; } = string.Empty; 11 | 12 | public List> HttpParameters { get; set; } = new List>(); 13 | 14 | public List> HttpHeaders { get; set; } = new List>(); 15 | 16 | public string HttpBody { get; set; } = string.Empty; 17 | 18 | public HttpVerifyTypes HttpVerifyType { get; set; } 19 | 20 | public string VerifyContent { get; set; } = string.Empty; 21 | 22 | public bool IsAsync { get; set; } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Dtos/SchedulerResourceDto.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Dtos; 5 | 6 | public class SchedulerResourceDto 7 | { 8 | public Guid Id { get; set; } 9 | 10 | public string Name { get; set; } = string.Empty; 11 | 12 | public string Description { get; set; } = string.Empty; 13 | 14 | public string FilePath { get; set; } = string.Empty; 15 | 16 | public string Version { get; set; } = string.Empty; 17 | 18 | public string JobAppIdentity { get; set; } = string.Empty; 19 | 20 | public DateTimeOffset UploadTime { get; set; } 21 | 22 | public Guid Creator { get; set; } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Dtos/SecurityTokenDto.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Dtos; 5 | 6 | public class SecurityTokenDto 7 | { 8 | public string Region { get; set; } 9 | 10 | public string AccessKeyId { get; set; } 11 | 12 | public string AccessKeySecret { get; set; } 13 | 14 | public string StsToken { get; set; } 15 | 16 | public string Bucket { get; set; } 17 | 18 | public SecurityTokenDto(string region, string accessKeyId, string accessKeySecret, string stsToken, string bucket) 19 | { 20 | Region = region; 21 | AccessKeyId = accessKeyId; 22 | AccessKeySecret = accessKeySecret; 23 | StsToken = stsToken; 24 | Bucket = bucket; 25 | } 26 | } -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Dtos/TeamDto.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Dtos; 5 | 6 | public class TeamDto 7 | { 8 | public Guid Id { get; set; } 9 | public string Name { get; set; } = string.Empty; 10 | public string Avatar { get; set; } = string.Empty; 11 | public int MemberCount { get; set; } 12 | public string Description { get; set; } = string.Empty; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Dtos/UserDto.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Dtos; 5 | 6 | public class UserDto 7 | { 8 | public Guid Id { get; set; } 9 | 10 | public string Name { get; set; } = string.Empty; 11 | 12 | public string DisplayName { get; set; } = string.Empty; 13 | 14 | public string? StaffDisplayName { get; set; } 15 | 16 | public string Account { get; set; } = string.Empty; 17 | 18 | public int Gender { get; set; } 19 | 20 | public string Avatar { get; set; } = string.Empty; 21 | 22 | public string? IdCard { get; set; } 23 | 24 | public string? PhoneNumber { get; set; } 25 | 26 | public string? Email { get; set; } 27 | 28 | public string? CompanyName { get; set; } 29 | 30 | public string? Department { get; set; } 31 | 32 | public string? Position { get; set; } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Helper/RegularHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Helper; 5 | public static class RegularHelper 6 | { 7 | public const string CHINESE_LETTER_NUMBER_SYMBOL = @"^\\s{0}$|^[\u4e00-\u9fa5_a-zA-Z0-9~!@#\$%\^&\*\(\)\+=\|\\\}\]\{\[_:;<.,>\?\/""]+$"; 8 | } 9 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Consts/SignalRMethodConsts.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Consts; 5 | 6 | public static class SignalRMethodConsts 7 | { 8 | public const string GET_NOTIFICATION = "get-notification"; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Consts/TempCurrentUserConsts.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Consts; 5 | 6 | public class TempCurrentUserConsts 7 | { 8 | public const string ID = "00000000-0000-0000-0000-000000000000"; 9 | public const string NAME = "Gavin"; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Consts/UserFriendlyExceptionCodes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Consts; 5 | 6 | public class UserFriendlyExceptionCodes 7 | { 8 | public const string VERSION_CANNOT_BE_DUPLICATE = "VersionCannotBeDuplicate"; 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/ConfirmDialogTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum ConfirmDialogTypes 7 | { 8 | DeleteResourceVersion = 1, 9 | DeleteResources, 10 | DeleteTask, 11 | StopTask, 12 | RestartTask, 13 | EnabledJob, 14 | DisabledJob 15 | } 16 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/FailedStrategyTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum FailedStrategyTypes 7 | { 8 | Auto = 1, 9 | Manual 10 | } 11 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/HttpMethods.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum HttpMethods 7 | { 8 | GET = 1, 9 | POST, 10 | HEAD, 11 | PUT, 12 | DELETE 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/HttpParameterTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum HttpParameterTypes 7 | { 8 | Parameter = 1, 9 | Headers, 10 | Body 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/HttpVerifyTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum HttpVerifyTypes 7 | { 8 | StatusCode200 = 1, 9 | CustomStatusCode, 10 | ContentContains, 11 | ContentUnContains, 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/JobCreateTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum JobCreateTypes 7 | { 8 | Manual = 1, 9 | Api 10 | } 11 | 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/JobNotifyStatus.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum JobNotifyStatus 7 | { 8 | Failure = 1, 9 | Timeout, 10 | Enabled, 11 | Disable, 12 | Delete 13 | } 14 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/JobQueryTimeTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum JobQueryTimeTypes 7 | { 8 | ScheduleTime = 1, 9 | RunStartTime = 2, 10 | RunEndTime = 3, 11 | CreationTime = 4, 12 | ModificationTime = 5 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/JobTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum JobTypes 7 | { 8 | JobApp = 1, 9 | Http, 10 | DaprServiceInvocation 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/LoggerTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum LoggerTypes 7 | { 8 | SchedulerInternalLog = 1, 9 | JobLog, 10 | } 11 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/ProjectAppTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum ProjectAppTypes 7 | { 8 | Service = 1, 9 | UI, 10 | Job 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/ResourceVersionTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum ResourceVersionTypes 7 | { 8 | Latest = 1, 9 | SpecifiedVersion 10 | } 11 | 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/RoutingStrategyTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum RoutingStrategyTypes 7 | { 8 | RoundRobin = 1, 9 | Specified 10 | // implement this routing strategy in next version 11 | //DynamicRatioApm 12 | } 13 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/RunTimeoutStrategyTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum RunTimeoutStrategyTypes 7 | { 8 | RunFailedStrategy = 1, 9 | IgnoreTimeout 10 | } 11 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/ScheduleBlockStrategyTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum ScheduleBlockStrategyTypes 7 | { 8 | Serial = 1, 9 | Parallel, 10 | Discard, 11 | Cover 12 | } 13 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/ScheduleExpiredStrategyTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum ScheduleExpiredStrategyTypes 7 | { 8 | ExecuteImmediately = 1, 9 | AutoCompensation, 10 | Ignore 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/ScheduleTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum ScheduleTypes 7 | { 8 | ManualRun = 1, 9 | Cron 10 | } 11 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/ServiceStatus.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum ServiceStatus 7 | { 8 | Normal = 1, 9 | Error, 10 | Stopped 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/TaskRunResultStatus.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum TaskRunResultStatus 7 | { 8 | Success = 3, 9 | Failure = 4, 10 | TimeoutSuccess = 6, 11 | Ignore = 9 12 | } 13 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/TaskRunStatus.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum TaskRunStatus 7 | { 8 | Idle = 1, 9 | Running, 10 | Success, 11 | Failure, 12 | Timeout, 13 | TimeoutSuccess, 14 | WaitToRetry, 15 | WaitToRun, 16 | Ignore 17 | } 18 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Enums/WriterTypes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 5 | 6 | public enum WriterTypes 7 | { 8 | Server = 1, 9 | Worker, 10 | Job 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Extensions/DnsHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler; 5 | 6 | public static class DnsHelper 7 | { 8 | public static string GetHostName(ILogger? logger=null) 9 | { 10 | var hostName = Dns.GetHostName(); 11 | try 12 | { 13 | var host = Dns.GetHostEntryAsync(hostName).GetAwaiter().GetResult(); 14 | hostName = host.HostName; 15 | } 16 | catch (Exception e) 17 | { 18 | logger?.LogError(e, e.Message); 19 | } 20 | 21 | return hostName; 22 | } 23 | } -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Extensions/MasaStackConfigExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler; 5 | 6 | public static class MasaStackConfigExtensions 7 | { 8 | public static string GetDbType(this IMasaStackConfig masaStackConfig) 9 | { 10 | var connStr = masaStackConfig.GetValue(MasaStackConfigConstant.CONNECTIONSTRING); 11 | var dbModel = JsonSerializer.Deserialize(connStr); 12 | return dbModel?.DbType ?? string.Empty; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/IntegrationEvents/BaseIntegrationEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.IntegrationEvents; 5 | 6 | public abstract record BaseIntegrationEvent : IntegrationEvent 7 | { 8 | public string ServiceId { get; set; } = string.Empty; 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/IntegrationEvents/NotifyTaskRunResultIntegrationEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.IntegrationEvents; 5 | 6 | public record NotifyTaskRunResultIntegrationEvent : IntegrationEvent 7 | { 8 | public override string Topic { get; set; } = nameof(NotifyTaskRunResultIntegrationEvent); 9 | 10 | public Guid TaskId { get; set; } 11 | 12 | public string Message { get; set; } = string.Empty; 13 | 14 | public TaskRunStatus Status { get; set; } 15 | 16 | public string? TraceId { get; set; } 17 | } 18 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/IntegrationEvents/NotifyTaskStartIntegrationEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.IntegrationEvents; 5 | 6 | public record NotifyTaskStartIntegrationEvent : IntegrationEvent 7 | { 8 | public override string Topic { get; set; } = nameof(NotifyTaskStartIntegrationEvent); 9 | 10 | public Guid TaskId { get; set; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/IntegrationEvents/OnlineIntegrationEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.IntegrationEvents; 5 | 6 | public abstract record OnlineIntegrationEvent : BaseIntegrationEvent 7 | { 8 | public BaseServiceModel OnlineService { get; set; } = default!; 9 | 10 | public bool IsPong { get; set; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/IntegrationEvents/SchedulerServerOnlineIntegrationEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.IntegrationEvents; 5 | 6 | public record SchedulerServerOnlineIntegrationEvent : OnlineIntegrationEvent 7 | { 8 | public override string Topic { get; set; } = nameof(SchedulerServerOnlineIntegrationEvent); 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/IntegrationEvents/SchedulerWorkerOnlineIntegrationEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.IntegrationEvents; 5 | 6 | public record SchedulerWorkerOnlineIntegrationEvent : OnlineIntegrationEvent 7 | { 8 | public override string Topic { get; set; } = nameof(SchedulerWorkerOnlineIntegrationEvent); 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/IntegrationEvents/StartTaskIntegrationEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.IntegrationEvents; 5 | 6 | public record StartTaskIntegrationEvent : BaseIntegrationEvent 7 | { 8 | public override string Topic { get; set; } = nameof(StartTaskIntegrationEvent); 9 | 10 | public SchedulerJobDto Job { get; set; } = default!; 11 | 12 | public Guid TaskId { get; set; } 13 | 14 | public DateTimeOffset ExcuteTime { get; set; } 15 | } 16 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/IntegrationEvents/StartWaitingTaskIntergrationEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.IntegrationEvents; 5 | 6 | public record StartWaitingTaskIntergrationEvent : IntegrationEvent 7 | { 8 | public override string Topic { get; set; } = nameof(StartWaitingTaskIntergrationEvent); 9 | 10 | public Guid TaskId { get; set; } 11 | 12 | public Guid OperatorId { get; set; } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/IntegrationEvents/StopTaskIntegrationEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.IntegrationEvents; 5 | 6 | public record StopTaskIntegrationEvent : BaseIntegrationEvent 7 | { 8 | public Guid TaskId { get; set; } 9 | 10 | public override string Topic { get; set; } = nameof(StopTaskIntegrationEvent); 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Isolation/MultiEnvironment.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Isolation; 5 | 6 | public class MultiEnvironment 7 | { 8 | public string Environment { get; set; } = string.Empty; 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Logger/SchedulerLoggerServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Logger; 5 | 6 | public static class SchedulerLoggerServiceCollectionExtensions 7 | { 8 | public static IServiceCollection AddSchedulerLogger(this IServiceCollection services) 9 | { 10 | services.AddScoped(); 11 | return services; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Managers/BaseSchedulerManagerData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Managers; 5 | 6 | public class BaseSchedulerManagerData where T : BaseServiceModel 7 | { 8 | public string ServiceId { get; set; } = string.Empty; 9 | 10 | public List ServiceList { get; set; } = new(); 11 | 12 | public List AddressList { get; set; } = new(); 13 | } 14 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/Managers/IScopedProcessingService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.Managers; 5 | 6 | public interface IScopedProcessingService 7 | { 8 | Task DoWorkAsync(CancellationToken stoppingToken); 9 | } -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/SignalRClients/MasaSignalRClient.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.SignalRClients; 5 | 6 | public class MasaSignalRClient : IDisposable 7 | { 8 | private string _defaultSignalRServiceUrl = string.Empty; 9 | 10 | public MasaSignalRClient(MasaSignalROptions options) 11 | { 12 | _defaultSignalRServiceUrl = options.SignalRServiceUrl; 13 | } 14 | 15 | public HubConnection? HubConnection { get; set; } 16 | 17 | public void Dispose() 18 | { 19 | HubConnection?.DisposeAsync(); 20 | } 21 | 22 | public async Task HubConnectionBuilder(string? signalRServiceUrl = null) 23 | { 24 | HubConnection = new HubConnectionBuilder() 25 | .WithUrl(string.IsNullOrEmpty(signalRServiceUrl) ? _defaultSignalRServiceUrl : signalRServiceUrl) 26 | .Build(); 27 | await HubConnection.StartAsync(); 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/SignalRClients/MasaSignalRClientServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.SignalRClients; 5 | 6 | public static class MasaSignalRClientServiceCollectionExtensions 7 | { 8 | public static IServiceCollection AddMasaSignalRClient(this IServiceCollection services, Action options) 9 | { 10 | var option = new MasaSignalROptions(); 11 | options?.Invoke(option); 12 | services.AddSingleton(option); 13 | services.AddScoped(); 14 | return services; 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Infrastructure/SignalRClients/MasaSignalROptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Infrastructure.SignalRClients; 5 | 6 | public class MasaSignalROptions 7 | { 8 | public string SignalRServiceUrl { get; set; } = string.Empty; 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Messages/BaseMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Messages; 5 | 6 | public class BaseMessage 7 | { 8 | /// 9 | /// Unique Identifier 10 | /// 11 | protected Guid _correlationId = Guid.NewGuid(); 12 | 13 | public Guid CorrelationId() => _correlationId; 14 | } 15 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Model/BaseServiceModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Model; 5 | 6 | public class BaseServiceModel 7 | { 8 | public string ServiceId { get; set; } = string.Empty; 9 | 10 | public string? HttpServiceUrl { get; set; } 11 | 12 | public string? HttpsServiceUrl { get; set; } 13 | 14 | public DateTimeOffset LastResponseTime { get; set; } 15 | 16 | public ServiceStatus Status { get; set; } 17 | 18 | public int NotResponseCount { get; set; } 19 | 20 | public string HeartbeatApi { get; set; } = string.Empty; 21 | 22 | public string GetServiceUrl() 23 | { 24 | if (!string.IsNullOrWhiteSpace(HttpsServiceUrl)) 25 | { 26 | return HttpsServiceUrl; 27 | } 28 | else if (!string.IsNullOrWhiteSpace(HttpServiceUrl)) 29 | { 30 | return HttpServiceUrl; 31 | } 32 | 33 | return string.Empty; 34 | } 35 | 36 | public string GetHeartbeatApiUrl() 37 | { 38 | var serviceUrl = GetServiceUrl(); 39 | 40 | return serviceUrl + HeartbeatApi; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Model/JobShellRunResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Model; 5 | 6 | public class JobShellRunResult 7 | { 8 | public Guid TaskId { get; set; } 9 | 10 | public bool IsSuccess { get; set; } 11 | 12 | public string Message { get; set; } = string.Empty; 13 | 14 | public object? MethodResult { get; set; } 15 | } 16 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Model/OssOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Model; 5 | 6 | public class OssOptions : ConfigurationApiMasaConfigurationOptions 7 | { 8 | [JsonIgnore] 9 | public override string AppId => "public-$Config"; 10 | 11 | [JsonIgnore] 12 | public override string? ObjectName { get; } = "$public.OSS"; 13 | 14 | public string AccessId { get; set; } = ""; 15 | 16 | public string AccessSecret { get; set; } = ""; 17 | 18 | public string Bucket { get; set; } = ""; 19 | 20 | public string Endpoint { get; set; } = ""; 21 | 22 | public string RoleArn { get; set; } = ""; 23 | 24 | public string RoleSessionName { get; set; } = ""; 25 | 26 | public string RegionId { get; set; } = ""; 27 | } 28 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Model/ServerModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Model; 5 | 6 | public class ServerModel : BaseServiceModel 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Model/TaskAssignModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Model; 5 | 6 | public class TaskAssignModel 7 | { 8 | public WorkerModel Worker { get; set; } = default!; 9 | 10 | public SchedulerTaskDto Task { get; set; } = default!; 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Model/WorkerModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Model; 5 | 6 | public class WorkerModel : BaseServiceModel 7 | { 8 | public int CurrentTaskRunCount { get; set; } 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/BaseRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests; 5 | 6 | public abstract class BaseRequest : BaseMessage 7 | { 8 | } 9 | 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/PaginationRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests; 5 | 6 | public class PaginationRequest : BaseRequest 7 | { 8 | public int Page { get; set; } 9 | 10 | public int PageSize { get; set; } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerJobs/AddSchedulerJobRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerJobs; 5 | 6 | public class AddSchedulerJobRequest: BaseRequest 7 | { 8 | public SchedulerJobDto Data { get; set; } = new(); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerJobs/ChangeEnabledStatusRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerJobs; 5 | 6 | public class ChangeEnabledStatusRequest : BaseRequest 7 | { 8 | public Guid JobId { get; set; } 9 | 10 | public Guid OperatorId { get; set; } 11 | 12 | public bool Enabled { get; set; } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerJobs/GetSchedulerJobByIdentityRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerJobs; 5 | 6 | public class GetSchedulerJobByIdentityRequest 7 | { 8 | public string JobIdentity { get; set; } = string.Empty; 9 | 10 | public string ProjectIdentity { get; set; } = string.Empty; 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerJobs/RemoveSchedulerJobRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerJobs; 5 | 6 | public class RemoveSchedulerJobRequest : BaseRequest 7 | { 8 | public Guid JobId { get; set; } 9 | 10 | public Guid OperatorId { get; set; } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerJobs/SchedulerJobListRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerJobs; 5 | 6 | public class SchedulerJobListRequest: PaginationRequest 7 | { 8 | public bool IsCreatedByManual { get; set; } 9 | 10 | public TaskRunStatus FilterStatus { get; set; } 11 | 12 | public string JobName { get; set; } = string.Empty; 13 | 14 | public JobQueryTimeTypes QueryTimeType { get; set; } 15 | 16 | public DateTime? QueryStartTime { get; set; } 17 | 18 | public DateTime? QueryEndTime { get; set; } 19 | 20 | public string BelongProjectIdentity { get; set; } = string.Empty; 21 | 22 | public JobTypes JobType { get; set; } 23 | 24 | public string Origin { get; set; } = string.Empty; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerJobs/StartSchedulerJobRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerJobs; 5 | 6 | public class StartSchedulerJobRequest 7 | { 8 | public Guid JobId { get; set; } 9 | 10 | public Guid OperatorId { get; set; } 11 | 12 | public DateTimeOffset ExcuteTime { get; set; } = DateTimeOffset.MinValue; 13 | } 14 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerJobs/UpdateCronJobRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerJobs; 5 | 6 | public class UpdateCronJobRequest : BaseRequest 7 | { 8 | public Guid JobId { get; set; } 9 | 10 | public bool Enabled { get; set; } 11 | 12 | public ScheduleTypes ScheduleType { get; set; } 13 | 14 | public string CronExpression { get; set; } = string.Empty; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerJobs/UpdateSchedulerJobRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerJobs; 5 | 6 | public class UpdateSchedulerJobRequest: BaseRequest 7 | { 8 | public SchedulerJobDto Data { get; set; } = new(); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerResources/AddSchedulerResourceRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerResources; 5 | 6 | public class AddSchedulerResourceRequest : BaseRequest 7 | { 8 | public SchedulerResourceDto Data { get; set; } = new(); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerResources/RemoveSchedulerResourceRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerResources; 5 | 6 | public class RemoveSchedulerResourceRequest : BaseRequest 7 | { 8 | public Guid ResourceId { get; set; } 9 | 10 | public string JobAppIdentity { get; set; } = string.Empty; 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerResources/SchedulerResourceListRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerResources; 5 | 6 | public class SchedulerResourceListRequest : BaseRequest 7 | { 8 | public string JobAppIdentity { get; set; } = string.Empty; 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerResources/UpdateSchedulerResourceRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerResources; 5 | 6 | public class UpdateSchedulerResourceRequest : BaseRequest 7 | { 8 | public SchedulerResourceDto Data { get; set; } = new(); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerTasks/AddSchedulerTaskRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerTasks; 5 | 6 | public class AddSchedulerTaskRequest : BaseRequest 7 | { 8 | public Guid JobId { get; set; } 9 | 10 | public string Origin { get; set; } = string.Empty; 11 | 12 | public Guid OperatorId { get; set; } 13 | 14 | public DateTimeOffset ExcuteTime { get; set; } 15 | } 16 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerTasks/NotifySchedulerTaskRunResultBySdkRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerTasks; 5 | 6 | public class NotifySchedulerTaskRunResultBySdkRequest : BaseRequest 7 | { 8 | public Guid TaskId { get; set; } 9 | 10 | public TaskRunResultStatus Status { get; set; } 11 | 12 | public string? Message { get; set; } 13 | } 14 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerTasks/NotifySchedulerTaskRunResultRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerTasks; 5 | 6 | public class NotifySchedulerTaskRunResultRequest : BaseRequest 7 | { 8 | public Guid TaskId { get; set; } 9 | 10 | public TaskRunStatus Status { get; set; } 11 | 12 | public string? Message { get; set; } 13 | 14 | public bool StopManaul { get; set; } 15 | 16 | public string? TraceId { get; set; } 17 | } 18 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerTasks/NotifyTaskStartRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerTasks; 5 | 6 | public class NotifyTaskStartRequest : BaseRequest 7 | { 8 | public Guid TaskId { get; set; } 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerTasks/RemoveSchedulerTaskRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerTasks; 5 | 6 | public class RemoveSchedulerTaskRequest : BaseRequest 7 | { 8 | public Guid TaskId { get; set; } 9 | 10 | public Guid OperatorId { get; set; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerTasks/SchedulerTaskListRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerTasks; 5 | 6 | public class SchedulerTaskListRequest : PaginationRequest 7 | { 8 | public Guid JobId { get; set; } 9 | 10 | public TaskRunStatus FilterStatus { get; set; } 11 | 12 | public JobQueryTimeTypes QueryTimeType { get; set; } 13 | 14 | public DateTime? QueryStartTime { get; set; } 15 | 16 | public DateTime? QueryEndTime { get; set; } 17 | 18 | public string Origin { get; set; } = string.Empty; 19 | } 20 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerTasks/StartSchedulerTaskRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerTasks; 5 | 6 | public class StartSchedulerTaskRequest : BaseRequest 7 | { 8 | public Guid TaskId { get; set; } 9 | 10 | public bool IsManual { get; set; } 11 | 12 | public DateTimeOffset ExcuteTime { get; set; } = DateTimeOffset.MinValue; 13 | 14 | public Guid OperatorId { get; set; } 15 | } 16 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerTasks/StopSchedulerTaskRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerTasks; 5 | 6 | public class StopSchedulerTaskRequest : BaseRequest 7 | { 8 | public Guid TaskId { get; set; } 9 | 10 | public Guid OperatorId { get; set; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerWorker/AssignTaskRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerWorker; 5 | 6 | public class AssignTaskRequest 7 | { 8 | public TaskAssignModel Data { get; set; } = default!; 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerWorker/StartTaskRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerWorker; 5 | 6 | public class StartTaskRequest : BaseRequest 7 | { 8 | public Guid TaskId { get; set; } 9 | 10 | public SchedulerJobDto Job { get; set; } = default!; 11 | } 12 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Requests/SchedulerWorker/StopTaskRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Requests.SchedulerWorker; 5 | 6 | public class StopTaskRequest : BaseRequest 7 | { 8 | public Guid TaskId { get; set; } 9 | } 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Responses/BasePaginationResponse.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Responses; 5 | 6 | public class BasePaginationResponse: BaseResponse> 7 | { 8 | public long Total { get; set; } 9 | 10 | public int TotalPages { get; set; } 11 | 12 | public BasePaginationResponse() 13 | { 14 | Data = new List(); 15 | } 16 | 17 | public BasePaginationResponse(long total, int totalPages, List result) 18 | { 19 | Total = total; 20 | TotalPages = totalPages; 21 | Data = result; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Responses/BaseResponse.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Responses; 5 | 6 | public abstract class BaseResponse : BaseMessage 7 | { 8 | public BaseResponse(Guid correlationId) : base() 9 | { 10 | base._correlationId = correlationId; 11 | } 12 | public BaseResponse() 13 | { 14 | } 15 | } 16 | 17 | public abstract class BaseResponse : BaseResponse where T : class, new() 18 | { 19 | public T Data { get; set; } = new(); 20 | } 21 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Responses/ProjectListResponse.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Responses; 5 | 6 | public class ProjectListResponse: BaseResponse> 7 | { 8 | } 9 | 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Responses/SchedulerJobListResponse.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Responses; 5 | 6 | public class SchedulerJobListResponse : BasePaginationResponse 7 | { 8 | public List OriginList { get; set; } 9 | 10 | public SchedulerJobListResponse() 11 | : base(0, 0, new List()) 12 | { 13 | OriginList = new(); 14 | } 15 | 16 | public SchedulerJobListResponse(long total, int totalPages, List result, List originList) 17 | :base(total, totalPages, result) 18 | { 19 | OriginList = originList; 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Responses/SchedulerResourceListResponse.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Responses; 5 | 6 | public class SchedulerResourceListResponse : BaseResponse> 7 | { 8 | } 9 | 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Responses/SchedulerTaskListResponse.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Responses; 5 | 6 | public class SchedulerTaskListResponse : BasePaginationResponse 7 | { 8 | public List OriginList { get; set; } 9 | 10 | public SchedulerTaskListResponse() 11 | :base(0, 0, new List()) 12 | { 13 | OriginList = new(); 14 | } 15 | 16 | public SchedulerTaskListResponse(long total, int totalPages, List result, List originList) 17 | : base(total, totalPages, result) 18 | { 19 | OriginList = originList; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Responses/TeamListResponse.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Responses; 5 | 6 | public class TeamListResponse: BaseResponse> 7 | { 8 | } 9 | 10 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Validator/SchedulerJobAppConfigDtoValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Validator; 5 | 6 | public class SchedulerJobAppConfigDtoValidator: AbstractValidator 7 | { 8 | public SchedulerJobAppConfigDtoValidator() 9 | { 10 | RuleFor(config => config.JobAppIdentity).Required(); 11 | RuleFor(config => config.JobEntryAssembly).Required(); 12 | RuleFor(config => config.JobEntryClassName).Required(); 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Validator/SchedulerJobDaprServiceInvocationConfigDtoValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Validator; 5 | 6 | public class SchedulerJobDaprServiceInvocationConfigDtoValidator: AbstractValidator 7 | { 8 | public SchedulerJobDaprServiceInvocationConfigDtoValidator() 9 | { 10 | RuleFor(config => config.MethodName).Required(); 11 | RuleFor(config => config.HttpMethod).Required(); 12 | RuleFor(config => config.DaprServiceIdentity).Required(); 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Validator/SchedulerJobHttpConfigDtoValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Validator; 5 | 6 | internal class SchedulerJobHttpConfigDtoValidator : AbstractValidator 7 | { 8 | public SchedulerJobHttpConfigDtoValidator() 9 | { 10 | RuleFor(config => config.HttpMethod).Required(); 11 | RuleFor(config => config.RequestUrl).Required(); 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/Contracts/Masa.Scheduler.Contracts.Server/Validator/SchedulerResourceDtoValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Contracts.Server.Validator; 5 | 6 | public class SchedulerResourceDtoValidator : AbstractValidator 7 | { 8 | public SchedulerResourceDtoValidator() 9 | { 10 | RuleFor(x=> x.FilePath).Required(); 11 | RuleFor(x=> x.Name).Required(); 12 | RuleFor(x => x.JobAppIdentity).Required(); 13 | RuleFor(x => x.Version).Length(0,20).Required(); 14 | RuleFor(x => x.Description).Length(0,255); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/Domain/Masa.Scheduler.Domain/Events/NotifyJobStatusDomainEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Events; 5 | 6 | public record NotifyJobStatusDomainEvent(Guid JobId, string NotifyUrl, JobNotifyStatus Status) : DomainEvent 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /src/Domain/Masa.Scheduler.Domain/Events/NotifyTaskRunResultDomainEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Events; 5 | 6 | public record NotifyTaskRunResultDomainEvent(NotifySchedulerTaskRunResultRequest Request) : Event; 7 | -------------------------------------------------------------------------------- /src/Domain/Masa.Scheduler.Domain/Events/RemoveSchedulerJobDomainEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Events; 5 | 6 | public record RemoveSchedulerJobDomainEvent(RemoveSchedulerJobRequest Request) : Event; 7 | -------------------------------------------------------------------------------- /src/Domain/Masa.Scheduler.Domain/Events/StartJobDomainEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Events; 5 | 6 | public record StartJobDomainEvent(StartSchedulerJobRequest Request) : Event; 7 | -------------------------------------------------------------------------------- /src/Domain/Masa.Scheduler.Domain/Events/StartTaskDomainEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Events; 5 | 6 | public record StartTaskDomainEvent(StartSchedulerTaskRequest Request, SchedulerTask? Task = null) : Event; 7 | -------------------------------------------------------------------------------- /src/Domain/Masa.Scheduler.Domain/Events/StopTaskDomainEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Events; 5 | 6 | public record StopTaskDomainEvent(StopSchedulerTaskRequest Request, bool IsRestart = false) : Event; 7 | -------------------------------------------------------------------------------- /src/Domain/Masa.Scheduler.Domain/Events/UpdateCronJobDomainEvent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Events; 5 | 6 | public record UpdateCronJobDomainEvent(UpdateCronJobRequest Request) : Event; 7 | -------------------------------------------------------------------------------- /src/Domain/Masa.Scheduler.Domain/Repositories/ISchedulerJobRepository.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Repositories; 5 | 6 | public interface ISchedulerJobRepository : IRepository 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /src/Domain/Masa.Scheduler.Domain/Repositories/ISchedulerTaskRepository.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Repositories; 5 | 6 | public interface ISchedulerTaskRepository : IRepository 7 | { 8 | IQueryable AsQueryable(); 9 | 10 | Task AnyAsync(Expression> predicate); 11 | } 12 | -------------------------------------------------------------------------------- /src/Domain/Masa.Scheduler.Domain/_Imports.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | // System Namespaces 5 | global using System.Linq.Expressions; 6 | global using System.Text.Json.Serialization; 7 | 8 | // MASA Building Blocks 9 | global using Masa.BuildingBlocks.Ddd.Domain.Entities.Full; 10 | global using Masa.BuildingBlocks.Ddd.Domain.Events; 11 | global using Masa.BuildingBlocks.Ddd.Domain.Repositories; 12 | global using Masa.BuildingBlocks.Ddd.Domain.Values; 13 | global using Masa.BuildingBlocks.Dispatcher.Events; 14 | 15 | // MASA Scheduler Contracts 16 | global using Masa.Scheduler.Contracts.Server.Dtos; 17 | global using Masa.Scheduler.Contracts.Server.Infrastructure.Enums; 18 | global using Masa.Scheduler.Contracts.Server.Requests.SchedulerJobs; 19 | global using Masa.Scheduler.Contracts.Server.Requests.SchedulerTasks; 20 | 21 | // MASA Scheduler Domain Aggregates and Events 22 | global using Masa.Scheduler.Services.Server.Domain.Aggregates.Jobs; 23 | global using Masa.Scheduler.Services.Server.Domain.Aggregates.Jobs.Configs; 24 | global using Masa.Scheduler.Services.Server.Domain.Aggregates.Tasks; 25 | global using Masa.Scheduler.Services.Server.Domain.Events; -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.PostgreSql/SchedulerPostgreSqlDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.EntityFrameworkCore; 5 | 6 | public class SchedulerPostgreSqlDbContextFactory : IDesignTimeDbContextFactory 7 | { 8 | public SchedulerDbContext CreateDbContext(string[] args) 9 | { 10 | SchedulerDbContext.RegisterAssembly(typeof(SchedulerPostgreSqlDbContextFactory).Assembly); 11 | var optionsBuilder = new MasaDbContextOptionsBuilder(); 12 | var configurationBuilder = new ConfigurationBuilder(); 13 | var configuration = configurationBuilder 14 | .AddJsonFile("appsettings.PostgreSql.json") 15 | .Build(); 16 | optionsBuilder.UseNpgsql(configuration.GetConnectionString("DefaultConnection")!, b => b.MigrationsAssembly("Masa.Scheduler.EntityFrameworkCore.PostgreSql")); 17 | 18 | return new SchedulerDbContext(optionsBuilder.MasaOptions); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.PostgreSql/_Imports.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | global using Microsoft.EntityFrameworkCore; 5 | global using Microsoft.EntityFrameworkCore.Design; 6 | global using Microsoft.Extensions.Configuration; 7 | global using Masa.Scheduler.EntityFrameworkCore; -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.PostgreSql/appsettings.PostgreSql.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=10.130.0.19;Port=3815;User Id=ss;Password=Lsd@2023;Database=scheduler_dev;" 4 | } 5 | } -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Masa.Scheduler.EntityFrameworkCore.SqlServer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | enable 5 | enable 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | PreserveNewest 21 | 22 | 23 | Always 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20220530104317_ChangeHttpConfig.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 6 | { 7 | public partial class ChangeHttpConfig : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.RenameColumn( 12 | name: "RunUserId", 13 | schema: "server", 14 | table: "SchedulerTask", 15 | newName: "OperatorId"); 16 | } 17 | 18 | protected override void Down(MigrationBuilder migrationBuilder) 19 | { 20 | migrationBuilder.RenameColumn( 21 | name: "OperatorId", 22 | schema: "server", 23 | table: "SchedulerTask", 24 | newName: "RunUserId"); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20220614014120_UpgradeSchedulerResourceTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | #nullable disable 5 | 6 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 7 | { 8 | public partial class UpgradeSchedulerResourceTable : Migration 9 | { 10 | protected override void Up(MigrationBuilder migrationBuilder) 11 | { 12 | migrationBuilder.AddColumn( 13 | name: "UploadTime", 14 | schema: "server", 15 | table: "SchedulerResource", 16 | type: "datetimeoffset", 17 | nullable: false, 18 | defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0))); 19 | } 20 | 21 | protected override void Down(MigrationBuilder migrationBuilder) 22 | { 23 | migrationBuilder.DropColumn( 24 | name: "UploadTime", 25 | schema: "server", 26 | table: "SchedulerResource"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20220622095650_SchedulerTaskAddExcuteTime.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | #nullable disable 5 | 6 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 7 | { 8 | public partial class SchedulerTaskAddExcuteTime : Migration 9 | { 10 | protected override void Up(MigrationBuilder migrationBuilder) 11 | { 12 | migrationBuilder.AddColumn( 13 | name: "ExcuteTime", 14 | schema: "server", 15 | table: "SchedulerTask", 16 | type: "datetimeoffset", 17 | nullable: false, 18 | defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0))); 19 | } 20 | 21 | protected override void Down(MigrationBuilder migrationBuilder) 22 | { 23 | migrationBuilder.DropColumn( 24 | name: "ExcuteTime", 25 | schema: "server", 26 | table: "SchedulerTask"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20220623052420_SchedulerJobAddUpdateExpiredStrategyTime.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | #nullable disable 5 | 6 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 7 | { 8 | public partial class SchedulerJobAddUpdateExpiredStrategyTime : Migration 9 | { 10 | protected override void Up(MigrationBuilder migrationBuilder) 11 | { 12 | migrationBuilder.AddColumn( 13 | name: "UpdateExpiredStrategyTime", 14 | schema: "server", 15 | table: "SchedulerJob", 16 | type: "datetimeoffset", 17 | nullable: false, 18 | defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0))); 19 | } 20 | 21 | protected override void Down(MigrationBuilder migrationBuilder) 22 | { 23 | migrationBuilder.DropColumn( 24 | name: "UpdateExpiredStrategyTime", 25 | schema: "server", 26 | table: "SchedulerJob"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20220623091948_RemoveExcuteTime.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | #nullable disable 5 | 6 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 7 | { 8 | public partial class RemoveExcuteTime : Migration 9 | { 10 | protected override void Up(MigrationBuilder migrationBuilder) 11 | { 12 | migrationBuilder.DropColumn( 13 | name: "ExcuteTime", 14 | schema: "server", 15 | table: "SchedulerTask"); 16 | } 17 | 18 | protected override void Down(MigrationBuilder migrationBuilder) 19 | { 20 | migrationBuilder.AddColumn( 21 | name: "ExcuteTime", 22 | schema: "server", 23 | table: "SchedulerTask", 24 | type: "datetimeoffset", 25 | nullable: false, 26 | defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0))); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20220725072548_add OwnerId.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | #nullable disable 5 | 6 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 7 | { 8 | public partial class addOwnerId : Migration 9 | { 10 | protected override void Up(MigrationBuilder migrationBuilder) 11 | { 12 | migrationBuilder.AddColumn( 13 | name: "OwnerId", 14 | schema: "server", 15 | table: "SchedulerJob", 16 | type: "uniqueidentifier", 17 | nullable: false, 18 | defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); 19 | } 20 | 21 | protected override void Down(MigrationBuilder migrationBuilder) 22 | { 23 | migrationBuilder.DropColumn( 24 | name: "OwnerId", 25 | schema: "server", 26 | table: "SchedulerJob"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20220813055646_AddJobIdentity.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 6 | { 7 | public partial class AddJobIdentity : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "JobIdentity", 13 | schema: "server", 14 | table: "SchedulerJob", 15 | type: "nvarchar(100)", 16 | maxLength: 100, 17 | nullable: false, 18 | defaultValue: ""); 19 | } 20 | 21 | protected override void Down(MigrationBuilder migrationBuilder) 22 | { 23 | migrationBuilder.DropColumn( 24 | name: "JobIdentity", 25 | schema: "server", 26 | table: "SchedulerJob"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20230320055332_SchedulerJobAlarmRuleId.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | #nullable disable 5 | 6 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 7 | { 8 | public partial class SchedulerJobAlarmRuleId : Migration 9 | { 10 | protected override void Up(MigrationBuilder migrationBuilder) 11 | { 12 | migrationBuilder.AddColumn( 13 | name: "AlarmRuleId", 14 | schema: "server", 15 | table: "SchedulerJob", 16 | type: "uniqueidentifier", 17 | nullable: false, 18 | defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); 19 | } 20 | 21 | protected override void Down(MigrationBuilder migrationBuilder) 22 | { 23 | migrationBuilder.DropColumn( 24 | name: "AlarmRuleId", 25 | schema: "server", 26 | table: "SchedulerJob"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20230322094627_AddSchedulerTaskTraceId.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 6 | { 7 | public partial class AddSchedulerTaskTraceId : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "TraceId", 13 | schema: "server", 14 | table: "SchedulerTask", 15 | type: "nvarchar(255)", 16 | maxLength: 255, 17 | nullable: false, 18 | defaultValue: ""); 19 | } 20 | 21 | protected override void Down(MigrationBuilder migrationBuilder) 22 | { 23 | migrationBuilder.DropColumn( 24 | name: "TraceId", 25 | schema: "server", 26 | table: "SchedulerTask"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20230329130658_AddSchedulerTaskIndex.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 6 | { 7 | public partial class AddSchedulerTaskIndex : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.CreateIndex( 12 | name: "IX_SchedulerTask_JobId_TaskStatus", 13 | schema: "server", 14 | table: "SchedulerTask", 15 | columns: new[] { "JobId", "TaskStatus" }); 16 | } 17 | 18 | protected override void Down(MigrationBuilder migrationBuilder) 19 | { 20 | migrationBuilder.DropIndex( 21 | name: "IX_SchedulerTask_JobId_TaskStatus", 22 | schema: "server", 23 | table: "SchedulerTask"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20230507133253_TaskMessage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 6 | { 7 | public partial class TaskMessage : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AlterColumn( 12 | name: "Message", 13 | schema: "server", 14 | table: "SchedulerTask", 15 | type: "nvarchar(max)", 16 | nullable: false, 17 | oldClrType: typeof(string), 18 | oldType: "nvarchar(255)", 19 | oldMaxLength: 255); 20 | } 21 | 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.AlterColumn( 25 | name: "Message", 26 | schema: "server", 27 | table: "SchedulerTask", 28 | type: "nvarchar(255)", 29 | maxLength: 255, 30 | nullable: false, 31 | oldClrType: typeof(string), 32 | oldType: "nvarchar(max)"); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/Migrations/20230518032756_IntegrationEventLog.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Masa.Scheduler.EntityFrameworkCore.SqlServer.Migrations 6 | { 7 | public partial class IntegrationEventLog : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "ExpandContent", 13 | table: "IntegrationEventLog", 14 | type: "nvarchar(max)", 15 | nullable: false, 16 | defaultValue: ""); 17 | } 18 | 19 | protected override void Down(MigrationBuilder migrationBuilder) 20 | { 21 | migrationBuilder.DropColumn( 22 | name: "ExpandContent", 23 | table: "IntegrationEventLog"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/SchedulerSqlServerDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.EntityFrameworkCore; 5 | 6 | public class SchedulerSqlServerDbContextFactory : IDesignTimeDbContextFactory 7 | { 8 | public SchedulerDbContext CreateDbContext(string[] args) 9 | { 10 | SchedulerDbContext.RegisterAssembly(typeof(SchedulerSqlServerDbContextFactory).Assembly); 11 | var optionsBuilder = new MasaDbContextOptionsBuilder(); 12 | var configurationBuilder = new ConfigurationBuilder(); 13 | var configuration = configurationBuilder 14 | .AddJsonFile("appsettings.SqlServer.json") 15 | .Build(); 16 | optionsBuilder.UseSqlServer(configuration.GetConnectionString("DefaultConnection")!, b => b.MigrationsAssembly("Masa.Scheduler.EntityFrameworkCore.SqlServer")); 17 | 18 | return new SchedulerDbContext(optionsBuilder.MasaOptions); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/_Imports.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | global using Microsoft.EntityFrameworkCore; 5 | global using Microsoft.EntityFrameworkCore.Design; 6 | global using Microsoft.Extensions.Configuration; 7 | global using Masa.Scheduler.EntityFrameworkCore; -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore.SqlServer/appsettings.SqlServer.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=10.130.0.19,2415;Database=scheduler_dev;User Id=ss;Password=Hzss@123;" 4 | } 5 | } -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore/EntityConfigurations/Resources/SchedulerResourceEntityTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.EntityFrameworkCore.EntityConfigurations.Resources; 5 | 6 | public class SchedulerResourceEntityTypeConfiguration : IEntityTypeConfiguration 7 | { 8 | public void Configure(EntityTypeBuilder builder) 9 | { 10 | builder.ToTable(nameof(SchedulerResource), SchedulerDbContext.SERVER_SCHEMA); 11 | builder.HasKey(x => x.Id); 12 | builder.HasIndex(x => x.Name); 13 | builder.Property(x => x.Description).HasMaxLength(255); 14 | builder.Property(x => x.FilePath).HasMaxLength(255); 15 | builder.Property(x => x.Version).HasMaxLength(20); 16 | builder.Property(x => x.JobAppIdentity).HasMaxLength(100); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore/EntityConfigurations/Tasks/SchedulerTaskEntityTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.EntityFrameworkCore.EntityConfigurations.Tasks; 5 | 6 | public class SchedulerTaskEntityTypeConfiguration : IEntityTypeConfiguration 7 | { 8 | public void Configure(EntityTypeBuilder builder) 9 | { 10 | builder.ToTable(nameof(SchedulerTask), SchedulerDbContext.SERVER_SCHEMA); 11 | builder.HasKey(x => x.Id); 12 | builder.HasIndex(x => new { x.JobId, x.IsDeleted, x.TaskStatus }); 13 | builder.HasIndex(x => new { x.Origin, x.IsDeleted }); 14 | builder.Property(x => x.Origin).HasMaxLength(50); 15 | builder.Property(x => x.WorkerHost).HasMaxLength(100); 16 | builder.Property(x => x.Message); 17 | builder.Property(x => x.TraceId).HasMaxLength(255); 18 | builder.HasOne(x => x.Job).WithMany(p => p.SchedulerTasks).HasForeignKey(x => x.JobId); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore/EntityConfigurations/ValueConverts/JsonValueConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.EntityFrameworkCore.EntityConfigurations.ValueConverts; 5 | 6 | public class JsonValueConverter : ValueConverter where T : class, new() 7 | { 8 | public JsonValueConverter() 9 | : base(x => SerializeObject(x), x => DeserializeObject(x)) 10 | { 11 | 12 | } 13 | 14 | private static string SerializeObject(T obj) 15 | { 16 | return JsonSerializer.Serialize(obj); 17 | } 18 | 19 | private static T DeserializeObject(string json) 20 | { 21 | if (string.IsNullOrEmpty(json)) 22 | { 23 | return new T(); 24 | } 25 | 26 | return JsonSerializer.Deserialize(json)!; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore/Masa.Scheduler.EntityFrameworkCore.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | enable 5 | enable 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore/Repositories/SchedulerJobRepository.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.EntityFrameworkCore.Repositories; 5 | 6 | public class SchedulerJobRepository : Repository, ISchedulerJobRepository 7 | { 8 | public SchedulerJobRepository(SchedulerDbContext context, IUnitOfWork unitOfWork) 9 | : base(context, unitOfWork) 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore/Repositories/SchedulerTaskRepository.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.EntityFrameworkCore.Repositories; 5 | 6 | public class SchedulerTaskRepository : Repository, ISchedulerTaskRepository 7 | { 8 | public SchedulerTaskRepository(SchedulerDbContext context, IUnitOfWork unitOfWork) 9 | : base(context, unitOfWork) 10 | { 11 | 12 | } 13 | 14 | public IQueryable AsQueryable() 15 | { 16 | return Context.Set().AsQueryable(); 17 | } 18 | 19 | public async Task AnyAsync(Expression> predicate) 20 | { 21 | return await Context.Set().AnyAsync(predicate); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore/ValueConverters/DateTimeUtcConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Masa.Scheduler.EntityFrameworkCore.ValueConverters; 2 | 3 | public class DateTimeUtcConverter : ValueConverter 4 | { 5 | public DateTimeUtcConverter() : base( 6 | v => v.ToUniversalTime(), 7 | v => DateTime.SpecifyKind(v, DateTimeKind.Utc)) 8 | { 9 | } 10 | } -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.EntityFrameworkCore/ValueConverters/NullableDateTimeUtcConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Masa.Scheduler.EntityFrameworkCore.ValueConverters; 2 | 3 | public class NullableDateTimeUtcConverter : ValueConverter 4 | { 5 | public NullableDateTimeUtcConverter() : base( 6 | v => v.HasValue ? v.Value.Kind == DateTimeKind.Unspecified ? DateTime.SpecifyKind(v.Value, DateTimeKind.Utc).ToUniversalTime() : v.Value.ToUniversalTime() : null, 7 | v => v.HasValue ? DateTime.SpecifyKind(v.Value, DateTimeKind.Utc) : null) 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.Infrastructure.Cache/ICacheContext.cs: -------------------------------------------------------------------------------- 1 | namespace Masa.Scheduler.Infrastructure.Cache; 2 | 3 | public interface ICacheContext 4 | { 5 | Task SetAsync(string key, T item, CacheEntryOptions? cacheEntryOptions = default); 6 | 7 | Task GetAsync(string key); 8 | 9 | Task GetOrSetAsync(string key, Func> setter, CacheEntryOptions? cacheEntryOptions = default); 10 | 11 | Task GetOrSetAsync(string key, Func> setter); 12 | 13 | Task Remove(string key); 14 | } -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.Infrastructure.Cache/Masa.Scheduler.Infrastructure.Cache.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | enable 5 | enable 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.Infrastructure.Cache/ServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Masa.Scheduler.Infrastructure.Cache; 2 | 3 | public static class ServiceCollectionExtensions 4 | { 5 | public static IServiceCollection AddCache(this IServiceCollection services, RedisConfigurationOptions redisOptions) 6 | { 7 | services.AddMultilevelCache(options => options.UseStackExchangeRedisCache(redisOptions)); 8 | services.TryAddScoped(); 9 | return services; 10 | } 11 | } -------------------------------------------------------------------------------- /src/Infrastructure/Masa.Scheduler.Infrastructure.Cache/_Imports.cs: -------------------------------------------------------------------------------- 1 | global using Microsoft.Extensions.DependencyInjection; 2 | global using Microsoft.Extensions.DependencyInjection.Extensions; 3 | global using Microsoft.Extensions.Configuration; 4 | global using Masa.BuildingBlocks.Caching; 5 | global using Masa.Contrib.Caching.Distributed.StackExchangeRedis; -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Auths/Queries/TeamQuery.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Auths.Queries; 5 | 6 | public record TeamQuery : Query> 7 | { 8 | public override List Result { get; set; } = new(); 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Auths/Queries/UserQuery.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Auths.Queries; 5 | 6 | public record UserQuery : Query> 7 | { 8 | public List UserIds { get; set; } = new(); 9 | 10 | public override List Result { get; set; } = new(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Commands/AddSchedulerJobBySdkCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Commands; 5 | 6 | public record AddSchedulerJobBySdkCommand(AddSchedulerJobBySdkRequest Request) : Command 7 | { 8 | public SchedulerJobDto Result { get; set; } = new(); 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Commands/AddSchedulerJobCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Commands; 5 | 6 | public record AddSchedulerJobCommand(AddSchedulerJobRequest Request) : Command 7 | { 8 | public SchedulerJobDto Result { get; set; } = new(); 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Commands/AddSchedulerJobCommandValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Commands; 5 | 6 | public class AddSchedulerJobCommandValidator : AbstractValidator 7 | { 8 | public AddSchedulerJobCommandValidator() 9 | { 10 | RuleFor(command => command.Request.Data).SetValidator(new SchedulerJobDtoValidator()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Commands/ChangeEnableStatusSchedulerJobCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Commands; 5 | 6 | public record ChangeEnableStatusSchedulerJobCommand(ChangeEnabledStatusRequest Request) : Command; -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Commands/RemoveSchedulerJobCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Commands; 5 | 6 | public record RemoveSchedulerJobCommand(RemoveSchedulerJobRequest Request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Commands/StartSchedulerJobCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Commands; 5 | 6 | public record StartSchedulerJobCommand(StartSchedulerJobRequest Request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Commands/UpdateSchedulerJobBySdkCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Commands; 5 | 6 | public record UpdateSchedulerJobBySdkCommand(Guid SchedulerJobId, UpdateSchedulerJobBySdkRequest Request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Commands/UpdateSchedulerJobCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Commands; 5 | 6 | public record UpdateSchedulerJobCommand(UpdateSchedulerJobRequest Request):Command; -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Commands/UpdateSchedulerJobCommandValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Commands; 5 | 6 | public class UpdateSchedulerJobCommandValidator: AbstractValidator 7 | { 8 | public UpdateSchedulerJobCommandValidator() 9 | { 10 | RuleFor(command => command.Request.Data).SetValidator(new SchedulerJobDtoValidator()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Commands/UpsertAlarmRuleCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Commands; 5 | 6 | public record UpsertAlarmRuleCommand(Guid JobId, Guid AlarmRuleId) : Command 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Queries/GetSchedulerJobQuery.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Queries; 5 | 6 | public record GetSchedulerJobQuery(Guid SchedulerJobId) : Query 7 | { 8 | public override SchedulerJobDto Result { get; set; } = new(); 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Jobs/Queries/SchedulerJobQuery.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Jobs.Queries; 5 | 6 | public record SchedulerJobQuery(SchedulerJobListRequest Request) : Query 7 | { 8 | public override SchedulerJobListResponse Result { get; set; } = null!; 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Projects/Queries/ProjectDetailsQuery.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Projects.Queries; 5 | 6 | public record ProjectDetailsQuery : Query 7 | { 8 | public string ProjectIdentity { get; set; } = string.Empty; 9 | 10 | public override ProjectDto Result { get; set; } = new(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Projects/Queries/ProjectQuery.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Projects.Queries; 5 | 6 | public record ProjectQuery: Query> 7 | { 8 | public Guid? TeamId { get; set; } 9 | 10 | public string Environment { get; set; } = "development"; 11 | 12 | public ProjectQuery(Guid? teamId, string enviroment) 13 | { 14 | TeamId = teamId; 15 | Environment = enviroment; 16 | } 17 | 18 | public override List Result { get; set; } = new(); 19 | } 20 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Resources/Commands/AddSchedulerResourceCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Resources.Commands; 5 | 6 | public record AddSchedulerResourceCommand(AddSchedulerResourceRequest Request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Resources/Commands/AddSchedulerResourceCommandValidator.cs: -------------------------------------------------------------------------------- 1 | namespace Masa.Scheduler.Services.Server.Application.Resources.Commands; 2 | 3 | public class AddSchedulerResourceCommandValidator : AbstractValidator 4 | { 5 | public AddSchedulerResourceCommandValidator() => RuleFor(cmd => cmd.Request.Data).SetValidator(new SchedulerResourceDtoValidator()); 6 | } -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Resources/Commands/RemoveSchedulerResourceCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Resources.Commands; 5 | 6 | public record RemoveSchedulerResourceCommand(RemoveSchedulerResourceRequest request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Resources/Commands/UpdateSchedulerResourceCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Resources.Commands; 5 | 6 | public record UpdateSchedulerResourceCommand(UpdateSchedulerResourceRequest Request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Resources/Commands/UpdateSchedulerResourceCommandValidator.cs: -------------------------------------------------------------------------------- 1 | namespace Masa.Scheduler.Services.Server.Application.Resources.Commands; 2 | 3 | public class UpdateSchedulerResourceCommandValidator : AbstractValidator 4 | { 5 | public UpdateSchedulerResourceCommandValidator() => RuleFor(cmd => cmd.Request.Data).SetValidator(new SchedulerResourceDtoValidator()); 6 | } -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Resources/Queries/SchedulerResourceListQuery.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Resources.Queries; 5 | 6 | public record SchedulerResourceListQuery(SchedulerResourceListRequest Request) : Query 7 | { 8 | public override SchedulerResourceListResponse Result { get; set; } = new(); 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Resources/SchedulerResourceQueryHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Resources; 5 | 6 | public class SchedulerResourceQueryHandler 7 | { 8 | private IRepository _repository; 9 | private IMapper _mapper; 10 | 11 | public SchedulerResourceQueryHandler(IRepository repository, IMapper mapper) 12 | { 13 | _repository = repository; 14 | _mapper = mapper; 15 | } 16 | 17 | [EventHandler] 18 | public async Task SchedulerResourceListQueryHandle(SchedulerResourceListQuery query) 19 | { 20 | var request = query.Request; 21 | 22 | var list = await _repository.GetListAsync(p => p.JobAppIdentity == request.JobAppIdentity, "CreationTime", true); 23 | 24 | var dtoList = _mapper.Map>(list); 25 | 26 | query.Result = new SchedulerResourceListResponse() { Data = dtoList }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Tasks/Commands/AddSchedulerTaskCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Tasks.Commands; 5 | 6 | public record AddSchedulerTaskCommand(AddSchedulerTaskRequest Request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Tasks/Commands/NotifySchedulerTaskRunResultBySdkCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Tasks.Commands; 5 | 6 | public record NotifySchedulerTaskRunResultBySdkCommand(NotifySchedulerTaskRunResultBySdkRequest Request) : Command; -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Tasks/Commands/NotifySchedulerTaskRunResultCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Tasks.Commands; 5 | 6 | public record NotifySchedulerTaskRunResultCommand(NotifySchedulerTaskRunResultRequest Request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Tasks/Commands/NotifyTaskStartRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Tasks.Commands; 5 | 6 | public record NotifyTaskStartCommand(NotifyTaskStartRequest Request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Tasks/Commands/RemoveSchedulerTaskCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Tasks.Commands; 5 | 6 | public record RemoveSchedulerTaskCommand (RemoveSchedulerTaskRequest Request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Tasks/Commands/StartSchedulerTaskCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Tasks.Commands; 5 | 6 | public record StartSchedulerTaskCommand (StartSchedulerTaskRequest Request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Tasks/Commands/StopSchedulerTaskCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Tasks.Commands; 5 | 6 | public record StopSchedulerTaskCommand (StopSchedulerTaskRequest Request) : Command; 7 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Application/Tasks/Queries/SchedulerTaskQuery.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Application.Tasks.Queries; 5 | 6 | public record SchedulerTaskQuery(SchedulerTaskListRequest Request) : Query 7 | { 8 | public override SchedulerTaskListResponse Result { get; set; } = null!; 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Assets/I18n/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "VersionCannotBeDuplicate": "Version number cannot be duplicate" 3 | } -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Assets/I18n/supportedCultures.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Culture": "zh-CN", 4 | "DisplayName": "中文简体", 5 | "Icon": "{Replace-Your-Icon}" 6 | }, 7 | { 8 | "Culture": "en-US", 9 | "DisplayName": "English (United States)", 10 | "Icon": "{Replace-Your-Icon}" 11 | } 12 | ] -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Assets/I18n/zh-CN.json: -------------------------------------------------------------------------------- 1 | { 2 | "VersionCannotBeDuplicate": "版本号不能重复" 3 | } -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM registry.cn-hangzhou.aliyuncs.com/masa/dotnet_sdk:6.0.403 AS publish 2 | WORKDIR /src 3 | COPY . . 4 | # ENV CSPROJ="src/Services/Masa.Scheduler.Services.Server/Masa.Scheduler.Services.Server.csproj" 5 | 6 | # RUN dotnet restore $CSPROJ && dotnet publish $CSPROJ -c Release -o /app/publish 7 | RUN cd src/Services/Masa.Scheduler.Services.Server && dotnet restore && dotnet publish -c Release -o /app/publish 8 | 9 | FROM registry.cn-hangzhou.aliyuncs.com/masa/dotnet_aspnet:6.0.0 10 | WORKDIR /app 11 | COPY --from=publish /app/publish . 12 | ENV ASPNETCORE_URLS=http://0.0.0.0:80 13 | EXPOSE 80 14 | ENTRYPOINT ["dotnet", "Masa.Scheduler.Services.Server.dll"] 15 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Domain/Managers/Servers/Data/SchedulerServerManagerData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Managers.Servers.Data; 5 | 6 | public class SchedulerServerManagerData : BaseSchedulerManagerData 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Domain/Managers/Servers/SchedulerServerManagerServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Managers.Servers; 5 | 6 | public static class SchedulerServerManagerServiceCollectionExtensions 7 | { 8 | public static IServiceCollection AddServerManager(this IServiceCollection services) 9 | { 10 | services.AddScoped(); 11 | services.AddSingleton(); 12 | services.AddScoped(); 13 | services.AddHostedService(); 14 | 15 | return services; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Domain/Services/SchedulerJobDomainService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Domain.Services; 5 | 6 | public class SchedulerJobDomainService : DomainService 7 | { 8 | private readonly ILogger _logger; 9 | private readonly ISchedulerJobRepository _schedulerJobRepository; 10 | 11 | public SchedulerJobDomainService(IDomainEventBus eventBus, ILogger logger, ISchedulerJobRepository schedulerJobRepository) : base(eventBus) 12 | { 13 | _logger = logger; 14 | _schedulerJobRepository = schedulerJobRepository; 15 | } 16 | 17 | public async Task StartJobAsync(StartSchedulerJobRequest request) 18 | { 19 | await EventBus.PublishAsync(new StartJobDomainEvent(request)); 20 | } 21 | 22 | public async Task UpdateCronJobAsync(UpdateCronJobRequest request) 23 | { 24 | await EventBus.PublishAsync(new UpdateCronJobDomainEvent(request)); 25 | } 26 | 27 | public async Task RemoveSchedulerJobAsync(RemoveSchedulerJobRequest request) 28 | { 29 | await EventBus.PublishAsync(new RemoveSchedulerJobDomainEvent(request)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Infrastructure/Common/CacheKeys.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Infrastructure.Common; 5 | 6 | public class CacheKeys 7 | { 8 | public const string CURRENT_RUN_COUNT = nameof(CURRENT_RUN_COUNT); 9 | public const string TASK_RETRY_COUNT = nameof(TASK_RETRY_COUNT); 10 | public const string SIGNALR_NOTIFY = nameof(SIGNALR_NOTIFY); 11 | public const string USER_QUERY = nameof(USER_QUERY); 12 | } 13 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Infrastructure/Extensions/MasaDbContextBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Infrastructure.Extensions; 5 | 6 | public static class MasaDbContextBuilderExtensions 7 | { 8 | public static MasaDbContextBuilder UseDbSql(this MasaDbContextBuilder builder, string dbType) 9 | { 10 | switch (dbType) 11 | { 12 | case "PostgreSql": 13 | SchedulerDbContext.RegisterAssembly(typeof(SchedulerPostgreSqlDbContextFactory).Assembly); 14 | builder.UseNpgsql(b => b.MigrationsAssembly("Masa.Scheduler.EntityFrameworkCore.PostgreSql")); 15 | break; 16 | default: 17 | SchedulerDbContext.RegisterAssembly(typeof(SchedulerSqlServerDbContextFactory).Assembly); 18 | builder.UseSqlServer(b => b.MigrationsAssembly("Masa.Scheduler.EntityFrameworkCore.SqlServer")); 19 | break; 20 | } 21 | return builder; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Infrastructure/SignalR/Hubs/NotificationsHub.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Infrastructure.SignalR.Hubs; 5 | 6 | public class NotificationsHub : Hub 7 | { 8 | public override async Task OnConnectedAsync() 9 | { 10 | await base.OnConnectedAsync(); 11 | await Groups.AddToGroupAsync(Context.ConnectionId, ConstStrings.GLOBAL_GROUP, Context.ConnectionAborted); 12 | } 13 | 14 | public override async Task OnDisconnectedAsync(Exception? exception) 15 | { 16 | await base.OnDisconnectedAsync(exception); 17 | await Groups.RemoveFromGroupAsync(Context.ConnectionId, ConstStrings.GLOBAL_GROUP, Context.ConnectionAborted); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Infrastructure/SignalR/MasaUserIdProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Infrastructure.SignalR; 5 | 6 | public class MasaUserIdProvider : IUserIdProvider 7 | { 8 | public string? GetUserId(HubConnectionContext connection) 9 | { 10 | return TempCurrentUserConsts.ID; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Services/AuthService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Services; 5 | 6 | public class AuthService : ServiceBase 7 | { 8 | public AuthService() : base(ConstStrings.AUTH_API) 9 | { 10 | RouteHandlerBuilder = builder => 11 | { 12 | builder.RequireAuthorization(); 13 | }; 14 | } 15 | 16 | public async Task GetTeamListAsync(IEventBus eventBus) 17 | { 18 | var query = new TeamQuery(); 19 | await eventBus.PublishAsync(query); 20 | return Results.Ok(query.Result); 21 | } 22 | 23 | public async Task GetUserInfoAsync(IEventBus eventBus, [FromQuery] Guid userId) 24 | { 25 | var query = new UserQuery(); 26 | query.UserIds.Add(userId); 27 | await eventBus.PublishAsync(query); 28 | return Results.Ok(query.Result.FirstOrDefault() ?? new()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Services/OssService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Services; 5 | 6 | public class OssService : ServiceBase 7 | { 8 | public OssService() : base(ConstStrings.OSS_API) 9 | { 10 | RouteHandlerBuilder = builder => 11 | { 12 | builder.RequireAuthorization(); 13 | }; 14 | } 15 | 16 | public async Task GetSecurityTokenAsync([FromServices] IObjectStorageClient client, [FromServices] IOptions ossOptions) 17 | { 18 | var region = "oss-cn-hangzhou"; 19 | var response = client.GetSecurityToken(); 20 | var stsToken = response.SessionToken; 21 | var accessId = response.AccessKeyId; 22 | var accessSecret = response.AccessKeySecret; 23 | var bucket = ossOptions.Value.Bucket; 24 | return await Task.FromResult(new SecurityTokenDto(region, accessId, accessSecret, stsToken, bucket)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/Services/PMService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Server.Services; 5 | 6 | public class PMService : ServiceBase 7 | { 8 | public PMService() : base(ConstStrings.PM_API) 9 | { 10 | RouteHandlerBuilder = builder => 11 | { 12 | builder.RequireAuthorization(); 13 | }; 14 | } 15 | 16 | public async Task GetProjectListAsync(IEventBus eventBus, Guid? teamId, string environment = "") 17 | { 18 | var query = new ProjectQuery(teamId, environment); 19 | await eventBus.PublishAsync(query); 20 | return Results.Ok(query.Result); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/appsettings.Develop.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error", 5 | "Masa.Scheduler.Contracts.Server.Infrastructure.Logger": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "PmClient": { 10 | "Url": "https://pm-service-dev.masastack.com/" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error", 5 | "Masa.Scheduler.Contracts.Server.Infrastructure.Logger": "Information" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/appsettings.Staging.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error", 5 | "Masa.Scheduler.Contracts.Server.Infrastructure.Logger": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error", 5 | "Masa.Scheduler.Contracts.Server.Infrastructure.Logger": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Worker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM registry.cn-hangzhou.aliyuncs.com/masa/dotnet_sdk:6.0.100 AS publish 2 | WORKDIR /src 3 | COPY . . 4 | ENV CSPROJ="src/Services/Masa.Scheduler.Services.Worker/Masa.Scheduler.Services.Worker.csproj" 5 | RUN dotnet restore $CSPROJ && dotnet publish $CSPROJ -c Release -o /app/publish 6 | 7 | ENV CSPROJ="src/Shells/Masa.Scheduler.Shells.JobShell/Masa.Scheduler.Shells.JobShell.csproj" 8 | RUN dotnet restore $CSPROJ && dotnet publish $CSPROJ -c Release -o /app/publish/JobShell 9 | 10 | FROM registry.cn-hangzhou.aliyuncs.com/masa/dotnet_aspnet:6.0.0 11 | RUN sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /etc/ssl/openssl.cnf 12 | RUN sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /usr/lib/ssl/openssl.cnf 13 | WORKDIR /app 14 | COPY --from=publish /app/publish . 15 | ENV ASPNETCORE_URLS=http://0.0.0.0:80 16 | EXPOSE 80 17 | ENTRYPOINT ["dotnet", "Masa.Scheduler.Services.Worker.dll"] 18 | 19 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Worker/Domain/Managers/Workers/Data/SchedulerWorkerManagerData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Worker.Domain.Managers.Workers.Data; 5 | 6 | public class SchedulerWorkerManagerData : BaseSchedulerManagerData 7 | { 8 | public List StopTask { get; set; } = new List(); 9 | public ConcurrentDictionary> TaskQueue { get; set; } = new(); 10 | 11 | public ConcurrentDictionary TaskCancellationTokenSources = new(); 12 | 13 | public ConcurrentDictionary InternalCancellationTokenSources = new(); 14 | } 15 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Worker/Domain/Managers/Workers/Data/TaskRunModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Worker.Domain.Managers.Workers.Data; 5 | 6 | public class TaskRunModel 7 | { 8 | public Guid TaskId { get; set; } 9 | 10 | public DateTimeOffset ExcuteTime { get; set; } 11 | 12 | public SchedulerJobDto Job { get; set; } = default!; 13 | 14 | public string ServiceId { get; set; } = string.Empty; 15 | 16 | public string? TraceId { get; set; } 17 | 18 | public string? SpanId { get; set; } 19 | } 20 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Worker/Domain/Managers/Workers/SchedulerWorkerManagerServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Worker.Managers.Workers; 5 | 6 | public static class SchedulerWorkerManagerServiceCollectionExtensions 7 | { 8 | public static IServiceCollection AddWorkerManager(this IServiceCollection services) 9 | { 10 | services.AddScoped(); 11 | services.AddTransient(); 12 | services.AddTransient(); 13 | services.AddTransient(); 14 | services.AddTransient(); 15 | services.AddSingleton(); 16 | services.AddHostedService(); 17 | services.AddScoped(); 18 | return services; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Worker/Domain/Managers/Workers/TaskHandlers/ITaskHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Worker.Domain.Managers.Workers.TaskHandlers; 5 | 6 | public interface ITaskHandler 7 | { 8 | Task RunTask(Guid taskId, SchedulerJobDto schedulerJobDto, DateTimeOffset excuteTime, string? traceId, string? spanId, CancellationToken token); 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Worker/Infrastructure/Extensions/MasaDbContextBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Worker.Infrastructure.Extensions; 5 | 6 | public static class MasaDbContextBuilderExtensions 7 | { 8 | public static MasaDbContextBuilder UseDbSql(this MasaDbContextBuilder builder, string dbType) 9 | { 10 | switch (dbType) 11 | { 12 | case "PostgreSql": 13 | builder.UseNpgsql(); 14 | break; 15 | default: 16 | builder.UseSqlServer(); 17 | break; 18 | } 19 | return builder; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Worker/Infrastructure/SchedulerDbContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Services.Worker.Infrastructure; 5 | 6 | public class SchedulerDbContext : MasaDbContext 7 | { 8 | public const string WORKER_SCHEMA = "woker"; 9 | 10 | public SchedulerDbContext(MasaDbContextOptions options) : base(options) 11 | { 12 | } 13 | 14 | protected override void OnConfiguring(MasaDbContextOptionsBuilder optionsBuilder) 15 | { 16 | optionsBuilder.DbContextOptionsBuilder 17 | .LogTo(Console.WriteLine, LogLevel.Warning) 18 | .EnableSensitiveDataLogging() 19 | .EnableDetailedErrors(); 20 | } 21 | 22 | protected override void OnModelCreatingExecuting(ModelBuilder builder) 23 | { 24 | builder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly()); 25 | base.OnModelCreatingExecuting(builder); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Worker/appsettings.Develop.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error", 5 | "Masa.Scheduler.Contracts.Server.Infrastructure.Logger": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Worker/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error", 5 | "Masa.Scheduler.Contracts.Server.Infrastructure.Logger": "Information", 6 | "SchedulerInternalLog": "Information", 7 | "Masa.Contrib.StackSdks.Scheduler": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Worker/appsettings.Staging.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error", 5 | "Masa.Scheduler.Contracts.Server.Infrastructure.Logger": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /src/Services/Masa.Scheduler.Services.Worker/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error", 5 | "Masa.Scheduler.Contracts.Server.Infrastructure.Logger": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /src/Shells/Masa.Scheduler.Shells.JobShell.Shared/Masa.Scheduler.Shells.JobShell.Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | enable 5 | enable 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Shells/Masa.Scheduler.Shells.JobShell.Shared/RunResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Shells.JobShell.Shared; 5 | 6 | public class RunResult 7 | { 8 | public Guid TaskId { get; set; } 9 | 10 | public bool IsSuccess { get; set; } 11 | 12 | public string Message { get; set; } = string.Empty; 13 | 14 | public object? MethodResult { get; set; } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/Shells/Masa.Scheduler.Shells.JobShell.Shared/_Imports.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | global using System.Text; 5 | -------------------------------------------------------------------------------- /src/Shells/Masa.Scheduler.Shells.JobShell/Masa.Scheduler.Shells.JobShell.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Shells/Masa.Scheduler.Shells.JobShell/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | var builder = WebApplication.CreateBuilder(); 5 | Debug.WriteLine(string.Join("@", args)); 6 | var cmd = args.ToShellCommand(); 7 | if (cmd == null) 8 | throw new ArgumentNullException(nameof(ShellCommandModel)); 9 | 10 | Debug.WriteLine(cmd.ToString()); 11 | ShellHelper.UseOpenTelemtry(builder, cmd.Value); 12 | var app = builder.Build(); 13 | await ShellHelper.Execute(app.Services, cmd.Value); -------------------------------------------------------------------------------- /src/Shells/Masa.Scheduler.Shells.JobShell/_Imports.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | global using Masa.BuildingBlocks.StackSdks.Scheduler; 5 | global using Masa.BuildingBlocks.StackSdks.Scheduler.Model; 6 | global using Masa.Contrib.StackSdks.Tsc; 7 | global using Masa.Scheduler.Shells.JobShell; 8 | global using Masa.Scheduler.Shells.JobShell.Shared; 9 | global using Microsoft.AspNetCore.Builder; 10 | global using Microsoft.Extensions.Configuration; 11 | global using Microsoft.Extensions.DependencyInjection; 12 | global using Microsoft.Extensions.Logging; 13 | global using OpenTelemetry; 14 | global using OpenTelemetry.Logs; 15 | global using OpenTelemetry.Resources; 16 | global using OpenTelemetry.Trace; 17 | global using System.Diagnostics; 18 | global using System.Reflection; 19 | global using System.Text.Json; 20 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/Certificates/7348307__lonsid.cn.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin.Server/Certificates/7348307__lonsid.cn.pfx -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM registry.cn-hangzhou.aliyuncs.com/masa/dotnet_sdk:6.0.403 AS publish 2 | WORKDIR /src 3 | COPY . . 4 | # ENV CSPROJ="src/Web/Masa.Scheduler.Web.Admin.Server/Masa.Scheduler.Web.Admin.Server.csproj" 5 | # RUN cd src/Web/Masa.Scheduler.Web.Admin.Server&& dotnet restore $CSPROJ && dotnet publish $CSPROJ -c Release -o /app/publish 6 | RUN cd src/Web/Masa.Scheduler.Web.Admin.Server && dotnet restore && dotnet publish -c Release -o /app/publish 7 | 8 | FROM registry.cn-hangzhou.aliyuncs.com/masa/dotnet_aspnet:6.0.4 9 | WORKDIR /app 10 | COPY --from=publish /app/publish . 11 | ENV ASPNETCORE_URLS=https://0.0.0.0:443 12 | EXPOSE 80 13 | EXPOSE 443 14 | ENTRYPOINT ["dotnet", "Masa.Scheduler.Web.Admin.Server.dll"] 15 | 16 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/Masa.Scheduler.Web.Admin.Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | enable 5 | enable 6 | 4f06bd7b-ed7c-4fc6-ab7c-a8358917f172 7 | Linux 8 | ..\..\.. 9 | false 10 | false 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | PreserveNewest 20 | 21 | 22 | 23 | 24 | 25 | PreserveNewest 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.AspNetCore.Mvc.RazorPages; 6 | using System.Diagnostics; 7 | 8 | namespace Masa.Scheduler.Web.Admin.Pages; 9 | 10 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 11 | [IgnoreAntiforgeryToken] 12 | public class ErrorModel : PageModel 13 | { 14 | public string? RequestId { get; set; } 15 | 16 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 17 | 18 | private readonly ILogger _logger; 19 | 20 | public ErrorModel(ILogger logger) 21 | { 22 | _logger = logger; 23 | } 24 | 25 | public void OnGet() 26 | { 27 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/Pages/Login.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model Masa.Scheduler.Web.Admin.Server.Pages.LoginModel 3 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/Pages/Login.cshtml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | using Microsoft.AspNetCore.Authentication; 5 | using Microsoft.AspNetCore.Authentication.OpenIdConnect; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | 9 | namespace Masa.Scheduler.Web.Admin.Server.Pages; 10 | 11 | public class LoginModel : PageModel 12 | { 13 | public async Task OnGetAsync(string redirectUri) 14 | { 15 | // just to remove compiler warning 16 | await Task.CompletedTask; 17 | 18 | if (string.IsNullOrWhiteSpace(redirectUri)) 19 | { 20 | redirectUri = Url.Content("~/"); 21 | } 22 | 23 | // If user is already logged in, we can redirect directly... 24 | if (HttpContext.User.Identity != null && HttpContext.User.Identity.IsAuthenticated) 25 | { 26 | Response.Redirect(redirectUri); 27 | } 28 | 29 | return Challenge( 30 | new AuthenticationProperties 31 | { 32 | RedirectUri = redirectUri 33 | }, 34 | OpenIdConnectDefaults.AuthenticationScheme); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/Pages/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model Masa.Scheduler.Web.Admin.Server.Pages.LogoutModel 3 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/Pages/Logout.cshtml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | using Microsoft.AspNetCore.Authentication; 5 | using Microsoft.AspNetCore.Authentication.Cookies; 6 | using Microsoft.AspNetCore.Authentication.OpenIdConnect; 7 | using Microsoft.AspNetCore.Mvc; 8 | using Microsoft.AspNetCore.Mvc.RazorPages; 9 | 10 | namespace Masa.Scheduler.Web.Admin.Server.Pages; 11 | 12 | public class LogoutModel : PageModel 13 | { 14 | public async Task OnGetAsync() 15 | { 16 | if (User.Identity != null && User.Identity.IsAuthenticated == true) 17 | { 18 | // delete local authentication cookie 19 | await HttpContext.SignOutAsync(); 20 | } 21 | 22 | return SignOut( 23 | new AuthenticationProperties 24 | { 25 | RedirectUri = "/" 26 | }, 27 | OpenIdConnectDefaults.AuthenticationScheme, 28 | CookieAuthenticationDefaults.AuthenticationScheme); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace Masa.Scheduler.Web.Admin.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = "_Layout"; 6 | 7 | var tokens = new TokenProvider 8 | { 9 | AccessToken = await HttpContext.GetTokenAsync(OpenIdConnectParameterNames.AccessToken), 10 | RefreshToken = await HttpContext.GetTokenAsync(OpenIdConnectParameterNames.RefreshToken), 11 | IdToken = await HttpContext.GetTokenAsync(OpenIdConnectParameterNames.IdToken) 12 | }; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/_Imports.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | // System Namespaces 5 | global using System.Security.Cryptography.X509Certificates; 6 | 7 | // Microsoft Namespaces 8 | global using Microsoft.AspNetCore.Authentication; 9 | global using Microsoft.AspNetCore.Hosting.StaticWebAssets; 10 | global using Microsoft.Extensions.DependencyInjection; 11 | global using Microsoft.IdentityModel.Logging; 12 | global using Microsoft.IdentityModel.Protocols.OpenIdConnect; 13 | 14 | // MASA Stack Components 15 | global using Masa.Stack.Components; 16 | global using Masa.Stack.Components.Extensions.OpenIdConnect; 17 | 18 | // MASA Contrib Packages 19 | global using Masa.Contrib.StackSdks.Caller; 20 | global using Masa.Contrib.StackSdks.Config; 21 | global using Masa.Contrib.StackSdks.Tsc; 22 | 23 | // MASA Scheduler Specific 24 | global using Masa.Scheduler.ApiGateways.Caller; 25 | global using Masa.Scheduler.Contracts.Server.Infrastructure.SignalRClients; -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/appsettings.Develop.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/appsettings.Staging.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Error" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin.Server/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.Server/wwwroot/nav/nav.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Id": 1, 4 | "Title": "Team", 5 | "Icon": "mdi-account-multiple", 6 | "Children": [ 7 | ] 8 | }, 9 | { 10 | "Id": 2, 11 | "Title": "ResourceFiles", 12 | "Icon": "mdi-file-document-outline", 13 | "Href": "pages/resource" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/Masa.Scheduler.Web.Admin.WebAssembly.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | enable 5 | enable 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | using Masa.Scheduler.Web.Admin; 5 | using Masa.Scheduler.Web.Admin.WebAssembly; 6 | using Microsoft.AspNetCore.Components.Authorization; 7 | using Microsoft.AspNetCore.Components.Web; 8 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 9 | 10 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 11 | 12 | builder.Services.AddAuthorizationCore(); 13 | builder.Services.AddScoped(); 14 | 15 | await builder.Services.AddGlobalForWasmAsync(builder.HostEnvironment.BaseAddress); 16 | 17 | builder.RootComponents.Add(typeof(App), "#app"); 18 | builder.RootComponents.Add("head::after"); 19 | builder.Services.AddMasaBlazor(builder => 20 | { 21 | builder.UseTheme(option => 22 | { 23 | option.Primary = "#4318FF"; 24 | option.Accent = "#4318FF"; 25 | }); 26 | }); 27 | 28 | await builder.Build().RunAsync(); 29 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:65230/", 7 | "sslPort": 44316 8 | } 9 | }, 10 | "profiles": { 11 | "Masa.Scheduler.Web.Admin": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 18 | "applicationUrl": "https://localhost:7138;http://localhost:5138", 19 | "dotnetRunMessages": true 20 | }, 21 | "IIS Express": { 22 | "commandName": "IISExpress", 23 | "launchBrowser": true, 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | }, 27 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}" 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/TestAuthStateProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | using Microsoft.AspNetCore.Components.Authorization; 5 | using System.Security.Claims; 6 | 7 | namespace Masa.Scheduler.Web.Admin.WebAssembly; 8 | 9 | public class TestAuthStateProvider : AuthenticationStateProvider 10 | { 11 | public async override Task GetAuthenticationStateAsync() 12 | { 13 | var anonymous = new ClaimsIdentity(); 14 | return await Task.FromResult(new AuthenticationState(new ClaimsPrincipal(anonymous))); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/css/app.css: -------------------------------------------------------------------------------- 1 | #blazor-error-ui { 2 | background: lightyellow; 3 | bottom: 0; 4 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 5 | display: none; 6 | left: 0; 7 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 8 | position: fixed; 9 | width: 100%; 10 | z-index: 1000; 11 | } 12 | 13 | #blazor-error-ui .dismiss { 14 | cursor: pointer; 15 | position: absolute; 16 | right: 0.75rem; 17 | top: 0.5rem; 18 | } 19 | 20 | .modal-overlay { 21 | position: fixed; 22 | top: 0; 23 | bottom: 0; 24 | left: 0; 25 | right: 0; 26 | background-color: #F0F3FA; 27 | z-index: 2000; 28 | display: flex; 29 | align-items: center; 30 | justify-content: center; 31 | flex-direction: column; 32 | --sk-color: #4318FF; 33 | } 34 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/i18n/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "$Text": "English", 3 | "Dashboard": "Dashboard", 4 | "eCommerce": "eCommerce", 5 | "Analytics": "Analytics", 6 | "Apps": "Apps", 7 | "Shop": "Shop", 8 | "Details": "Details", 9 | "Order": "Order", 10 | "Todo": "Todo", 11 | "Invoice": "Invoice", 12 | "List": "List", 13 | "Preview": "Preview", 14 | "Edit": "Edit", 15 | "Add": "Add", 16 | "User": "User", 17 | "View": "View", 18 | "Pages": "Pages", 19 | "Auth": "Auth", 20 | "Login v1": "Login v1", 21 | "Login v2": "Login v2", 22 | "Not Authorized": "Not Authorized", 23 | "Register v1": "Register v1", 24 | "Register v2": "Register v2", 25 | "Forgot Password v1": "Forgot Password v1", 26 | "Forgot Password v2": "Forgot Password v2", 27 | "Reset Password v1": "Reset Password v1", 28 | "Reset Password v2": "Reset Password v2", 29 | "Others": "Others", 30 | "Account Settings": "Account Settings", 31 | "Favorite": "Favorite" 32 | } -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/i18n/supportedCultures.json: -------------------------------------------------------------------------------- 1 | [ 2 | "zh-CN", 3 | "en-US" 4 | ] 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/i18n/zh-CN.json: -------------------------------------------------------------------------------- 1 | { 2 | "$DefaultLanguage": "true", 3 | "$Text": "中文简体", 4 | "Dashboard": "仪表盘", 5 | "eCommerce": "电子商务", 6 | "Analytics": "分析", 7 | "Apps": "应用", 8 | "Shop": "购物", 9 | "Details": "商品详情", 10 | "Order": "订单", 11 | "Todo": "工作事项", 12 | "Invoice": "发票 ", 13 | "List": "列表", 14 | "Preview": "预览 ", 15 | "Edit": "编辑", 16 | "Add": "添加", 17 | "User": "用户", 18 | "View": "展示", 19 | "Pages": "页面", 20 | "Auth": "认证 ", 21 | "Login v1": "登录版本1", 22 | "Login v2": "登录版本2", 23 | "Not Authorized": "没有授权", 24 | "Register v1": "注册版本1", 25 | "Register v2": "注册版本2", 26 | "Forgot Password v1": "忘记密码版本1", 27 | "Forgot Password v2": "忘记密码版本2", 28 | "Reset Password v1": "重置密码版本1", 29 | "Reset Password v2": "重置密码版本2", 30 | "Others": "其他", 31 | "Account Settings": "账户设置", 32 | "Favorite": "收藏" 33 | } 34 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/analytics/json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/analytics/json.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/analytics/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/analytics/left.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/analytics/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/analytics/right.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/login/2873.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/login/2873.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/login/Gxwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/login/Gxwd.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/mainLayout/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/status/401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/status/401.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/status/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/status/404.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/status/500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin.WebAssembly/wwwroot/img/status/500.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/App.razor: -------------------------------------------------------------------------------- 1 |  2 | @inject TokenProvider TokenProvider 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | @code { 20 | [Parameter] 21 | public TokenProvider InitialState { get; set; } = null!; 22 | 23 | protected override Task OnInitializedAsync() 24 | { 25 | TokenProvider.AccessToken = InitialState.AccessToken; 26 | TokenProvider.RefreshToken = InitialState.RefreshToken; 27 | TokenProvider.IdToken = InitialState.IdToken; 28 | return base.OnInitializedAsync(); 29 | } 30 | } -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/AlarmRules/Validator/AlarmRuleItemViewModelValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Components.AlarmRules.Validator; 5 | 6 | public class AlarmRuleItemViewModelValidator : AbstractValidator 7 | { 8 | public AlarmRuleItemViewModelValidator(I18n i18n) 9 | { 10 | RuleFor(x => x.Expression).Required(); 11 | RuleFor(x => x.AlertSeverity).IsInEnum(); 12 | } 13 | } -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/AlarmRules/Validator/CheckFrequencyViewModelValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Components.AlarmRules.Validator; 5 | 6 | public class CheckFrequencyViewModelValidator : AbstractValidator 7 | { 8 | public CheckFrequencyViewModelValidator(I18n i18n) 9 | { 10 | RuleFor(x => x.Type).Required(); 11 | RuleFor(x => x.CronExpression).Required() 12 | .Must(x => CronExpression.IsValidExpression(x ?? string.Empty)) 13 | .When(x => x.Type == AlarmCheckFrequencyType.Cron); 14 | RuleFor(x => x.FixedInterval).SetValidator(new TimeIntervalViewModelValidator(i18n)) 15 | .When(x => x.Type == AlarmCheckFrequencyType.FixedInterval); 16 | } 17 | } -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/AlarmRules/Validator/LogMonitorItemViewModelValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Components.AlarmRules.Validator; 5 | 6 | public class LogMonitorItemViewModelValidator : AbstractValidator 7 | { 8 | public LogMonitorItemViewModelValidator(I18n i18n) 9 | { 10 | RuleFor(x => x.Field).Required(); 11 | RuleFor(x => x.Alias).Required(); 12 | } 13 | } -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/AlarmRules/Validator/SilenceCycleViewModelValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Components.AlarmRules.Validator; 5 | 6 | public class SilenceCycleViewModelValidator : AbstractValidator 7 | { 8 | public SilenceCycleViewModelValidator(I18n i18n) 9 | { 10 | RuleFor(x => x.TimeInterval).SetValidator(new TimeIntervalViewModelValidator(i18n)).When(x => x.Type == SilenceCycleType.Time); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/AlarmRules/Validator/TimeIntervalViewModelValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Components.AlarmRules.Validator; 5 | 6 | public class TimeIntervalViewModelValidator : AbstractValidator 7 | { 8 | public TimeIntervalViewModelValidator(I18n i18n) 9 | { 10 | RuleFor(x => x.IntervalTimeType).IsInEnum(); 11 | RuleFor(x => x.IntervalTime).InclusiveBetween(1, 59) 12 | .When(x => x.IntervalTimeType == TimeType.Minute); 13 | RuleFor(x => x.IntervalTime).InclusiveBetween(1, 23) 14 | .When(x => x.IntervalTimeType == TimeType.Hour); 15 | RuleFor(x => x.IntervalTime).InclusiveBetween(1, 31) 16 | .When(x => x.IntervalTimeType == TimeType.Day); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/AlarmRules/ViewModel/CheckFrequencyViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Components.AlarmRules.ViewModel; 5 | 6 | public class CheckFrequencyViewModel 7 | { 8 | public AlarmCheckFrequencyType Type { get; set; } 9 | 10 | public TimeIntervalViewModel FixedInterval { get; set; } = new TimeIntervalViewModel(); 11 | 12 | 13 | public string CronExpression { get; set; } = string.Empty; 14 | } 15 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/AlarmRules/ViewModel/SilenceCycleViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Components.AlarmRules.ViewModel; 5 | 6 | public class SilenceCycleViewModel 7 | { 8 | public SilenceCycleType Type { get; set; } 9 | 10 | public TimeIntervalViewModel TimeInterval { get; set; } = new TimeIntervalViewModel(); 11 | 12 | public int SilenceCycleValue { get; set; } 13 | } 14 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/AlarmRules/ViewModel/TimeIntervalViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Components.AlarmRules.ViewModel; 5 | 6 | public class TimeIntervalViewModel 7 | { 8 | public int IntervalTime { get; set; } 9 | 10 | public TimeType IntervalTimeType { get; set; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/AuditedInfo.razor: -------------------------------------------------------------------------------- 1 | @if (Audited.CreationTime != default) 2 | { 3 |
4 | @I18n.T("Creator"): @Audited.CreatorName 5 | @I18n.T("CreationTime"): @Audited.CreationTime.Add(JsInitVariables.TimezoneOffset).ToString(I18n.T("$DateTimeFormat")) 6 |
7 | } 8 | 9 | @if (Audited.ModificationTime != default) 10 | { 11 |
12 | @I18n.T("Modifier"): @Audited.ModifierName 13 | @I18n.T("ModificationTime"): @Audited.ModificationTime.Add(JsInitVariables.TimezoneOffset).ToString(I18n.T("$DateTimeFormat")) 14 |
15 | } 16 | 17 | @code { 18 | [Inject] 19 | public I18n I18n { get; set; } = default!; 20 | 21 | [Parameter] 22 | public AuditedEntityDto Audited { get; set; } = new(); 23 | 24 | [Inject] 25 | public JsInitVariables JsInitVariables { get; set; } = default!; 26 | } 27 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/AutoHeight.razor: -------------------------------------------------------------------------------- 1 | 
2 | @HeaderContent 3 |
4 | @AutoHeightContent 5 |
6 | @FooterContent 7 |
8 | 9 | 10 | @code { 11 | [Parameter] 12 | public RenderFragment? HeaderContent { get; set; } 13 | 14 | [Parameter] 15 | public RenderFragment? AutoHeightContent { get; set; } 16 | 17 | [Parameter] 18 | public RenderFragment? FooterContent { get; set; } 19 | 20 | [Parameter] 21 | public string AutoClass { get; set; } = ""; 22 | 23 | [Parameter] 24 | public string Class { get; set; } = ""; 25 | 26 | [Parameter] 27 | public bool Overflow { get; set; } 28 | } 29 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/DateTimeFormat.razor: -------------------------------------------------------------------------------- 1 | @inherits ProComponentBase 2 | 3 | @_valueFormatString 4 | 5 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/DefaultTitle.razor: -------------------------------------------------------------------------------- 1 | 
2 | @ChildContent 3 |
4 | 5 | @code { 6 | [Parameter] 7 | public RenderFragment? ChildContent { get; set; } 8 | 9 | [Parameter] 10 | public string Class { get; set; } = "mt-9 mb-6"; 11 | } 12 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/DefaultTooltip.razor: -------------------------------------------------------------------------------- 1 | mdi-help-circle-outline 2 | 3 | @code { 4 | [Parameter] 5 | public string Tooltip { get; set; } = string.Empty; 6 | 7 | [Parameter] 8 | public string Class { get; set; } = string.Empty; 9 | } 10 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/MenuTooltip.razor: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | mdi-help-circle-outline 9 | 10 | 11 | 12 | @((MarkupString)Tooltip) 13 | 14 | 15 | 16 | @code { 17 | [Parameter] 18 | public string Tooltip { get; set; } = string.Empty; 19 | 20 | [Parameter] 21 | public string Class { get; set; } = string.Empty; 22 | } 23 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/Tsc/ApmJwtBearaToken.razor: -------------------------------------------------------------------------------- 1 | @namespace Masa.Scheduler.Web.Admin.Components.Tsc 2 | 3 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/Tsc/ApmSamplePage.razor: -------------------------------------------------------------------------------- 1 | @namespace Masa.Scheduler.Web.Admin.Components.Tsc 2 | @inherits TscComponentBase 3 | 4 |
5 | mdi-page-first 6 | mdi-chevron-left 7 |
@Current of@Total
8 | mdi-chevron-right 9 | mdi-page-last 10 |
11 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/Tsc/ApmTraceView.razor.css: -------------------------------------------------------------------------------- 1 | .slide_in { 2 | animation-name: fadein; 3 | } 4 | 5 | .slide_out { 6 | animation-name: fadeout; 7 | transform: translateX(1100px); 8 | } 9 | 10 | .slide { 11 | position: fixed; 12 | z-index: 9; 13 | top: 96px; 14 | right: 0px; 15 | width: 1000px; 16 | height: calc(100vh - 96px); 17 | border: solid 1px #ccc; 18 | background-color: white; 19 | } 20 | 21 | .text-wrap { 22 | white-space: pre-line; 23 | line-height: 1.5rem; 24 | word-break: break-all; 25 | word-wrap: break-word 26 | } 27 | 28 | @keyframes fadein { 29 | 0% { 30 | opacity: 0; 31 | transform: translateX(1100px); 32 | } 33 | 34 | 100% { 35 | opacity: 1; 36 | transform: translateX(0px); 37 | } 38 | } 39 | 40 | @keyframes fadeout { 41 | 0% { 42 | opacity: 1; 43 | transform: translateX(0px); 44 | } 45 | 46 | 100% { 47 | opacity: 0; 48 | transform: translateX(1100px); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Components/Tsc/MonacoEditor.razor: -------------------------------------------------------------------------------- 1 | @namespace Masa.Scheduler.Web.Admin.Components.Tsc 2 | 3 |
4 |
5 |

JwtToken

6 |
7 | 8 |
-------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Data/Base/GlobalVariables.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Data.Base; 5 | 6 | public static class GlobalVariables 7 | { 8 | public const string DefaultRoute = "pages/resource"; 9 | } 10 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Data/Base/PagingData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Data.Base; 5 | 6 | public class PagingData where TEntity : class 7 | { 8 | public int PageIndex { get; private set; } 9 | 10 | public int PageSize { get; private set; } 11 | 12 | public long Count { get; private set; } 13 | 14 | public int PageCount => (int)Math.Ceiling(Count / (decimal)PageSize); 15 | 16 | public IEnumerable Items { get; private set; } 17 | 18 | public PagingData(int pageIndex, int pageSize, long count, IEnumerable items) 19 | { 20 | PageIndex = pageIndex; 21 | PageSize = pageSize; 22 | Count = count; 23 | Items = items; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Extensitions/I18nExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Blazor; 5 | 6 | internal static class TscI18nExtensions 7 | { 8 | public static string Team(this I18n? i18n, string key) 9 | { 10 | return i18n?.T("Team", key)!; 11 | } 12 | 13 | public static string Log(this I18n? i18n, string key) 14 | { 15 | return i18n?.T("Log", key)!; 16 | } 17 | 18 | public static string Trace(this I18n? i18n, string key) 19 | { 20 | return i18n?.T("Trace", key)!; 21 | } 22 | 23 | public static string Apm(this I18n? i18n, string key) 24 | { 25 | return i18n?.T("Apm", key)!; 26 | } 27 | 28 | public static string Dashboard(this I18n? i18n, string key) 29 | { 30 | return i18n?.T("Dashboard", key)!; 31 | } 32 | 33 | public static string TeamDashboard(this I18n? i18n, string key) 34 | { 35 | return i18n?.T("TeamDashboard", key)!; 36 | } 37 | 38 | public static string DateTimeRange(this I18n? i18n, string key) 39 | { 40 | return i18n?.T("DateTimeRange", key)!; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Global/ServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection; 5 | 6 | public static class ServiceCollectionExtensions 7 | { 8 | public static IServiceCollection AddGlobalForServer(this IServiceCollection services) 9 | { 10 | services.AddScoped(); 11 | return services; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Model/SideBarItem.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Model; 5 | 6 | public class SideBarItem 7 | { 8 | public StringNumber Identity { get; set; } = default!; 9 | 10 | public string Title { get; set; } = string.Empty; 11 | 12 | public bool IsProject { get; set; } 13 | 14 | public bool Expanded { get; set; } 15 | 16 | public List Children { get; set; } = new(); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Pages/SchedulerResources/AppResourceViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Pages.SchedulerResources; 5 | 6 | public class AppResourceViewModel 7 | { 8 | public string Name { get; set; } = string.Empty; 9 | 10 | public string Identity { get; set; } = string.Empty; 11 | 12 | public bool IsExpand { get; set; } 13 | 14 | public List Resources { get; set; } = new(); 15 | } 16 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Pages/SchedulerResources/Components/AddSchedulerResourceFiles.razor.css: -------------------------------------------------------------------------------- 1 | .upload-btn ::deep .m-input { 2 | opacity: 0; 3 | position: absolute; 4 | top: 0; 5 | left: 0; 6 | } 7 | 8 | .upload-btn ::deep .m-input__control { 9 | height: 100%; 10 | width: 100%; 11 | position: absolute; 12 | } 13 | 14 | .upload-btn ::deep .m-input__slot { 15 | height: 100%; 16 | width: 100%; 17 | } 18 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Pages/SchedulerResources/Components/SchedulerResourceFilesInformation.razor: -------------------------------------------------------------------------------- 1 | @inherits ProComponentBase 2 | 3 | 5 |
6 | 8 | 9 |
10 |
@Model.Name.Substring(0, Model.Name.LastIndexOf("."))
11 |
@Model.Name.Substring(Model.Name.LastIndexOf("."))
12 |
13 |
14 |
15 | 16 | @_description 17 |
18 | 19 |
-------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Pages/Tsc/ErrorDetail.razor.css: -------------------------------------------------------------------------------- 1 | .ex_title { 2 | } 3 | 4 | .ex_context, .ex_content_stacktrace { 5 | background: rgb(241, 244, 250); 6 | white-space: pre-line 7 | } 8 | 9 | .right-error-text { 10 | white-space: pre-line; 11 | line-height: 1.55rem; 12 | word-break:break-word 13 | } 14 | 15 | .my-table tr:nth-child(2n+1) { 16 | background: rgb(241, 244, 250); 17 | } 18 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Pages/Tsc/ErrorDetail.razor.js: -------------------------------------------------------------------------------- 1 | function autoHeight() { 2 | let table = document.getElementsByClassName("error-detail")[0]; 3 | if (!table) return; 4 | table = table.getElementsByTagName("table")[0]; 5 | if (!table) return; 6 | let parent = table?.parentNode; 7 | if (!table || !parent) return; 8 | let t = setTimeout(function () { 9 | parent.style.height = (table.offsetHeight + 10) + "px"; 10 | clearTimeout(t); 11 | }, 100) 12 | 13 | } 14 | 15 | export { autoHeight } -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Pages/Tsc/Trace/TimeLine.razor.css: -------------------------------------------------------------------------------- 1 | .time_line { 2 | cursor: pointer; 3 | border-bottom: solid 1px #ccc 4 | } 5 | 6 | .time_line:hover { 7 | background-color: #ddc 8 | } 9 | 10 | .time_line:hover .right_col { 11 | border-left: none; 12 | } 13 | 14 | time_line .left, time_line .right, .time_line .process { 15 | height: 16px; 16 | } 17 | 18 | /*.time_line .process { 19 | background-color: rgb(84, 179, 153); 20 | }*/ 21 | 22 | .time_line .left_col { 23 | width: 80px 24 | } 25 | 26 | .time_line .right_col { 27 | width: 20px; 28 | border-left: solid 1px #ccc 29 | } 30 | 31 | .time_line .name { 32 | overflow-y: hidden 33 | } -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Shared/EmptyLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 4 |
5 | @Body 6 |
7 |
-------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @inject NavigationManager Navigation 3 | @inject IMasaStackConfig MasaStackConfig 4 | 5 | 8 | @Body 9 | 10 | 11 | @code { 12 | [Inject] 13 | public IPopupService PopupService { get; set; } = default!; 14 | 15 | [Inject] 16 | public SchedulerServerCaller SchedulerServerCaller { get; set; } = default!; 17 | 18 | private readonly List _whiteUris = new() { "/job/task/*" }; 19 | 20 | private bool SignOut() 21 | { 22 | Navigation.NavigateTo("/Logout", true); 23 | return true; 24 | } 25 | } -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/Store/SchedulerJobsState.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) MASA Stack All rights reserved. 2 | // Licensed under the Apache License. See LICENSE.txt in the project root for license information. 3 | 4 | namespace Masa.Scheduler.Web.Admin.Store; 5 | 6 | public class SchedulerJobsState 7 | { 8 | public TaskRunStatus QueryStatus { get; set; } 9 | 10 | public string QueryJobName { get; set; } = string.Empty; 11 | 12 | public JobTypes QueryJobType { get; set; } 13 | 14 | public string QueryOrigin { get; set; } = string.Empty; 15 | 16 | public string ProjectIdentity { get; set; } = string.Empty; 17 | 18 | public JobCreateTypes JobCreateType { get; set; } = JobCreateTypes.Manual; 19 | } 20 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/i18n/supportedCultures.json: -------------------------------------------------------------------------------- 1 | [ 2 | "zh-CN", 3 | "en-US" 4 | ] 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/analytics/json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/analytics/json.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/analytics/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/analytics/left.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/analytics/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/analytics/right.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/login/2873.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/login/2873.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/login/Gxwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/login/Gxwd.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/mainLayout/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/status/401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/status/401.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/status/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/status/404.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/status/500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/status/500.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/upload/upload-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/upload/upload-active.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/upload/upload-complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/upload/upload-complete.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/upload/upload-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/upload/upload-error.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/upload/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/MASA.Scheduler/de8b61ca2c452c6eeaaeb1e4bccd90990f229b2e/src/Web/Masa.Scheduler.Web.Admin/wwwroot/img/upload/upload.png -------------------------------------------------------------------------------- /src/Web/Masa.Scheduler.Web.Admin/wwwroot/js/download-file.js: -------------------------------------------------------------------------------- 1 | window._blazorDownloadFile=function(url, filename) { 2 | const xhr = new XMLHttpRequest(); 3 | xhr.open('GET', url, true); 4 | xhr.responseType = 'blob'; 5 | xhr.onload = () => { 6 | if (xhr.status === 200) { 7 | var blob = xhr.response; 8 | if (window.navigator.msSaveOrOpenBlob) { 9 | navigator.msSaveBlob(blob, filename); 10 | } else { 11 | const link = document.createElement('a'); 12 | const body = document.querySelector('body'); 13 | 14 | link.href = window.URL.createObjectURL(blob); 15 | link.download = filename; 16 | link.style.display = 'none'; 17 | body.appendChild(link); 18 | 19 | link.click(); 20 | body.removeChild(link); 21 | 22 | window.URL.revokeObjectURL(link.href); 23 | } 24 | } 25 | }; 26 | xhr.send(); 27 | } 28 | --------------------------------------------------------------------------------