ui: add help tool to datastore panel

This commit is contained in:
Dietmar Maurer 2020-11-10 09:15:12 +01:00
parent d89f91b538
commit 31112c79ac
3 changed files with 28 additions and 0 deletions

View File

@ -224,6 +224,30 @@ Ext.define('PBS.Utils', {
Proxmox.Utils.format_size(val), Proxmox.Utils.format_size(max)) + ')'; 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() { constructor: function() {
var me = this; var me = this;

View File

@ -203,6 +203,8 @@ Ext.define('PBS.datastore.DataStores', {
border: false, border: false,
}, },
tools: [PBS.Utils.get_help_tool("datastore_intro")],
items: [ items: [
{ {
xtype: 'pbsDataStoreList', xtype: 'pbsDataStoreList',

View File

@ -34,6 +34,8 @@ Ext.define('PBS.DataStorePanel', {
border: false, border: false,
}, },
tools: [PBS.Utils.get_help_tool("datastore_intro")],
items: [ items: [
{ {
xtype: 'pbsDataStoreSummary', xtype: 'pbsDataStoreSummary',