mirror of
https://github.com/zadam/trilium.git
synced 2025-10-04 12:34:47 +08:00
chore(client): fix a table nesting issue
This commit is contained in:
parent
4dbc76790a
commit
c38bf09af0
1 changed files with 46 additions and 44 deletions
|
@ -37,53 +37,55 @@ export default function NoteInfoTab({ note }: TabContext) {
|
|||
<div className="note-info-widget">
|
||||
{note && (
|
||||
<table className="note-info-widget-table">
|
||||
<tr>
|
||||
<th>{t("note_info_widget.note_id")}:</th>
|
||||
<td>{note.noteId}</td>
|
||||
<th>{t("note_info_widget.created")}:</th>
|
||||
<td>{formatDateTime(metadata?.dateCreated)}</td>
|
||||
<th>{t("note_info_widget.modified")}:</th>
|
||||
<td>{formatDateTime(metadata?.dateModified)}</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>{t("note_info_widget.note_id")}:</th>
|
||||
<td>{note.noteId}</td>
|
||||
<th>{t("note_info_widget.created")}:</th>
|
||||
<td>{formatDateTime(metadata?.dateCreated)}</td>
|
||||
<th>{t("note_info_widget.modified")}:</th>
|
||||
<td>{formatDateTime(metadata?.dateModified)}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>{t("note_info_widget.type")}:</th>
|
||||
<td>
|
||||
<span class="note-info-type">{note.type}</span>{' '}
|
||||
{ note.mime && <span class="note-info-mime">({note.mime})</span> }
|
||||
</td>
|
||||
<tr>
|
||||
<th>{t("note_info_widget.type")}:</th>
|
||||
<td>
|
||||
<span class="note-info-type">{note.type}</span>{' '}
|
||||
{ note.mime && <span class="note-info-mime">({note.mime})</span> }
|
||||
</td>
|
||||
|
||||
<th title={t("note_info_widget.note_size_info")}>{t("note_info_widget.note_size")}:</th>
|
||||
<td colSpan={3}>
|
||||
{!isLoading && !noteSizeResponse && !subtreeSizeResponse && (
|
||||
<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);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<th title={t("note_info_widget.note_size_info")}>{t("note_info_widget.note_size")}:</th>
|
||||
<td colSpan={3}>
|
||||
{!isLoading && !noteSizeResponse && !subtreeSizeResponse && (
|
||||
<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>
|
||||
<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>
|
||||
|
|
Loading…
Add table
Reference in a new issue