Subversion Repositories DevTools

Rev

Rev 6070 | Rev 6175 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6070 Rev 6166
Line 18... Line 18...
18
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/_form_window_common.asp"-->
19
<!--#include file="common/_form_window_common.asp"-->
20
<!--#include file="_action_buttons.asp"-->
20
<!--#include file="_action_buttons.asp"-->
21
<!--#include file="class/classActionButtonControl.asp"-->
21
<!--#include file="class/classActionButtonControl.asp"-->
22
<!--#include file="common/daemon_instructions.asp"-->
22
<!--#include file="common/daemon_instructions.asp"-->
-
 
23
<!--#include file="common/common_daemon.asp"-->
23
<% '------------ ACCESS CONTROL ------------------ %>
24
<% '------------ ACCESS CONTROL ------------------ %>
24
<!--#include file="_access_control_login.asp"-->
25
<!--#include file="_access_control_login.asp"-->
25
<!--#include file="_access_control_general.asp"-->
26
<!--#include file="_access_control_general.asp"-->
26
<!--#include file="_access_control_action_project.asp"-->
27
<!--#include file="_access_control_action_project.asp"-->
27
<% '------------ Scripts -------------------------- %>
28
<% '------------ Scripts -------------------------- %>
Line 89... Line 90...
89
   OraDatabase.Parameters.Remove "RTAG_ID"
90
   OraDatabase.Parameters.Remove "RTAG_ID"
90
   OraDatabase.Parameters.Remove "USER_ID"
91
   OraDatabase.Parameters.Remove "USER_ID"
91
 
92
 
92
End Sub
93
End Sub
93
'--------------------------------------------------------------------------------------------------------------------------
94
'--------------------------------------------------------------------------------------------------------------------------
94
Function PrettyDelta( delta, daemonState,pkgId )
-
 
95
    Dim style
-
 
96
    style = ""
-
 
97
 
-
 
98
    If (delta > 600) AND (IsNull(pkgId) OR pkgId = "") Then
-
 
99
      style = "style=color:Red"
-
 
100
      If (delta > 86400 ) Then
-
 
101
        Dim bdate, dd,mm,yy
-
 
102
        bdate = DateAdd("s", - delta,Now())
-
 
103
        dd = Day(bdate)
-
 
104
        mm = MonthName(Month(bdate),1)
-
 
105
        yy = Year( bdate)
-
 
106
        delta = dd & "-" & mm & "-" & yy
-
 
107
        If ( daemonState >= 2 ) Then
-
 
108
            style = ""
-
 
109
        End If
-
 
110
      ElseIf ( delta > 60*60 ) Then
-
 
111
        'Dim bdate, hh, mins, ss
-
 
112
        bdate = DateAdd("s", - delta,Now())
-
 
113
        delta = TimeValue( bdate)
-
 
114
        'delta = hh & ":" & mins & ":" & ss
-
 
115
      End If
-
 
116
    End If
-
 
117
 
-
 
118
    If style <> "" Then
-
 
119
        delta = "<span " & style & ">" & delta & "</span>"
-
 
120
    End If
-
 
121
    PrettyDelta = delta
-
 
122
End Function
-
 
123
'--------------------------------------------------------------------------------------------------------------------------
-
 
124
Function Get_Daemon_Mode( cMode )
-
 
125
 
-
 
126
   If cMode = "S" Then
-
 
127
      Get_Daemon_Mode = "Slave"
-
 
128
   ElseIf cMode = "M" Then
-
 
129
      Get_Daemon_Mode = "Master"
-
 
130
   End If
-
 
131
 
-
 
132
End Function
-
 
133
'--------------------------------------------------------------------------------------------------------------------------
-
 
134
Function Get_Run_Level( nLevel, indefinitePause, astate)
-
 
135
 
-
 
136
   If indefinitePause Then
-
 
137
      Get_Run_Level = "<span class='err_alert'>Stopped</span>"
-
 
138
   ElseIf astate = 1 Then      ' if build daemon paused
-
 
139
      Get_Run_Level = "Paused"
-
 
140
   ElseIf astate = 2 Then      ' if build daemon disabled
-
 
141
      Get_Run_Level = "Disabled"
-
 
142
   ElseIf astate = 0 Then     ' if build daemon enabled
-
 
143
      If nLevel = 1 Then
-
 
144
         Get_Run_Level = "Cannot Continue"
-
 
145
      ElseIf nLevel = 2 Then
-
 
146
         Get_Run_Level = "Paused"
-
 
147
      ElseIf nLevel = 3 Then
-
 
148
         Get_Run_Level = "Building"
-
 
149
      ElseIf nLevel = 4 Then
-
 
150
         Get_Run_Level = "Idle"
-
 
151
      ElseIf nLevel = 5 Then
-
 
152
         Get_Run_Level = "Waiting"
-
 
153
      ElseIf nLevel = 6 Then
