aboutsummaryrefslogtreecommitdiff
path: root/src/main.tsx
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-11-05 22:22:37 +0200
committeromagdy7 <omar.professional8777@gmail.com>2023-11-05 22:22:37 +0200
commit121becd9cf52c735e2d33032873fca8fc6e3db54 (patch)
treeafcbd0697808faf66d7cb84f2852d979b5da8550 /src/main.tsx
parent7c9ade2c19b5b65721918dd291de54bcd4dc805b (diff)
downloadollama-logseq-121becd9cf52c735e2d33032873fca8fc6e3db54.tar.xz
ollama-logseq-121becd9cf52c735e2d33032873fca8fc6e3db54.zip
Added all the main features of the plugin and also added setting and made the plugin respect themeing
Diffstat (limited to 'src/main.tsx')
-rw-r--r--src/main.tsx24
1 files changed, 12 insertions, 12 deletions
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() {
</React.StrictMode>
);
- function show() {
- logseq.showMainUI();
- }
function createModel() {
return {
show() {
- logseq.showMainUI();
+ ollamaUI()
},
};
}
@@ -83,7 +83,7 @@ function main() {
template: `
<a data-on-click="show"
class="button">
- <i class="ti ti-brand-reddit"></i>
+ <i class="ti ti-wand"></i>
</a>
`,
});