Skip to content
Snippets Groups Projects
Commit 78ce67ae authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

Make leon online more configurable so that it can run on laraserver

parent 1dae9568
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,10 @@ object Application extends Controller { ...@@ -15,7 +15,10 @@ object Application extends Controller {
val examples = VerificationExamples.allExamples val examples = VerificationExamples.allExamples
def index = Action { implicit request => def index = Action { implicit request =>
Ok(views.html.index(examples, VerificationExamples.default)) val prefix = Play.current.configuration.getString("app.prefix").getOrElse("")
val wsURL = Play.current.configuration.getString("app.wsURL").getOrElse(routes.Application.openConsole().webSocketURL())
Ok(views.html.index(examples, VerificationExamples.default, prefix, wsURL))
} }
def getExample(id: Int) = Action { def getExample(id: Int) = Action {
......
...@@ -20,9 +20,6 @@ import leon.{LeonContext, Settings, Reporter} ...@@ -20,9 +20,6 @@ import leon.{LeonContext, Settings, Reporter}
import leon.plugin.{TemporaryInputPhase, ExtractionPhase} import leon.plugin.{TemporaryInputPhase, ExtractionPhase}
import leon.verification.AnalysisPhase import leon.verification.AnalysisPhase
import scala.tools.util.PathResolver
object LeonConsole { object LeonConsole {
def open: Promise[(Iteratee[JsValue,_],Enumerator[JsValue])] = { def open: Promise[(Iteratee[JsValue,_],Enumerator[JsValue])] = {
import ConsoleProtocol._ import ConsoleProtocol._
......
@(exs: List[examples.Example], default: examples.Example)(implicit request: RequestHeader) @(exs: List[examples.Example], default: examples.Example, prefix: String, websocketURL: String)(implicit request: RequestHeader)
@main("Leon Online") { @main("Leon Online", prefix) {
<div id="allcontent"> <div id="allcontent">
<div id="title" class="contentbox"></div> <div id="title" class="contentbox"></div>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var WS = window['MozWebSocket'] ? MozWebSocket : WebSocket var WS = window['MozWebSocket'] ? MozWebSocket : WebSocket
var leonSocket = new WS("@leon.web.controllers.routes.Application.openConsole().webSocketURL()") var leonSocket = new WS("@websocketURL")
var sendMessage = function() { var sendMessage = function() {
} }
......
@(title: String)(content: Html) @(title: String, prefix: String)(content: Html)
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>@title</title> <title>@title</title>
<link href="@routes.Assets.at("images/lambda-ico.png")" type="image/png" rel="icon"> <link href="@prefix@routes.Assets.at("images/lambda-ico.png")" type="image/png" rel="icon">
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/leon.css")"> <link rel="stylesheet" media="screen" href="@prefix@routes.Assets.at("stylesheets/leon.css")">
<script src="@routes.Assets.at("javascripts/jquery-1.8.3.min.js")" type="text/javascript"></script> <script src="@prefix@routes.Assets.at("javascripts/jquery-1.8.3.min.js")" type="text/javascript"></script>
<script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script> <script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="@routes.Assets.at("javascripts/leon.js")" type="text/javascript"></script> <script src="@prefix@routes.Assets.at("javascripts/leon.js")" type="text/javascript"></script>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head> </head>
<body> <body>
......
...@@ -45,3 +45,8 @@ logger.play=INFO ...@@ -45,3 +45,8 @@ logger.play=INFO
# Logger provided to your application: # Logger provided to your application:
logger.application=DEBUG logger.application=DEBUG
# This specifies the prefix under which the web page lies, used almost exclusively for the laraserver setup
# app.prefix=/leon
# Defines a specific URL to the websocket service
# app.wsURL="ws://laraserver.epfl.ch:9000/openConsole"
...@@ -6,7 +6,7 @@ body { ...@@ -6,7 +6,7 @@ body {
font-family: Arial, Helvetica, Sans-serif; font-family: Arial, Helvetica, Sans-serif;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
background-image: url('/assets/images/lionbkg.png'); background-image: url('../images/lionbkg.png');
background-color: #FFFFFF; background-color: #FFFFFF;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 25px 15px; background-position: 25px 15px;
...@@ -52,7 +52,7 @@ div#title { ...@@ -52,7 +52,7 @@ div#title {
width: 700px; width: 700px;
min-height: 80px; min-height: 80px;
max-height: 80px; max-height: 80px;
background-image: url('/assets/images/leonlogo.png'); background-image: url('../images/leonlogo.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: right bottom; background-position: right bottom;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment