feature/IO-3000-messaging-sockets-migration2 -

- Polling Mode indicator now pegged to socket.connected

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-11-27 10:13:38 -08:00
parent 083534c3f3
commit 5e871b024d
3 changed files with 31 additions and 15 deletions

View File

@@ -108,7 +108,7 @@ export function ChatPopupComponent({ chatVisible, selectedConversation, toggleCh
<InfoCircleOutlined />
</Tooltip>
<SyncOutlined style={{ cursor: "pointer" }} onClick={() => refetch()} />
{pollInterval > 0 && <Tag color="yellow">{t("messaging.labels.nopush")}</Tag>}
{!socket?.connected && <Tag color="yellow">{t("messaging.labels.nopush")}</Tag>}
</Space>
<ShrinkOutlined
onClick={() => toggleChatVisible()}

16
package-lock.json generated
View File

@@ -55,7 +55,7 @@
"soap": "^1.1.6",
"socket.io": "^4.8.1",
"socket.io-adapter": "^2.5.5",
"ssh2-sftp-client": "^10.0.3",
"ssh2-sftp-client": "^11.0.0",
"twilio": "^4.23.0",
"uuid": "^10.0.0",
"winston": "^3.17.0",
@@ -66,6 +66,7 @@
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"concurrently": "^8.2.2",
"p-limit": "^3.1.0",
"prettier": "^3.3.3",
"source-map-explorer": "^2.5.2"
},
@@ -6707,8 +6708,8 @@
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
"integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
"devOptional": true,
"license": "MIT",
"optional": true,
"dependencies": {
"yocto-queue": "^0.1.0"
},
@@ -7737,16 +7738,17 @@
}
},
"node_modules/ssh2-sftp-client": {
"version": "10.0.3",
"resolved": "https://registry.npmjs.org/ssh2-sftp-client/-/ssh2-sftp-client-10.0.3.tgz",
"integrity": "sha512-Wlhasz/OCgrlqC8IlBZhF19Uw/X/dHI8ug4sFQybPE+0sDztvgvDf7Om6o7LbRLe68E7XkFZf3qMnqAvqn1vkQ==",
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/ssh2-sftp-client/-/ssh2-sftp-client-11.0.0.tgz",
"integrity": "sha512-lOjgNYtioYquhtgyHwPryFNhllkuENjvCKkUXo18w/Q4UpEffCnEUBfiOTlwFdKIhG1rhrOGnA6DeKPSF2CP6w==",
"license": "Apache-2.0",
"dependencies": {
"concat-stream": "^2.0.0",
"promise-retry": "^2.0.1",
"ssh2": "^1.15.0"
},
"engines": {
"node": ">=16.20.2"
"node": ">=18.20.4"
},
"funding": {
"type": "individual",
@@ -8691,8 +8693,8 @@
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
"devOptional": true,
"license": "MIT",
"optional": true,
"engines": {
"node": ">=10"
},

View File

@@ -26,7 +26,7 @@ function StartStatusReporter() {
}
try {
const crispStatusReporter = new CrispStatusReporter({
return new CrispStatusReporter({
token: process.env.CRISP_SECRET_TOKEN, // Your reporter token (given by Crisp)
service_id: process.env.CRISP_SERVICE_IDENTIFIER, // Service ID containing the parent Node for Replica (given by Crisp)
node_id: process.env.CRISP_NODE_IDENTIFIER, // Node ID containing Replica (given by Crisp)
@@ -34,14 +34,28 @@ function StartStatusReporter() {
interval: 30, // Reporting interval (in seconds; defaults to 30 seconds if not set)
console: {
debug: (log_message, data) => logger.log("crisp-status-update", "DEBUG", null, null, { log_message, data }),
log: (log_message, data) => logger.log("crisp-status-update", "DEBUG", null, null, { log_message, data }),
warn: (log_message, data) => logger.log("crisp-status-update", "WARN", null, null, { log_message, data }),
error: (log_message, data) => logger.log("crisp-status-update", "ERROR", null, null, { log_message, data })
debug: (log_message, data) =>
logger.log("crisp-status-update", "DEBUG", null, null, {
log_message,
data
}),
log: (log_message, data) =>
logger.log("crisp-status-update", "DEBUG", null, null, {
log_message,
data
}),
warn: (log_message, data) =>
logger.log("crisp-status-update", "WARN", null, null, {
log_message,
data
}),
error: (log_message, data) =>
logger.log("crisp-status-update", "ERROR", null, null, {
log_message,
data
})
} // Console instance if you need to debug issues,
});
return crispStatusReporter;
} catch (error) {
logger.log("crisp-status-update-error", "DEBUG", null, null, { error: error.message });
}