tape: ui - avoid changer status query in backup content panel

This commit is contained in:
Dietmar Maurer 2021-02-15 12:17:36 +01:00
parent 41a8db3576
commit 159100b944
2 changed files with 16 additions and 6 deletions

View File

@ -45,6 +45,11 @@ use crate::{
schema: MEDIA_POOL_NAME_SCHEMA,
optional: true,
},
"update-status": {
description: "Try to update tape library status (check what tapes are online).",
optional: true,
default: true,
},
},
},
returns: {
@ -56,17 +61,22 @@ use crate::{
},
)]
/// List pool media
pub async fn list_media(pool: Option<String>) -> Result<Vec<MediaListEntry>, Error> {
pub async fn list_media(
pool: Option<String>,
update_status: bool,
) -> Result<Vec<MediaListEntry>, Error> {
let (config, _digest) = config::media_pool::config()?;
let status_path = Path::new(TAPE_STATUS_DIR);
let catalogs = tokio::task::spawn_blocking(move || {
// update online media status
if let Err(err) = update_online_status(status_path) {
eprintln!("{}", err);
eprintln!("update online media status failed - using old state");
if update_status {
// update online media status
if let Err(err) = update_online_status(status_path) {
eprintln!("{}", err);
eprintln!("update online media status failed - using old state");
}
}
// test what catalog files we have
MediaCatalog::media_with_catalogs(status_path)

View File

@ -40,7 +40,7 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
loadContent: async function() {
let me = this;
let content_response = await PBS.Async.api2({
url: '/api2/extjs/tape/media/list',
url: '/api2/extjs/tape/media/list?update-status=false',
});
let data = {};