mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-30 00:51:30 +08:00
chore(client/ts): port services/note_types
This commit is contained in:
parent
f7dc9ea8e4
commit
4505564f13
@ -2,8 +2,18 @@ import server from "./server.js";
|
|||||||
import froca from "./froca.js";
|
import froca from "./froca.js";
|
||||||
import { t } from "./i18n.js";
|
import { t } from "./i18n.js";
|
||||||
|
|
||||||
async function getNoteTypeItems(command) {
|
type NoteTypeItem = {
|
||||||
const items = [
|
title: string;
|
||||||
|
command: string;
|
||||||
|
type: string;
|
||||||
|
uiIcon: string;
|
||||||
|
templateNoteId?: string;
|
||||||
|
} | {
|
||||||
|
title: "----"
|
||||||
|
};
|
||||||
|
|
||||||
|
async function getNoteTypeItems(command: string) {
|
||||||
|
const items: NoteTypeItem[] = [
|
||||||
{ title: t("note_types.text"), command: command, type: "text", uiIcon: "bx bx-note" },
|
{ title: t("note_types.text"), command: command, type: "text", uiIcon: "bx bx-note" },
|
||||||
{ title: t("note_types.code"), command: command, type: "code", uiIcon: "bx bx-code" },
|
{ title: t("note_types.code"), command: command, type: "code", uiIcon: "bx bx-code" },
|
||||||
{ title: t("note_types.saved-search"), command: command, type: "search", uiIcon: "bx bx-file-find" },
|
{ title: t("note_types.saved-search"), command: command, type: "search", uiIcon: "bx bx-file-find" },
|
||||||
@ -17,7 +27,7 @@ async function getNoteTypeItems(command) {
|
|||||||
{ title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap" }
|
{ title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap" }
|
||||||
];
|
];
|
||||||
|
|
||||||
const templateNoteIds = await server.get("search-templates");
|
const templateNoteIds = await server.get<string[]>("search-templates");
|
||||||
const templateNotes = await froca.getNotes(templateNoteIds);
|
const templateNotes = await froca.getNotes(templateNoteIds);
|
||||||
|
|
||||||
if (templateNotes.length > 0) {
|
if (templateNotes.length > 0) {
|
Loading…
x
Reference in New Issue
Block a user