mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 08:45:50 +01:00
Note info ribbon flex layout (#7678)
This commit is contained in:
@@ -42,7 +42,7 @@ div.promoted-attributes-container {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* The property label */
|
/* The property label */
|
||||||
.note-info-widget-table th,
|
.note-info-item > span:first-child,
|
||||||
.file-properties-widget .file-table th,
|
.file-properties-widget .file-table th,
|
||||||
.image-properties > div:first-child > span > strong {
|
.image-properties > div:first-child > span > strong {
|
||||||
opacity: 0.65;
|
opacity: 0.65;
|
||||||
@@ -50,7 +50,6 @@ div.promoted-attributes-container {
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.note-info-widget-table td,
|
|
||||||
.file-properties-widget .file-table td {
|
.file-properties-widget .file-table td {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,57 +36,58 @@ export default function NoteInfoTab({ note }: TabContext) {
|
|||||||
return (
|
return (
|
||||||
<div className="note-info-widget">
|
<div className="note-info-widget">
|
||||||
{note && (
|
{note && (
|
||||||
<table className="note-info-widget-table">
|
<>
|
||||||
<tbody>
|
<div className="note-info-item">
|
||||||
<tr>
|
<span>{t("note_info_widget.note_id")}:</span>
|
||||||
<th>{t("note_info_widget.note_id")}:</th>
|
<span className="note-info-id">{note.noteId}</span>
|
||||||
<td class="note-info-id">{note.noteId}</td>
|
</div>
|
||||||
<th>{t("note_info_widget.created")}:</th>
|
<div className="note-info-item">
|
||||||
<td>{formatDateTime(metadata?.dateCreated)}</td>
|
<span>{t("note_info_widget.created")}:</span>
|
||||||
<th>{t("note_info_widget.modified")}:</th>
|
<span>{formatDateTime(metadata?.dateCreated)}</span>
|
||||||
<td>{formatDateTime(metadata?.dateModified)}</td>
|
</div>
|
||||||
</tr>
|
<div className="note-info-item">
|
||||||
|
<span>{t("note_info_widget.modified")}:</span>
|
||||||
|
<span>{formatDateTime(metadata?.dateModified)}</span>
|
||||||
|
</div>
|
||||||
|
<div className="note-info-item">
|
||||||
|
<span>{t("note_info_widget.type")}:</span>
|
||||||
|
<span>
|
||||||
|
<span className="note-info-type">{note.type}</span>{' '}
|
||||||
|
{note.mime && <span className="note-info-mime">({note.mime})</span>}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="note-info-item">
|
||||||
|
<span title={t("note_info_widget.note_size_info")}>{t("note_info_widget.note_size")}:</span>
|
||||||
|
<span className="note-info-size-col-span">
|
||||||
|
{!isLoading && !noteSizeResponse && !subtreeSizeResponse && (
|
||||||
|
<Button
|
||||||
|
className="calculate-button"
|
||||||
|
icon="bx bx-calculator"
|
||||||
|
text={t("note_info_widget.calculate")}
|
||||||
|
onClick={() => {
|
||||||
|
setIsLoading(true);
|
||||||
|
setTimeout(async () => {
|
||||||
|
await Promise.allSettled([
|
||||||
|
server.get<NoteSizeResponse>(`stats/note-size/${note.noteId}`).then(setNoteSizeResponse),
|
||||||
|
server.get<SubtreeSizeResponse>(`stats/subtree-size/${note.noteId}`).then(setSubtreeSizeResponse)
|
||||||
|
]);
|
||||||
|
setIsLoading(false);
|
||||||
|
}, 0);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<tr>
|
<span className="note-sizes-wrapper">
|
||||||
<th>{t("note_info_widget.type")}:</th>
|
<span className="note-size">{formatSize(noteSizeResponse?.noteSize)}</span>
|
||||||
<td>
|
{" "}
|
||||||
<span class="note-info-type">{note.type}</span>{' '}
|
{subtreeSizeResponse && subtreeSizeResponse.subTreeNoteCount > 1 &&
|
||||||
{ note.mime && <span class="note-info-mime">({note.mime})</span> }
|
<span className="subtree-size">{t("note_info_widget.subtree_size", { size: formatSize(subtreeSizeResponse.subTreeSize), count: subtreeSizeResponse.subTreeNoteCount })}</span>
|
||||||
</td>
|
}
|
||||||
|
{isLoading && <LoadingSpinner />}
|
||||||
<th title={t("note_info_widget.note_size_info")}>{t("note_info_widget.note_size")}:</th>
|
</span>
|
||||||
<td colSpan={3}>
|
</span>
|
||||||
{!isLoading && !noteSizeResponse && !subtreeSizeResponse && (
|
</div>
|
||||||
<Button
|
</>
|
||||||
className="calculate-button"
|
|
||||||
style={{ padding: "0px 10px 0px 10px" }}
|
|
||||||
icon="bx bx-calculator"
|
|
||||||
text={t("note_info_widget.calculate")}
|
|
||||||
onClick={() => {
|
|
||||||
setIsLoading(true);
|
|
||||||
setTimeout(async () => {
|
|
||||||
await Promise.allSettled([
|
|
||||||
server.get<NoteSizeResponse>(`stats/note-size/${note.noteId}`).then(setNoteSizeResponse),
|
|
||||||
server.get<SubtreeSizeResponse>(`stats/subtree-size/${note.noteId}`).then(setSubtreeSizeResponse)
|
|
||||||
]);
|
|
||||||
setIsLoading(false);
|
|
||||||
}, 0);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<span className="note-sizes-wrapper">
|
|
||||||
<span class="note-size">{formatSize(noteSizeResponse?.noteSize)}</span>
|
|
||||||
{" "}
|
|
||||||
{subtreeSizeResponse && subtreeSizeResponse.subTreeNoteCount > 1 &&
|
|
||||||
<span class="subtree-size">{t("note_info_widget.subtree_size", { size: formatSize(subtreeSizeResponse.subTreeSize), count: subtreeSizeResponse.subTreeNoteCount })}</span>
|
|
||||||
}
|
|
||||||
{isLoading && <LoadingSpinner />}
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -160,17 +160,20 @@
|
|||||||
/* #region Note info */
|
/* #region Note info */
|
||||||
.note-info-widget {
|
.note-info-widget {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: baseline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.note-info-widget-table {
|
.note-info-item {
|
||||||
max-width: 100%;
|
display: flex;
|
||||||
display: block;
|
align-items: baseline;
|
||||||
overflow-x: auto;
|
padding-inline-end: 15px;
|
||||||
white-space: nowrap;
|
padding-block: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.note-info-widget-table td, .note-info-widget-table th {
|
.note-info-item > span:first-child {
|
||||||
padding: 5px;
|
padding-inline-end: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.note-info-mime {
|
.note-info-mime {
|
||||||
@@ -186,6 +189,10 @@
|
|||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
vertical-align: middle !important;
|
vertical-align: middle !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.note-info-widget .calculate-button {
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
/* #endregion */
|
/* #endregion */
|
||||||
|
|
||||||
/* #region Similar Notes */
|
/* #region Similar Notes */
|
||||||
|
|||||||
Reference in New Issue
Block a user