private Result listSessions ( ) { StringBuilder sb = new StringBuilder ( "<!DOCTYPE html>\n" + "<html lang=\"en\">\n" + "<head>\n" + " <meta charset=\"utf-8\">\n" + " <title>Training sessions - DL4J Training UI</title>\n" + " </head>\n" + "\n" + " <body>\n" + " <h1>DL4J Training UI</h1>\n" + " <p>UI server is in multi-session mode." + " To visualize a training session, please select one from the following list.</p>\n" + " <h2>List of attached training sessions</h2>\n" ) ; if ( ! knownSessionIDs . isEmpty ( ) ) { sb . append ( " <ul>" ) ; for ( String sessionId : knownSessionIDs . keySet ( ) ) { sb . append ( " <li><a href=\"train/" + sessionId + "\">" + sessionId + "</a></li>\n" ) ; } sb . append ( " </ul>" ) ; } else { sb . append ( "No training session attached." ) ; } sb . append ( " </body>\n" + "</html>\n" ) ; return ok ( sb . toString ( ) ) . as ( "text/html; charset=utf-8" ) ; }
List training sessions