configure mode http or https options
This commit is contained in:
parent
9cb83a5195
commit
b581856d0b
|
@ -184,7 +184,7 @@ class Login(QDialog):
|
|||
password = self.field_password.text()
|
||||
server = self.field_host.text()
|
||||
database = self.field_database.text()
|
||||
self.connection = xconnection(
|
||||
self.connection = xconnection(self.params['mode'],
|
||||
user, password, server, self.params['port'],
|
||||
database, self.params['protocol']
|
||||
)
|
||||
|
@ -202,18 +202,17 @@ class Login(QDialog):
|
|||
self.error_msg.show()
|
||||
|
||||
|
||||
def xconnection(user, password, host, port, database, protocol):
|
||||
def xconnection(mode, user, password, host, port, database, protocol):
|
||||
# Get user_id and session
|
||||
try:
|
||||
url = 'http://%s:%s@%s:%s/%s/' % (
|
||||
user, password, host, port, database)
|
||||
url = '%s://%s:%s@%s:%s/%s/' % (
|
||||
mode, user, password, host, port, database)
|
||||
try:
|
||||
if not common.test_server_version(host, int(port)):
|
||||
print(u'Incompatible version of the server')
|
||||
return
|
||||
except:
|
||||
pass
|
||||
|
||||
if protocol == 'json':
|
||||
conn = connection.set_jsonrpc(url[:-1])
|
||||
elif protocol == 'local':
|
||||
|
@ -226,10 +225,9 @@ def xconnection(user, password, host, port, database, protocol):
|
|||
else:
|
||||
print("Protocol error...!")
|
||||
return None
|
||||
|
||||
return conn
|
||||
except:
|
||||
print('LOG: Data connection invalid!')
|
||||
except Exception as e:
|
||||
print('LOG: Data connection invalid!', e)
|
||||
return None
|
||||
|
||||
|
||||
|
|
|
@ -34,8 +34,9 @@ class FastModel(object):
|
|||
self.model = model
|
||||
self.ctx = ctx
|
||||
api_url = ctx['params']['api_url']
|
||||
mode = ctx['params']['mode']
|
||||
db = ctx['params']['database']
|
||||
self.api = '/'.join(['http:/', api_url, db])
|
||||
self.api = '/'.join([mode + ':/', api_url, db])
|
||||
_model = MODELS.get(model)
|
||||
self.fields = None
|
||||
if fields:
|
||||
|
|
|
@ -1 +1 @@
|
|||
__version__ = "6.0.1"
|
||||
__version__ = "6.0.2"
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
protocol=xml
|
||||
server=127.0.0.1
|
||||
api_url=localhost:5070
|
||||
# options http or https
|
||||
mode=https
|
||||
port=8000
|
||||
database=DEMO
|
||||
user=admin
|
||||
|
|
Loading…
Reference in New Issue