From 28aa36e77a5f9774c81ed4048659e6b460a83d80 Mon Sep 17 00:00:00 2001 From: Patrykb0802 Date: Tue, 16 Jul 2024 13:33:18 +0200 Subject: [PATCH 1/2] #2826 Fixed Cannot create Serotonin Persistent TCP type publisher - Added extractPrefix method for PublisherEditDwr.savePersistentSender() argument --- WebContent/WEB-INF/jsp/publisherEdit.jsp | 4 +++- .../WEB-INF/jsp/publisherEdit/editPersistent.jsp | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/WebContent/WEB-INF/jsp/publisherEdit.jsp b/WebContent/WEB-INF/jsp/publisherEdit.jsp index 3381edcadd..eba0e5d4fb 100644 --- a/WebContent/WEB-INF/jsp/publisherEdit.jsp +++ b/WebContent/WEB-INF/jsp/publisherEdit.jsp @@ -39,7 +39,9 @@ errorMessages[j].innerHTML = ''; } showMessage("message", ""); - showHttpSenderTest(); + if (${publisher.type.id == applicationScope['constants.PublisherVO.Types.HTTP_SENDER']}) { + showHttpSenderTest(); + } } } diff --git a/WebContent/WEB-INF/jsp/publisherEdit/editPersistent.jsp b/WebContent/WEB-INF/jsp/publisherEdit/editPersistent.jsp index acb6f6c516..566acbddfa 100644 --- a/WebContent/WEB-INF/jsp/publisherEdit/editPersistent.jsp +++ b/WebContent/WEB-INF/jsp/publisherEdit/editPersistent.jsp @@ -125,9 +125,17 @@ points[points.length] = {dataPointId: selectedPoints[i].id}; PublisherEditDwr.savePersistentSender(name, xid, enabled, points, $get("host"), $get("port"), - $get("authorizationKey"), $get("syncType"), cacheWarningSize, changesOnly, sendSnapshot, + $get("authorizationKey"), extractPrefix(xid), $get("syncType"), cacheWarningSize, changesOnly, sendSnapshot, snapshotSendPeriods, snapshotSendPeriodType, savePublisherCB); } + + function extractPrefix(xid) { + let underscoreIndex = xid.indexOf('_'); + if (underscoreIndex !== -1) { + return xid.substring(0, underscoreIndex); + } + return ""; + } From ed0d766bfbb1eaed05fa8deaf952ce47499c484a Mon Sep 17 00:00:00 2001 From: Patrykb0802 Date: Thu, 18 Jul 2024 11:15:49 +0200 Subject: [PATCH 2/2] #2826 Fixed Cannot create Serotonin Persistent TCP type publisher - Removed extractPrefix() method, passing xid as argument --- .../WEB-INF/jsp/publisherEdit/editPersistent.jsp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/WebContent/WEB-INF/jsp/publisherEdit/editPersistent.jsp b/WebContent/WEB-INF/jsp/publisherEdit/editPersistent.jsp index 566acbddfa..ba87f38f55 100644 --- a/WebContent/WEB-INF/jsp/publisherEdit/editPersistent.jsp +++ b/WebContent/WEB-INF/jsp/publisherEdit/editPersistent.jsp @@ -125,17 +125,9 @@ points[points.length] = {dataPointId: selectedPoints[i].id}; PublisherEditDwr.savePersistentSender(name, xid, enabled, points, $get("host"), $get("port"), - $get("authorizationKey"), extractPrefix(xid), $get("syncType"), cacheWarningSize, changesOnly, sendSnapshot, + $get("authorizationKey"), xid, $get("syncType"), cacheWarningSize, changesOnly, sendSnapshot, snapshotSendPeriods, snapshotSendPeriodType, savePublisherCB); } - - function extractPrefix(xid) { - let underscoreIndex = xid.indexOf('_'); - if (underscoreIndex !== -1) { - return xid.substring(0, underscoreIndex); - } - return ""; - }