tape: add 'latest-only' property to backup job config
This commit is contained in:
parent
81678129fb
commit
21e3ed3449
@ -117,6 +117,8 @@ pub enum DeletableProperty {
|
||||
EjectMedia,
|
||||
/// Delete the export-media-set property
|
||||
ExportMediaSet,
|
||||
/// Delete the 'latest-only' property
|
||||
LatestOnly,
|
||||
}
|
||||
|
||||
#[api(
|
||||
|
@ -53,6 +53,11 @@ lazy_static! {
|
||||
type: bool,
|
||||
optional: true,
|
||||
},
|
||||
"latest-only": {
|
||||
description: "Backup latest snapshots only.",
|
||||
type: bool,
|
||||
optional: true,
|
||||
},
|
||||
comment: {
|
||||
optional: true,
|
||||
schema: SINGLE_LINE_COMMENT_SCHEMA,
|
||||
@ -77,6 +82,8 @@ pub struct TapeBackupJobConfig {
|
||||
#[serde(skip_serializing_if="Option::is_none")]
|
||||
export_media_set: Option<bool>,
|
||||
#[serde(skip_serializing_if="Option::is_none")]
|
||||
latest_only: Option<bool>,
|
||||
#[serde(skip_serializing_if="Option::is_none")]
|
||||
pub comment: Option<String>,
|
||||
#[serde(skip_serializing_if="Option::is_none")]
|
||||
pub schedule: Option<String>,
|
||||
|
@ -4,6 +4,7 @@ Ext.define('pbs-tape-backup-job-status', {
|
||||
'id', 'store', 'pool', 'drive', 'store', 'schedule', 'comment',
|
||||
{ name: 'eject-media', type: 'boolean' },
|
||||
{ name: 'export-media-set', type: 'boolean' },
|
||||
{ name: 'latest-only', type: 'boolean' },
|
||||
'next-run', 'last-run-upid', 'last-run-state', 'last-run-endtime',
|
||||
{
|
||||
name: 'duration',
|
||||
@ -214,6 +215,12 @@ Ext.define('PBS.config.TapeBackupJobView', {
|
||||
width: 60,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
header: gettext('Latest Only'),
|
||||
dataIndex: 'latest-only',
|
||||
renderer: Proxmox.Utils.format_boolean,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
header: gettext('Schedule'),
|
||||
dataIndex: 'schedule',
|
||||
|
@ -29,6 +29,14 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', {
|
||||
|
||||
items: {
|
||||
xtype: 'inputpanel',
|
||||
onGetValues: function(values) {
|
||||
let me = this;
|
||||
|
||||
if (values['export-media-set'] && !me.up('pbsTapeBackupJobEdit').isCreate) {
|
||||
Proxmox.Utils.assemble_field_data(values, { delete: 'eject-media' });
|
||||
}
|
||||
return values;
|
||||
},
|
||||
column1: [
|
||||
{
|
||||
xtype: 'pmxDisplayEditField',
|
||||
@ -76,7 +84,7 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', {
|
||||
deleteEmpty: '{!isCreate}',
|
||||
},
|
||||
listeners: {
|
||||
change1: function(cb, value) {
|
||||
change: function(cb, value) {
|
||||
let me = this;
|
||||
let eject = me.up('window').down('proxmoxcheckbox[name=eject-media]');
|
||||
if (value) {
|
||||
@ -94,6 +102,14 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', {
|
||||
deleteEmpty: '{!isCreate}',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldLabel: gettext('Latest Only'),
|
||||
xtype: 'proxmoxcheckbox',
|
||||
name: 'latest-only',
|
||||
cbind: {
|
||||
deleteEmpty: '{!isCreate}',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
columnB: [
|
||||
|
Loading…
Reference in New Issue
Block a user