Browse Source

[FIX] protocols

Gogs 7 năm trước cách đây
mục cha
commit
69c2dcae7f
2 tập tin đã thay đổi với 5 bổ sung7 xóa
  1. 3 5
      models/socket.py
  2. 2 2
      static/src/js/main.js

+ 3 - 5
models/socket.py

@@ -2,10 +2,8 @@
 from openerp import api, models, fields
 
 AVAILABLE_PROTOCOLS = [
-    ('ws', 'ws (WebSocket)'),
-    ('wss', 'wss (WebSocket Seguro)'),
-    ('http', 'http (HyperTexto)'),
-    ('https', 'https (HyperTexto Seguro)')
+    ('ws', 'ws'),
+    ('wss', 'wss'),
 ]
 
 class PrintEngineSocket(models.Model):
@@ -17,7 +15,7 @@ class PrintEngineSocket(models.Model):
 
     name = fields.Char(string='Nombre', size=35, required=True)
     protocol = fields.Selection(string='Protocolo', selection=AVAILABLE_PROTOCOLS, default='ws')
-    host = fields.Char(string='Host', default='127.0.0.1', required=True)
+    host = fields.Char(string='Host', default='localhost', required=True)
     port = fields.Integer(string='Puerto', default=8070, required=True)
     path = fields.Char(string='Recurso', default='/')
     last_connection = fields.Datetime(string='Última conexión', readonly=True)

+ 2 - 2
static/src/js/main.js

@@ -64,7 +64,7 @@
                     self.handleMessage(e);
                 };
             } catch(e) {
-                // Ignore exception
+                // Ignore this error
             }
         },
         reconnect: function () {
@@ -110,7 +110,7 @@
             }
         },
         handleError: function (e) {
-            // Ignore error
+            // Ignore this error
         },
         sendToSocket: function (data) {
             if (this.state !== 'online') {