-
 
154
         Get_Run_Level = "Publishing"
-
 
155
      Else
-
 
156
         Get_Run_Level = "<span class='err_alert'>Unknown!</span>"
-
 
157
      End If
-
 
158
   End If
-
 
159
 
-
 
160
End Function
-
 
161
 
-
 
162
'--------------------------------------------------------------------------------------------------------------------------
-
 
163
Function Get_Package_Name( sPackageName,nRtagId,nPkgPvid )
-
 
164
 
-
 
165
  If IsNull(sPackageName) Then
-
 
166
    Get_Package_Name = "None"
-
 
167
  ElseIf IsNull(nPkgPvid) or nPkgPvid <= 0 Then
-
 
168
    Get_Package_Name = sPackageName
-
 
169
  Else
-
 
170
    Get_Package_Name = "<a class=""txt_linked"" href=""dependencies.asp?pv_id=" +  nPkgPvid + "&rtag_id=" + nRtagId + """>" + sPackageName + "</a>"
-
 
171
  End If
-
 
172
 
-
 
173
End Function
-
 
174
'--------------------------------------------------------------------------------------------------------------------------
-
 
175
Function GetLastBuildAge( rtagid)
-
 
176
   Dim  query_string, rsQry
-
 
177
       query_string = "SELECT TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) as delta," &_
-
 
178
                      "       TO_CHAR(rl.LAST_BUILD, 'DD-Mon-YYYY') as last_build," &_
-
 
179
                      "       TO_CHAR(rl.LAST_BUILD, 'HH:MI:SS PM') as last_build_hours," &_
-
 
180
                      "       TRUNC (SYSDATE - rl.LAST_BUILD) as last_build_days" &_
-
 
181
                      " FROM RELEASE_CONFIG rc, RUN_LEVEL rl, BUILD_MACHINE_CONFIG bm " &_
-
 
182
                      " WHERE rc.RTAG_ID =" &rtagid &_
-
 
183
                      "   AND rc.bmcon_id is not null" &_
-
 
184
                      "   AND rl.RCON_ID = rc.RCON_ID" &_
-
 
185
                      "   AND rc.bmcon_id = bm.bmcon_id(+)"
-
 
186
 
-
 
187
        Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
-
 
188
        If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
-
 
189
            Dim delta, last_build, last_build_time, last_build_days
-
 
190
            If IsNull(rsQry("delta")) Then
-
 
191
                delta = 0
-
 
192
            Else
-
 
193
                delta = CLng(rsQry("delta"))
-
 
194
            End If
-
 
195
            last_build = rsQry("last_build")
-
 
196
            last_build_time = rsQry("last_build_hours")
-
 
197
            last_build_days = rsQry("last_build_days")
-
 
198
            If delta < (60*60*24) Then
-
 
199
                GetLastBuildAge = last_build_time  
-
 
200
            Else     
-
 
201
                GetLastBuildAge = last_build
-
 
202
            End If
-
 
203
        End If
-
 
204
        rsQry.Close()
-
 
205
        Set rsQry = nothing
-
 
206
 
-
 
207
End Function
-
 
208
 
-
 
209
'--------------------------------------------------------------------------------------------------------------------------
-
 
210
Function GetModifiedSeqNo( rtagid)
-
 
211
   Dim  query_string, rsQry
-
 
212
       query_string = "SELECT SEQNUM FROM RELEASE_MODIFIED WHERE RTAG_ID = " & rtagid
-
 
213
 
-
 
214
        Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
-
 
215
        If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
-
 
216
            GetModifiedSeqNo = rsQry("SEQNUM")
-
 
217
        Else
-
 
218
            GetModifiedSeqNo = "-"
-
 
219
        End If
-
 
220
        rsQry.Close()
-
 
221
        Set rsQry = nothing
-
 
222
 
-
 
223
End Function
-
 
224
 
-
 
225
'--------------------------------------------------------------------------------------------------------------------------
-
 
226
%>
-
 
227
<%
-
 
228
'------------ RUN BEFORE PAGE RENDER ----------
95
'------------ RUN BEFORE PAGE RENDER ----------
229
shref_base = "http://" & archive_server & "/devl/abtlog/"
96
shref_base = "http://" & archive_server & "/devl/abtlog/"
230
 
97
 
231
' --- Get Form details from DB ---
98
' --- Get Form details from DB ---
232
Call GetFormDetails ( Request("rtag_id"), objFormCollector )
99
Call GetFormDetails ( Request("rtag_id"), objFormCollector )
Line 540... Line 407...
540
                           <tr>
407
                           <tr>
541
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
408
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
542
                                 <p>DAEMON STATUS INFORMATION</p>
409
                                 <p>DAEMON STATUS INFORMATION</p>
543
                              </td>
410
                              </td>
544
                              <td  valign="bottom" class="body_rowg">
411
                              <td  valign="bottom" class="body_rowg">
545
                                Last Build: <%=GetLastBuildAge(parRtagId)%>
412
                                Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
546
                                 [<%=GetModifiedSeqNo(parRtagId)%>]
-
 
547
                              </td>
413
                              </td>
548
                              <td align="right" valign="bottom">
414
                              <td align="right" valign="bottom">
549
                                <a class="txt_linked" href="build_status.asp?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a></td>
415
                                <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a></td>
550
                              </td>
416
                              </td>
551
                           </tr>
417
                           </tr>
552
                        </table>
418
                        </table>
553
                     </td>
419
                     </td>
554
                     <td width="1%"></td>
420
                     <td width="1%"></td>
Line 566... Line 432...
566
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
432
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
567
                        <br>
433
                        <br>
568
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
434
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
569
                           <%
435
                           <%
570
                           Dim indefinitelyPaused
436
                           Dim indefinitelyPaused
571
                           indefinitelyPaused = FALSE
437
                           indefinitelyPaused = Indefinitely_Paused()
572
                           ' Insert a warning into the page if the build daemons are indefintely paused.
438
                           ' Insert a warning into the page if the build daemons are indefintely paused.
573
                           query_string = " select * from run_level_schedule rls where rls.indefinite_pause = 'P'"
-
 
574
 
-
 
575
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
-
 
576
                           If rsQry.RecordCount > 0 Then
-
 
577
                              indefinitelyPaused = TRUE %>
439
                           If indefinitelyPaused Then %>
578
                              <tr>
440
                              <tr>
579
                                 <span class='err_alert'>
441
                                 <span class='err_alert'>
580
                                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
442
                                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
581
                                 </span>
443
                                 </span>
582
                              </tr>
444
                              </tr>
583
                           <%End If
445
                           <%End If
584
 
-
 
585
                           rsQry.Close()
-
 
586
                           Set rsQry = nothing
-
 
587
                           %>
446
                           %>
588
                           <td width="9%" valign="top"></td>
447
                           <td width="9%" valign="top"></td>
589
                           <tr>
448
                           <tr>
590
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
449
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
591
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
450
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
Line 672... Line 531...
672
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused,daemonState)%></td>
531
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused,daemonState)%></td>
673
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid)%></td>
532
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid)%></td>
674
                                 <td nowrap class="body_rowg"><%=PrettyDelta(delta, daemonState,pkgName )%></td>
533
                                 <td nowrap class="body_rowg"><%=PrettyDelta(delta, daemonState,pkgName )%></td>
675
                                 <td nowrap class="body_rowg">
534
                                 <td nowrap class="body_rowg">
676
                                    <%
535
                                    <%
677
                                    If (rsQry2.RecordCount > 0) Then
536
                                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
678
                                       If canActionControlInProject("BuildControl") Then
537
                                       If canActionControlInProject("BuildControl") Then
679
                                          If daemonState = 0 Then
538
                                          If daemonState = 0 Then
680
                                             Call Action_Buttons ( "Daemon Pause" )
539
                                             Call Action_Buttons ( "Daemon Pause" )
681
                                          ElseIf daemonState = 1 Then
540
                                          ElseIf daemonState = 1 Then
682
                                             Call Action_Buttons ( "Daemon Resume" )
541
                                             Call Action_Buttons ( "Daemon Resume" )
Line 707... Line 566...
707
                              Set rsQry2 = nothing
566
                              Set rsQry2 = nothing
708
                              rsQry.MoveNext
567
                              rsQry.MoveNext
709
                           Loop
568
                           Loop
710
                           %>
569
                           %>
711
                           <tr>
570
                           <tr>
712
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
571
                             <td nowrap background="images/bg_table_col.gif" class="body_col" colspan=6>
713
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
572
                             <%If CheckConfigErrors(parRtagId) Then%><span class="err_alert">&nbsp;Daemon configuration errors detected</span>
714
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
573
                                <a class="txt_linked" href="release_config.asp?rtag_id=<%=parRtagId%>">
715
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
574
                                    <img src="images/i_link.gif" hspace="2" border="0" align="absmiddle" title="Goto Configuration">
716
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
575
                                </a>
717
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
576
                             <%End If%>
-
 
577
                             </td>
718
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
578
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
719
                             <%
579
                             <%
720
                               If (rsQry.RecordCount > 0) Then
580
                               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused  Then
721
                                 If canActionControlInProject("BuildControl") Then
581
                                 If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
722
                                   Call Action_Buttons ( "Daemon Control All" )
582
                                   Call Action_Buttons ( "Daemon Control All" )
723
                                 Else 
583
                                 Else 
724
                                   Call Action_Buttons ( "Daemon Control All Disabled" )
584
                                   Call Action_Buttons ( "Daemon Control All Disabled" )
725
                                 End If
585
                                 End If
726
                               Else
586
                               Else