Skip to content

Commit aa42c7d

Browse files
committed
[FIX] On/Off monitor bug.
1 parent 5ad2935 commit aa42c7d

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

csp-data/csp/confpage.csp.xml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,23 @@ function submitAll()
2323
function stopMon()
2424
{
2525
#server(..StopMonitor())#;
26+
checkMon();
2627
}
2728
function startMon()
2829
{
2930
#server(..StartMonitor())#;
31+
checkMon();
3032
}
3133
function docLoc(page)
3234
{
3335
var newloc = 'http://' + window.location.host + '/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25' + page;
3436
window.open(newloc,"_blank","");
3537
}
38+
function checkMon()
39+
{
40+
#call(..CheckMon())#;
41+
}
42+
checkMon();
3643
</script>
3744
3845
<csp:method name = "WriteClassChanges" Arguments="a:%Integer,b:%String">
@@ -65,7 +72,7 @@ if $data(^SYSMONClassTemp)
6572
6673
<csp:method name = "StopMonitor">
6774
new $namespace
68-
set $namespace = "%SYS"
75+
set $namespace = "SYSMON"
6976
set sc = ##class(%SYS.Monitor).Stop()
7077
if sc=1 {
7178
&js< alert(" System Monitor stopped")>
@@ -78,7 +85,7 @@ if sc=1 {
7885
7986
<csp:method name = "StartMonitor">
8087
new $namespace
81-
set $namespace = "%SYS"
88+
set $namespace = "SYSMON"
8289
set sc = ##class(%SYS.Monitor).Start()
8390
if sc=1 {
8491
&js< alert("System Monitor started")>
@@ -89,6 +96,20 @@ if sc=1 {
8996
}
9097
</csp:method>
9198
99+
<csp:method name = "CheckMon">
100+
new $namespace
101+
set $namespace = "SYSMON"
102+
set sc = ##class(%SYS.Monitor).State()
103+
if sc=0 {
104+
&js< document.getElementById('btnstart').disabled = false;
105+
document.getElementById('btnstop').disabled = true;>
106+
} else{
107+
&js< document.getElementById('btnstop').disabled = false;
108+
document.getElementById('btnstart').disabled = true;>
109+
}
110+
</csp:method>
111+
112+
92113
<body>
93114
<script language="cache" runat="server">
94115
new $namespace
@@ -102,7 +123,7 @@ if sc=1 {
102123
<div style="width: 30%; margin: auto;">
103124
<div>
104125
<div style="text-align: center;">
105-
<h4><b>Sysmon Applicatin Classes configuration:</b></h4>
126+
<h4><b>Sysmon Application Classes configuration:</b></h4>
106127
</div>
107128
<div style="padding: auto;">
108129
<form name="configform">
@@ -130,9 +151,9 @@ if sc=1 {
130151
<div style="text-align: center;">
131152
<h4><b>Control System Monitor:</b></h4>
132153
</div>
133-
<div style="width: 243px; margin: auto;">
134-
<input class="btn btn-primary" type="button" value="Start SYSMON" onclick="startMon();"/>
135-
<input class="btn btn-danger" type="button" value="Stop SYSMON" onclick="stopMon();"/>
154+
<div style="width: 250px; margin: auto;">
155+
<input id="btnstart" class="btn btn-primary" type="button" value="Start SYSMON" onclick="startMon();"/>
156+
<input id="btnstop" class="btn btn-danger" type="button" value="Stop SYSMON" onclick="stopMon();"/>
136157
</div>
137158
</div>
138159
</div>

0 commit comments

Comments
 (0)