File tree Expand file tree Collapse file tree 1 file changed +47
-2
lines changed Expand file tree Collapse file tree 1 file changed +47
-2
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,16 @@ open Thoth.Fetch
6
6
open Shared
7
7
8
8
type Model =
9
- { Hello: string }
9
+ { Hello: string
10
+ Status: BuildStatus }
10
11
11
12
type Msg =
12
13
| GotHello of string
13
14
14
15
let init () =
15
16
let model : Model =
16
- { Hello = " " }
17
+ { Hello = " "
18
+ Status = Requests [ BuildRequest.create() ] }
17
19
let getHello () = Fetch.get< unit, string> Route.hello
18
20
let cmd = Cmd.OfPromise.perform getHello () GotHello
19
21
model, cmd
@@ -25,6 +27,48 @@ let update msg model =
25
27
26
28
open Feliz
27
29
30
+ let renderRequest request =
31
+ Html.tr [
32
+ prop.style [
33
+ style.border ( 1 , borderStyle.solid, " lightgray" )
34
+ ]
35
+ prop.children [
36
+ Html.td request.User
37
+ Html.td [
38
+ Html.a [
39
+ prop.style [ style.fontFamily " monospace" ]
40
+ prop.href ( sprintf " http://github/owner/repo/commit/%A " request.Sha1)
41
+ prop.text ( request.Sha1.ToString() .Substring( 0 , 7 ))
42
+ ]
43
+ ]
44
+ Html.td [
45
+ prop.style [ style.fontFamily " monospace" ]
46
+ prop.text ( request.Platform.ToString())
47
+ ]
48
+ Html.td [
49
+ prop.style [ style.fontFamily " monospace" ]
50
+ prop.text ( request.Configuration.ToString())
51
+ ]
52
+ ]
53
+ ]
54
+
55
+ let renderQueue model =
56
+ Html.table [
57
+ prop.style [
58
+ style.marginLeft length.auto
59
+ style.marginRight length.auto
60
+ style.borderCollapse.collapse
61
+ ]
62
+ prop.children [
63
+ Html.tbody [
64
+ match model.Status with
65
+ | Requests requests ->
66
+ for r in requests do
67
+ yield renderRequest r
68
+ ]
69
+ ]
70
+ ]
71
+
28
72
let view model dispatch =
29
73
Html.div [
30
74
prop.style [
@@ -37,6 +81,7 @@ let view model dispatch =
37
81
Html.img [ prop.src " favicon.png" ]
38
82
Html.h1 " safe_minimal"
39
83
Html.h2 model.Hello
84
+ renderQueue model
40
85
]
41
86
]
42
87
]
You can’t perform that action at this time.
0 commit comments