From 6d14db86074f5ca61378b90bc7a33da2fb045b1e Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Thu, 23 Jun 2016 22:04:54 +0200 Subject: [PATCH] Addad initial map page --- resource/web/main_index.tmpl | 2 +- resource/web/map.tmpl | 12 ++++++++++++ src/se/hal/HalServer.java | 2 ++ src/se/hal/page/MapHttpPage.java | 26 ++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100755 resource/web/map.tmpl create mode 100755 src/se/hal/page/MapHttpPage.java diff --git a/resource/web/main_index.tmpl b/resource/web/main_index.tmpl index 547b10f4..49db3256 100755 --- a/resource/web/main_index.tmpl +++ b/resource/web/main_index.tmpl @@ -108,7 +108,7 @@ {{/showSubNav}} {{#showSubNav}}
{{/showSubNav}} - {{^showSubNav}}
{{/showSubNav}} + {{^showSubNav}}
{{/showSubNav}} {{alerts}} {{content}}
diff --git a/resource/web/map.tmpl b/resource/web/map.tmpl new file mode 100755 index 00000000..1a100907 --- /dev/null +++ b/resource/web/map.tmpl @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/se/hal/HalServer.java b/src/se/hal/HalServer.java index 6b835142..e568715b 100755 --- a/src/se/hal/HalServer.java +++ b/src/se/hal/HalServer.java @@ -76,6 +76,8 @@ public class HalServer { HalHttpPage.getRootNav().createSubNav("Events").setWeight(100); pages = new ArrayList<>(); pages.addAll(Arrays.asList(new HalHttpPage[]{ + new MapHttpPage(), + new SensorOverviewHttpPage(), new SensorConfigHttpPage(), diff --git a/src/se/hal/page/MapHttpPage.java b/src/se/hal/page/MapHttpPage.java new file mode 100755 index 00000000..244a00dd --- /dev/null +++ b/src/se/hal/page/MapHttpPage.java @@ -0,0 +1,26 @@ +package se.hal.page; + +import se.hal.intf.HalHttpPage; +import zutil.io.file.FileUtil; +import zutil.parser.Templator; + +import java.util.Map; + +/** + * Created by Ziver on 2016-06-23. + */ +public class MapHttpPage extends HalHttpPage { + private static final String TEMPLATE = "resource/web/map.tmpl"; + + + public MapHttpPage() { + super("map"); + super.getRootNav().createSubNav(this.getId(), "Map").setWeight(-100); + super.showSubNav(false); + } + + @Override + public Templator httpRespond(Map session, Map cookie, Map request) throws Exception { + return new Templator(FileUtil.find(TEMPLATE)); + } +}