Skip to content

Commit

Permalink
Merge pull request #375 from jeremypoulter/master
Browse files Browse the repository at this point in the history
Fix for WiFi portal page
  • Loading branch information
jeremypoulter authored Jun 6, 2022
2 parents df185b4 + 0478aa5 commit 139d881
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gui
4 changes: 2 additions & 2 deletions src/web_static/web_server.wifi_portal.js.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
static const char CONTENT_WIFI_PORTAL_JS[] PROGMEM =
"\"use strict\";function WiFiPortalViewModel(e,n){var i=this;i.baseHost=ko.observable(\"\"!==e?e:\"openevse.local\"),i.basePort=ko.observable(n),i.baseEndpoint=ko.pureComputed(function(){var e=\"//\"+i.baseHost();return 80!==i.basePort()&&(e+=\":\"+i.basePort()),e}),i.config=new ConfigViewModel(i.baseEndpoint),i.status=new StatusViewModel(i.baseEndpoint),i.scan=new WiFiScanViewModel(i.baseEndpoint),i.wifi=new WiFiConfigViewModel(i.baseEndpoint,i.config,i.status,i.scan),i.time=new TimeViewModel(i.status),i.initialised=ko.observable(!1),i.updating=ko.observable(!1),i.wifi.selectedNet.subscribe(function(e){!1!==e&&i.config.ssid(e.ssid())}),i.config.ssid.subscribe(function(e){i.wifi.setSsid(e)}),i.wifiPassword=new PasswordViewModel(i.config.pass);var t=null;i.start=function(){i.updating(!0),i.config.update(function(){i.status.update(function(){i.initialised(!0),t=setTimeout(i.update,5e3),i.updating(!1),i.status.connect(),i.config.min_current_hard.subscribe(function(){i.generateCurrentList()}),i.config.max_current_hard.subscribe(function(){i.generateCurrentList()}),i.generateCurrentList()})})},i.update=function(){i.updating()||(i.updating(!0),null!==t&&(clearTimeout(t),t=null),i.status.update(function(){t=setTimeout(i.update,5e3),i.updating(!1)}))},i.openEvseSetting=function(n){var t=i.config[n],e=new ConfigGroupViewModel(i.baseEndpoint,function(){var e={};return e[n]=t(),e});return t.subscribe(function(){i.config.loaded()&&e.save()}),e},i.openEvseService=i.openEvseSetting(\"service\"),i.openEvseMaxCurrentSoft=i.openEvseSetting(\"max_current_soft\"),i.createCurrentArray=function(t,e){return Array(e-t+1).fill().map(function(e,n){return{name:t+n+\" A\",value:t+n}})},i.generateCurrentList=function(){var e=i.config.min_current_hard(),n=i.config.max_current_hard(),n=i.createCurrentArray(e,n);ko.mapping.fromJS(n,{},i.currentLevels)},i.serviceLevels=[{name:\"Auto\",value:0},{name:\"1\",value:1},{name:\"2\",value:2}],i.currentLevels=ko.observableArray(i.createCurrentArray(config.min_current_hard(),80))}function scaleString(e,n,t){return(parseInt(e)/n).toFixed(t)}!function(){var n=window.location.hostname,t=window.location.port;$(function(){var e=new WiFiPortalViewModel(n,t);ko.applyBindings(e),e.start()})}();\n"
"\"use strict\";function WiFiPortalViewModel(e,n){var i=this;i.baseHost=ko.observable(\"\"!==e?e:\"openevse.local\"),i.basePort=ko.observable(n),i.baseEndpoint=ko.pureComputed(function(){var e=\"//\"+i.baseHost();return 80!==i.basePort()&&(e+=\":\"+i.basePort()),e}),i.config=new ConfigViewModel(i.baseEndpoint),i.status=new StatusViewModel(i.baseEndpoint),i.scan=new WiFiScanViewModel(i.baseEndpoint),i.wifi=new WiFiConfigViewModel(i.baseEndpoint,i.config,i.status,i.scan),i.time=new TimeViewModel(i.status),i.initialised=ko.observable(!1),i.updating=ko.observable(!1),i.wifi.selectedNet.subscribe(function(e){!1!==e&&i.config.ssid(e.ssid())}),i.config.ssid.subscribe(function(e){i.wifi.setSsid(e)}),i.wifiPassword=new PasswordViewModel(i.config.pass);var t=null;i.start=function(){i.updating(!0),i.config.update(function(){i.status.update(function(){i.initialised(!0),t=setTimeout(i.update,5e3),i.updating(!1),i.status.connect(),i.config.min_current_hard.subscribe(function(){i.generateCurrentList()}),i.config.max_current_hard.subscribe(function(){i.generateCurrentList()}),i.generateCurrentList()})})},i.update=function(){i.updating()||(i.updating(!0),null!==t&&(clearTimeout(t),t=null),i.status.update(function(){t=setTimeout(i.update,5e3),i.updating(!1)}))},i.openEvseSetting=function(n){var t=i.config[n],e=new ConfigGroupViewModel(i.baseEndpoint,function(){var e={};return e[n]=t(),e});return t.subscribe(function(){i.config.loaded()&&e.save()}),e},i.openEvseService=i.openEvseSetting(\"service\"),i.openEvseMaxCurrentSoft=i.openEvseSetting(\"max_current_soft\"),i.createCurrentArray=function(t,e){return Array(e-t+1).fill().map(function(e,n){return{name:t+n+\" A\",value:t+n}})},i.generateCurrentList=function(){var e=i.config.min_current_hard(),n=i.config.max_current_hard(),n=i.createCurrentArray(e,n);ko.mapping.fromJS(n,{},i.currentLevels)},i.serviceLevels=[{name:\"Auto\",value:0},{name:\"1\",value:1},{name:\"2\",value:2}],i.currentLevels=ko.observableArray(i.createCurrentArray(i.config.min_current_hard(),80))}function scaleString(e,n,t){return(parseInt(e)/n).toFixed(t)}!function(){var n=window.location.hostname,t=window.location.port;$(function(){var e=new WiFiPortalViewModel(n,t);ko.applyBindings(e),e.start()})}();\n"
"//# sourceMappingURL=wifi_portal.js.map\n";
static const char CONTENT_WIFI_PORTAL_JS_ETAG[] PROGMEM = "1269a2a397bd87f4d2a22f9f9bfccc398a5fa970bb15cbdb39424fe535b6c008";
static const char CONTENT_WIFI_PORTAL_JS_ETAG[] PROGMEM = "dfaa7ed5b848deb31f1a67ab7a26c544f52f8da0c2a1ae2c2a5f05732d1ef41d";
10 changes: 10 additions & 0 deletions test/config.http
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,13 @@ Content-Type: application/json
"offset": 0
}

###

POST {{baseUrl}}/config HTTP/1.1
Content-Type: application/json

{
"ssid": "{{ssid}}",
"pass": "{{pass}}"
}

0 comments on commit 139d881

Please sign in to comment.