diff --git a/src/DirectoryBreadcrumbs.jsx b/src/DirectoryBreadcrumbs.jsx index 7cacefd..47e5074 100644 --- a/src/DirectoryBreadcrumbs.jsx +++ b/src/DirectoryBreadcrumbs.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import Button from 'react-bootstrap/Button'; +import Breadcrumb from 'react-bootstrap/Breadcrumb'; import { useHistory, useLocation } from 'react-router-dom'; -import { GoBackButton } from './uiutil'; +import { OverlayTrigger, Tooltip } from "react-bootstrap"; export function DirectoryBreadcrumbs() { const location = useLocation(); @@ -12,17 +12,29 @@ export function DirectoryBreadcrumbs() { breadcrumbs.unshift(state) } - return (<> - {breadcrumbs.length <= 1 && } + // TODO: get name of "snapshot"!!?? ##### + // TODO: no tooltip if no OID ##### + // TODO: enable copying of OID to clipboard ##### + // TODO: disable / improve wrapping of tooltip ##### + // TODO: there is some flickering if hovering changes ##### + // TODO: disable clicking on current breadcrumb item ##### + return ( + + Snapshots ##### { breadcrumbs.map((state, i) => { const index = breadcrumbs.length - i - 1 // revert index return ( - + OID: {state.oid}}> + history.go(-index)} + active={!index}> + {state.label} + + ); }) } - + ) } diff --git a/src/DirectoryObject.jsx b/src/DirectoryObject.jsx index a558e64..315591d 100644 --- a/src/DirectoryObject.jsx +++ b/src/DirectoryObject.jsx @@ -119,14 +119,7 @@ export class DirectoryObject extends Component { } return <> - - - -   - OID: {this.state.oid} - - -   + {this.state.mountInfo.path ? <> diff --git a/src/uiutil.jsx b/src/uiutil.jsx index 6be2279..a105145 100644 --- a/src/uiutil.jsx +++ b/src/uiutil.jsx @@ -92,7 +92,7 @@ export function rfc3339TimestampForDisplay(n) { export function objectLink(n, label, prevState) { if (n.startsWith("k") || n.startsWith("Ik")) { - return { pathname: "/snapshots/dir/" + n, state: { label, prevState } }; + return { pathname: "/snapshots/dir/" + n, state: { label, oid: n, prevState } }; } return "/api/v1/objects/" + n; }