Esempio n. 1
0
        /// <returns>
        /// The end of the JS map that is the jquery datatable config for the
        /// attempts table.
        /// </returns>
        private string AttemptsTableInit()
        {
            TaskType type   = null;
            string   symbol = $(AMParams.TaskType);

            if (!symbol.IsEmpty())
            {
                type = MRApps.TaskType(symbol);
            }
            else
            {
                TaskId taskID = MRApps.ToTaskID($(AMParams.TaskId));
                type = taskID.GetTaskType();
            }
            StringBuilder b = JQueryUI.TableInit().Append(", 'aaData': attemptsTableData").Append
                                  (", bDeferRender: true").Append(", bProcessing: true").Append("\n,aoColumnDefs:[\n"
                                                                                                ).Append("\n{'aTargets': [ 4 ]").Append(", 'bSearchable': false }").Append("\n, {'sType':'numeric', 'aTargets': [ 0 ]"
                                                                                                                                                                           ).Append(", 'mRender': parseHadoopAttemptID }").Append("\n, {'sType':'numeric', 'aTargets': [ 5, 6"
                                                                                                                                                                                                                                  ).Append(type == TaskType.Reduce ? ", 7, 8" : string.Empty).Append(" ], 'mRender': renderHadoopDate }"
                                                                                                                                                                                                                                                                                                     ).Append("\n, {'sType':'numeric', 'aTargets': [").Append(type == TaskType.Reduce
                                 ? "9, 10, 11, 12" : "7").Append(" ], 'mRender': renderHadoopElapsedTime }]").Append
                                  ("\n, aaSorting: [[0, 'asc']]").Append("}");

            //logs column should not filterable (it includes container ID which may pollute searches)
            //Column numbers are different for maps and reduces
            // Sort by id upon page load
            return(b.ToString());
        }
Esempio n. 2
0
 //TODO We need a way to move all of the javascript/CSS that is for a subview
 // into that subview.
 /// <returns>
 /// The end of a javascript map that is the jquery datatable
 /// configuration for the jobs table.  the Jobs table is assumed to be
 /// rendered by the class returned from
 /// <see cref="Content()"/>
 ///
 /// </returns>
 private string JobsTableInit()
 {
     return(JQueryUI.TableInit().Append(", 'aaData': jobsTableData").Append(", bDeferRender: true"
                                                                            ).Append(", bProcessing: true").Append(", aaSorting: [[3, 'desc']]").Append(", aoColumnDefs:["
                                                                                                                                                        ).Append("{'sType':'numeric', 'bSearchable': false" + ", 'aTargets': [ 8, 9, 10, 11 ] }"
                                                                                                                                                                 ).Append("]}").ToString());
 }
Esempio n. 3
0
 public static string AppsTableInit(bool isFairSchedulerPage)
 {
     // id, user, name, queue, starttime, finishtime, state, status, progress, ui
     // FairSchedulerPage's table is a bit different
     return(JQueryUI.TableInit().Append(", 'aaData': appsTableData").Append(", bDeferRender: true"
                                                                            ).Append(", bProcessing: true").Append("\n, aoColumnDefs: ").Append(GetAppsTableColumnDefs
                                                                                                                                                    (isFairSchedulerPage)).Append(", aaSorting: [[0, 'desc']]}").ToString());
 }
Esempio n. 4
0
 private string AttemptsTableInit()
 {
     return(JQueryUI.TableInit().Append(", 'aaData': attemptsTableData").Append(", bDeferRender: true"
                                                                                ).Append(", bProcessing: true").Append("\n,aoColumnDefs:[\n").Append("\n{'aTargets': [ 5 ]"
                                                                                                                                                     ).Append(", 'bSearchable': false }").Append("\n, {'sType':'numeric', 'aTargets': [ 6, 7"
                                                                                                                                                                                                 ).Append(" ], 'mRender': renderHadoopDate }").Append("\n, {'sType':'numeric', 'aTargets': [ 8"
                                                                                                                                                                                                                                                      ).Append(" ], 'mRender': renderHadoopElapsedTime }]").Append("\n, aaSorting: [[0, 'asc']]"
                                                                                                                                                                                                                                                                                                                   ).Append("}").ToString());
 }
