//var appdata = browserapp.getconfig();
var params = "?";
for (var i in this.config){
- params += "&" + i +"=" + encodeURIComponent(appdata[i]);
+ params += "&" + i +"=" + encodeURIComponent(this.config[i]);
}
//console.log("modules/"+modulename+"/index.html"+params);
$("#moduleframe").attr("src","modules/"+modulename+"/index.html"+ params);
//var appdata = browserapp.getconfig();
var params = "?";
for (var i in this.config){
- params += "&" + i +"=" + encodeURIComponent(appdata[i]);
+ params += "&" + i +"=" + encodeURIComponent(this.config[i]);
}
if (pageparams){
for (var i in pageparams){
$("#moduleframe").attr("src","modules/"+modulename+"/"+ page +".html"+ params);
},
setdatasets: function(myds){
+ $("#globaldatasets").html("");
var ds = usersystem.getLocalDataSets();
for (var i in ds){
var prop = usersystem.getPreference(ds[i]);
}
},
loaddataset: function(){
- if ($("globaldatasets").val() == ""){
+ var gdset = $("#globaldatasets :selected").val();
+ if (gdset == ""){
this.config = null;
}else {
- var ldata = usersystem.getPreference($("globaldatasets").val());
+ var ldata = usersystem.getPreference(gdset);
this.config={dbfile:ldata.dbfile,serviceurl:"http://"+ldata.server+":6060/"};
}
}
+++ /dev/null
-const {app, BrowserWindow} = require('electron')
-const path = require('path')
-const url = require('url')
-const os = require('os')
-const http = require('http')
-const dialog = require('electron').dialog
-const {ipcMain} = require('electron')
-var child = require('child_process').execFile;
-
-// Keep a global reference of the window object, if you don't, the window will
-// be closed automatically when the JavaScript object is garbage collected.
-let win
-
-function createWindow () {
- var executablePath = "";
- var parameters = [];
- if (os.platform() == "win32"){
- executablePath = "C:\\Strawberry\\perl\\bin\\perl.exe";
- parameters = ["C:\\Users\\ksaff\\Workspace\\DKSService\\dkslocalserver.pl"];
- } else { //os.platform() == "darwin"
- executablePath = "/Users/kilian/perl5/perlbrew/perls/perl-5.28.1/bin/perl";
- parameters = ["/Users/kilian/Workspace/DKSService/dkslocalserver.pl"];
- }
- win = new BrowserWindow({show: false})
- win.setMenu(null)
- win.maximize()
- // child(executablePath, parameters, function(err, data) {
- // if(err){
- // console.error('stderr',err);
- // } else {
- // // var test = app.getPath('USERPROFILE');
- // // console.log("Path:" + test);
- // // console.log(data.toString());
- // win.show()
- // }
-
- // });
-
- // Create the browser window.
-
-
-
- // and load the index.html of the app.
- win.loadURL(url.format({
- pathname: path.join(__dirname, 'index.html'),
- protocol: 'file:'
- }))
-
- // Open the DevTools.
- win.webContents.openDevTools()
-
- // Emitted when the window is closed.
- win.on('closed', () => {
- // Dereference the window object, usually you would store windows
- // in an array if your app supports multi windows, this is the time
- // when you should delete the corresponding element.
- win = null
- })
-
-// win.webContents.on('new-window', (event, urlx, frameName, disposition, options, additionalFeatures) => {
-// console.log('Open New Window!');
-// //console.log(event);
-
-// console.log("URL:" + urlx);
-// //if (frameName === 'modal') {
-// // open window as modal
-// event.preventDefault();
-
-// event.newGuest = new BrowserWindow({show: false,parent: win,width: 600,height: 800});
-// event.newGuest.webContents.openDevTools()
-// event.newGuest.loadURL(urlx)
-
-// event.newGuest.webContents.on('did-finish-load', () => {
-// console.log("Finished loading print page!");
-// // event.newGuest.printToPDF({}, (error, data) => {
-// // if (error) throw error
-// // fs.writeFile('C:\\Users\\ksaff\\creorga.pdf', data, (error) => {
-// // if (error) throw error
-// // console.log('Write PDF successfully.')
-// // })
-// // })
-
-
-// })
-// event.newGuest.show();
-// //}
-// })
-
-
-}
-
-// This method will be called when Electron has finished
-// initialization and is ready to create browser windows.
-// Some APIs can only be used after this event occurs.
-app.on('ready', createWindow)
-
-// Quit when all windows are closed.
-app.on('window-all-closed', () => {
- http.get('http://localhost:6060/server/unload', (resp) => {
- // resp.on('end',() => {console.log("vpn disconnected!")});
- });
- // On macOS it is common for applications and their menu bar
- // to stay active until the user quits explicitly with Cmd + Q
- if (process.platform !== 'darwin') {
- app.quit()
- }
-})
-
-app.on('activate', () => {
- // On macOS it's common to re-create a window in the app when the
- // dock icon is clicked and there are no other windows open.
- if (win === null) {
- createWindow()
- }
-})
-