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