aboutsummaryrefslogtreecommitdiff
path: root/mavigator-server/src/main/twirl/mavigator/views
diff options
context:
space:
mode:
Diffstat (limited to 'mavigator-server/src/main/twirl/mavigator/views')
-rw-r--r--mavigator-server/src/main/twirl/mavigator/views/app.scala.html47
-rw-r--r--mavigator-server/src/main/twirl/mavigator/views/dashboard.scala.html11
-rw-r--r--mavigator-server/src/main/twirl/mavigator/views/main.scala.html8
3 files changed, 62 insertions, 4 deletions
diff --git a/mavigator-server/src/main/twirl/mavigator/views/app.scala.html b/mavigator-server/src/main/twirl/mavigator/views/app.scala.html
new file mode 100644
index 0000000..7b935b3
--- /dev/null
+++ b/mavigator-server/src/main/twirl/mavigator/views/app.scala.html
@@ -0,0 +1,47 @@
+@(appId: String)(args: (String, String)*)
+
+<div id="scalajs-error" class="alert alert-danger" style="display: none;">
+ <p><strong><i class="fa fa-bug"></i> Error! </strong> An uncaught exception occurred in the browser application,
+ any information displayed on this website may be corrupt. This is NOT an error that should occur under normal
+ operation, it is an indication of a bug in the software.</p>
+ <p>The error was: "<span id="scalajs-error-message"></span>"
+ </p>
+</div>
+
+<div id="@appId">
+ <div class="loader">
+ <i class="fa fa-spinner fa-spin"></i>
+ </div>
+</div>
+
+<script type="text/javascript">
+ document.addEventListener("DOMContentLoaded", function(event) {
+ try {
+ var root0 = document.getElementById("@appId");
+ var args0 = {
+ @args.map{ case (key, value) =>
+ @key: "@value",
+ }
+ }
+
+ while (root0.firstChild) {
+ root0.removeChild(root0.firstChild);
+ }
+
+ Main().start({
+ root: root0,
+ assetsBase: "/assets",
+ args: args0
+ });
+
+ } catch(err) {
+ document.getElementById("scalajs-error").style.display = "block";
+ document.getElementById("scalajs-error-message").innerHTML = err;
+ console.error(err);
+ throw err;
+ }
+ });
+</script>
+
+<script type="text/javascript" src="/assets/js/@{appId}-opt.js"></script>
+
diff --git a/mavigator-server/src/main/twirl/mavigator/views/dashboard.scala.html b/mavigator-server/src/main/twirl/mavigator/views/dashboard.scala.html
new file mode 100644
index 0000000..addd4d5
--- /dev/null
+++ b/mavigator-server/src/main/twirl/mavigator/views/dashboard.scala.html
@@ -0,0 +1,11 @@
+@(socket: String, remoteSystemId: Byte, systemId: Byte, componentId: Byte)
+
+@main("Main"){
+ @app("mavigator-dashboard")(
+ "socketUrl" -> socket,
+ "remoteSystemId" -> remoteSystemId.toString,
+ "systemId" -> systemId.toString,
+ "componentId" -> componentId.toString
+ )
+}
+
diff --git a/mavigator-server/src/main/twirl/mavigator/views/main.scala.html b/mavigator-server/src/main/twirl/mavigator/views/main.scala.html
index 9631c4d..e3e83b8 100644
--- a/mavigator-server/src/main/twirl/mavigator/views/main.scala.html
+++ b/mavigator-server/src/main/twirl/mavigator/views/main.scala.html
@@ -11,16 +11,16 @@
<title>Mavigator - @title</title>
<link rel="shortcut icon" href="/assets/images/logo.svg">
- <link rel="stylesheet" media="screen" href="/assets/lib/bootstrap/css/bootstrap.min.css">
- <link rel="stylesheet" media="screen" href="/assets/lib/font-awesome/css/font-awesome.min.css">
+ <link rel="stylesheet" media="screen" href="/assets/lib/bootstrap-3.3.6-dist/css/bootstrap.min.css">
+ <link rel="stylesheet" media="screen" href="/assets/lib/font-awesome-4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" media="screen" href="/assets/stylesheets/main.css">
</head>
<body>
@content
- <script type="text/javascript" src="/assets/lib/jquery/jquery.js"></script>
- <script type="text/javascript" src="/assets/lib/bootstrap/js/bootstrap.min.js"></script>
+ <script type="text/javascript" src="/assets/lib/jquery-2.2.0/jquery.js"></script>
+ <script type="text/javascript" src="/assets/lib/bootstrap-3.3.6-dist/js/bootstrap.min.js"></script>
</body>
</html>