From 121becd9cf52c735e2d33032873fca8fc6e3db54 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Sun, 5 Nov 2023 22:22:37 +0200 Subject: Added all the main features of the plugin and also added setting and made the plugin respect themeing --- src/main.tsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/main.tsx') diff --git a/src/main.tsx b/src/main.tsx index c994e33..048b9ab 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -7,16 +7,13 @@ import "./index.css"; import { logseq as PL } from "../package.json"; import { SettingSchemaDesc } from "@logseq/libs/dist/LSPlugin"; +import { ollamaUI } from "./ollama"; // @ts-expect-error const css = (t, ...args) => String.raw(t, ...args); -const delay = (t = 100) => new Promise(r => setTimeout(r, t)) - const pluginId = PL.id; - - let settings: SettingSchemaDesc[] = [ { key: "host", @@ -32,13 +29,19 @@ let settings: SettingSchemaDesc[] = [ description: "Set your desired model to use ollama", default: "mistral:instruct" }, + { + key: "shortcut", + type: "string", + title: "Shortcut", + description: "Shortcut to open plugin command pallete", + default: "mod+shift+o" + }, ] + function main() { - console.log("Hello") console.info(`#${pluginId}: MAIN`); - // logseq.useSettingsSchema(settings) - let loading = false + logseq.useSettingsSchema(settings) const root = ReactDOM.createRoot(document.getElementById("app")!); root.render( @@ -47,13 +50,10 @@ function main() { ); - function show() { - logseq.showMainUI(); - } function createModel() { return { show() { - logseq.showMainUI(); + ollamaUI() }, }; } @@ -83,7 +83,7 @@ function main() { template: ` - + `, }); -- cgit v1.2.3