diff --git a/data/config.toml b/data/config.toml index 495e309..9bd4a58 100644 --- a/data/config.toml +++ b/data/config.toml @@ -6,7 +6,7 @@ backend_port = 13956 [basic] title = "Pap" -log_level = "WARNING" +log_level = "INFO" [path] note_dir = "./data/note/" diff --git a/index.html b/index.html index de2c049..6941bb1 100644 --- a/index.html +++ b/index.html @@ -10,10 +10,10 @@
diff --git a/package.json b/package.json index b7098f8..9a0ec8f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pap", "private": true, - "version": "0.2.4", + "version": "0.2.5", "type": "module", "scripts": { "dev": "vite", diff --git a/scripts/pap.sh b/scripts/pap.sh index 618bca2..5da3329 100755 --- a/scripts/pap.sh +++ b/scripts/pap.sh @@ -54,9 +54,6 @@ if [ "$Update" = true ]; then mv ./PapPack/libmd_net.so ./libmd_net.so mv ./PapPack/requirements_release.txt ./requirements_release.txt - rm PapPack -r - rm PapPack.tar.gz - if [ -d ".venv" ]; then rm .venv -r fi diff --git a/src/api/note.ts b/src/api/note.ts index 81e5f52..f4c8f75 100644 --- a/src/api/note.ts +++ b/src/api/note.ts @@ -44,6 +44,7 @@ export class NoteApi extends BaseApi { public static async getNoteByTags(tagsId: TagSetSchema): Promise> { return new Promise(function (resolve, reject) { pFetch(`/note/get_note_by_tags`, { + method: 'POST', body: JSON.stringify(tagsId), }).then(async res => { const notes = await res.json() as Array; diff --git a/src/components/Markdown/MdTip.vue b/src/components/Markdown/MdTip.vue deleted file mode 100644 index c376d43..0000000 --- a/src/components/Markdown/MdTip.vue +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/Middlebar/Note.vue b/src/components/Middlebar/Note.vue index 61be8b7..05a4c01 100644 --- a/src/components/Middlebar/Note.vue +++ b/src/components/Middlebar/Note.vue @@ -23,11 +23,11 @@ tagStore.$onAction( name: name, after: after, }) => { - after((result) => { + after(async (result) => { switch (name) { case "onUpdate": filterTags.value = [] - getNoteAsync() + await getNoteAsync() break; case "onChoose": const e = result as TagEvent @@ -35,6 +35,7 @@ tagStore.$onAction( filterTags.value = filterTags.value.filter((t) => t.id !== e.tag.id) filterTags.value.push(e.tag) } + await getNoteByTagsAsync() break; } }) @@ -52,6 +53,12 @@ async function getNoteAsync() { noteSet.value = newData } +async function getNoteByTagsAsync() { + const tagSet = { tags_id: filterTags.value.map((t) => t.id) } + const newData = await NoteApi.getNoteByTags(tagSet) + noteSet.value = newData +} + // callback function function handleShowTag() { tagStore.setShow() diff --git a/src/components/Tag/TagDrawer.vue b/src/components/Tag/TagDrawer.vue index 6ef6065..f60e2f4 100644 --- a/src/components/Tag/TagDrawer.vue +++ b/src/components/Tag/TagDrawer.vue @@ -54,6 +54,12 @@ let filterTags: ComputedRef> = computed(() => { }) let targetTag: ReactiveVariable = reactive(tagDefault()) let inputValue: Ref = ref("") +let dialogWidth = computed(() => { + const w = window.screen.width + if (w < 540) return '90%' + else if (w < 900) return '50%' + else return '30%' +}) // callback function async function handleUpdateConfirmAsync() { @@ -192,7 +198,7 @@ onMounted(() => { - + @@ -219,7 +225,7 @@ onMounted(() => { - +
{{ targetTag?.name }} diff --git a/src/store/state.ts b/src/store/state.ts index a1460ac..38288ad 100644 --- a/src/store/state.ts +++ b/src/store/state.ts @@ -19,6 +19,7 @@ export enum ContentIndex { } const sideIndexes = [SidebarIndex.Note, SidebarIndex.Net, SidebarIndex.Resource, SidebarIndex.Setting] +const contentIndexes = [ContentIndex.Note, ContentIndex.Net, ContentIndex.Resource] export const useStateStore = defineStore('states', { state: () => { @@ -39,6 +40,9 @@ export const useStateStore = defineStore('states', { }, select(index: number) { this.sidebarIndex = sideIndexes[index] + if (index != 3) { + this.contentIndex = contentIndexes[index] + } }, ownMiddlebar(): boolean { let a = this.sidebarIndex != SidebarIndex.Net