Skip to content

Commit abf01dc

Browse files
committed
Schedule create and edit actions tested. Fixed some issues
1 parent 3c8b63a commit abf01dc

File tree

53 files changed

+1207
-1141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1207
-1141
lines changed

Syrna.QuartzAdmin.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Async/@EntryIndexedValue">False</s:String>
2121
<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Mutable/@EntryIndexedValue">False</s:String>
2222
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQL/@EntryIndexedValue">SQL</s:String>
23+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Blazorise/@EntryIndexedValue">True</s:Boolean>
2324
<s:Boolean x:Key="/Default/UserDictionary/Words/=Syrna/@EntryIndexedValue">True</s:Boolean>
2425
</wpf:ResourceDictionary>

demos/MainDemo/host/Syrna.QuartzAdmin.MainDemo.HttpApi.Host/AbpApplicationLocalizationAppService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public class AbpApplicationLocalizationAppService :
1414
ApplicationService,
1515
IAbpApplicationLocalizationAppService
1616
{
17-
protected IExternalLocalizationStore ExternalLocalizationStore { get; }
18-
protected AbpLocalizationOptions LocalizationOptions { get; }
17+
private IExternalLocalizationStore ExternalLocalizationStore { get; }
18+
private AbpLocalizationOptions LocalizationOptions { get; }
1919

2020
public AbpApplicationLocalizationAppService(
2121
IExternalLocalizationStore externalLocalizationStore,

demos/MainDemo/host/Syrna.QuartzAdmin.MainDemo.HttpApi.Host/SampleSchedulerListener.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ await UseQuartzJob(t, () =>
7171
}
7272
tb.WithIdentity(tk);
7373
tb.WithDescription(so.TriggerDescription ?? $"{t.Name}'s Trigger,full name is {t.FullName}");
74-
if (so.Priority > 0) tb.WithPriority(so.Priority);
74+
if (so.Priority > 0)
75+
{
76+
tb.WithPriority(so.Priority);
77+
}
78+
7579
return tb;
7680
}
7781
else
@@ -111,7 +115,9 @@ public async Task UseQuartzJob(Type t, IEnumerable<TriggerBuilder> triggerBuilde
111115
public async Task StartAsync(CancellationToken cancellationToken)
112116
{
113117
if (_scheduleJobs == null || !_scheduleJobs.Any())
118+
{
114119
return;
120+
}
115121

116122
foreach (var scheduleJob in _scheduleJobs)
117123
{

demos/MainDemo/src/Syrna.QuartzAdmin.MainDemo.Jobs/AutoJob.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Syrna.QuartzAdmin.MainDemo.Jobs
55
{
6-
[QuartzTrigger(5, "this is an job test", "_jobauto")]
6+
[QuartzTrigger(1, 0, "this is an job test", "_jobauto")]
77
public class AutoJob : IJob
88
{
99
public async Task CanFireIt()

demos/MainDemo/src/Syrna.QuartzAdmin.MainDemo.Jobs/AutoJob2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Syrna.QuartzAdmin.MainDemo.Jobs
77
{
8-
[QuartzTrigger(120, "this is an long job test", "_longjobauto")]
8+
[QuartzTrigger(2,0, "this is an long job test", "_longjobauto")]
99
public class AutoJob2 : IJob
1010
{
1111
private readonly ILogger<HelloJob> _logger;

demos/MainDemo/src/Syrna.QuartzAdmin.MainDemo.Jobs/HttpJob.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ public async Task Execute(IJobExecutionContext context)
8282

8383
HttpContent reqParam = null;
8484
if (!string.IsNullOrEmpty(parameters))
85+
{
8586
reqParam = new StringContent(parameters, Encoding.UTF8, Application.Json);
87+
}
8688

8789
HttpResponseMessage response = new HttpResponseMessage();
8890
logger.LogInformation("[{runInstanceId}]. Sending '{action}' request to specified url '{url}'.",

modules/src/Syrna.QuartzAdmin.Application.Contracts/Syrna/QuartzAdmin/DataMapItemModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ public bool IsSameKeyAsOriginal()
3030
public void SetValue(string value)
3131
{
3232
if (string.IsNullOrEmpty(value))
33-
return;
34-
33+
{
34+
return;
35+
}
36+
3537
switch (Type)
3638
{
3739
case DataMapType.Bool:

modules/src/Syrna.QuartzAdmin.Application.Contracts/Syrna/QuartzAdmin/Jobs/JobDetailModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Syrna.QuartzAdmin.Jobs
55
{
66
public class JobDetailModel
77
{
8-
[Required(ErrorMessage = "Job Name is required")]
8+
//[Required(ErrorMessage = "Job Name is required")]
99
public string Name { get; set; } = string.Empty;
1010

1111
public string Group { get; set; } = Constants.DEFAULT_GROUP;

modules/src/Syrna.QuartzAdmin.Application.Contracts/Syrna/QuartzAdmin/Scheduler/ISchedulerAppService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ public interface ISchedulerAppService : IApplicationService
3737
Task ResumeTrigger(string triggerName, string triggerGroup);
3838
Task TriggerJob(string jobName, string jobGroup);
3939
Task<bool> DeleteSchedule(ScheduleModel model);
40-
Task UpdateSchedule(Key oldJobKey, Key oldTriggerKey, JobDetailModel newJobModel, TriggerDetailModel newTriggerModel);
40+
Task UpdateSchedule(UpdateScheduleArgs args);
4141
Task<SchedulerMetaDataDto> GetMetadataAsync();
4242
Task<IList<KeyValuePair<string, int>>> GetScheduledJobSummary();
4343
Task PauseAllSchedules();
4444
Task ResumeAllSchedules();
4545
Task ShutdownScheduler();
4646
Task StartScheduler();
4747
Task StandbyScheduler();
48-
4948
}
5049
}

modules/src/Syrna.QuartzAdmin.Application.Contracts/Syrna/QuartzAdmin/Scheduler/ScheduleModel.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,22 @@ public string GetJobTypeShortName(int suggestedMaxLength = SHORT_JOBTYPE_NAME_MA
3939
if (JobType != null)
4040
{
4141
if (JobType.Length <= suggestedMaxLength)
42-
return JobType;
42+
{
43+
return JobType;
44+
}
4345

4446
var dotIndex = JobType.LastIndexOf('.');
4547
if (dotIndex < 0)
46-
return JobType;
48+
{
49+
return JobType;
50+
}
4751

4852
var className = JobType.Substring(dotIndex+1);
4953
var classNameLength = className.Length;
5054
if (classNameLength >= suggestedMaxLength)
51-
return className;
55+
{
56+
return className;
57+
}
5258

5359
var remainLength = suggestedMaxLength - classNameLength - 3;
5460
return $"{JobType[..remainLength]}...{className}";

0 commit comments

Comments
 (0)