0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-12-22 21:23:48 +01:00

Using cgi-bin for network/openap and network/associate

This commit is contained in:
peteruithoven 2013-10-16 12:31:22 +02:00
parent 50cb44b865
commit 6419af4055
2 changed files with 11 additions and 5 deletions

View File

@ -28,6 +28,7 @@ var settings = {
function SettingsWindow() {
this.wifiboxURL;
this.wifiboxCGIBinURL
this.window;
this.form;
this.timeoutTime = 3000;
@ -78,8 +79,9 @@ function SettingsWindow() {
var self = this;
this.init = function(wifiboxURL) {
this.init = function(wifiboxURL,wifiboxCGIBinURL) {
this.wifiboxURL = wifiboxURL;
this.wifiboxCGIBinURL = wifiboxCGIBinURL;
this.window = $("#settings");
this.window.find(".btnOK").click(this.submitwindow);
@ -520,7 +522,7 @@ function SettingsWindow() {
console.log(" postData: ",postData);
if (communicateWithWifibox) {
$.ajax({
url: self.wifiboxURL + "/network/associate",
url: self.wifiboxCGIBinURL + "/network/associate",
type: "POST",
data: postData,
dataType: 'json',
@ -545,7 +547,7 @@ function SettingsWindow() {
this.createAP = function() {
if (communicateWithWifibox) {
$.ajax({
url: self.wifiboxURL + "/network/openap",
url: self.wifiboxCGIBinURL + "/network/openap",
type: "POST",
dataType: 'json',
timeout: self.timeoutTime,

View File

@ -10,6 +10,8 @@ var settingsWindow = new SettingsWindow();
var firstTimeSettingsLoaded = true;
var wifiboxURL; // Using the uhttpd lua handler as default, because of better performance
var wifiboxCGIBinURL; // CGI-bin, for some network stuff, where it needs to restart the webserver for example
var $drawAreaContainer, $doodleCanvas, doodleCanvas, doodleCanvasContext, $previewContainer;
@ -26,9 +28,11 @@ $(function() {
if (getURLParameter("u") != "null") autoUpdate = (getURLParameter("u") == "1");
if (wifiboxIsRemote) {
wifiboxURL = "http://192.168.5.1/cgi-bin/d3dapi";
wifiboxURL = "http://192.168.5.1/d3dapi";
wifiboxCGIBinURL = "http://192.168.5.1/cgi-bin/d3dapi";
} else {
wifiboxURL = "http://" + window.location.host + "/d3dapi";
wifiboxCGIBinURL = "http://" + window.location.host + "/cgi-bin/d3dapi";
}
if (!communicateWithWifibox) {
@ -52,7 +56,7 @@ $(function() {
printer.init();
$(document).on(Printer.UPDATE,update);
settingsWindow.init(wifiboxURL);
settingsWindow.init(wifiboxURL,wifiboxCGIBinURL);
$(document).on(SettingsWindow.SETTINGS_LOADED, settingsLoaded);
if(debugMode) {