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
OpenDAS
ollama
Commits
3f7d2336
Commit
3f7d2336
authored
Jul 21, 2023
by
Eva Ho
Browse files
add prettier and address comments
parent
e0a73d7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
19 deletions
+22
-19
app/package.json
app/package.json
+3
-1
app/src/declarations.d.ts
app/src/declarations.d.ts
+3
-3
app/src/index.ts
app/src/index.ts
+16
-15
No files found.
app/package.json
View file @
3f7d2336
...
@@ -11,7 +11,9 @@
...
@@ -11,7 +11,9 @@
"make"
:
"electron-forge make"
,
"make"
:
"electron-forge make"
,
"make:sign"
:
"SIGN=1 electron-forge make"
,
"make:sign"
:
"SIGN=1 electron-forge make"
,
"publish"
:
"SIGN=1 electron-forge publish"
,
"publish"
:
"SIGN=1 electron-forge publish"
,
"lint"
:
"eslint --ext .ts,.tsx ."
"lint"
:
"eslint --ext .ts,.tsx ."
,
"format"
:
"prettier --check . --ignore-path .gitignore"
,
"format:fix"
:
"prettier --write . --ignore-path .gitignore"
},
},
"keywords"
:
[],
"keywords"
:
[],
"author"
:
{
"author"
:
{
...
...
app/src/declarations.d.ts
View file @
3f7d2336
declare
module
'
*.svg
'
{
declare
module
'
*.svg
'
{
const
content
:
string
;
const
content
:
string
export
default
content
;
export
default
content
}
}
\ No newline at end of file
app/src/index.ts
View file @
3f7d2336
...
@@ -67,25 +67,25 @@ function firstRunWindow() {
...
@@ -67,25 +67,25 @@ function firstRunWindow() {
function
createSystemtray
()
{
function
createSystemtray
()
{
let
iconPath
=
nativeTheme
.
shouldUseDarkColors
let
iconPath
=
nativeTheme
.
shouldUseDarkColors
?
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
assets
'
,
'
ollama_icon_16x16Template.png
'
)
?
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
assets
'
,
'
ollama_icon_16x16Template.png
'
)
:
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
assets
'
,
'
ollama_outline_icon_16x16Template.png
'
)
:
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
assets
'
,
'
ollama_outline_icon_16x16Template.png
'
)
if
(
app
.
isPackaged
)
{
if
(
app
.
isPackaged
)
{
iconPath
=
nativeTheme
.
shouldUseDarkColors
iconPath
=
nativeTheme
.
shouldUseDarkColors
?
path
.
join
(
process
.
resourcesPath
,
'
ollama_icon_16x16Template.png
'
)
?
path
.
join
(
process
.
resourcesPath
,
'
ollama_icon_16x16Template.png
'
)
:
path
.
join
(
process
.
resourcesPath
,
'
ollama_outline_icon_16x16Template.png
'
)
:
path
.
join
(
process
.
resourcesPath
,
'
ollama_outline_icon_16x16Template.png
'
)
}
}
tray
=
new
Tray
(
iconPath
)
tray
=
new
Tray
(
iconPath
)
nativeTheme
.
on
(
'
updated
'
,
function
theThemeHasChanged
()
{
nativeTheme
.
on
(
'
updated
'
,
function
theThemeHasChanged
()
{
if
(
nativeTheme
.
shouldUseDarkColors
)
{
if
(
nativeTheme
.
shouldUseDarkColors
)
{
app
.
isPackaged
app
.
isPackaged
?
tray
.
setImage
(
path
.
join
(
process
.
resourcesPath
,
'
ollama_icon_16x16Template.png
'
))
?
tray
.
setImage
(
path
.
join
(
process
.
resourcesPath
,
'
ollama_icon_16x16Template.png
'
))
:
tray
.
setImage
(
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
assets
'
,
'
ollama_icon_16x16Template.png
'
))
:
tray
.
setImage
(
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
assets
'
,
'
ollama_icon_16x16Template.png
'
))
}
else
{
}
else
{
app
.
isPackaged
app
.
isPackaged
?
tray
.
setImage
(
path
.
join
(
process
.
resourcesPath
,
'
ollama_outline_icon_16x16Template.png
'
))
?
tray
.
setImage
(
path
.
join
(
process
.
resourcesPath
,
'
ollama_outline_icon_16x16Template.png
'
))
:
tray
.
setImage
(
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
assets
'
,
'
ollama_outline_icon_16x16Template.png
'
))
:
tray
.
setImage
(
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
assets
'
,
'
ollama_outline_icon_16x16Template.png
'
))
}
}
})
})
...
@@ -102,8 +102,8 @@ if (require('electron-squirrel-startup')) {
...
@@ -102,8 +102,8 @@ if (require('electron-squirrel-startup')) {
function
server
()
{
function
server
()
{
const
binary
=
app
.
isPackaged
const
binary
=
app
.
isPackaged
?
path
.
join
(
process
.
resourcesPath
,
'
ollama
'
)
?
path
.
join
(
process
.
resourcesPath
,
'
ollama
'
)
:
path
.
resolve
(
process
.
cwd
(),
'
..
'
,
'
ollama
'
)
:
path
.
resolve
(
process
.
cwd
(),
'
..
'
,
'
ollama
'
)
const
proc
=
spawn
(
binary
,
[
'
serve
'
])
const
proc
=
spawn
(
binary
,
[
'
serve
'
])
...
@@ -114,15 +114,16 @@ function server() {
...
@@ -114,15 +114,16 @@ function server() {
proc
.
stderr
.
on
(
'
data
'
,
data
=>
{
proc
.
stderr
.
on
(
'
data
'
,
data
=>
{
logger
.
error
(
data
.
toString
().
trim
())
logger
.
error
(
data
.
toString
().
trim
())
})
})
proc
.
on
(
'
exit
'
,
(
code
)
=>
{
function
restart
(
code
:
number
)
{
logger
.
error
(
`Server exited with code:
${
code
}
`
)
logger
.
info
(
`Server exited with code:
${
code
}
`
)
setTimeout
(
server
,
3000
)
setTimeout
(
server
,
3000
)
})
}
proc
.
on
(
'
exit
'
,
code
=>
restart
(
code
))
app
.
on
(
'
before-quit
'
,
()
=>
{
app
.
on
(
'
before-quit
'
,
()
=>
{
proc
.
off
(
'
exit
'
,
server
)
proc
.
off
(
'
exit
'
,
code
=>
restart
(
code
)
)
proc
.
kill
()
proc
.
kill
()
})
})
}
}
...
...
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