Esempio n. 5
0
 private string TasksTableInit()
 {
     return(JQueryUI.TableInit().Append(", 'aaData': tasksTableData").Append(", bDeferRender: true"
                                                                             ).Append(", bProcessing: true").Append("\n, aoColumnDefs: [\n").Append("{'sType':'string', 'aTargets': [0]"
                                                                                                                                                    ).Append(", 'mRender': parseHadoopID }").Append("\n, {'sType':'numeric', bSearchable:false, 'aTargets': [1]"
                                                                                                                                                                                                    ).Append(", 'mRender': parseHadoopProgress }").Append("\n, {'sType':'numeric', 'aTargets': [4, 5]"
                                                                                                                                                                                                                                                          ).Append(", 'mRender': renderHadoopDate }").Append("\n, {'sType':'numeric', 'aTargets': [6]"
                                                                                                                                                                                                                                                                                                             ).Append(", 'mRender': renderHadoopElapsedTime }]").Append(", aaSorting: [[0, 'asc']] }"
                                                                                                                                                                                                                                                                                                                                                                        ).ToString());
 }
Esempio n. 6
0
        private string NodesTableInit()
        {
            StringBuilder b = JQueryUI.TableInit().Append(", aoColumnDefs: [");

            b.Append("{'bSearchable': false, 'aTargets': [ 7 ]}");
            b.Append(", {'sType': 'title-numeric', 'bSearchable': false, " + "'aTargets': [ 8, 9 ] }"
                     );
            b.Append(", {'sType': 'title-numeric', 'aTargets': [ 5 ]}");
            b.Append("]}");
            return(b.ToString());
        }
Esempio n. 7
0
 protected internal override void Render(Hamlet.HTML <HtmlPage._> html)
 {
     Set(JQueryUI.DatatablesId, "t1 t2 t3 t4");
     Set(JQueryUI.InitID(JQueryUI.Datatables, "t1"), JQueryUI.TableInit().Append("}").
         ToString());
     Set(JQueryUI.InitID(JQueryUI.Datatables, "t2"), StringHelper.Join("{bJQueryUI:true, sDom:'t',"
                                                                       , "aoColumns:[null, {bSortable:false, bSearchable:false}]}"));
     Set(JQueryUI.InitID(JQueryUI.Datatables, "t3"), "{bJQueryUI:true, sDom:'t'}");
     Set(JQueryUI.InitID(JQueryUI.Datatables, "t4"), "{bJQueryUI:true, sDom:'t'}");
     html.Title("Test DataTables").Link("/static/yarn.css").(typeof(JQueryUI)).Style(".wrapper { padding: 1em }"
                                                                                     , ".wrapper h2 { margin: 0.5em 0 }", ".dataTables_wrapper { min-height: 1em }").
     Div(".wrapper").H2("Default table init").Table("#t1").Thead().Tr().Th("Column1")
     .Th("Column2").().().Tbody().Tr().Td("c1r1").Td("c2r1").().Tr().Td("c1r2").Td("c2r2"
                                                                                   ).().().().H2("Nested tables").Div(JQueryUI.InfoWrap).Table("#t2").Thead().Tr().
     Th(JQueryUI.Th, "Column1").Th(JQueryUI.Th, "Column2").().().Tbody().Tr().Td("r1"
                                                                                 ).Td().$class(JQueryUI.CTable).Table("#t3").Thead().Tr().Th("SubColumn1").Th("SubColumn2"
                                                                                                                                                              ).().().Tbody().Tr().Td("subc1r1").Td("subc2r1").().Tr().Td("subc1r2").Td("subc2r2"
                                                                                                                                                                                                                                        ).().().().().().Tr().Td("r2").Td().$class(JQueryUI.CTable).Table("#t4").Thead()
     .Tr().Th("SubColumn1").Th("SubColumn2").().().Tbody().Tr().Td("subc1r1").Td("subc2r1"
                                                                                 ).().Tr().Td("subc1r2").Td("subc2r2").().().().().().().().().().();
 }
