@@ -31,45 +31,51 @@ class DriverOutputPage(parent: MesosClusterUI) extends WebUIPage("") {
31
31
def render (request : HttpServletRequest ): Seq [Node ] = {
32
32
val stateFuture = (dispatcher ? RequestDispatcherState )(timeout).mapTo[DispatcherStateResponse ]
33
33
val state = Await .result(stateFuture, timeout)
34
+
35
+ val driverHeaders = Seq (" DriverID" , " Submit Date" , " Start Date" , " Logs" )
36
+ val completedDriverHeaders = driverHeaders ++ Seq (" State" , " Exception" )
37
+ val driverTable = UIUtils .listingTable(driverHeaders, driverRow, state.activeDrivers)
38
+ val completedDriverTable =
39
+ UIUtils .listingTable(completedDriverHeaders, completedDriverRow, state.completedDrivers)
34
40
val content =
35
41
<div class =" row-fluid" >
36
42
<div class =" span12" >
37
- <h3 > Active drivers</ h3 >
38
- {state.activeDrivers.map(d => driverContent(d)).flatten }
39
- <h3 > Completed drivers</ h3 >
40
- {state.completedDrivers.map(d => completedDriverContent(d)).flatten }
43
+ <h4 > Running Drivers </ h4 >
44
+ {driverTable }
45
+ <h4 > Finished Drivers </ h4 >
46
+ {completedDriverTable }
41
47
</div >
42
48
</div >;
43
49
UIUtils .basicSparkPage(content, " Spark Drivers for Mesos cluster" )
44
50
}
45
51
46
- def driverContent (info : DriverInfo ): Seq [Node ] = {
47
- <ul class = " unstyled " >
48
- <li >< strong > ID :</ strong > {info.id}</li >
49
- <li >< strong > Submit Date :</ strong > {info.submitDate}</li >
50
- <li >< strong > Start Date :</ strong > {info.startTime}</li >
51
- <li >< strong > Output :</ strong >
52
+ def driverRow (info : DriverInfo ): Seq [Node ] = {
53
+ <tr >
54
+ <td > {info.id}</td >
55
+ <td > {info.submitDate}</td >
56
+ <td > {info.startTime}</td >
57
+ <td >
52
58
< a href= {" logPage?driverId=%s&logType=stdout"
53
- .format(info.id)}> stdout</a >
59
+ .format(info.id)}> stdout</a >,
54
60
< a href= {" logPage?driverId=%s&logType=stderr"
55
61
.format(info.id)}> stderr</a >
56
- </li >
57
- </ul >
62
+ </td >
63
+ </tr >
58
64
}
59
65
60
- def completedDriverContent (info : DriverInfo ): Seq [Node ] = {
61
- <ul class = " unstyled " >
62
- <li >< strong > ID :</ strong > {info.id}</li >
63
- <li >< strong > Submit Date :</ strong > {info.submitDate}</li >
64
- <li >< strong > Start Date :</ strong > {info.startTime}</li >
65
- <li >< strong > Output :</ strong >
66
+ def completedDriverRow (info : DriverInfo ): Seq [Node ] = {
67
+ <tr >
68
+ <td > {info.id}</td >
69
+ <td > {info.submitDate}</td >
70
+ <td > {info.startTime}</td >
71
+ <td >
66
72
< a href= {" logPage?driverId=%s&logType=stdout"
67
- .format(info.id)}> stdout</a >
73
+ .format(info.id)}> stdout</a >,
68
74
< a href= {" logPage?driverId=%s&logType=stderr"
69
75
.format(info.id)}> stderr</a >
70
- </li >
71
- <li >< strong > State :</ strong > {info.state}</li >
72
- <li >< strong > Exception :</ strong > {info.exception}</li >
73
- </ul >
76
+ </td >
77
+ <td > {info.state}</td >
78
+ <td > {info.exception}</td >
79
+ </tr >
74
80
}
75
81
}
0 commit comments