webfast 0.1.41 → 0.1.43
Sign up to get free protection for your applications and to get access to all the features.
- package/app/content/js/webfast.js +16 -8
- package/modules/bots/init.js +4 -0
- package/package.json +1 -1
@@ -164,7 +164,6 @@ web.fast.connectWebSocket = function(socketURL,maxRetries = 40, retries = 0) {
|
|
164
164
|
}
|
165
165
|
|
166
166
|
// Call the function to start the WebSocket connection
|
167
|
-
web.fast.connectWebSocket(socketURL);
|
168
167
|
web.fast.receive = function(data,message) {
|
169
168
|
// Placeholder for processing the received data
|
170
169
|
// Implement your logic here (e.g., update UI, handle specific messages)
|
@@ -286,14 +285,20 @@ jQuery(document).ready(function() {
|
|
286
285
|
}
|
287
286
|
|
288
287
|
const webFastFunc = jQuery(this).attr(`webfast-func`);
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
288
|
+
|
289
|
+
// Create que instead of sending quick
|
290
|
+
web.fast.que.list.push({
|
291
|
+
path : `socket.api.${webAction}`,
|
292
|
+
message : {
|
293
|
+
ts : Date.now(),
|
294
|
+
ell : jQuery(this).attr(`id`),
|
295
|
+
other : other,
|
296
|
+
action : action,
|
297
|
+
webAction : webAction,
|
298
|
+
function : webFastFunc
|
299
|
+
}
|
296
300
|
})
|
301
|
+
|
297
302
|
break;
|
298
303
|
case "BUTTON":
|
299
304
|
// Check button interaction
|
@@ -303,4 +308,7 @@ jQuery(document).ready(function() {
|
|
303
308
|
console.error(`No Action for : ${elementType}`);
|
304
309
|
}
|
305
310
|
});
|
311
|
+
|
312
|
+
// Connect to websocket
|
313
|
+
web.fast.connectWebSocket(socketURL);
|
306
314
|
});
|
package/modules/bots/init.js
CHANGED
@@ -2,6 +2,10 @@ module.exports = {
|
|
2
2
|
dependOn : [`express.app`],
|
3
3
|
name : 'bot',
|
4
4
|
run : async function(program,name) {
|
5
|
+
if (process.env.bot == 'false') {
|
6
|
+
return false;
|
7
|
+
}
|
8
|
+
|
5
9
|
console.log(`Running ${name}`);
|
6
10
|
// Scan bots folder and exclude
|
7
11
|
const routesPath = program.path.join(__dirname,`applications`);
|