Skip to content

Commit

Permalink
Merge pull request #100 from input-output-hk/cad-2320-fix-node-commit…
Browse files Browse the repository at this point in the history
…-link

CAD-2320: fix Node commit href.
  • Loading branch information
Denis Shevchenko committed Nov 24, 2020
2 parents 1927d2a + 7d6aa5c commit f03d23b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/Cardano/RTView/GUI/CSS/Style.hs
Expand Up @@ -42,6 +42,10 @@ ownCSS = unpack . TL.toStrict . render $ do
a # visited # hover ? do
color "#4b0082"

cl InactiveHref ? do
pointerEvents none
cursor cursorDefault

cl TopBar ? do
backgroundColor "#1b2238"
color whitesmoke
Expand Down
2 changes: 2 additions & 0 deletions src/Cardano/RTView/GUI/Elements.hs
Expand Up @@ -150,6 +150,7 @@ data HTMLClass
| GridRowCell
| HSpacer
| IdleNode
| InactiveHref
| InfoMark
| InfoMarkImg
| MetricsArea
Expand Down Expand Up @@ -264,6 +265,7 @@ instance Show HTMLClass where
show GridRowCell = "GridRowCell"
show HSpacer = "HSpacer"
show IdleNode = "IdleNode"
show InactiveHref = "InactiveHref"
show InfoMark = "InfoMark"
show InfoMarkImg = "InfoMarkImg"
show MetricsArea = "MetricsArea"
Expand Down
5 changes: 3 additions & 2 deletions src/Cardano/RTView/GUI/Markup/Grid.hs
Expand Up @@ -227,9 +227,10 @@ mkNodeElements NodeState {..} nameOfNode elIdleNode acceptors = do
#+ []

elNodeCommitHref
<- UI.anchor # set UI.href ""
<- UI.anchor #. [InactiveHref]
# set UI.href ""
# set UI.target "_blank"
# set UI.title__ "Browse cardano-node repository on this commit"
# set UI.title__ ""
# set UI.text (showText nodeShortCommit)

return $ HM.fromList
Expand Down
5 changes: 3 additions & 2 deletions src/Cardano/RTView/GUI/Markup/Pane.hs
Expand Up @@ -145,9 +145,10 @@ mkNodePane nsTVar NodeState {..} nameOfNode acceptors = do
]
elRTSMemoryProgressBox <- UI.div #. [ProgressBarBox] #+ [element elRTSMemoryProgress]

elNodeCommitHref <- UI.anchor # set UI.href ""
elNodeCommitHref <- UI.anchor #. [InactiveHref]
# set UI.href ""
# set UI.target "_blank"
# set UI.title__ "Browse cardano-node repository on this commit"
# set UI.title__ ""
# set UI.text (showText nodeShortCommit)

-- Create content area for each tab.
Expand Down
4 changes: 3 additions & 1 deletion src/Cardano/RTView/GUI/Updater.hs
Expand Up @@ -384,8 +384,10 @@ setNodeCommit
setNodeCommit _ _ _ _ False _ _ = return ()
setNodeCommit tv nameOfNode commit shortCommit True els elName =
whenJust (els !? elName) $ \el -> do
void $ element el # set UI.href ("https://github.com/input-output-hk/cardano-node/commit/"
void $ element el #. []
# set UI.href ("https://github.com/input-output-hk/cardano-node/commit/"
<> unpack commit)
# set UI.title__ "Browse cardano-node repository on this commit"
# set text (unpack shortCommit)
setChangedFlag tv
nameOfNode
Expand Down

0 comments on commit f03d23b

Please sign in to comment.