diff --git a/public/static/css/white.css b/public/static/css/white.css index 5c3da5b..6ec8553 100644 --- a/public/static/css/white.css +++ b/public/static/css/white.css @@ -88,14 +88,20 @@ } .theme-default #breadcrumb { - padding: 1rem 0; width: 100%; } +.theme-default #breadcrumb .location-item { + margin: 0 0.5rem 0 0; + display: inline-block; + line-height: 3rem; +} + .theme-default #breadcrumb .item { - color: #697384; - margin-right: 1rem; + margin: 0 0.5rem 0 0; max-width: 6rem; + display: inline-block; + line-height: 3rem; } .theme-default #breadcrumb .content { @@ -106,9 +112,10 @@ display: block; } -.theme-default #breadcrumb .item { - color: #697384; - margin-right: 1rem; +.theme-default #space-used { + text-align: right; + line-height: 3rem; + font-size: 1.4rem; } .container { diff --git a/src/client/web/src/common/controls.ts b/src/client/web/src/common/controls.ts new file mode 100644 index 0000000..c3c691f --- /dev/null +++ b/src/client/web/src/common/controls.ts @@ -0,0 +1,7 @@ +export const settingsTabsCtrl = "settingsTabs"; +export const settingsDialogCtrl = "settingsDialog"; +export const sharingCtrl = "sharingCtrl"; +export const filesViewCtrl = "filesView"; +export const ctrlHidden = "hidden"; +export const ctrlOn = "on"; +export const ctrlOff = "off"; \ No newline at end of file diff --git a/src/client/web/src/components/layout/segments.tsx b/src/client/web/src/components/layout/segments.tsx new file mode 100644 index 0000000..317c396 --- /dev/null +++ b/src/client/web/src/components/layout/segments.tsx @@ -0,0 +1,43 @@ +import * as React from "react"; +import { List } from "immutable"; + +export interface Props { + id?: string; + children: List; + ratios: List; + dir: boolean; // true=left, false=right + className?: string; +} + +export const Segments = (props: Props) => { + let sum = 0; + props.ratios.forEach((ratio) => { + sum += Math.trunc(ratio); + }); + if (sum > 100) { + throw `segments: ratio sum(${sum}) > 100`; + } else if (props.children.size !== props.ratios.size) { + throw `segments: children size(${props.children.size}) != ratio size(${props.ratios.size})`; + } + + const children = props.children.map( + (child: React.ReactNode, i: number): React.ReactNode => { + const width = `${props.ratios.get(i, 0)}%`; + return ( +
+ {child} +
+ ); + } + ); + + return ( +
+
{children}
+
+
+ ); +}; diff --git a/src/client/web/src/components/panel_files.tsx b/src/client/web/src/components/panel_files.tsx index 4aec1bf..1127a6f 100644 --- a/src/client/web/src/components/panel_files.tsx +++ b/src/client/web/src/components/panel_files.tsx @@ -24,6 +24,7 @@ import { MetadataResp, roleVisitor, roleAdmin } from "../client"; import { Flexbox } from "./layout/flexbox"; import { Container } from "./layout/container"; import { Table, Cell, Head } from "./layout/table"; +import { Segments } from "./layout/segments"; import { Rows, Row } from "./layout/rows"; import { Up } from "../worker/upload_mgr"; import { UploadEntry, UploadState } from "../worker/interface"; @@ -734,15 +735,19 @@ export class FilesPanel extends React.Component { const breadcrumb = this.props.filesInfo.dirPath.map( (pathPart: string, key: number) => { return ( - + + + this.chdir(this.props.filesInfo.dirPath.slice(0, key + 1)) + } + className="item clickable" + > + {pathPart} + + + {"/"} + + ); } ); @@ -902,38 +907,30 @@ export class FilesPanel extends React.Component { /> - - , - , - ])} - childrenStyles={List([ - { flex: "0 0 auto" }, - { flex: "0 0 auto" }, - ])} - /> - , - - - {`${this.props.msg.pkg.get( - "browser.used" - )} ${usedSpace} / ${spaceLimit}`} - , +
+ + + {`${this.props.msg.pkg.get("breadcrumb.loc")}:`} + + + {breadcrumb} +
, +
{`${this.props.msg.pkg.get( + "browser.used" + )} ${usedSpace} / ${spaceLimit}`}
, ])} - childrenStyles={List([{}, { justifyContent: "flex-end" }])} + ratios={List([60, 40])} + dir={true} /> +
+ {view} diff --git a/src/client/web/src/i18n/en_US.ts b/src/client/web/src/i18n/en_US.ts index d980e8f..eb0705c 100644 --- a/src/client/web/src/i18n/en_US.ts +++ b/src/client/web/src/i18n/en_US.ts @@ -131,4 +131,5 @@ export const msgs: Map = Map({ "op.truncate": "Truncate", "op.submit": "Submit", "term.time": "Time", + "breadcrumb.loc": "Location", }); diff --git a/src/client/web/src/i18n/zh_CN.ts b/src/client/web/src/i18n/zh_CN.ts index 301a36c..8f2fc63 100644 --- a/src/client/web/src/i18n/zh_CN.ts +++ b/src/client/web/src/i18n/zh_CN.ts @@ -128,4 +128,5 @@ export const msgs: Map = Map({ "op.truncate": "清空", "op.submit": "提交", "term.time": "时间", + "breadcrumb.loc": "位置", });