diff --git a/README.md b/README.md index 8e7ac235..a4ad977d 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,34 @@ docker run -d -p 3000:8080 --name ollama-webui --restart always ollama-webui caddy run --envfile .env --config ./Caddyfile.localhost ``` +## Troubleshooting + +### Connection Errors + +If you encounter difficulties connecting to the Ollama server, please follow these steps to diagnose and resolve the issue: + +**1. Verify Ollama Server Configuration** + +Ensure that the Ollama server is properly configured to accept incoming connections from all origins. To do this, make sure the server is launched with the `OLLAMA_ORIGINS=*` environment variable, as shown in the following command: + +```bash +OLLAMA_HOST=0.0.0.0 OLLAMA_ORIGINS=* ollama serve +``` + +This configuration allows Ollama to accept connections from any source. + +**2. Check Ollama URL Format** + +Ensure that the Ollama URL is correctly formatted in the application settings. Follow these steps: + +- Go to "Settings" within the Ollama WebUI. +- Navigate to the "General" section. +- Verify that the Ollama URL is in the following format: `http://localhost:11434/api`. + +It is crucial to include the `/api` at the end of the URL to ensure that the Ollama Web UI can communicate with the server. + +By following these troubleshooting steps, you should be able to identify and resolve connection issues with your Ollama server configuration. If you require further assistance or have additional questions, please don't hesitate to reach out or refer to our documentation for comprehensive guidance. + ## What's Next? 🚀 ### To-Do List 📝 diff --git a/package-lock.json b/package-lock.json index 7080e3cd..e071c47e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-static": "^2.0.3", "@sveltejs/kit": "^1.20.4", + "@tailwindcss/typography": "^0.5.10", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "autoprefixer": "^10.4.16", @@ -838,6 +839,34 @@ "vite": "^4.0.0" } }, + "node_modules/@tailwindcss/typography": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.10.tgz", + "integrity": "sha512-Pe8BuPJQJd3FfRnm6H0ulKIGoMEQS+Vq01R6M5aCrFB/ccR/shT+0kXLjouGC1gFLm9hopTFN+DMP0pfwRWzPw==", + "dev": true, + "dependencies": { + "lodash.castarray": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "postcss-selector-parser": "6.0.10" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders" + } + }, + "node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@types/cookie": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.5.2.tgz", @@ -2603,6 +2632,18 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.castarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", + "integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==", + "dev": true + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -4670,6 +4711,30 @@ "debug": "^4.3.4" } }, + "@tailwindcss/typography": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.10.tgz", + "integrity": "sha512-Pe8BuPJQJd3FfRnm6H0ulKIGoMEQS+Vq01R6M5aCrFB/ccR/shT+0kXLjouGC1gFLm9hopTFN+DMP0pfwRWzPw==", + "dev": true, + "requires": { + "lodash.castarray": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "postcss-selector-parser": "6.0.10" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "dev": true, + "requires": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + } + } + } + }, "@types/cookie": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.5.2.tgz", @@ -5909,6 +5974,18 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "lodash.castarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", + "integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==", + "dev": true + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true + }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", diff --git a/package.json b/package.json index 2f454eda..9959f20c 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-static": "^2.0.3", "@sveltejs/kit": "^1.20.4", + "@tailwindcss/typography": "^0.5.10", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "autoprefixer": "^10.4.16", diff --git a/src/app.html b/src/app.html index effe0d0d..9dc420cb 100644 --- a/src/app.html +++ b/src/app.html @@ -3,7 +3,7 @@ - + %sveltekit.head% diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index 66b5f72f..42fd8c6f 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -1,13 +1,14 @@ @@ -609,7 +663,9 @@ {:else} -
+
{@html marked.parse(message.content)}
{/if} @@ -863,4 +919,33 @@ clip-path: inset(0 -1ch 0 0); } } + + pre[class*='language-'] { + position: relative; + overflow: auto; + + /* make space */ + margin: 5px 0; + padding: 1.75rem 0 1.75rem 1rem; + border-radius: 10px; + } + + pre[class*='language-'] button { + position: absolute; + top: 5px; + right: 5px; + + font-size: 0.9rem; + padding: 0.15rem; + background-color: #828282; + + border: ridge 1px #7b7b7c; + border-radius: 5px; + text-shadow: #c4c4c4 0 0 2px; + } + + pre[class*='language-'] button:hover { + cursor: pointer; + background-color: #bcbabb; + } diff --git a/tailwind.config.js b/tailwind.config.js index 709efb53..54ab6813 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -17,8 +17,19 @@ export default { 900: '#202123', 950: '#050509' } + }, + typography: { + DEFAULT: { + css: { + pre: false, + code: false, + 'pre code': false, + 'code::before': false, + 'code::after': false + } + } } } }, - plugins: [] + plugins: [require('@tailwindcss/typography')] };