Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
f1b350cb
"include/ck/ck.hpp" did not exist on "3bf52e60c5374c9a63256dff5e3442a4046c81dc"
Commit
f1b350cb
authored
Jun 17, 2024
by
Timothy J. Baek
Browse files
enh: use model profile image in call
parent
9023a60d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
19 deletions
+35
-19
src/lib/components/chat/MessageInput/CallOverlay.svelte
src/lib/components/chat/MessageInput/CallOverlay.svelte
+19
-3
src/routes/(app)/workspace/models/create/+page.svelte
src/routes/(app)/workspace/models/create/+page.svelte
+8
-8
src/routes/(app)/workspace/models/edit/+page.svelte
src/routes/(app)/workspace/models/edit/+page.svelte
+8
-8
No files found.
src/lib/components/chat/MessageInput/CallOverlay.svelte
View file @
f1b350cb
<
script
lang
=
"ts"
>
import { config, settings, showCallOverlay } from '$lib/stores';
import
{
config
,
models
,
settings
,
showCallOverlay
}
from
'$lib/stores'
;
import
{
onMount
,
tick
,
getContext
}
from
'svelte'
;
import
{
...
...
@@ -28,6 +28,8 @@
export
let
chatId
;
export
let
modelId
;
let
model
=
null
;
let
loading
=
false
;
let
confirmed
=
false
;
let
interrupted
=
false
;
...
...
@@ -507,6 +509,8 @@
};
onMount
(
async
()
=>
{
model
=
$
models
.
find
((
m
)
=>
m
.
id
===
modelId
);
startRecording
();
const
chatStartHandler
=
async
(
e
)
=>
{
...
...
@@ -657,7 +661,13 @@
? ' size-16'
: rmsLevel * 100 > 1
? 'size-14'
: 'size-12'} transition-all bg-black dark:bg-white rounded-full"
: 'size-12'} transition-all rounded-full {(model?.info?.meta
?.profile_image_url ?? '/favicon.png') !== '/favicon.png'
? ' bg-cover bg-center bg-no-repeat'
: 'bg-black dark:bg-white'} bg-black dark:bg-white"
style
={(
model
?.
info
?.
meta
?.
profile_image_url
??
'/favicon.png'
)
!== '/favicon.png'
?
`
background
-
image
:
url
(
'${model?.info?.meta?.profile_image_url}'
);`
:
''
}
/>
{/
if
}
<
!-- navbar -->
...
...
@@ -732,7 +742,13 @@
? 'size-48'
: rmsLevel * 100 > 1
? 'size-[11.5rem]'
: 'size-44'} transition-all bg-black dark:bg-white rounded-full"
: 'size-44'} transition-all rounded-full {(model?.info?.meta
?.profile_image_url ?? '/favicon.png') !== '/favicon.png'
? ' bg-cover bg-center bg-no-repeat'
: 'bg-black dark:bg-white'} "
style
={(
model
?.
info
?.
meta
?.
profile_image_url
??
'/favicon.png'
)
!== '/favicon.png'
?
`
background
-
image
:
url
(
'${model?.info?.meta?.profile_image_url}'
);`
:
''
}
/>
{/
if
}
</
button
>
...
...
src/routes/(app)/workspace/models/create/+page.svelte
View file @
f1b350cb
...
...
@@ -229,20 +229,20 @@
// Calculate the new width and height to fit within 100x100
let newWidth, newHeight;
if (aspectRatio > 1) {
newWidth =
10
0 * aspectRatio;
newHeight =
10
0;
newWidth =
25
0 * aspectRatio;
newHeight =
25
0;
} else {
newWidth =
10
0;
newHeight =
10
0 / aspectRatio;
newWidth =
25
0;
newHeight =
25
0 / aspectRatio;
}
// Set the canvas size
canvas.width =
10
0;
canvas.height =
10
0;
canvas.width =
25
0;
canvas.height =
25
0;
// Calculate the position to center the image
const offsetX = (
10
0 - newWidth) / 2;
const offsetY = (
10
0 - newHeight) / 2;
const offsetX = (
25
0 - newWidth) / 2;
const offsetY = (
25
0 - newHeight) / 2;
// Draw the image on the canvas
ctx.drawImage(img, offsetX, offsetY, newWidth, newHeight);
...
...
src/routes/(app)/workspace/models/edit/+page.svelte
View file @
f1b350cb
...
...
@@ -190,20 +190,20 @@
//
Calculate
the
new
width
and
height
to
fit
within
100
x100
let
newWidth
,
newHeight
;
if
(
aspectRatio
>
1
)
{
newWidth
=
10
0
*
aspectRatio
;
newHeight
=
10
0
;
newWidth
=
25
0
*
aspectRatio
;
newHeight
=
25
0
;
}
else
{
newWidth
=
10
0
;
newHeight
=
10
0
/
aspectRatio
;
newWidth
=
25
0
;
newHeight
=
25
0
/
aspectRatio
;
}
//
Set
the
canvas
size
canvas
.
width
=
10
0
;
canvas
.
height
=
10
0
;
canvas
.
width
=
25
0
;
canvas
.
height
=
25
0
;
//
Calculate
the
position
to
center
the
image
const
offsetX
=
(
10
0
-
newWidth
)
/
2
;
const
offsetY
=
(
10
0
-
newHeight
)
/
2
;
const
offsetX
=
(
25
0
-
newWidth
)
/
2
;
const
offsetY
=
(
25
0
-
newHeight
)
/
2
;
//
Draw
the
image
on
the
canvas
ctx
.
drawImage
(
img
,
offsetX
,
offsetY
,
newWidth
,
newHeight
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment