Changeset 3a89adb for src/webapp/mapservice/src-gen/openapi_server
- Timestamp:
- Mar 13, 2019, 9:16:45 PM (8 years ago)
- Branches:
- debian/bullseye, master
- Children:
- 5e4cb73
- Parents:
- cb39a77
- git-author:
- Joachim Langenbach <joachim.langenbach@…> (03/13/19 20:03:34)
- git-committer:
- Joachim Langenbach <joachim.langenbach@…> (03/13/19 21:16:45)
- Location:
- src/webapp/mapservice/src-gen/openapi_server
- Files:
-
- 21 added
- 6 moved
-
__init__.py (moved) (moved from src/webapp/apigility/memory: )
-
__main__.py (added)
-
controllers/__init__.py (added)
-
controllers/waters_controller.py (added)
-
encoder.py (added)
-
models/__init__.py (added)
-
models/base_model_.py (added)
-
models/http_error.py (added)
-
models/order.py (added)
-
models/water.py (added)
-
models/water_creation.py (added)
-
openapi/openapi.yaml (added)
-
server_impl (added)
-
static/css/GnuBoat.Colors.css (moved) (moved from src/webapp/apigility/module/gnuboat_mapservice/src/GnuBoat/MapService/Water.php ) (2 diffs)
-
static/css/GnuBoat.css (moved) (moved from src/webapp/webserver/css/GnuBoat.css )
-
static/css/side-menu.css (added)
-
static/index.html (moved) (moved from src/webapp/webserver/index.html ) (4 diffs)
-
static/js/GnuBoat.Webserver.js (moved) (moved from src/webapp/webserver/js/GnuBoat.Webserver.js ) (2 diffs)
-
static/js/GnuBoat.js (added)
-
static/resources/gnuboat-256-256-transparent.png (added)
-
static/resources/layers-2x.png (moved) (moved from src/webapp/webserver/lib/css/leaflet/images/layers-2x.png )
-
static/resources/layers.png (added)
-
templates/index.html (added)
-
test/__init__.py (added)
-
test/test_default_controller.py (added)
-
test/test_waters_controller.py (added)
-
util.py (added)
Legend:
- Unmodified
- Added
- Removed
-
src/webapp/mapservice/src-gen/openapi_server/static/css/GnuBoat.Colors.css
rcb39a77 r3a89adb 1 <?php2 1 /* 3 Copyright (C) 201 9EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.2 Copyright (C) 2018 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved. 4 3 5 4 This program is free software: you can redistribute it and/or modify … … 17 16 */ 18 17 19 namespace gnuboat_mapservice\GnuBoat\MapService; 20 21 class Water 22 { 23 public $waterId; 24 public $label; 25 public $osmId; 26 public $osmType; 27 public $osmClass; 18 :root { 19 --gnuboat-turquois-dark: #347C7C; 20 --gnuboat-turquois-middle: #93C0C0; 21 --gnuboat-turquois-light: #BCD9D9; 22 --gnuboat-green-dark: #45A545; 23 --gnuboat-green-middle: #ACDFAC; 24 --gnuboat-green-light: #CCECCC; 25 --gnuboat-red: #8C1C00; 28 26 29 public function __construct(int $id, string $label, int $osm_id, string $osm_type, string $osm_class) 30 { 31 $this->waterId = $id; 32 $this->label = $label; 33 $this->osmId = $osm_id; 34 $this->osmType = $osm_type; 35 $this->osmClass = $osm_class; 36 } 27 --gnuboat-primary-dark: var(--gnuboat-turquois-dark); 28 --gnuboat-primary-middle: var(--gnuboat-turquois-middle); 29 --gnuboat-primary-light: var(--gnuboat-turquois-light); 30 --gnuboat-secondary-dark: var(--gnuboat-green-dark); 31 --gnuboat-secondary-middle: var(--gnuboat-green-middle); 32 --gnuboat-secondary-light: var(--gnuboat-green-light); 33 --gnuboat-warning: var(--gnuboat-red); 37 34 } -
src/webapp/mapservice/src-gen/openapi_server/static/index.html
rcb39a77 r3a89adb 33 33 34 34 <script src="lib/js/jquery-3.2.1.min.js" type="text/javascript"></script> 35 <script src="lib/js/jquery.validate.min.js" type="text/javascript"></script> 35 36 <script src="lib/js/leaflet.js" type="text/javascript"></script> 36 37 <!--<script src="lib/js/leaflet.hotline.min.js" type="text/javascript"></script>--> … … 70 71 71 72 GnuBoat.Webserver.initialize(); 73 GnuBoat.Webserver.setServer("http://localhost:8080/mapservice/v1/"); 72 74 }); 73 75 </script> … … 80 82 <a class="pure-menu-heading" href="#">GNUBoat</a> 81 83 <ul class="pure-menu-list"> 82 <li class="pure-menu-item"><a class="pure-menu-link" href="#map">Map</a></li>84 <li class="pure-menu-item"><a id="linkMap" class="pure-menu-link" href="#map">Map</a></li> 83 85 <li class="pure-menu-item"><a class="pure-menu-link" href="#upload">Upload</a></li> 84 <li class="pure-menu-item"><a class="pure-menu-link" href="#mygnuboat">My GnuBoat</a></li>86 <li class="pure-menu-item"><a id="linkMyGnuboat" class="pure-menu-link" href="#mygnuboat">My GnuBoat</a></li> 85 87 </ul> 86 88 </div> … … 88 90 <div id="main"> 89 91 <!--<div class="content">--> 90 <a name="map"></a> 91 <div id="mapViewport" class="viewportGeometry"> 92 <div class="leaflet-top map-middle"> 93 <div class="leaflet-control"> 94 <img id="logo" src="resources/gnuboat-256-256-transparent.png" /> 95 </div> 92 <a name="map"></a> 93 <div id="mapViewport" class="viewportGeometry"> 94 <div class="leaflet-top map-middle"> 95 <div class="leaflet-control"> 96 <img id="logo" src="resources/gnuboat-256-256-transparent.png" /> 96 97 </div> 97 98 </div> 98 <!--</div>--> 99 </div> 100 <!--</div>--> 101 <div class="content"> 102 <a name="mygnuboat"></a> 103 <div id="login"> 104 <form id="loginForm" class="pure-form pure-form-aligned"> 105 <fieldset> 106 <legend>Login</legend> 107 <div class="pure-control-group"> 108 <label for="loginUsername">Username:</label> 109 <input id="loginUsername" type="text" name="loginUsername" value="" required> 110 </div> 111 <div class="pure-control-group"> 112 <label for="loginPassword">Password:</label> 113 <input id="loginPassword" type="password" name="loginPassword" value="" required> 114 </div> 115 <input type="submit" class="pure-button pure-button-primary" name="loginButton" value="Login"/> 116 </fieldset> 117 </form> 118 </div> 119 <div id="myWaters"> 120 <h2 class="content-subhead">My Waters</h2> 121 <form id="myWatersForm" class="pure-form"> 122 <div class="pure-control-group"> 123 <select id="myWatersSelect" class="pure-input-1"></select> 124 </div> 125 </form> 126 </div> 127 </div> 99 128 </div> 100 129 </body> -
src/webapp/mapservice/src-gen/openapi_server/static/js/GnuBoat.Webserver.js
rcb39a77 r3a89adb 28 28 { 29 29 GnuBoat.Webserver.private.mapSetup(); 30 $("#loginForm").validate({ 31 rules: { 32 loginUsername: { 33 required: true 34 }, 35 loginPassword: { 36 required: true 37 } 38 }, 39 submitHandler: function(form){ 40 GnuBoat.Webserver.login(form); 41 } 42 }); 43 44 $("#login").hide(); 45 $("#myWaters").hide(); 46 $("#linkMyGnuboat").click(function(){ $("#mapViewport").hide(); GnuBoat.Webserver.loginCheck(); }); 47 $("#linkMap").click(function(){ $("#mapViewport").show(); }); 48 } 49 50 /** 51 * @brief Sets the webservice base url, used by any other functions 52 */ 53 GnuBoat.Webserver.setServer = function(baseUrl) 54 { 55 if(baseUrl.slice(-1) != "/") 56 baseUrl += "/"; 57 GnuBoat.Webserver.private.serverBaseUrl = baseUrl; 30 58 } 31 59 32 60 GnuBoat.Webserver.private = { 61 loggedin: false, 33 62 map: null, 34 63 mapSetup: function () … … 72 101 L.control.scale().addTo(GnuBoat.Webserver.private.map); 73 102 } 74 } 103 }; 104 105 GnuBoat.Webserver.login = function(form) 106 { 107 Cookies.set('username', $("#loginUsername").val()); 108 Cookies.set('password', $("#loginPassword").val()); 109 GnuBoat.Webserver.private.loggedin = false; 110 111 // getting my waters 112 $.ajax({ 113 headers: { 114 // manager: Cookies.get('username') 115 manager: "bla" 116 }, 117 dataType: "json", 118 url: GnuBoat.Webserver.private.serverBaseUrl +'waters', 119 }).done(function(data) { 120 GnuBoat.Webserver.private.loggedin = true; 121 GnuBoat.Webserver.loginCheck(); 122 123 $("#myWatersDiv").empty(); 124 if(data.length < 1){ 125 $("<p>No Waters found!</p>").appendTo("#myWatersDiv"); 126 } 127 else{ 128 $('<select id="myWatersSelect" class="pure-input-1"></select>').appendTo("#myWatersDiv"); 129 data.forEach(function(value, index){ 130 $("<option value=\""+ value.water_id +"\">"+ value.name +"</option>").appendTo("#myWatersSelect"); 131 }) 132 } 133 $("#myWaters").show(); 134 }).fail(function() { 135 alert('request failed'); 136 }); 137 }; 138 139 GnuBoat.Webserver.loginCheck = function() 140 { 141 console.log([Cookies.get('username'), Cookies.get('username') == undefined, Cookies.get('password'), Cookies.get('password') == undefined, GnuBoat.Webserver.private.loggedin]); 142 if(Cookies.get('username') == undefined || Cookies.get('password') == undefined || !GnuBoat.Webserver.private.loggedin){ 143 $("#login").show(); 144 return; 145 } 146 $("#login").hide(); 147 };
Note:
See TracChangeset
for help on using the changeset viewer.
