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
f93ffb96
"git@developer.sourcefind.cn:OpenDAS/fairscale.git" did not exist on "e10de4b57aebfb6ae213fa889ded37581884d575"
Commit
f93ffb96
authored
Jul 06, 2023
by
Jeffrey Morgan
Browse files
fix missing string crash
parent
da74384a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
17 deletions
+14
-17
app/src/index.ts
app/src/index.ts
+13
-16
app/src/telemetry.ts
app/src/telemetry.ts
+1
-1
No files found.
app/src/index.ts
View file @
f93ffb96
...
@@ -28,10 +28,7 @@ const createSystemtray = () => {
...
@@ -28,10 +28,7 @@ const createSystemtray = () => {
})
})
}
}
const
contextMenu
=
Menu
.
buildFromTemplate
([{
role
:
'
quit
'
,
label
:
'
Quit Ollama
'
,
accelerator
:
'
Command+Q
'
}])
const
contextMenu
=
Menu
.
buildFromTemplate
([
{
role
:
'
quit
'
,
label
:
'
Quit Ollama
'
,
accelerator
:
'
Command+Q
'
},
])
tray
.
setContextMenu
(
contextMenu
)
tray
.
setContextMenu
(
contextMenu
)
tray
.
setToolTip
(
'
Ollama
'
)
tray
.
setToolTip
(
'
Ollama
'
)
...
@@ -91,7 +88,7 @@ function installCLI() {
...
@@ -91,7 +88,7 @@ function installCLI() {
.
showMessageBox
({
.
showMessageBox
({
type
:
'
info
'
,
type
:
'
info
'
,
title
:
'
Ollama CLI installation
'
,
title
:
'
Ollama CLI installation
'
,
message
:
'
To
install
the Ollama
CLI, we need to ask you for
administrator privileges.
'
,
message
:
'
To
make
the Ollama
command line work in your terminal, it needs
administrator privileges.
'
,
buttons
:
[
'
OK
'
],
buttons
:
[
'
OK
'
],
})
})
.
then
(
result
=>
{
.
then
(
result
=>
{
...
@@ -111,35 +108,36 @@ function installCLI() {
...
@@ -111,35 +108,36 @@ function installCLI() {
})
})
}
}
if
(
!
SingleInstanceLock
)
{
if
(
!
SingleInstanceLock
)
{
app
.
quit
()
app
.
quit
()
}
else
{
}
else
{
app
.
on
(
'
ready
'
,
()
=>
{
app
.
on
(
'
ready
'
,
()
=>
{
if
(
process
.
platform
===
'
darwin
'
)
{
if
(
process
.
platform
===
'
darwin
'
)
{
app
.
dock
.
hide
()
app
.
dock
.
hide
()
if
(
!
app
.
isInApplicationsFolder
())
{
if
(
!
app
.
isInApplicationsFolder
())
{
const
chosen
=
dialog
.
showMessageBoxSync
({
const
chosen
=
dialog
.
showMessageBoxSync
({
type
:
'
question
'
,
type
:
'
question
'
,
buttons
:
[
'
Move to Applications
'
,
'
Do Not Move
'
],
buttons
:
[
'
Move to Applications
'
,
'
Do Not Move
'
],
message
:
'
Move
Ollama
to
the Applications directory
?
'
,
message
:
'
Ollama
works best when run from
the Applications directory
.
'
,
defaultId
:
0
,
defaultId
:
0
,
cancelId
:
1
cancelId
:
1
,
})
})
if
(
chosen
===
0
)
{
if
(
chosen
===
0
)
{
try
{
try
{
app
.
moveToApplicationsFolder
({
app
.
moveToApplicationsFolder
({
conflictHandler
:
(
conflictType
)
=>
{
conflictHandler
:
conflictType
=>
{
if
(
conflictType
===
'
existsAndRunning
'
)
{
if
(
conflictType
===
'
existsAndRunning
'
)
{
dialog
.
showMessageBoxSync
({
dialog
.
showMessageBoxSync
({
type
:
'
info
'
,
type
:
'
info
'
,
message
:
'
Cannot move to Applications directory
'
,
message
:
'
Cannot move to Applications directory
'
,
detail
:
'
Another version of Ollama is currently running from your Applications directory. Close it first and try again.
'
detail
:
'
Another version of Ollama is currently running from your Applications directory. Close it first and try again.
'
,
})
})
}
}
return
true
return
true
}
}
,
})
})
return
return
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -149,16 +147,15 @@ if (!SingleInstanceLock) {
...
@@ -149,16 +147,15 @@ if (!SingleInstanceLock) {
}
}
}
}
}
}
createSystemtray
()
createSystemtray
()
if
(
app
.
isPackaged
)
{
if
(
app
.
isPackaged
)
{
installCLI
()
installCLI
()
}
}
})
})
}
}
// Quit when all windows are closed, except on macOS. There, it's common
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
// explicitly with Cmd + Q.
...
...
app/src/telemetry.ts
View file @
f93ffb96
...
@@ -4,7 +4,7 @@ import { v4 as uuidv4 } from 'uuid'
...
@@ -4,7 +4,7 @@ import { v4 as uuidv4 } from 'uuid'
const
Store
=
require
(
'
electron-store
'
)
const
Store
=
require
(
'
electron-store
'
)
const
store
=
new
Store
()
const
store
=
new
Store
()
export
const
analytics
=
new
Analytics
({
writeKey
:
process
.
env
.
TELEMETRY_WRITE_KEY
||
''
})
export
const
analytics
=
new
Analytics
({
writeKey
:
process
.
env
.
TELEMETRY_WRITE_KEY
||
'
<empty>
'
})
export
function
id
():
string
{
export
function
id
():
string
{
const
id
=
store
.
get
(
'
id
'
)
const
id
=
store
.
get
(
'
id
'
)
...
...
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