@@ -31,45 +31,51 @@ class DriverOutputPage(parent: MesosClusterUI) extends WebUIPage("") {
3131 def render (request : HttpServletRequest ): Seq [Node ] = {
3232 val stateFuture = (dispatcher ? RequestDispatcherState )(timeout).mapTo[DispatcherStateResponse ]
3333 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)
3440 val content =
3541 <div class =" row-fluid" >
3642 <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 }
4147 </div >
4248 </div >;
4349 UIUtils .basicSparkPage(content, " Spark Drivers for Mesos cluster" )
4450 }
4551
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 >
5258 < a href= {" logPage?driverId=%s&logType=stdout"
53- .format(info.id)}> stdout</a >
59+ .format(info.id)}> stdout</a >,
5460 < a href= {" logPage?driverId=%s&logType=stderr"
5561 .format(info.id)}> stderr</a >
56- </li >
57- </ul >
62+ </td >
63+ </tr >
5864 }
5965
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 >
6672 < a href= {" logPage?driverId=%s&logType=stdout"
67- .format(info.id)}> stdout</a >
73+ .format(info.id)}> stdout</a >,
6874 < a href= {" logPage?driverId=%s&logType=stderr"
6975 .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 >
7480 }
7581}
0 commit comments