Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
74
Issues
74
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
3ab416f1
Verified
Commit
3ab416f1
authored
Sep 17, 2019
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add showInstructions to EngineOptions with -q/--quiet command-line option
parent
6227658d
Pipeline
#31284
passed with stage
in 6 minutes and 32 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
39 deletions
+46
-39
Libraries/iTasks/Engine.dcl
Libraries/iTasks/Engine.dcl
+19
-18
Libraries/iTasks/Engine.icl
Libraries/iTasks/Engine.icl
+27
-21
No files found.
Libraries/iTasks/Engine.dcl
View file @
3ab416f1
...
...
@@ -57,24 +57,25 @@ instance Startable [StartableTask]
instance
Startable
(
a
,
b
)
|
Startable
a
&
Startable
b
::
EngineOptions
=
{
appName
::
String
,
appPath
::
FilePath
// Location of the application's executable
,
appVersion
::
String
,
serverPort
::
Int
,
serverUrl
::
String
,
allowedHosts
::
[
String
]
// Only allow connections from these hosts (default ["127.0.0.1"])
,
keepaliveTime
::
Timespec
,
sessionTime
::
Timespec
,
persistTasks
::
Bool
,
autoLayout
::
Bool
,
maxEvents
::
Int
,
timeout
::
Maybe
Int
// The timeout
,
distributed
::
Bool
,
sdsPort
::
Int
,
webDirPath
::
FilePath
// Location of public files that are served by the iTask webserver
,
storeDirPath
::
FilePath
// Location of the application's persistent data files
,
tempDirPath
::
FilePath
// Location for temporary files used in tasks
,
byteCodePath
::
FilePath
// Location of the application's bytecode
{
appName
::
!
String
,
appPath
::
!
FilePath
//* Location of the application's executable
,
appVersion
::
!
String
,
serverPort
::
!
Int
,
serverUrl
::
!
String
,
allowedHosts
::
![
String
]
//* Only allow connections from these hosts (default ["127.0.0.1"])
,
keepaliveTime
::
!
Timespec
,
sessionTime
::
!
Timespec
,
persistTasks
::
!
Bool
,
autoLayout
::
!
Bool
,
maxEvents
::
!
Int
,
timeout
::
!
Maybe
Int
//* The timeout
,
distributed
::
!
Bool
,
sdsPort
::
!
Int
,
webDirPath
::
!
FilePath
//* Location of public files that are served by the iTask webserver
,
storeDirPath
::
!
FilePath
//* Location of the application's persistent data files
,
tempDirPath
::
!
FilePath
//* Location for temporary files used in tasks
,
byteCodePath
::
!
FilePath
//* Location of the application's bytecode
,
showInstructions
::
!
Bool
//* Whether instructions to open the browser should be shown
}
derive
class
iTask
EngineOptions
...
...
Libraries/iTasks/Engine.icl
View file @
3ab416f1
...
...
@@ -24,6 +24,7 @@ import iTasks.Internal.Util
import
iTasks
.
SDS
.
Sources
.
System
import
iTasks
.
WF
.
Combinators
.
Common
import
iTasks
.
WF
.
Definition
import
iTasks
.
WF
.
Tasks
.
Core
import
iTasks
.
WF
.
Tasks
.
SDS
import
iTasks
.
WF
.
Tasks
.
System
import
iTasks
.
WF
.
Derives
...
...
@@ -151,6 +152,8 @@ where
"Enable distributed mode (populate the symbols share)"
,
Option
[
's'
]
[
"sdsPort"
]
(
ReqArg
(\
p
->
fmap
\
o
->{
o
&
sdsPort
=
toInt
p
})
"SDSPORT"
)
(
"Specify the SDS port (default: "
+++
toString
defaults
.
sdsPort
+++
")"
)
,
Option
[
'q'
]
[
"quiet"
]
(
NoArg
(
fmap
\
o
->{
o
&
showInstructions
=
False
}))
"Don't show instructions to open the browser"
]
onStartup
::
(
Task
a
)
->
StartableTask
|
iTask
a
...
...
@@ -189,10 +192,11 @@ instance Startable (a,b) | Startable a & Startable b
where
toStartable
(
x
,
y
)
=
toStartable
x
++
toStartable
y
viewWebServerInstructions
::
Task
String
viewWebServerInstructions
::
Task
()
viewWebServerInstructions
=
get
applicationOptions
>>-
\{
EngineOptions
|
appName
,
serverPort
}
->
>>-
\{
EngineOptions
|
appName
,
serverPort
,
showInstructions
}
|
showInstructions
->
traceValue
(
join
OS_NEWLINE
[
"*** "
+++
appName
+++
" HTTP server ***"
,
""
...
...
@@ -200,7 +204,8 @@ viewWebServerInstructions
if
(
serverPort
==
80
)
"/"
(
":"
+++
toString
serverPort
+++
"/"
)
])
])
@!
()
|
otherwise
->
treturn
()
defaultEngineOptions
::
!*
World
->
(!
EngineOptions
,!*
World
)
defaultEngineOptions
world
...
...
@@ -209,24 +214,25 @@ defaultEngineOptions world
#
appDir
=
takeDirectory
appPath
#
appName
=
(
if
(
takeExtension
appPath
==
"exe"
)
dropExtension
id
o
dropDirectory
)
appPath
#
options
=
{
appName
=
appName
,
appPath
=
appPath
,
appVersion
=
appVersion
,
serverPort
=
IF_POSIX_OR_WINDOWS
8080
80
,
serverUrl
=
"http://localhost/"
,
allowedHosts
=
[
"127.0.0.1"
]
,
keepaliveTime
=
{
tv_sec
=
300
,
tv_nsec
=
0
}
// 5 minutes
,
sessionTime
=
{
tv_sec
=
60
,
tv_nsec
=
0
}
// 1 minute, (the client pings every 10 seconds by default)
,
persistTasks
=
False
,
autoLayout
=
True
,
distributed
=
False
,
maxEvents
=
5
,
sdsPort
=
9090
,
timeout
=
Nothing
//Just 500
,
webDirPath
=
appDir
</>
appName
+++
"-www"
,
storeDirPath
=
appDir
</>
appName
+++
"-data"
</>
"stores"
,
tempDirPath
=
appDir
</>
appName
+++
"-data"
</>
"tmp"
,
byteCodePath
=
appDir
</>
appName
+++
".bc"
{
appName
=
appName
,
appPath
=
appPath
,
appVersion
=
appVersion
,
serverPort
=
IF_POSIX_OR_WINDOWS
8080
80
,
serverUrl
=
"http://localhost/"
,
allowedHosts
=
[
"127.0.0.1"
]
,
keepaliveTime
=
{
tv_sec
=
300
,
tv_nsec
=
0
}
// 5 minutes
,
sessionTime
=
{
tv_sec
=
60
,
tv_nsec
=
0
}
// 1 minute, (the client pings every 10 seconds by default)
,
persistTasks
=
False
,
autoLayout
=
True
,
distributed
=
False
,
maxEvents
=
5
,
sdsPort
=
9090
,
timeout
=
Nothing
//Just 500
,
webDirPath
=
appDir
</>
appName
+++
"-www"
,
storeDirPath
=
appDir
</>
appName
+++
"-data"
</>
"stores"
,
tempDirPath
=
appDir
</>
appName
+++
"-data"
</>
"tmp"
,
byteCodePath
=
appDir
</>
appName
+++
".bc"
,
showInstructions
=
True
}
=
(
options
,
world
)
...
...
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