Display deprecated channels (#489)
This commit is contained in:
parent
75e8457105
commit
74ed61a915
|
@ -27,7 +27,7 @@
|
|||
filteredChannels =
|
||||
lib.filterAttrs
|
||||
(n: v:
|
||||
builtins.elem v.status ["beta" "stable" "rolling"] &&
|
||||
builtins.elem v.status ["rolling" "beta" "stable" "deprecated"] &&
|
||||
lib.hasPrefix "nixos-" n &&
|
||||
v ? variant && v.variant == "primary"
|
||||
)
|
||||
|
|
|
@ -170,15 +170,27 @@ type alias NixOSChannel =
|
|||
|
||||
type NixOSChannelStatus
|
||||
= Rolling
|
||||
| Stable
|
||||
| Beta
|
||||
| Stable
|
||||
| Deprecated
|
||||
|
||||
|
||||
channelTitle : NixOSChannel -> String
|
||||
channelTitle channel =
|
||||
if channel.status == Beta
|
||||
then channel.id ++ " (Beta)"
|
||||
else channel.id
|
||||
channelBadge : NixOSChannelStatus -> List (Html msg)
|
||||
channelBadge status =
|
||||
case status of
|
||||
Rolling ->
|
||||
-- [ span [ class "label label-success" ] [ text "Rolling" ] ]
|
||||
[]
|
||||
|
||||
Beta ->
|
||||
[ span [ class "label label-info" ] [ text "Beta" ] ]
|
||||
|
||||
Stable ->
|
||||
-- [ span [ class "label label-success" ] [ text "Stable" ] ]
|
||||
[]
|
||||
|
||||
Deprecated ->
|
||||
[ span [ class "label label-warning" ] [ text "Deprecated" ] ]
|
||||
|
||||
|
||||
decodeNixOSChannels : Json.Decode.Decoder NixOSChannels
|
||||
|
@ -188,7 +200,6 @@ decodeNixOSChannels =
|
|||
(Json.Decode.field "channels" (Json.Decode.list decodeNixOSChannel))
|
||||
|
||||
|
||||
|
||||
decodeNixOSChannel : Json.Decode.Decoder NixOSChannel
|
||||
decodeNixOSChannel =
|
||||
Json.Decode.map4 NixOSChannel
|
||||
|
@ -201,11 +212,14 @@ decodeNixOSChannel =
|
|||
"rolling" ->
|
||||
Json.Decode.succeed Rolling
|
||||
|
||||
"beta" ->
|
||||
Json.Decode.succeed Beta
|
||||
|
||||
"stable" ->
|
||||
Json.Decode.succeed Stable
|
||||
|
||||
"beta" ->
|
||||
Json.Decode.succeed Beta
|
||||
"deprecated" ->
|
||||
Json.Decode.succeed Deprecated
|
||||
|
||||
_ ->
|
||||
Json.Decode.fail ("Unknown status: " ++ status)
|
||||
|
@ -983,7 +997,7 @@ viewChannels nixosChannels outMsg selectedChannel =
|
|||
]
|
||||
, onClick <| outMsg (ChannelChange channel.id)
|
||||
]
|
||||
[ text <| channelTitle channel ]
|
||||
(List.intersperse (text " ") ([ text channel.id ] ++ channelBadge channel.status))
|
||||
)
|
||||
nixosChannels
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue