Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
walint
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
hub
walint
Commits
1db21885
Commit
1db21885
authored
3 years ago
by
stuebinm
Browse files
Options
Downloads
Patches
Plain Diff
server: fix map paths in api
parent
dea6636b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/Handlers.hs
+3
-3
3 additions, 3 deletions
server/Handlers.hs
server/Server.hs
+6
-3
6 additions, 3 deletions
server/Server.hs
with
9 additions
and
6 deletions
server/Handlers.hs
+
3
−
3
View file @
1db21885
...
@@ -31,8 +31,8 @@ import Network.WebSockets (PendingConnection, acceptRequest,
...
@@ -31,8 +31,8 @@ import Network.WebSockets (PendingConnection, acceptRequest,
import
Servant
(
Handler
,
err404
,
throwError
)
import
Servant
(
Handler
,
err404
,
throwError
)
import
Server
(
JobStatus
(
..
),
Org
(
orgUrl
),
import
Server
(
JobStatus
(
..
),
Org
(
orgUrl
),
RemoteRef
(
reponame
),
ServerState
,
RemoteRef
(
reponame
),
ServerState
,
Sha1
,
adjustedPath
,
getJobStatus
,
Sha1
,
getJobStatus
,
unState
)
unState
,
adjustedWebPath
)
import
Worker
(
Job
(
Job
))
import
Worker
(
Job
(
Job
))
...
@@ -60,7 +60,7 @@ instance ToJSON MapService where
...
@@ -60,7 +60,7 @@ instance ToJSON MapService where
mapInfo
rev
mappath
MapResult
{
..
}
=
A
.
object
mapInfo
rev
mappath
MapResult
{
..
}
=
A
.
object
[
"badges"
.=
mapresultBadges
[
"badges"
.=
mapresultBadges
-- TODO: type-safe url library for adding the slash?
-- TODO: type-safe url library for adding the slash?
,
"url"
.=
(
orgUrl
org
<>
adjustedPath
rev
org
<>
"/"
<>
toText
mappath
)
]
,
"url"
.=
(
orgUrl
org
<>
adjusted
Web
Path
rev
org
<>
"/"
<>
toText
mappath
)
]
...
...
This diff is collapsed.
Click to expand it.
server/Server.hs
+
6
−
3
View file @
1db21885
...
@@ -30,7 +30,7 @@ module Server ( loadConfig
...
@@ -30,7 +30,7 @@ module Server ( loadConfig
,
ServerState
,
emptyState
,
unState
,
ServerState
,
emptyState
,
unState
,
JobStatus
(
..
)
,
JobStatus
(
..
)
,
prettySha
,
getJobStatus
,
overJobStatus
,
prettySha
,
getJobStatus
,
overJobStatus
,
adjustedPath
,
RealtimeMsg
(
..
),
newRealtimeChannel
)
where
,
adjustedPath
,
RealtimeMsg
(
..
),
newRealtimeChannel
,
adjustedWebPath
)
where
import
Universum
import
Universum
...
@@ -269,9 +269,12 @@ getJobStatus mvar orgslug sha = withMVar mvar $ \state -> pure $ do
...
@@ -269,9 +269,12 @@ getJobStatus mvar orgslug sha = withMVar mvar $ \state -> pure $ do
-- | the path (relative to a baseurl / webdir) where an adjusted
-- | the path (relative to a baseurl / webdir) where an adjusted
-- map should go
-- map should go
adjustedPath
::
Text
->
Org
True
->
Text
-- TODO: filepath library using Text?
adjustedPath
::
Text
->
Org
True
->
Text
-- TODO: filepath library using Text?
adjustedPath
rev
Org
{
..
}
=
adjustedPath
rev
org
@
Org
{
..
}
=
orgWebdir
<>
"/"
<>
(
rev
<>
show
orgGeneration
)
orgWebdir
<>
"/"
<>
adjustedWebPath
rev
org
adjustedWebPath
::
Text
->
Org
True
->
Text
adjustedWebPath
rev
Org
{
..
}
=
rev
<>
show
orgGeneration
newRealtimeChannel
::
IO
RealtimeChannel
newRealtimeChannel
::
IO
RealtimeChannel
newRealtimeChannel
=
atomically
newBroadcastTChan
newRealtimeChannel
=
atomically
newBroadcastTChan
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment