@@ -38,25 +38,26 @@ socketio.on("connection",function (socket) {
38
38
39
39
40
40
//Emit databases names
41
- socket . on ( "get:database " , function ( data ) {
41
+ socket . on ( "get:databases " , function ( data ) {
42
42
console . log ( "[Interface] : list databases" ) ;
43
43
// ask service to emit then database names
44
-
45
-
44
+ socket . broadcast . emit ( "get:databases" ) ;
46
45
47
46
} ) ;
48
47
49
48
//Emit table names from database given
50
- socket . on ( "get:table " , function ( data ) {
49
+ socket . on ( "get:tables " , function ( data ) {
51
50
console . log ( "[Interface] : list tables" ) ;
52
- //socket.emit("get:table",);
51
+ // ask service to emit then table names
52
+ socket . broadcast . emit ( "get:tables" , data ) ;
53
53
} ) ;
54
54
55
55
56
56
//Emit fields and data based on the table names from database given
57
57
socket . on ( "get:table:data" , function ( data ) {
58
58
console . log ( "[Interface] : list fields and data" ) ;
59
- //socket.emit("get:table:data",);
59
+ // ask service to emit then data inside the tables
60
+ socket . broadcast . emit ( "get:table:data" , data ) ;
60
61
} ) ;
61
62
62
63
@@ -68,23 +69,29 @@ socketio.on("connection",function (socket) {
68
69
//Service Events
69
70
70
71
socket . on ( "service:send:databases" , function ( data ) {
71
- console . log ( "[Service] : Sent Databases" ) ;
72
72
73
+ console . log ( "[Service] : Sent Databases" ) ;
74
+
73
75
// Emit/Send the databases to the Interface
76
+ socket . broadcast . emit ( "service:send:databases" , data ) ;
74
77
75
78
} ) ;
76
79
77
- socket . on ( "service:send:Tables" , function ( data ) {
80
+ socket . on ( "service:send:tables" , function ( data ) {
81
+
78
82
console . log ( "[Service] : Sent Tables" ) ;
79
83
80
- // Emit/Send the tables to the Interface
84
+ // Emit/Send the tables to the Interface
85
+ socket . broadcast . emit ( "service:send:tables" , data ) ;
81
86
82
87
} ) ;
83
88
84
- socket . on ( "service:send:fields and Data" , function ( data ) {
85
- console . log ( "[Service] : Sent fields and Data" ) ;
89
+ socket . on ( "service:send:data" , function ( data ) {
90
+
91
+ console . log ( "[Service] : Sent fields and Data" ) ;
86
92
87
93
// Emit/Send the fields and data to the Interface
94
+ socket . broadcast . emit ( "service:send:data" , data ) ;
88
95
89
96
} ) ;
90
97
0 commit comments