mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-03 13:30:25 +00:00
calendar event simulator: rename number parameter to iterations
in sync with the same option of `systemd-analyze calendar` and number is so generic. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
f493f5685d
commit
584a57ea3c
@ -47,7 +47,7 @@ __PACKAGE__->register_method({
|
||||
additionalProperties => 0,
|
||||
properties => {
|
||||
schedule => {
|
||||
description => "Backup schedule. The format is a subset of `systemd` calendar events.",
|
||||
description => "Job schedule. The format is a subset of `systemd` calendar events.",
|
||||
type => 'string', format => 'pve-calendar-event',
|
||||
maxLength => 128,
|
||||
},
|
||||
@ -56,8 +56,8 @@ __PACKAGE__->register_method({
|
||||
optional => 1,
|
||||
type => 'integer',
|
||||
},
|
||||
number => {
|
||||
description => "Number of timestamps to return.",
|
||||
iterations => {
|
||||
description => "Number of event-iteration to simulate and return.",
|
||||
optional => 1,
|
||||
type => 'integer',
|
||||
minimum => 1,
|
||||
@ -68,7 +68,7 @@ __PACKAGE__->register_method({
|
||||
},
|
||||
returns => {
|
||||
type => 'array',
|
||||
description => 'Contains the guest objects.',
|
||||
description => 'An array of the next <iterations> events since <starttime>.',
|
||||
items => {
|
||||
type => 'object',
|
||||
properties => {
|
||||
@ -87,14 +87,14 @@ __PACKAGE__->register_method({
|
||||
my ($param) = @_;
|
||||
|
||||
my $starttime = $param->{starttime} // time();
|
||||
my $number = $param->{number} // 10;
|
||||
my $iterations = $param->{iterations} // 10;
|
||||
my $schedule = $param->{schedule};
|
||||
|
||||
my $result = [];
|
||||
|
||||
my $event = PVE::CalendarEvent::parse_calendar_event($schedule);
|
||||
|
||||
for (my $count = 0; $count < $number; $count++) {
|
||||
for (my $count = 0; $count < $iterations; $count++) {
|
||||
my $next = PVE::CalendarEvent::compute_next_event($event, $starttime);
|
||||
push @$result, {
|
||||
timestamp => $next,
|
||||
|
@ -12,13 +12,13 @@ Ext.define('PVE.window.ScheduleSimulator', {
|
||||
if (!schedule) {
|
||||
return;
|
||||
}
|
||||
let number = me.lookup('number').getValue() || 10;
|
||||
let iterations = me.lookup('iterations').getValue() || 10;
|
||||
Proxmox.Utils.API2Request({
|
||||
url: '/cluster/jobs/schedule-analyze',
|
||||
method: 'GET',
|
||||
params: {
|
||||
schedule,
|
||||
number,
|
||||
iterations,
|
||||
},
|
||||
failure: function(response, opts) {
|
||||
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
||||
@ -71,8 +71,8 @@ Ext.define('PVE.window.ScheduleSimulator', {
|
||||
minValue: 1,
|
||||
maxValue: 100,
|
||||
value: 10,
|
||||
reference: 'number',
|
||||
fieldLabel: gettext('Number'),
|
||||
reference: 'iterations',
|
||||
fieldLabel: gettext('Iterations'),
|
||||
},
|
||||
{
|
||||
xtype: 'button',
|
||||
|
Loading…
Reference in New Issue
Block a user