mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
image notes can't be updated + minor visual tweaks
This commit is contained in:
parent
6749cbed1b
commit
39b3c91abf
14
db/migrations/0116__add_indexes.sql
Normal file
14
db/migrations/0116__add_indexes.sql
Normal file
@ -0,0 +1,14 @@
|
||||
create index IDX_links_noteId_index
|
||||
on links (noteId);
|
||||
|
||||
create index IDX_links_targetNoteId_index
|
||||
on links (targetNoteId);
|
||||
|
||||
create index IDX_attributes_name_index
|
||||
on attributes (name);
|
||||
|
||||
create index IDX_attributes_noteId_index
|
||||
on attributes (noteId);
|
||||
|
||||
create index IDX_attributes_value_index
|
||||
on attributes (value);
|
@ -19,8 +19,8 @@ async function show() {
|
||||
|
||||
$component.show();
|
||||
|
||||
$fileName.text(attributeMap.originalFileName);
|
||||
$fileSize.text(attributeMap.fileSize + " bytes");
|
||||
$fileName.text(attributeMap.originalFileName || "?");
|
||||
$fileSize.text((attributeMap.fileSize || "?") + " bytes");
|
||||
$fileType.text(currentNote.mime);
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,8 @@ async function show() {
|
||||
|
||||
$component.show();
|
||||
|
||||
$fileName.text(attributeMap.originalFileName);
|
||||
$fileSize.text(attributeMap.fileSize + " bytes");
|
||||
$fileName.text(attributeMap.originalFileName || "?");
|
||||
$fileSize.text((attributeMap.fileSize || "?") + " bytes");
|
||||
$fileType.text(currentNote.mime);
|
||||
|
||||
$imageView.prop("src", `/api/images/${currentNote.noteId}/${currentNote.title}`);
|
||||
|
@ -275,8 +275,8 @@ async function updateNote(noteId, noteUpdates) {
|
||||
throw new Error(`Note ${noteId} is not available for change!`);
|
||||
}
|
||||
|
||||
if (note.type === 'file') {
|
||||
// for update file, newNote doesn't contain file payloads
|
||||
if (note.type === 'file' || note.type === 'image') {
|
||||
// files and images are immutable, they can't be updated
|
||||
noteUpdates.content = note.content;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div id="note-detail-file" class="note-detail-component">
|
||||
<table id="file-table">
|
||||
<tr>
|
||||
<th>File name:</th>
|
||||
<th>Original file name:</th>
|
||||
<td id="file-filename"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<div id="note-detail-image" class="note-detail-component">
|
||||
<strong>File name:</strong>
|
||||
<strong>Original file name:</strong>
|
||||
<span id="image-filename"></span>
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user