From d0eea8e0d9516f9236b5aec0e3f774226d239d03 Mon Sep 17 00:00:00 2001 From: AndzejsP Date: Mon, 5 Jun 2023 13:45:43 +0300 Subject: [PATCH 1/6] removed garbage --- web/src/views/SettingsView.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/web/src/views/SettingsView.vue b/web/src/views/SettingsView.vue index 548afc0f..85753cc8 100644 --- a/web/src/views/SettingsView.vue +++ b/web/src/views/SettingsView.vue @@ -1068,7 +1068,6 @@ export default { this.isLoading = false this.diskUsage = await this.api_get_req("disk_usage") this.isMounted = true - console.log('reffy', this.$refs.bindingZoo) }, computed: { From 4fde7a6c0693d213abb5603c8d27f5d9ff3ffb4a Mon Sep 17 00:00:00 2001 From: AndzejsP Date: Mon, 5 Jun 2023 13:46:54 +0300 Subject: [PATCH 2/6] rounded code block, experimenting with css --- web/src/components/MarkdownRenderer.vue | 26 ++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/web/src/components/MarkdownRenderer.vue b/web/src/components/MarkdownRenderer.vue index f17ce867..2adfd5d1 100644 --- a/web/src/components/MarkdownRenderer.vue +++ b/web/src/components/MarkdownRenderer.vue @@ -9,11 +9,12 @@ import { nextTick } from 'vue' import feather from 'feather-icons' import MarkdownIt from 'markdown-it'; import emoji from 'markdown-it-emoji'; -import 'highlight.js/styles/tomorrow-night-blue.css' +//import 'highlight.js/styles/tomorrow-night-blue.css' //import 'highlight.js/styles/tokyo-night-dark.css' import hljs from 'highlight.js'; + const markdownIt = new MarkdownIt('commonmark', { html: false, xhtmlOut: true, @@ -26,8 +27,8 @@ const markdownIt = new MarkdownIt('commonmark', { try { return ( - '
'+
-      '' +
+          '
' +
+          '' +
           hljs.highlight(str, { language: lang }).value +
           '
' ); @@ -35,7 +36,7 @@ const markdownIt = new MarkdownIt('commonmark', { } catch (__) { } } return ( - '
'+
+      '
' +
       '' +
       markdownIt.utils.escapeHtml(str) +
       '
' @@ -53,22 +54,28 @@ export default { }, data() { return { - renderedMarkdown: '' + renderedMarkdown: '', + }; }, mounted() { - + this.renderedMarkdown = markdownIt.render(this.markdownText); nextTick(() => { feather.replace() }) + }, + created() { + + }, methods: { copyContentToClipboard() { navigator.clipboard.writeText(theCode); }, + }, watch: { markdownText(newText) { @@ -78,7 +85,12 @@ export default { feather.replace() }) - } + }, + + }, + computed:{ + + } }; From 1242b6986836622c5d1d1c1b9fa34a7089645d68 Mon Sep 17 00:00:00 2001 From: AndzejsP Date: Mon, 5 Jun 2023 13:47:07 +0300 Subject: [PATCH 3/6] reworked message layout --- web/src/components/Message.vue | 175 +++++++++++++++++++-------------- 1 file changed, 100 insertions(+), 75 deletions(-) diff --git a/web/src/components/Message.vue b/web/src/components/Message.vue index 68d455b7..5e0134d7 100644 --- a/web/src/components/Message.vue +++ b/web/src/components/Message.vue @@ -1,79 +1,104 @@ @@ -120,7 +145,7 @@ export default { }, methods: { copyContentToClipboard() { this.$emit('copy', this.message.content) - + }, deleteMsg() { this.$emit('delete', this.message.id) @@ -141,21 +166,21 @@ export default { resendMessage() { this.$emit('resendMessage', this.message.id, this.new_message_content) }, - getImgUrl() { - + getImgUrl() { + if (this.message.sender == "user") { if (this.avatar) { - + return this.avatar } - + return userImgPlaceholder; } - if(this.avatar){ - return bUrl + this.avatar - } - return botImgPlaceholder; + if (this.avatar) { + return bUrl + this.avatar + } + return botImgPlaceholder; }, defaultImg(event) { From c8b40e7b6ad7d63118eb877fdba8a9d7bb1148c4 Mon Sep 17 00:00:00 2001 From: AndzejsP Date: Mon, 5 Jun 2023 13:47:21 +0300 Subject: [PATCH 4/6] loading codeblock css on theme switch --- web/src/components/TopBar.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/components/TopBar.vue b/web/src/components/TopBar.vue index 76bc214d..5aa62d9f 100644 --- a/web/src/components/TopBar.vue +++ b/web/src/components/TopBar.vue @@ -83,8 +83,10 @@ export default { if (this.userTheme == "dark" || (!this.userTheme && this.systemTheme)) { document.documentElement.classList.add("dark"); this.moonIcon.classList.add("display-none"); + import('highlight.js/styles/tokyo-night-dark.css'); return } + import('highlight.js/styles/tomorrow-night-blue.css'); this.sunIcon.classList.add("display-none") }, @@ -93,9 +95,11 @@ export default { document.documentElement.classList.remove("dark"); localStorage.setItem("theme", "light") this.iconToggle() + import('highlight.js/styles/tomorrow-night-blue.css'); return } + import('highlight.js/styles/tokyo-night-dark.css'); document.documentElement.classList.add("dark"); localStorage.setItem("theme", "dark") this.iconToggle() From cd1cbb92922439f6ada91b9d5b7e7d774b04d790 Mon Sep 17 00:00:00 2001 From: AndzejsP Date: Mon, 5 Jun 2023 17:43:16 +0300 Subject: [PATCH 5/6] WIP but almost working --- web/src/components/TopBar.vue | 39 ++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/web/src/components/TopBar.vue b/web/src/components/TopBar.vue index 5aa62d9f..8592db87 100644 --- a/web/src/components/TopBar.vue +++ b/web/src/components/TopBar.vue @@ -1,4 +1,5 @@