1
0

main.tpl 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. {{ define "main" }}
  2. {{ template "header" .}}
  3. <div id="wrapper">
  4. {{ template "navigation" .}}
  5. <!-- Page Content -->
  6. <div id="page-wrapper">
  7. <div class="container-fluid">
  8. <div class="row">
  9. <div class="col-lg-12">
  10. {{ if .Title }}
  11. <h1 class="page-header">{{.Title}}</h1>
  12. {{ end }}
  13. <div class="col-lg-6">
  14. {{ if .Agents }}
  15. <div class="panel panel-default">
  16. <div class="panel-heading">
  17. Statistics
  18. </div>
  19. <!-- /.panel-heading -->
  20. <div class="panel-body">
  21. <ul>
  22. <li>{{.Agents}}</li>
  23. <li>{{.Inventory}}</li>
  24. <li>{{.Positions}}</li>
  25. <li>{{.Obstacles}}</li>
  26. </ul>
  27. </div>
  28. <!-- /.panel-body -->
  29. </div>
  30. <!-- /.panel -->
  31. {{ end }}
  32. {{ if .ObstaclePieChart }}
  33. <div class="panel panel-default">
  34. <div class="panel-heading">
  35. Obstacles (and Phantom objects)
  36. </div>
  37. <!-- /.panel-heading -->
  38. <div class="panel-body">
  39. <div class="flot-chart">
  40. <div class="flot-chart-content" id="flot-pie-chart"></div>
  41. </div>
  42. </div>
  43. <!-- /.panel-body -->
  44. </div>
  45. <!-- /.panel -->
  46. {{ end }}
  47. </div> <!-- ./col-lg-6 -->
  48. <div class="col-lg-6">
  49. {{ if and .SetCookie (not .LSL) (not .Preamble) }}
  50. <div class="panel panel-default">
  51. <div class="panel-heading">
  52. User
  53. </div>
  54. <!-- /.panel-heading -->
  55. <div class="panel-body">
  56. {{ if .Gravatar }}
  57. <div style="float:left;">
  58. <a href="https://gravatar.com/{{ .GravatarHash }}" title="{{ .SetCookie }}">
  59. <img class="avatar avatar-{{ .GravatarSize }} photo" src="{{ .Gravatar }}" srcset="https://secure.gravatar.com/avatar/{{ .GravatarHash }}?s={{ .GravatarTwiceSize }}&amp;d=mm&amp;r=r 2x" height="{{ .GravatarSize }}" width="{{ .GravatarSize }}" alt="{{ .SetCookie }}">
  60. </a>
  61. </div>
  62. {{ end }}
  63. <div style="float:right;">
  64. Welcome, {{ .SetCookie }}
  65. </div>
  66. </div>
  67. <!-- /.panel-body -->
  68. </div>
  69. <!-- /.panel -->
  70. {{ end }}
  71. {{ if .MapURL }}
  72. <div class="panel panel-default">
  73. <div class="panel-heading">
  74. In-world map
  75. </div>
  76. <!-- /.panel-heading -->
  77. <div class="panel-body">
  78. <div id="map"></div>
  79. <script type="text/javascript">
  80. // create a few cute markers
  81. var agentMarker = L.VectorMarkers.icon({
  82. icon: 'android',
  83. markerColor: 'green'
  84. });
  85. var objectMarker = L.VectorMarkers.icon({
  86. icon: 'cubes',
  87. markerColor: 'blue'
  88. });
  89. var positionMarker = L.VectorMarkers.icon({
  90. icon: 'codepen',
  91. markerColor: 'red'
  92. });
  93. // set up the map
  94. var map = L.map('map', {
  95. attributionControl: false,
  96. crs: L.CRS.Simple,
  97. minZoom: -3
  98. });
  99. var bounds = [[0,0], [255,255]];
  100. var image = L.imageOverlay({{ .MapURL }}, bounds).addTo(map);
  101. map.fitBounds(bounds);
  102. {{ .MapMarkers }}
  103. map.setView([128, 128], 1);
  104. /*
  105. var mapMinZoom = 1
  106. var mapMaxZoom = 6
  107. L.Projection.Direct = {
  108. project: function (latlng) {
  109. return new L.Point(latlng.lat*256, latlng.lng*256);
  110. },
  111. unproject: function (point) {
  112. return new L.LatLng(point.x/256, point.y/256);
  113. }
  114. };
  115. L.CRS.OpenSim=L.extend({},L.CRS,{
  116. projection: L.Projection.Direct,
  117. transformation:new L.Transformation(1,0,1,0),
  118. scale: function (zoom) {
  119. return 1;// OpenSim zoom
  120. }
  121. });
  122. var map = L.map('map',{
  123. attributionControl: false,
  124. minZoom: mapMinZoom,
  125. maxZoom: mapMaxZoom,
  126. crs: L.CRS.OpenSim
  127. });
  128. map.setView([3646, 3645], 1);
  129. L.tileLayer('http://opensim.betatechnologies.info:8002/map-{z}-{x}-{y}-objects.jpg', {
  130. maxZoom: mapMaxZoom,
  131. continuousWorld: true,
  132. noWrap:true,
  133. tileSize:256,
  134. crs: L.CRS.OpenSim,
  135. attribution: 'opensim',
  136. id: 'opensim',
  137. }).addTo(map);
  138. map.panTo([3646, 3645]);
  139. */
  140. </script>
  141. </div>
  142. <!-- /.panel-body -->
  143. </div>
  144. <!-- /.panel -->
  145. {{ end }}
  146. </div> <!-- ./col-lg-6 -->
  147. {{ if .Preamble }}
  148. {{ .Preamble }}
  149. {{ end }}
  150. {{ if .Content }}
  151. {{ .Content }}
  152. {{ end }}
  153. {{ if .LSL }}
  154. {{ if eq .LSL "lsl-register-object" }}
  155. {{ template "lsl-register-object" . }}
  156. {{ end }}
  157. {{ if eq .LSL "lsl-bot-controller" }}
  158. {{ template "lsl-bot-controller" . }}
  159. {{ end }}
  160. {{ if eq .LSL "lsl-agent-scripts" }}
  161. {{ template "lsl-agent-scripts" . }}
  162. {{ end }}
  163. <script>hljs.initHighlightingOnLoad();</script>
  164. {{ end }}
  165. {{ if .ButtonText }}
  166. <a href="{{.URLPathPrefix}}{{ .ButtonURL }}">
  167. <button id={{.ButtonID}} type="button" class="btn btn-outline btn-primary btn-lg">{{ .ButtonText }}</button>
  168. </a>
  169. {{ end }}
  170. </div>
  171. <!-- /.col-lg-12 -->
  172. </div>
  173. <!-- /.row -->
  174. </div>
  175. <!-- /.container-fluid -->
  176. </div>
  177. <!-- /#page-wrapper -->
  178. </div>
  179. <!-- /#wrapper -->
  180. {{ template "footer" .}}
  181. {{ end }}