diff --git a/src/main/org/epics/archiverappliance/mgmt/staticcontent/js/mgmt.js b/src/main/org/epics/archiverappliance/mgmt/staticcontent/js/mgmt.js index 6d5e071b5..72f045659 100644 --- a/src/main/org/epics/archiverappliance/mgmt/staticcontent/js/mgmt.js +++ b/src/main/org/epics/archiverappliance/mgmt/staticcontent/js/mgmt.js @@ -251,7 +251,8 @@ function abortArchiveRequestFromDetails(pvName) { } -var refreshPVStatus = false; +var inRefreshPVStatus = false; +var skipAutoRefresh = false; // Displays the status of the PVs as typed in the #archstatpVNames textarea in the archstats table. function checkPVStatus() { @@ -269,11 +270,14 @@ function checkPVStatus() { createReportTable(jsonurl, tabledivname, [{'srcAttr' : 'pvName', 'label' : 'PV Name'} , {'srcAttr' : 'status', 'label' : 'Status', 'srcFunction' : function(curdata) { + if(skipAutoRefresh) { + return curdata.status; + } if(curdata.status !== undefined && curdata.status != 'Being archived') { - if(!refreshPVStatus) { - refreshPVStatus = true; + if(!inRefreshPVStatus) { + inRefreshPVStatus = true; window.setTimeout(function() { - refreshPVStatus = false; + inRefreshPVStatus = false; checkPVStatus(); }, 60*1000); } diff --git a/src/test/org/epics/archiverappliance/mgmt/ArchiveFieldsWorkflowTest.java b/src/test/org/epics/archiverappliance/mgmt/ArchiveFieldsWorkflowTest.java index df4447346..6171268dc 100644 --- a/src/test/org/epics/archiverappliance/mgmt/ArchiveFieldsWorkflowTest.java +++ b/src/test/org/epics/archiverappliance/mgmt/ArchiveFieldsWorkflowTest.java @@ -9,6 +9,7 @@ import org.junit.Before; import org.junit.Test; import org.openqa.selenium.By; +import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; @@ -41,6 +42,7 @@ public void tearDown() throws Exception { @Test public void testArchiveFieldsPV() throws Exception { driver.get("http://localhost:17665/mgmt/ui/index.html"); + ((JavascriptExecutor)driver).executeScript("window.skipAutoRefresh = true;"); WebElement pvstextarea = driver.findElement(By.id("archstatpVNames")); String[] fieldsToArchive = new String[] { "UnitTestNoNamingConvention:sine",