Esempio n. 8
0
        /// <returns>
        /// the end of the JS map that is the jquery datatable configuration
        /// for the tasks table.
        /// </returns>
        private string TasksTableInit()
        {
            TaskType type   = null;
            string   symbol = $(AMParams.TaskType);

            if (!symbol.IsEmpty())
            {
                type = MRApps.TaskType(symbol);
            }
            StringBuilder b = JQueryUI.TableInit().Append(", 'aaData': tasksTableData").Append
                                  (", bDeferRender: true").Append(", bProcessing: true").Append("\n, aoColumnDefs: [\n"
                                                                                                ).Append("{'sType':'string', 'aTargets': [ 0 ]").Append(", 'mRender': parseHadoopID }"
                                                                                                                                                        ).Append(", {'sType':'numeric', 'aTargets': [ 4").Append(type == TaskType.Reduce
                                 ? ", 9, 10, 11, 12" : ", 7").Append(" ], 'mRender': renderHadoopElapsedTime }")
                              .Append("\n, {'sType':'numeric', 'aTargets': [ 2, 3, 5").Append(type == TaskType
                                                                                              .Reduce ? ", 6, 7, 8" : ", 6").Append(" ], 'mRender': renderHadoopDate }]").Append
                                  ("\n, aaSorting: [[0, 'asc']]").Append("}");

            // Sort by id upon page load
            return(b.ToString());
        }
Esempio n. 9
0
 private string JobsTableInit()
 {
     return(JQueryUI.TableInit().Append(", aaSorting: [[0, 'asc']]").Append(",aoColumns:[{sType:'title-numeric'},"
                                                                            ).Append("null,null,{sType:'title-numeric', bSearchable:false},null,").Append("null,{sType:'title-numeric',bSearchable:false}, null, null]}"
                                                                                                                                                          ).ToString());
 }
Esempio n. 10
0
 /// <returns>
 /// The end of a javascript map that is the jquery datatable
 /// configuration for the jobs table.  the Jobs table is assumed to be
 /// rendered by the class returned from
 /// <see cref="Content()"/>
 ///
 /// </returns>
 private string CounterTableInit()
 {
     return(JQueryUI.TableInit().Append(",aoColumnDefs:[").Append("{'sType':'title-numeric', 'aTargets': [ 1 ] }"
                                                                  ).Append("]}").ToString());
 }
Esempio n. 11
0
 private string ContainersTableInit()
 {
     return(JQueryUI.TableInit().Append(",aoColumns:[null]}").ToString());
 }
Esempio n. 12
0
 private string AppsTableInit()
 {
     return(JQueryUI.TableInit().Append(", aaSorting: [[0, 'asc']]").Append(", aoColumns:[null, null]} "
                                                                            ).ToString());
 }
Esempio n. 13
0
 /// <returns>
 /// the end of the JS map that is the jquery datatable config for the
 /// conf table.
 /// </returns>
 private string ConfTableInit()
 {
     return(JQueryUI.TableInit().Append("}").ToString());
 }
Esempio n. 14
0
 private string ContainersTableInit()
 {
     return(JQueryUI.TableInit().Append(", aoColumns:[null, null, {bSearchable:false}]} "
                                        ).ToString());
 }
Esempio n. 15
0
 public static string ContainersTableInit()
 {
     return(JQueryUI.TableInit().Append(", 'aaData': containersTableData").Append(", bDeferRender: true"
                                                                                  ).Append(", bProcessing: true").Append("\n, aoColumnDefs: ").Append(GetContainersTableColumnDefs
                                                                                                                                                          ()).Append(", aaSorting: [[0, 'desc']]}").ToString());
 }