]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: add help tool to datastore panel
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 10 Nov 2020 08:15:12 +0000 (09:15 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 10 Nov 2020 08:15:12 +0000 (09:15 +0100)
www/Utils.js
www/datastore/DataStoreList.js
www/datastore/Panel.js

index a84ef664bcfbe49ad13496e622e6c148152188f2..4fae705ca1a7a8f74df096302fd694203c5a378b 100644 (file)
@@ -224,6 +224,30 @@ Ext.define('PBS.Utils', {
            Proxmox.Utils.format_size(val), Proxmox.Utils.format_size(max)) + ')';
     },
 
+    get_help_tool: function(blockid) {
+
+       let info = Proxmox.Utils.get_help_info(blockid);
+       if (info === undefined) {
+           info = Proxmox.Utils.get_help_info('pbs_documentation_index');
+       }
+       if (info === undefined) {
+           throw "get_help_info failed"; // should not happen
+       }
+
+       let docsURI = window.location.origin + info.link;
+       let title = info.title;
+       if (info.subtitle) {
+           title += ' - ' + info.subtitle;
+       }
+       return {
+           type: 'help',
+           tooltip: title,
+           handler: function() {
+               window.open(docsURI);
+           }
+        };
+    },
+
     constructor: function() {
        var me = this;
 
index 71dd5fdb461fbb696ed50b64742169abc2bac974..12d311a62b4f0d62b2e8cd2ce7ee51a25f73d3dc 100644 (file)
@@ -203,6 +203,8 @@ Ext.define('PBS.datastore.DataStores', {
        border: false,
     },
 
+    tools: [PBS.Utils.get_help_tool("datastore_intro")],
+
     items: [
        {
            xtype: 'pbsDataStoreList',
index bca663e83420244c34a5f38bb66b8453201b8710..f0d1317ca70d944eb7d823eda67b757e550ba25d 100644 (file)
@@ -34,6 +34,8 @@ Ext.define('PBS.DataStorePanel', {
        border: false,
     },
 
+    tools: [PBS.Utils.get_help_tool("datastore_intro")],
+
     items: [
        {
            xtype: 'pbsDataStoreSummary',