Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 14 additions & 23 deletions projects/swimlane/ngx-cron/src/lib/ngx-cron.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
@if (_allowedPeriods.length > 1) {
<div>
<div class="period-selection">
@for (key of _allowedPeriods; track key) {
<ngx-button
class="btn"
Expand All @@ -23,8 +23,7 @@
</span>
}
@if (cronData.period === 'Hourly') {
<span>
At
<span>At</span>
<ngx-input
type="number"
[(ngModel)]="cronData.minute"
Expand All @@ -33,19 +32,18 @@
min="0"
max="59"
[disabled]="disabled"
[withHint]="false"
>
</ngx-input>
<span [ngPlural]="cronData.minute">
<ng-template ngPluralCase="=1">minute</ng-template>
<ng-template ngPluralCase="other">minutes</ng-template>
</span>
past the hour
</span>
<span>past the hour</span>
}

@if (cronData.period === 'Secondly') {
<span class="every">
Every
<span>Every</span>
<ngx-input
type="number"
[ngModel]="cronData.secondInterval"
Expand All @@ -54,17 +52,16 @@
min="1"
max="59"
[disabled]="disabled"
[withHint]="false"
>
</ngx-input>
<span [ngPlural]="cronData.secondInterval">
<ng-template ngPluralCase="=1">second</ng-template>
<ng-template ngPluralCase="other">seconds</ng-template>
</span>
</span>
}
@if (cronData.period === 'Minutely') {
<span class="every">
Every
<span>Every</span>
<ngx-input
type="number"
[ngModel]="cronData.minuteInterval"
Expand All @@ -73,23 +70,21 @@
min="1"
max="59"
[disabled]="disabled"
[withHint]="false"
>
</ngx-input>
<span [ngPlural]="cronData.minuteInterval">
<ng-template ngPluralCase="=1">minute</ng-template>
<ng-template ngPluralCase="other">minutes</ng-template>
</span>
</span>
}
@if (
cronData.period === 'Daily' ||
cronData.period === 'Weekly' ||
cronData.period === 'Monthly' ||
cronData.period === 'Yearly'
) {
<span
>
At
<span>At</span>
<ngx-date-time
[ngModel]="time"
(ngModelChange)="onValueChange($event)"
Expand All @@ -102,26 +97,24 @@
(dateTimeSelected)="onDateTimeSelected($event)"
>
</ngx-date-time>
</span>
}
@if (cronData.period === 'Monthly' || cronData.period === 'Yearly') {
<span
>, on day
<span>, on day</span>
<ngx-input
type="number"
[(ngModel)]="cronData.day"
(change)="cronDataChanged()"
min="1"
[max]="cronData.period === 'Yearly' ? cronData.daysMax : 31"
[disabled]="disabled"
[withHint]="false"
>
</ngx-input>
of the month
</span>
<span>of the month</span>
}
@if (cronData.period === 'Yearly') {
<span
>, only in
>, only in</span>
<ngx-select
class="ngx-scroll"
[filterable]="false"
Expand All @@ -135,11 +128,10 @@
<ngx-select-option [name]="month" [value]="month"></ngx-select-option>
}
</ngx-select>
</span>
}
@if (cronData.period === 'Weekly') {
<span>
, only on
, only on</span>
<ngx-select
[filterable]="false"
[forceDownwardOpening]="true"
Expand All @@ -152,7 +144,6 @@
<ngx-select-option [name]="day" [value]="day"></ngx-select-option>
}
</ngx-select>
</span>
}
</div>
@if (!cronData.valid && cronData.period !== 'Custom') {
Expand Down
12 changes: 9 additions & 3 deletions projects/swimlane/ngx-cron/src/lib/ngx-cron.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,26 @@ ngx-cron-input {

.ngx-button {
padding: 0.35rem;
margin-right: 5px;
font-size: 0.8em;
}

.period-selection,
.period-selection {
display: flex;
flex-wrap: wrap;
gap: 5px;
}

.selections {
margin-top: 16px;
height: 70px;
display: flex;
flex-direction: column;

.date-selection {
display: inline-block;
display: inline-flex;
align-items: baseline;
flex-wrap: wrap;
gap: 5px;
}
}

Expand Down
Loading