Skip to content

Commit

Permalink
Merge pull request #205 from iceljc/features/refine-chat-window
Browse files Browse the repository at this point in the history
Features/refine chat window
  • Loading branch information
iceljc authored Sep 4, 2024
2 parents a2f536c + 82353f0 commit d3a4f9a
Show file tree
Hide file tree
Showing 32 changed files with 1,185 additions and 480 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"svelte-splitpanes": "^8.0.5",
"svelte-viewport-info": "^1.0.1",
"svelvet": "^9.0.0",
"sweetalert2": "^11.6.13",
"sweetalert2": "^11.12.4",
"swiper": "^10.3.1",
"uuid": "^10.0.0"
}
Expand Down
11 changes: 8 additions & 3 deletions src/lib/helpers/directives.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/** @param {any} node */
export function clickOutside(node) {
export function clickoutsideDirective(node) {

const handleClick = (/** @type {any} */ event) => {
if (!!node && !node.contains(event.target)) {
node.dispatchEvent(new CustomEvent('click_outside', node));
if (node) {
node.dispatchEvent(new CustomEvent('clickoutside', {
detail: {
currentNode: node,
targetNode: event.target
}
}));
}
}

Expand Down
21 changes: 18 additions & 3 deletions src/lib/helpers/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,36 @@ function skipLoader(config) {
new RegExp('http(s*)://(.*?)/agent', 'g'),
new RegExp('http(s*)://(.*?)/knowledge/vector/(.*?)/page', 'g'),
new RegExp('http(s*)://(.*?)/knowledge/(.*?)/search', 'g'),
new RegExp('http(s*)://(.*?)/knowledge/vector/(.*?)/update', 'g'),
new RegExp('http(s*)://(.*?)/knowledge/vector/(.*?)/create', 'g')
];

const putRegexes = [
new RegExp('http(s*)://(.*?)/knowledge/vector/(.*?)/update', 'g'),
];

const deleteRegexes = [
new RegExp('http(s*)://(.*?)/knowledge/vector/(.*?)/delete-collection', 'g'),
];

const getRegexes = [
new RegExp('http(s*)://(.*?)/address/options(.*?)', 'g'),
new RegExp('http(s*)://(.*?)/conversation/(.*?)/files/(.*?)', 'g'),
new RegExp('http(s*)://(.*?)/llm-provider/(.*?)/models', 'g'),
new RegExp('http(s*)://(.*?)/knowledge/collections', 'g'),
new RegExp('http(s*)://(.*?)/knowledge/vector/collections', 'g'),
new RegExp('http(s*)://(.*?)/setting/(.*?)', 'g'),
new RegExp('http(s*)://(.*?)/user/me', 'g'),
new RegExp('http(s*)://(.*?)/plugin/menu', 'g')
];

if ((config.method === 'post' || config.method === "put") && !!config.data && postRegexes.some(regex => regex.test(config.url || ''))) {
if (config.method === 'post' && !!config.data && postRegexes.some(regex => regex.test(config.url || ''))) {
return true;
}

if (config.method === 'put' && !!config.data && putRegexes.some(regex => regex.test(config.url || ''))) {
return true;
}

if (config.method === 'delete' && !!config.data && deleteRegexes.some(regex => regex.test(config.url || ''))) {
return true;
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/helpers/types/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ IRichContent.prototype.quick_replies;
* @property {string | null} [start_id] - The start id.
* @property {number} size - Page size.
* @property {boolean} [with_vector] - Include vector or not.
* @property {{ key: string, value: string }[]} [search_pairs] - Search pairs.
*/

/**
Expand Down
182 changes: 3 additions & 179 deletions src/lib/scss/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ File: Main Css File
@import "custom/components/alert";
@import "custom/components/file";
@import "custom/components/audio";
@import "custom/components/text";

// Plugins
@import "custom/plugins/custom-scrollbar";
Expand Down Expand Up @@ -94,6 +95,7 @@ File: Main Css File
// Common
@import "custom/common/animation";
@import "custom/common/display";
@import "custom/common/common";

//RTL
// @import "custom/rtl/bootstrap-rtl";
Expand All @@ -104,182 +106,4 @@ File: Main Css File
// @import "custom/rtl/plugins-rtl";
// @import "custom/rtl/spacing-rtl";
// @import "custom/rtl/structure-rtl";
// @import "custom/rtl/text-rtl";

// custom css
.tab-content .nav-tabs {
display: none;
}

// dropzone
.dropzone .dz-message {
text-align: center;
}

[data-bs-theme="dark"] {
.right-bar .right-bar-toggle {
color: #575d64;
background-color: #fff;
}

.svelte-select {
max-height: 20px !important;
min-height: 37px !important;
background-color: var(--bs-secondary-bg) !important;
border-color: var(--bs-border-color-translucent) !important;
padding-right: 5px !important;

.value-container {
padding: 0 !important;

.selected-item {
color: #dedddd !important;
font-size: .8125rem !important;
z-index: 1;
}

input {
background-color: var(--bs-secondary-bg) !important;
font-size: .8125rem !important;
}

}

.indicators {
font-size: .8125rem !important;

.clear-select {
height: 18px !important;
width: 18px !important;
// font-size: .8125rem !important;
}
}
}

.svelte-select-list {
background-color: #282b2e !important;
}

// Modal
.modal {
.modal-content{
background-color: var(--bs-modal-bg);
border: var(--bs-modal-border-width) solid var(--bs-modal-border-color);
}
}
}

// select elements
.svelte-select {
max-height: 20px !important;
min-height: 37px !important;
// background-color: #f3f6f9 !important;
border-color: #f3f6f9 !important;
padding-right: 5px !important;

.value-container {
padding: 0 !important;

.selected-item {
color: #000 !important;
font-size: .8125rem !important;
z-index: 1;
}

input {
// background-color: #f3f6f9 !important;
font-size: .8125rem !important;
}

}

.indicators {
font-size: .8125rem !important;

.clear-select {
height: 18px !important;
width: 18px !important;

}
}
}

.jvm-zoom-btn {
position: absolute;
left: 10px;
background: #424242;
padding: 2px;
color: white;
width: 15px;
height: 15px;
cursor: pointer;
line-height: 10px;
text-align: center;
left: 28px;
border-radius: 3px;

&.jvm-zoom-btn {

top: 90px;
}

&.jvm-zoomout {
top: 110px;
}
}

// data tables

.sort {
&.asc::after {
content: ""/"";
float: right;
}

&.desc::after{
content: ""/"";
float: right;
}
}

.json-container .json-string {
overflow-x: hidden;
}

// swal2
.swal2-container .swal2-confirm {
background-color: var(--bs-primary);
}

button:focus {
outline: none !important;
box-shadow: none !important;
}

.clickable {
cursor: pointer;
}

.markdown-container {
pre {
-ms-overflow-style: none !important;
white-space: pre-wrap;
}

pre::-webkit-scrollbar {
display: none !important;
}

p {
margin-top: 0 !important;
margin-bottom: 0 !important;
}

a {
color: white;
}

ul {
list-style-position: inside !important;
}
}
// @import "custom/rtl/text-rtl";
Loading

0 comments on commit d3a4f9a

Please sign in to comment.