diff --git a/otoroshi/javascript/src/components/DefaultSidebar.js b/otoroshi/javascript/src/components/DefaultSidebar.js index d257e058f9..21e399c576 100644 --- a/otoroshi/javascript/src/components/DefaultSidebar.js +++ b/otoroshi/javascript/src/components/DefaultSidebar.js @@ -314,6 +314,64 @@ function Block({ .filter((d) => d.display === undefined || d.display()) .map(({ title, link, icon }) => { const alreadyInShortcuts = !!shortcuts.find((s) => s === title.toLowerCase()); + if (link.indexOf('http') === 0) { + return ( + { + if (!addShortcutButton) { + writeStorage([...new Set([...shortcuts, title.toLowerCase()])]); + } + }}> +
+ +
+ {title} +
+
+ {addShortcutButton && ( + { + if (!alreadyInShortcuts && addShortcutButton) { + writeStorage([...new Set([...shortcuts, title.toLowerCase()])]); + e.preventDefault(); + e.stopPropagation(); + } + }} + /> + )} +
+ ); + } return ( )} - {!openedSidebar ? '' : title ? firstLetterUppercase(title) : firstLetterUppercase(path)} - + } + {path.indexOf('http') === 0 && + {' '} + + {!openedSidebar ? '' : title ? firstLetterUppercase(title) : firstLetterUppercase(path)} + + } , - action: () => (window.location.href = '/docs/index.html'), + action: () => (window.location.href = 'https://maif.github.io/otoroshi/manual/index.html'), }); options.push({ action: () => this.routeTo('/stats'),