Addad initial map page

This commit is contained in:
Ziver Koc 2016-06-23 22:04:54 +02:00
parent c765b4d983
commit 6d14db8607
4 changed files with 41 additions and 1 deletions

View file

@ -108,7 +108,7 @@
{{/showSubNav}} {{/showSubNav}}
{{#showSubNav}}<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">{{/showSubNav}} {{#showSubNav}}<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">{{/showSubNav}}
{{^showSubNav}}<div class="col-sm-11 col-sm-offset-1 col-md-11 col-md-offset-1 main">{{/showSubNav}} {{^showSubNav}}<div class="col-sm-9 col-sm-offset-1 col-md-10 col-md-offset-1 main">{{/showSubNav}}
{{alerts}} {{alerts}}
{{content}} {{content}}
</div> </div>

12
resource/web/map.tmpl Executable file
View file

@ -0,0 +1,12 @@
<svg width="100%" width="500" viewBox="0 0 1000 500">
<!-- Map -->
<image x="0" y="0" width="1000" height="500"
xlink:href="/img/floorplan.jpg" />
<!-- debug stuff -->
<rect width="100%" height="100%" style="fill-opacity:0;stroke-width:5;stroke:rgb(0,0,0)" />
</svg>

After

Width:  |  Height:  |  Size: 298 B

View file

@ -76,6 +76,8 @@ public class HalServer {
HalHttpPage.getRootNav().createSubNav("Events").setWeight(100); HalHttpPage.getRootNav().createSubNav("Events").setWeight(100);
pages = new ArrayList<>(); pages = new ArrayList<>();
pages.addAll(Arrays.asList(new HalHttpPage[]{ pages.addAll(Arrays.asList(new HalHttpPage[]{
new MapHttpPage(),
new SensorOverviewHttpPage(), new SensorOverviewHttpPage(),
new SensorConfigHttpPage(), new SensorConfigHttpPage(),

View file

@ -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<String, Object> session, Map<String, String> cookie, Map<String, String> request) throws Exception {
return new Templator(FileUtil.find(TEMPLATE));
}
}