refs #4974 First commit v4
This commit is contained in:
parent
8128c74ec2
commit
79d578cf29
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
||||||
Copyright (C) 2020 - Verdnatura Levante S.L.
|
Copyright (C) 2023 - Verdnatura Levante S.L.
|
||||||
|
|
||||||
This package is free software; you can redistribute it and/or modify
|
This package is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -56,6 +56,8 @@ Source: "ocx\*"; \
|
||||||
DestDir: {sys}; Flags: onlyifdoesntexist regserver 32bit
|
DestDir: {sys}; Flags: onlyifdoesntexist regserver 32bit
|
||||||
Source: "fonts\Roboto*"; \
|
Source: "fonts\Roboto*"; \
|
||||||
DestDir: "{fonts}"; FontInstall: "Roboto"; Flags: onlyifdoesntexist uninsneveruninstall
|
DestDir: "{fonts}"; FontInstall: "Roboto"; Flags: onlyifdoesntexist uninsneveruninstall
|
||||||
|
Source: "fonts\Poppins*"; \
|
||||||
|
DestDir: "{fonts}"; FontInstall: "Poppins"; Flags: onlyifdoesntexist uninsneveruninstall
|
||||||
Source: "fonts\Lucida Sans - *"; \
|
Source: "fonts\Lucida Sans - *"; \
|
||||||
DestDir: "{fonts}"; FontInstall: "Lucida Sans"; Flags: onlyifdoesntexist uninsneveruninstall
|
DestDir: "{fonts}"; FontInstall: "Lucida Sans"; Flags: onlyifdoesntexist uninsneveruninstall
|
||||||
Source: "fonts\Code128B.ttf"; \
|
Source: "fonts\Code128B.ttf"; \
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 893 B |
231
src/main.js
231
src/main.js
|
@ -1,45 +1,74 @@
|
||||||
|
|
||||||
var Conf = {
|
var Conf = {
|
||||||
appName: 'Verdnatura'
|
appName: 'Verdnatura',
|
||||||
,dsName: 'verdnatura'
|
dsName: 'verdnatura',
|
||||||
,dsPath: 'HKCU\\Software\\ODBC\\ODBC.INI\\verdnatura'
|
dsPath: 'HKCU\\SOFTWARE\\ODBC\\ODBC.INI\\verdnatura',
|
||||||
,regPath: 'HKCU\\Software\\Verdnatura\\vn-access'
|
regPath: 'HKCU\\SOFTWARE\\Verdnatura\\vn-access',
|
||||||
,remoteUrl: 'https://cdn.verdnatura.es/vn-access'
|
remoteUrl: 'https://cdn.verdnatura.es/vn-access',
|
||||||
,dbHost: 'db.verdnatura.es'
|
dbHost: 'db.verdnatura.es',
|
||||||
,defaultModule: 'tpv'
|
defaultModule: 'vn',
|
||||||
,defaultLocale: 'es'
|
defaultLocale: 'es',
|
||||||
,defaultBranch: 'master'
|
defaultBranch: 'master',
|
||||||
,dbName: 'vn2008'
|
dbName: 'vn2008',
|
||||||
,maxCorruptSize: 600
|
maxCorruptSize: 600,
|
||||||
,odbcDriver: 'MySQL ODBC 8.0 Unicode Driver'
|
odbcDriver: 'MySQL ODBC 8.0 Unicode Driver',
|
||||||
,driverPath: '\\MySQL\\Connector ODBC 8.0\\myodbc8w.dll'
|
driverPath: '\\MySQL\\Connector ODBC 8.0\\myodbc8w.dll',
|
||||||
,version: 3
|
defaultDatasource: 'production',
|
||||||
|
version: 4,
|
||||||
|
cdnURL: 'https://cdn.verdnatura.es/vn-access',
|
||||||
|
cdnURL: 'https://salix.verdnatura.es',
|
||||||
|
datasources: {
|
||||||
|
production: {
|
||||||
|
DESCRIPTION: 'production',
|
||||||
|
SERVER: 'db.verdnatura.es',
|
||||||
|
PORT: '3306',
|
||||||
|
SSLMODE: 'VERIFY_IDENTITY'
|
||||||
|
},
|
||||||
|
test: {
|
||||||
|
DESCRIPTION: 'test',
|
||||||
|
SERVER: 'test-db.verdnatura.es',
|
||||||
|
PORT: '3307',
|
||||||
|
SSLMODE: 'DISABLED'
|
||||||
|
},
|
||||||
|
dev: {
|
||||||
|
DESCRIPTION: 'dev',
|
||||||
|
SERVER: 'dev-db.verdnatura.es',
|
||||||
|
PORT: '3307',
|
||||||
|
SSLMODE: 'DISABLED'
|
||||||
|
},
|
||||||
|
local: {
|
||||||
|
DESCRIPTION: 'local',
|
||||||
|
SERVER: 'localhost',
|
||||||
|
PORT: '3306',
|
||||||
|
SSLMODE: 'DISABLED'
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var Locale = {
|
var Locale = {
|
||||||
es: {
|
es: {
|
||||||
"Enter a user name":
|
"Enter a user name":
|
||||||
"Introduce un nombre de usuario"
|
"Introduce un nombre de usuario",
|
||||||
,"Enter a password":
|
"Enter a password":
|
||||||
"Introduce una contraseña"
|
"Introduce una contraseña",
|
||||||
,"Server can't be reached":
|
"Server can't be reached":
|
||||||
"No se ha podido conectar con el servidor"
|
"No se ha podido conectar con el servidor",
|
||||||
,"Updating":
|
"Updating":
|
||||||
"Actualizando"
|
"Actualizando",
|
||||||
,"Bad login":
|
"Bad login":
|
||||||
"Usuario o contraseña incorrectos"
|
"Usuario o contraseña incorrectos, recuerda que se hace distinción entre mayúsculas y minúsculas",
|
||||||
,"Application it's already open":
|
"Application it's already open":
|
||||||
"La aplicación ya está abierta"
|
"La aplicación ya está abierta",
|
||||||
,"Loading":
|
"Loading":
|
||||||
"Cargando"
|
"Cargando",
|
||||||
,"Error while updating":
|
"Error while updating":
|
||||||
"Error al actualizar"
|
"Error al actualizar",
|
||||||
,"Microsoft Access 2003 is not installed":
|
"Microsoft Access 2003 is not installed":
|
||||||
"Microsoft Access 2003 no está instalado en el sistema"
|
"Microsoft Access 2003 no está instalado en el sistema",
|
||||||
,"MDB file not found":
|
"MDB file not found":
|
||||||
"No se encontró el fichero MDB"
|
"No se encontró el fichero MDB",
|
||||||
,"Cache files have been deleted":
|
"Cache files have been deleted":
|
||||||
"Se han borrado todos los ficheros de la caché"
|
"Se han borrado todos los ficheros almacenados en la caché"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,9 +77,10 @@ var App = {
|
||||||
fso: new ActiveXObject('scripting.filesystemobject'),
|
fso: new ActiveXObject('scripting.filesystemobject'),
|
||||||
|
|
||||||
init: function() {
|
init: function() {
|
||||||
var width = 420;
|
// Specify the size of window
|
||||||
var height = 525;
|
|
||||||
|
|
||||||
|
var width = 420;
|
||||||
|
var height = 560;
|
||||||
window.resizeTo(width, height);
|
window.resizeTo(width, height);
|
||||||
window.moveTo((screen.width - width) / 2, (screen.height - height) / 2);
|
window.moveTo((screen.width - width) / 2, (screen.height - height) / 2);
|
||||||
},
|
},
|
||||||
|
@ -78,9 +108,9 @@ var App = {
|
||||||
|
|
||||||
// Creates the necessary registry entries
|
// Creates the necessary registry entries
|
||||||
|
|
||||||
var configured = this.regRead(Conf.regPath, 'configured');
|
var myVersion = this.regRead(Conf.regPath, 'version');
|
||||||
|
|
||||||
if (!configured || configured < Conf.version) {
|
if (!myVersion || myVersion != Conf.version) {
|
||||||
var path;
|
var path;
|
||||||
|
|
||||||
// Creates the Access configuration entries
|
// Creates the Access configuration entries
|
||||||
|
@ -118,26 +148,51 @@ var App = {
|
||||||
params
|
params
|
||||||
);
|
);
|
||||||
|
|
||||||
// Marks the application as configured
|
// Upload the string value to version installed
|
||||||
|
|
||||||
this.regWrite(Conf.regPath, 'configured', Conf.version);
|
this.regWrite(Conf.regPath, 'version', Conf.version);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loads the form data
|
//Datasources creations
|
||||||
|
this.createDatasources();
|
||||||
|
|
||||||
|
// Check the strings values and the respective keys
|
||||||
|
|
||||||
|
var stringValues = [
|
||||||
|
'remoteURL',
|
||||||
|
'remoteUser',
|
||||||
|
'remotePass'
|
||||||
|
]
|
||||||
|
|
||||||
|
for (var i in stringValues) {
|
||||||
|
if (!this.regRead(Conf.regPath, stringValues[i]))
|
||||||
|
this.regWrite(Conf.regPath, stringValues[i], null)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.regRead(Conf.regPath, 'currentDatasource'))
|
||||||
|
this.regWrite(Conf.regPath, 'currentDatasource', Conf.defaultDatasource);
|
||||||
|
|
||||||
|
if (!this.regRead(Conf.regPath, 'notSignOut'))
|
||||||
|
this.regWrite(Conf.regPath, 'notSignOut', 0);
|
||||||
|
|
||||||
|
// Loads the form data
|
||||||
|
|
||||||
var user = this.regRead(Conf.dsPath, 'UID');
|
var user = this.regRead(Conf.dsPath, 'UID');
|
||||||
var password = this.regRead(Conf.dsPath, 'PWD');
|
var password = this.regRead(Conf.dsPath, 'PWD');
|
||||||
var remember = this.regRead(Conf.regPath, 'remember');
|
var notSignOut = this.regRead(Conf.regPath, 'notSignOut');
|
||||||
|
|
||||||
this.$('branch').value = this.getBranch();
|
this.$('branch').value = this.getBranch();
|
||||||
this.onChangeBranchChange();
|
this.onChangeBranch();
|
||||||
|
|
||||||
|
this.$('datasource').value = this.getDatasource();
|
||||||
|
this.onChangeDatasource();
|
||||||
|
|
||||||
if (user)
|
if (user)
|
||||||
this.$('user').value = user;
|
this.$('user').value = user;
|
||||||
|
|
||||||
if (remember && password) {
|
if (notSignOut && password) {
|
||||||
this.$('password').value = password;
|
this.$('password').value = password;
|
||||||
this.$('remember').checked = true;
|
this.$('notSignOut').checked = true;
|
||||||
this.onEnterClick();
|
this.onEnterClick();
|
||||||
} else
|
} else
|
||||||
this.resetForm(true);
|
this.resetForm(true);
|
||||||
|
@ -167,7 +222,7 @@ var App = {
|
||||||
|
|
||||||
this.$('user').disabled = disabled;
|
this.$('user').disabled = disabled;
|
||||||
this.$('password').disabled = disabled;
|
this.$('password').disabled = disabled;
|
||||||
this.$('remember').disabled = disabled;
|
this.$('notSignOut').disabled = disabled;
|
||||||
this.$('enter').disabled = disabled;
|
this.$('enter').disabled = disabled;
|
||||||
|
|
||||||
var display = disabled ? 'block' : 'none';
|
var display = disabled ? 'block' : 'none';
|
||||||
|
@ -179,14 +234,27 @@ var App = {
|
||||||
setTimeout(function() { App.cleanCache(); });
|
setTimeout(function() { App.cleanCache(); });
|
||||||
},
|
},
|
||||||
|
|
||||||
onShowOptionsClick: function() {
|
onShowBranchOptionsClick: function() {
|
||||||
var style = this.$("branchSelector").style;
|
var style = this.$("branchSelector").style;
|
||||||
style.display = style.display == 'none' || !style.display
|
style.display = style.display == 'none' || !style.display
|
||||||
? 'inline'
|
? 'inline'
|
||||||
: 'none';
|
: 'none';
|
||||||
},
|
},
|
||||||
|
|
||||||
onChangeBranchChange: function() {
|
onShowDatasourceOptionsClick: function() {
|
||||||
|
var style = this.$("datasourceSelector").style;
|
||||||
|
style.display = style.display == 'none' || !style.display
|
||||||
|
? 'inline'
|
||||||
|
: 'none';
|
||||||
|
|
||||||
|
if (!this.$("datasourceLogo").className)
|
||||||
|
this.$("datasourceLogo").className = "on";
|
||||||
|
else
|
||||||
|
this.$("datasourceLogo").className = "";
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
onChangeBranch: function() {
|
||||||
if (this.$("branch").value == "master"||"test"||"dev") {
|
if (this.$("branch").value == "master"||"test"||"dev") {
|
||||||
this.$("branchButton").className = this.$("branch").value;
|
this.$("branchButton").className = this.$("branch").value;
|
||||||
this.$("branch").className = this.$("branch").value;
|
this.$("branch").className = this.$("branch").value;
|
||||||
|
@ -197,6 +265,18 @@ var App = {
|
||||||
this.$('user').focus();
|
this.$('user').focus();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onChangeDatasource: function() {
|
||||||
|
if (this.$("datasource").value == "production"||"test"||"dev") {
|
||||||
|
this.$("datasourceButton").className = this.$("datasource").value;
|
||||||
|
this.$("datasource").className = this.$("datasource").value;
|
||||||
|
} else {
|
||||||
|
this.$("datasourceButton").className = null;
|
||||||
|
this.$("datasource").className = null;
|
||||||
|
}
|
||||||
|
this.updateDatasource(this.$("datasource").value);
|
||||||
|
this.$('user').focus();
|
||||||
|
},
|
||||||
|
|
||||||
cleanCache: function() {
|
cleanCache: function() {
|
||||||
if (this.fso.folderExists(this.moduleDir)) {
|
if (this.fso.folderExists(this.moduleDir)) {
|
||||||
var folder = this.fso.getFolder(this.moduleDir);
|
var folder = this.fso.getFolder(this.moduleDir);
|
||||||
|
@ -245,13 +325,16 @@ var App = {
|
||||||
var user = this.$('user').value;
|
var user = this.$('user').value;
|
||||||
var password = this.$('password').value;
|
var password = this.$('password').value;
|
||||||
var branch = this.$('branch').value;
|
var branch = this.$('branch').value;
|
||||||
|
var datasource = this.$('datasource').value;
|
||||||
|
|
||||||
if (!user || user === '')
|
if (!user || user === '')
|
||||||
throw new Error(_('Enter a user name'));
|
throw new Error(_('Enter a user name'));
|
||||||
if (!password || password === '')
|
if (!password || password === '')
|
||||||
throw new Error(_('Enter a password'));
|
throw new Error(_('Enter a password'));
|
||||||
if (!branch || branch === '')
|
if (!branch || branch === '')
|
||||||
throw new Error(_('Select a branch'));
|
throw new Error(_('Select a branch'));
|
||||||
|
if (!datasource || datasource === '')
|
||||||
|
throw new Error(_('Select a datasource'));
|
||||||
|
|
||||||
this.regWrite(Conf.dsPath, 'UID', user);
|
this.regWrite(Conf.dsPath, 'UID', user);
|
||||||
this.regWrite(Conf.dsPath, 'PWD', password);
|
this.regWrite(Conf.dsPath, 'PWD', password);
|
||||||
|
@ -262,7 +345,7 @@ var App = {
|
||||||
var remoteFile = version
|
var remoteFile = version
|
||||||
? '.archive/'+ this.module +'/'+ version +'.7z'
|
? '.archive/'+ this.module +'/'+ version +'.7z'
|
||||||
: this.module +'.7z?'+ new Date().getTime();
|
: this.module +'.7z?'+ new Date().getTime();
|
||||||
remoteFile = Conf.remoteUrl +'/'+ remoteFile;
|
remoteFile = Conf.cdnURL +'/'+ remoteFile;
|
||||||
var request = new ActiveXObject("MSXML2.XMLHTTP");
|
var request = new ActiveXObject("MSXML2.XMLHTTP");
|
||||||
request.open('GET', remoteFile, true);
|
request.open('GET', remoteFile, true);
|
||||||
request.onreadystatechange = function() {
|
request.onreadystatechange = function() {
|
||||||
|
@ -334,9 +417,6 @@ var App = {
|
||||||
rs.close();
|
rs.close();
|
||||||
mysqlConn.close();
|
mysqlConn.close();
|
||||||
|
|
||||||
if (this.$('previous-version').checked && version > 1)
|
|
||||||
version -= 1;
|
|
||||||
|
|
||||||
// Checks if it's already open
|
// Checks if it's already open
|
||||||
if (this.fso.fileExists(this.lockFile))
|
if (this.fso.fileExists(this.lockFile))
|
||||||
try {
|
try {
|
||||||
|
@ -368,7 +448,6 @@ var App = {
|
||||||
? version
|
? version
|
||||||
: null;
|
: null;
|
||||||
},
|
},
|
||||||
|
|
||||||
mdbGetValue: function(query, field, parseFn) {
|
mdbGetValue: function(query, field, parseFn) {
|
||||||
var value;
|
var value;
|
||||||
|
|
||||||
|
@ -393,14 +472,12 @@ var App = {
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
|
|
||||||
getOdbcString: function(options) {
|
getOdbcString: function(options) {
|
||||||
var optionsArray = [];
|
var optionsArray = [];
|
||||||
for (var option in options)
|
for (var option in options)
|
||||||
optionsArray.push(option +'='+ options[option]);
|
optionsArray.push(option +'='+ options[option]);
|
||||||
return optionsArray.join(';');
|
return optionsArray.join(';');
|
||||||
},
|
},
|
||||||
|
|
||||||
onRequestReady: function(request) {
|
onRequestReady: function(request) {
|
||||||
if (request.readyState !== 4)
|
if (request.readyState !== 4)
|
||||||
return;
|
return;
|
||||||
|
@ -438,10 +515,9 @@ var App = {
|
||||||
this.catchError(e);
|
this.catchError(e);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
openMdb: function() {
|
openMdb: function() {
|
||||||
var remember = !!this.$('remember').checked;
|
var notSignOut = !!this.$('notSignOut').checked;
|
||||||
this.regWrite(Conf.regPath, 'remember', remember);
|
this.regWrite(Conf.regPath, 'notSignOut', notSignOut);
|
||||||
|
|
||||||
var programFiles = this.getEnv('ProgramFiles');
|
var programFiles = this.getEnv('ProgramFiles');
|
||||||
var accessBin = programFiles +'\\Microsoft Office\\OFFICE11\\MSACCESS.EXE';
|
var accessBin = programFiles +'\\Microsoft Office\\OFFICE11\\MSACCESS.EXE';
|
||||||
|
@ -452,18 +528,16 @@ var App = {
|
||||||
this.shell.exec('"'+ accessBin +'" "'+ this.mdbFile +'"');
|
this.shell.exec('"'+ accessBin +'" "'+ this.mdbFile +'"');
|
||||||
window.close();
|
window.close();
|
||||||
},
|
},
|
||||||
|
|
||||||
catchError: function(err) {
|
catchError: function(err) {
|
||||||
var clearPassword = err.name == 'BadLogin';
|
var clearPassword = err.name == 'BadLogin';
|
||||||
|
|
||||||
if (!this.$('remember').checked || clearPassword)
|
if (!this.$('notSignOut').checked || clearPassword)
|
||||||
this.regWrite(Conf.dsPath, 'PWD', '');
|
this.regWrite(Conf.dsPath, 'PWD', '');
|
||||||
|
|
||||||
this.disableUi(false);
|
this.disableUi(false);
|
||||||
this.showMessage(err.message, 'error');
|
this.showMessage(err.message, 'error');
|
||||||
this.resetForm(clearPassword);
|
this.resetForm(clearPassword);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a non-intrusive message.
|
* Displays a non-intrusive message.
|
||||||
*
|
*
|
||||||
|
@ -475,7 +549,6 @@ var App = {
|
||||||
App.showMessageAsync(message, className);
|
App.showMessageAsync(message, className);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
showMessageAsync: function(message, className) {
|
showMessageAsync: function(message, className) {
|
||||||
if (this.messageTimeout)
|
if (this.messageTimeout)
|
||||||
clearTimeout(this.messageTimeout);
|
clearTimeout(this.messageTimeout);
|
||||||
|
@ -488,11 +561,9 @@ var App = {
|
||||||
App.hideMessage();
|
App.hideMessage();
|
||||||
}, 10000);
|
}, 10000);
|
||||||
},
|
},
|
||||||
|
|
||||||
onBodyClick: function() {
|
onBodyClick: function() {
|
||||||
this.hideMessage();
|
this.hideMessage();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hides the last displayed non-intrusive message.
|
* Hides the last displayed non-intrusive message.
|
||||||
*/
|
*/
|
||||||
|
@ -503,7 +574,6 @@ var App = {
|
||||||
this.messageTimeout = null;
|
this.messageTimeout = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtains a DOM element by it's identifier.
|
* Obtains a DOM element by it's identifier.
|
||||||
*
|
*
|
||||||
|
@ -512,18 +582,15 @@ var App = {
|
||||||
$: function(id) {
|
$: function(id) {
|
||||||
return document.getElementById(id);
|
return document.getElementById(id);
|
||||||
},
|
},
|
||||||
|
|
||||||
run: function(command, wait) {
|
run: function(command, wait) {
|
||||||
if (!wait)
|
if (!wait)
|
||||||
wait = false;
|
wait = false;
|
||||||
|
|
||||||
this.shell.run(command, 0, wait);
|
this.shell.run(command, 0, wait);
|
||||||
},
|
},
|
||||||
|
|
||||||
getEnv: function(varName) {
|
getEnv: function(varName) {
|
||||||
return this.shell.expandEnvironmentStrings('%'+ varName +'%');
|
return this.shell.expandEnvironmentStrings('%'+ varName +'%');
|
||||||
},
|
},
|
||||||
|
|
||||||
regRead: function(path, key) {
|
regRead: function(path, key) {
|
||||||
try {
|
try {
|
||||||
var value = this.shell.regRead(path +'\\'+ key);
|
var value = this.shell.regRead(path +'\\'+ key);
|
||||||
|
@ -533,7 +600,6 @@ var App = {
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
|
|
||||||
regWrite: function(path, key, value, type) {
|
regWrite: function(path, key, value, type) {
|
||||||
if (!type)
|
if (!type)
|
||||||
switch (typeof (value))
|
switch (typeof (value))
|
||||||
|
@ -547,16 +613,16 @@ var App = {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
type = 'REG_SZ';
|
type = 'REG_SZ';
|
||||||
|
if (!value)
|
||||||
|
value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.shell.regWrite(path +'\\'+ key, value.toString(), type);
|
this.shell.regWrite(path + '\\' + key, value.toString(), type);
|
||||||
},
|
},
|
||||||
|
|
||||||
regWrites: function(path, values, type) {
|
regWrites: function(path, values, type) {
|
||||||
for(var key in values)
|
for(var key in values)
|
||||||
this.regWrite(path, key, values[key], type);
|
this.regWrite(path, key, values[key], type);
|
||||||
},
|
},
|
||||||
|
|
||||||
regDelete: function(path) {
|
regDelete: function(path) {
|
||||||
try {
|
try {
|
||||||
this.shell.regDelete(path);
|
this.shell.regDelete(path);
|
||||||
|
@ -573,7 +639,20 @@ var App = {
|
||||||
'branch', String
|
'branch', String
|
||||||
);
|
);
|
||||||
return branch || Conf.defaultBranch;
|
return branch || Conf.defaultBranch;
|
||||||
}
|
},
|
||||||
|
getDatasource: function() {
|
||||||
|
var datasource = this.regRead(
|
||||||
|
'HKCU\\SOFTWARE\\Verdnatura\\vn-access',
|
||||||
|
'currentDatasource'
|
||||||
|
);
|
||||||
|
return datasource || Conf.defaultDatasource;
|
||||||
|
},
|
||||||
|
updateDatasource: function(datasource) {
|
||||||
|
this.regWrite(Conf.regPath, 'currentDatasource', datasource);
|
||||||
|
},
|
||||||
|
createDatasources: function() {
|
||||||
|
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
App.init();
|
App.init();
|
||||||
|
|
144
src/style.css
144
src/style.css
|
@ -1,13 +1,13 @@
|
||||||
body {
|
body {
|
||||||
|
font-family: 'Poppins', 'Verdana', 'Sans';
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
padding: .8em;
|
padding: .8em;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: #222;
|
color: #222;
|
||||||
font-family: Roboto;
|
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #44f;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Login form */
|
/* Login form */
|
||||||
|
@ -15,8 +15,8 @@ a {
|
||||||
#logo {
|
#logo {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-bottom: 2.5em;
|
margin-bottom: 4em;
|
||||||
width: 80%;
|
width: 62%;
|
||||||
}
|
}
|
||||||
button,
|
button,
|
||||||
input {
|
input {
|
||||||
|
@ -28,21 +28,12 @@ select {
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
background-color: #8d8d8d;
|
background-color: #8d8d8d;
|
||||||
}
|
}
|
||||||
select.master {
|
|
||||||
background-color: #c20000;
|
|
||||||
}
|
|
||||||
select.test {
|
|
||||||
background-color: #31a527;
|
|
||||||
}
|
|
||||||
select.dev {
|
|
||||||
background-color: #a59827;
|
|
||||||
}
|
|
||||||
option {
|
option {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
#fields {
|
#fields {
|
||||||
max-width: 11em;
|
max-width: 13em;
|
||||||
margin: 0 auto;
|
margin-left: 3.32em;
|
||||||
}
|
}
|
||||||
#inputs > div {
|
#inputs > div {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
|
@ -74,17 +65,10 @@ input[type='text']:focus,
|
||||||
input[type='password']:focus {
|
input[type='password']:focus {
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
}
|
}
|
||||||
input[type='text']::selection,
|
#notSignOut {
|
||||||
input[type='password']::selection {
|
|
||||||
background-color: #97d700;
|
|
||||||
}
|
|
||||||
#rememberMe {
|
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
font-size: .9em;
|
font-size: .9em;
|
||||||
}
|
margin-bottom: 2.5em;
|
||||||
#oldVersion {
|
|
||||||
margin-top: .5em;
|
|
||||||
font-size: .9em;
|
|
||||||
}
|
}
|
||||||
#submit {
|
#submit {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
|
@ -104,15 +88,16 @@ input[type='password']::selection {
|
||||||
}
|
}
|
||||||
button {
|
button {
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
background-color: #f7931e;
|
background-color: black;
|
||||||
padding: .7em;
|
padding: 1em;
|
||||||
padding-right: 2.5em;
|
padding-right: 4.5em;
|
||||||
padding-left: 2.5em;
|
padding-left: 4.5em;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 25px;
|
border-radius: 25px;
|
||||||
|
font-size: .9em;
|
||||||
}
|
}
|
||||||
button:hover {
|
button:hover {
|
||||||
background-color: #eb8b1d;
|
background-color: #3d3f42;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,14 +109,12 @@ button:hover {
|
||||||
#branchLogo {
|
#branchLogo {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding-top: .4em;
|
padding-top: .4em;
|
||||||
padding-bottom: .2em;
|
|
||||||
padding-left: .4em;
|
padding-left: .4em;
|
||||||
padding-right: .4em;
|
padding-right: .4em;
|
||||||
}
|
}
|
||||||
#branch {
|
#branch {
|
||||||
border: none;
|
border: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-left: .4em;
|
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
#branchSelector {
|
#branchSelector {
|
||||||
|
@ -145,7 +128,7 @@ button:hover {
|
||||||
float: left;
|
float: left;
|
||||||
border-radius: 25px;
|
border-radius: 25px;
|
||||||
color: black;
|
color: black;
|
||||||
box-shadow: 0px 0px 5px 0px #000000;
|
box-shadow: 0px 0px 5px 0px black;
|
||||||
background-color: #8d8d8d;
|
background-color: #8d8d8d;
|
||||||
}
|
}
|
||||||
#branchButton:hover {
|
#branchButton:hover {
|
||||||
|
@ -160,36 +143,105 @@ button:hover {
|
||||||
#branchButton.dev {
|
#branchButton.dev {
|
||||||
background-color: #a59827;
|
background-color: #a59827;
|
||||||
}
|
}
|
||||||
|
select.master {
|
||||||
|
background-color: #c20000;
|
||||||
|
}
|
||||||
|
select.test {
|
||||||
|
background-color: #31a527;
|
||||||
|
}
|
||||||
|
select.dev {
|
||||||
|
background-color: #a59827;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Datasource */
|
||||||
|
|
||||||
|
#datasourceOptions {
|
||||||
|
margin-top: 1em;
|
||||||
|
margin-left: 17.3em;
|
||||||
|
}
|
||||||
|
#datasourceLogo {
|
||||||
|
cursor: pointer;
|
||||||
|
padding-top: .4em;
|
||||||
|
padding-left: .4em;
|
||||||
|
padding-right: .4em;
|
||||||
|
}
|
||||||
|
#datasourceLogo.on {
|
||||||
|
cursor: pointer;
|
||||||
|
padding-top: .4em;
|
||||||
|
padding-left: .4em;
|
||||||
|
padding-right: .4em;
|
||||||
|
margin-left: 7em;
|
||||||
|
}
|
||||||
|
#datasource {
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-right: 1.5em;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
#datasourceSelector {
|
||||||
|
float: right;
|
||||||
|
display: none;
|
||||||
|
padding-right: .8em;
|
||||||
|
margin-right: 0.5em;
|
||||||
|
margin-top: -1.91em;
|
||||||
|
}
|
||||||
|
#datasourceButton {
|
||||||
|
float: right;
|
||||||
|
border-radius: 25px;
|
||||||
|
color: black;
|
||||||
|
box-shadow: 0px 0px 5px 0px #000000;
|
||||||
|
background-color: #8d8d8d;
|
||||||
|
}
|
||||||
|
#datasourceButton:hover {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
#datasourceButton.production {
|
||||||
|
background-color: #c20000;
|
||||||
|
}
|
||||||
|
#datasourceButton.test {
|
||||||
|
background-color: #31a527;
|
||||||
|
}
|
||||||
|
#datasourceButton.dev {
|
||||||
|
background-color: #a59827;
|
||||||
|
}
|
||||||
|
select.production {
|
||||||
|
background-color: #c20000;
|
||||||
|
}
|
||||||
|
select.test {
|
||||||
|
background-color: #31a527;
|
||||||
|
}
|
||||||
|
select.dev {
|
||||||
|
background-color: #a59827;
|
||||||
|
}
|
||||||
|
|
||||||
/* Message */
|
/* Message */
|
||||||
|
|
||||||
#message {
|
#message {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 2em;
|
top: 1.8em;
|
||||||
left: 49.2%;
|
left: 11.8em;
|
||||||
width: 16em;
|
width: 20em;
|
||||||
padding: .5em;
|
padding: .5em;
|
||||||
margin-left: -8.25em;
|
margin-left: -8.25em;
|
||||||
margin-top: 2em;
|
margin-top: 2em;
|
||||||
border: 1px solid #644;
|
|
||||||
background-color: #EBB;
|
background-color: #EBB;
|
||||||
color: #644;
|
color: #644;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: .9em;
|
font-size: .8em;
|
||||||
display: none;
|
display: none;
|
||||||
border-radius: 25px;
|
border-radius: 5px;
|
||||||
box-shadow: 0px 0px 5px 0px #000000
|
box-shadow: 0 0 0.4em rgba(1,1,1,0.6);
|
||||||
}
|
}
|
||||||
#message.error {
|
#message.error {
|
||||||
border-color: black;
|
border-color: black;
|
||||||
background-color: #a52727;
|
background-color: #ffcdd2;
|
||||||
color: white;
|
color: #bf0000;
|
||||||
}
|
}
|
||||||
#message.notice {
|
#message.notice {
|
||||||
border-color: black;
|
border-color: black;
|
||||||
background-color: #2773a5;
|
background-color: #d0cdff;
|
||||||
color: white;
|
color: #0d00bf;
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +254,7 @@ button:hover {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
filter: alpha(opacity=70);
|
filter: alpha(opacity=50);
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -214,7 +266,7 @@ button:hover {
|
||||||
width: 10em;
|
width: 10em;
|
||||||
height: 5em;
|
height: 5em;
|
||||||
margin-top: -4em;
|
margin-top: -4em;
|
||||||
margin-left: -5.9em;
|
margin-left: -6.1em;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
@ -233,4 +285,4 @@ button:hover {
|
||||||
}
|
}
|
||||||
#loading-message {
|
#loading-message {
|
||||||
font-size: .9em;
|
font-size: .9em;
|
||||||
}
|
}
|
|
@ -41,38 +41,27 @@
|
||||||
<input id="password" type="password"/>
|
<input id="password" type="password"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="rememberMe">
|
<div id="notSignOut">
|
||||||
<input id="remember" type="checkbox"/>
|
<input id="notSignOutInput" type="checkbox"/>
|
||||||
<label for="remember">Recuérdame</label>
|
<label for="notSignOutInput">No cerrar sesión</label>
|
||||||
</div>
|
|
||||||
<div id="oldVersion">
|
|
||||||
<input id="previous-version" type="checkbox"/>
|
|
||||||
<label for="previous-version">Usar versión anterior</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="submit">
|
<div id="submit">
|
||||||
<button
|
<button id="enter" onclick="App.onEnterClick()"> Iniciar sesión</button>
|
||||||
id="enter"
|
|
||||||
onclick="App.onEnterClick()">
|
|
||||||
Entrar
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="clean">
|
<div id="clean">
|
||||||
<a
|
<a href="#" onclick="App.onCleanCacheClick()"> Limpiar caché </a>
|
||||||
href="#"
|
|
||||||
onclick="App.onCleanCacheClick()">
|
|
||||||
Limpiar caché
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="branchOptions">
|
<div id="branchOptions">
|
||||||
<div id="branchButton">
|
<div id="branchButton">
|
||||||
<img
|
<img
|
||||||
id="branchLogo"
|
id="branchLogo"
|
||||||
src="branch.png"
|
src="branch.png"
|
||||||
onclick="App.onShowOptionsClick()"
|
onclick="App.onShowBranchOptionsClick(),
|
||||||
|
App.onShowDatasourceOptionsClick()"
|
||||||
alt="Change branch"/>
|
alt="Change branch"/>
|
||||||
<div id="branchSelector">
|
<div id="branchSelector">
|
||||||
<select id="branch" onchange="App.onChangeBranchChange()">
|
<select id="branch" onchange="App.onChangeBranch()">
|
||||||
<option value="master">master</option>
|
<option value="master">master</option>
|
||||||
<option value="test">test</option>
|
<option value="test">test</option>
|
||||||
<option value="dev">dev</option>
|
<option value="dev">dev</option>
|
||||||
|
@ -80,8 +69,25 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="background">
|
<div id="datasourceOptions">
|
||||||
|
<div id="datasourceButton">
|
||||||
|
<img
|
||||||
|
id="datasourceLogo"
|
||||||
|
src="datasource.png"
|
||||||
|
onclick="App.onShowDatasourceOptionsClick(),
|
||||||
|
App.onShowBranchOptionsClick()"
|
||||||
|
alt="Change datasource"/>
|
||||||
|
<div id="datasourceSelector">
|
||||||
|
<select id="datasource" onchange="App.onChangeDatasource()">
|
||||||
|
<option value="production">production</option>
|
||||||
|
<option value="test">test</option>
|
||||||
|
<option value="dev">dev</option>
|
||||||
|
<option value="localhost">localhost</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="background"></div>
|
||||||
<div id="spinner">
|
<div id="spinner">
|
||||||
<img
|
<img
|
||||||
alt="Cargando..."
|
alt="Cargando..."
|
||||||
|
|
Loading…
Reference in New Issue