]> git.proxmox.com Git - proxmox-backup.git/commitdiff
tape: ui - avoid changer status query in backup content panel
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 15 Feb 2021 11:17:36 +0000 (12:17 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 15 Feb 2021 11:17:36 +0000 (12:17 +0100)
src/api2/tape/media.rs
www/tape/BackupOverview.js

index 647cc7558e8c5f8fea636bf4c78cdcb46715fd09..2888aad1a2ec9b86617972d3e38c4c3f1de552f3 100644 (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)
index 36791a1d6805f611fafced8ec8255993f1784d85..c90d23d70c59c4eaaf297dbd6f72f0b805059826 100644 (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 = {};