Subversion Repositories DevTools

Rev

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

Rev 6676 Rev 6786
Line 29... Line 29...
29
'------------ Variable Definition -------------
29
'------------ Variable Definition -------------
30
Dim rsQry
30
Dim rsQry
31
Dim parRtagId
31
Dim parRtagId
32
Dim query_string
32
Dim query_string
33
Dim rcon_id
33
Dim rcon_id
-
 
34
Dim canControl
34
'------------ Constants Declaration -----------
35
'------------ Constants Declaration -----------
35
'------------ Variable Init -------------------
36
'------------ Variable Init -------------------
36
parRtagId = Request("rtag_id")
37
parRtagId = Request("rtag_id")
37
objPMod.PersistInQryString("rtag_id")
38
objPMod.PersistInQryString("rtag_id")
-
 
39
canControl = canActionControlInProject("BuildControl")
38
'-------------------------------------------------
40
'-------------------------------------------------
39
' 
41
' 
40
Sub ShowDaemonStatus
42
Sub ShowDaemonStatus
41
%>
43
%>
42
<table class="embedded_table" style="margin-bottom:20px">
44
<table class="embedded_table" style="margin-bottom:20px">
43
  <tr>
45
    <tr>
44
     <td>
46
        <td>
-
 
47
            <table class="rounded_box embedded_table">
-
 
48
                <caption>
45
        <table width="95%" align="center" class="embedded_table">
49
                    <table align="center" class="full_table">
46
           <tr>
50
                       <tr>
47
              <td nowrap class="form_ttl"><p>DAEMON STATUS INFORMATION</p>
51
                          <td nowrap class="form_ttl"><p>DAEMON STATUS INFORMATION</p>
48
              </td>
52
                          </td>
49
              <td  valign="bottom" class="body_rowg">
53
                          <td  valign="bottom" class="body_rowg">
50
                Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
54
                            Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
51
              </td>
55
                          </td>
52
              <td align="right" valign="bottom">
56
                          <td align="right" valign="bottom">
53
                <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a>
57
                            <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a>
54
              </td>
58
                          </td>
55
           </tr>
59
                       </tr>
56
        </table>
60
                    </table>
57
     </td>
61
                </caption>
58
  </tr>
-
 
59
  <tr>
62
            <tr>
60
   <td>
63
                <td>
61
   <table class="rounded_box embedded_table">
64
                    <div class='round_box_pad'>
62
  <tr>
-
 
63
     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
-
 
64
     <td bgcolor="#FFFFFF" valign="top">
-
 
65
        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
65
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
66
        <!--#include file="messages/_msg_inline.asp"-->
66
                        <!--#include file="messages/_msg_inline.asp"-->
67
        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
67
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
68
        <br>
68
                        <br>
69
        <table width="100%" border="0" cellspacing="2" cellpadding="0">
69
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
70
           <%
70
                           <%
71
           Dim bInactiveMachine : bInactiveMachine = false
71
                           Dim bInactiveMachine : bInactiveMachine = false
72
           Dim indefinitelyPaused : indefinitelyPaused = Indefinitely_Paused()
72
                           Dim indefinitelyPaused : indefinitelyPaused = Indefinitely_Paused()
73
           ' Insert a warning into the page if the build daemons are indefintely paused.
73
                           ' Insert a warning into the page if the build daemons are indefintely paused.
74
           If indefinitelyPaused Then %>
74
                           If indefinitelyPaused Then %>
75
              <tr>
75
                              <tr>
76
                 <span class='err_alert'>
76
                                 <span class='err_alert'>
77
                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
77
                                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
78
                 </span>
78
                                 </span>
79
              </tr>
79
                              </tr>
80
           <%End If
80
                           <%End If
81
           %>
81
                           %>
82
           <td width="9%" valign="top"></td>
82
                           <td width="9%" valign="top"></td>
83
           <tr>
83
                           <tr>
84
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
84
                              <td valign="top" nowrap class="body_lcol">Daemon Host</td>
85
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
85
                              <td valign="top" nowrap class="body_lcol">Machine Type</td>
86
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
86
                              <td valign="top" nowrap class="body_lcol">Mode</td>
87
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
87
                              <td valign="top" nowrap class="body_lcol">Run Level</td>
88
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
88
                              <td valign="top" nowrap class="body_lcol">Current Package</td>
89
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Est Duration<%=Quick_Help("h_buildtime")%></td>
89
                              <td valign="top" nowrap class="body_lcol">Est Duration<%=Quick_Help("h_buildtime")%></td>
90
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<%=Quick_Help("h_lastchange")%></td>
90
                              <td valign="top" nowrap class="body_lcol">Last Change<%=Quick_Help("h_lastchange")%></td>
91
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
91
                              <td valign="top" nowrap class="body_lcol">Control State</td>
92
           </tr>
92
                           </tr>
93
           <%
93
                           <%
94
           ' Get Build Information for this Release
94
                           ' Get Build Information for this Release
95
           query_string = _
95
                           query_string = _
96
                "SELECT rc.rcon_id, display_name, gbe_value, daemon_mode, NVL(ACTIVE, 'U') AS ACTIVE," &_
96
                                "SELECT rc.rcon_id, display_name, gbe_value, daemon_mode, NVL(ACTIVE, 'U') AS ACTIVE," &_
97
                "       rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) AS delta," &_
97
                                "       rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) AS delta," &_
98
                "       pk.pkg_name, rl.current_pv_id, pv.build_time, TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) AS build_delta" &_
98
                                "       pk.pkg_name, rl.current_pv_id, pv.build_time, TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) AS build_delta" &_
99
                " FROM release_config rc," &_
99
                                " FROM release_config rc," &_
100
                "   gbe_machtype gm," &_
100
                                "   gbe_machtype gm," &_
101
                "   build_machine_config bm," &_
101
                                "   build_machine_config bm," &_
102
                "   run_level rl," &_
102
                                "   run_level rl," &_
103
                "   packages pk," &_
103
                                "   packages pk," &_
104
                "   package_versions pv" &_
104
                                "   package_versions pv" &_
105
                " WHERE rc.rtag_id     = " & parRtagId &_
105
                                " WHERE rc.rtag_id     = " & parRtagId &_
106
                "  AND gm.gbe_id        = rc.gbe_id" &_
106
                                "  AND gm.gbe_id        = rc.gbe_id" &_
107
                "  AND rl.rcon_id       = rc.rcon_id" &_
107
                                "  AND rl.rcon_id       = rc.rcon_id" &_
108
                "  AND rc.bmcon_id      =bm.bmcon_id(+)" &_
108
                                "  AND rc.bmcon_id      =bm.bmcon_id(+)" &_
109
                "  AND pk.pkg_id(+)     = rl.current_pkg_id_being_built" &_
109
                                "  AND pk.pkg_id(+)     = rl.current_pkg_id_being_built" &_
110
                "  AND rl.current_pv_id = pv.pv_id(+)" &_
110
                                "  AND rl.current_pv_id = pv.pv_id(+)" &_
111
                " ORDER BY bm.display_name, rc.rcon_id"
111
                                " ORDER BY bm.display_name, rc.rcon_id"
112
 
112
 
113
           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
113
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
114
 
114
 
115
           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
115
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
116
              Dim pkgName
116
                              Dim pkgName
117
              Dim pkgPvid
117
                              Dim pkgPvid
118
              Dim pkgBuildTime
118
                              Dim pkgBuildTime
119
              Dim currentRunLevel
119
                              Dim currentRunLevel
120
              Dim daemonState
120
                              Dim daemonState
121
              Dim delta
121
                              Dim delta
122
              Dim PkgBuildDelta
122
                              Dim PkgBuildDelta
123
              Dim pkgId
123
                              Dim pkgId
124
              Dim bActive
124
                              Dim bActive
125
              Dim estDuration
125
                              Dim estDuration
126
              Dim daemonMode 
126
                              Dim daemonMode 
127
              Dim lastChange
127
                              Dim lastChange
128
 
128
 
129
              rcon_id = rsQry("rcon_id")
129
                              rcon_id = rsQry("rcon_id")
130
              ' = rsQry("display_name")
130
                              ' = rsQry("display_name")
131
              ' = rsQry("gbe_value")
131
                              ' = rsQry("gbe_value")
132
              daemonMode = rsQry("daemon_mode")
132
                              daemonMode = rsQry("daemon_mode")
133
              bActive = rsQry("ACTIVE")
133
                              bActive = rsQry("ACTIVE")
134
              daemonState = rsQry("pause")
134
                              daemonState = rsQry("pause")
135
              currentRunLevel = rsQry("current_run_level")
135
                              currentRunLevel = rsQry("current_run_level")
136
              pkgId = rsQry("current_pkg_id_being_built")
136
                              pkgId = rsQry("current_pkg_id_being_built")
137
              delta = rsQry("delta")
137
                              delta = rsQry("delta")
138
              pkgName = rsQry("pkg_name")
138
                              pkgName = rsQry("pkg_name")
139
              pkgPvid = rsQry("current_pv_id")
139
                              pkgPvid = rsQry("current_pv_id")
140
              pkgBuildTime = rsQry("build_time")
140
                              pkgBuildTime = rsQry("build_time")
141
              PkgBuildDelta = rsQry("build_delta")
141
                              PkgBuildDelta = rsQry("build_delta")
142
              lastChange = NULL
142
                              lastChange = NULL
143
              bInactiveMachine = FALSE
143
                              bInactiveMachine = FALSE
144
              estDuration = NULL
144
                              estDuration = NULL
145
 
145
 
146
              If bActive = "N" Then bInactiveMachine = true
146
                              If bActive = "N" Then bInactiveMachine = true
147
              If IsNull(daemonState) Then daemonState = 0
147
                              If IsNull(daemonState) Then daemonState = 0
148
              If daemonState = "2" Then pkgId = Null
148
                              If daemonState = "2" Then pkgId = Null
149
              If IsNull(currentRunLevel) Then currentRunLevel = -1
149
                              If IsNull(currentRunLevel) Then currentRunLevel = -1
150
              If daemonMode = "M" AND not IsNull(pkgName) Then estDuration = pkgBuildTime & "[" & PkgBuildDelta & "]"
150
                              If daemonMode = "M" AND not IsNull(pkgName) Then estDuration = pkgBuildTime & "[" & PkgBuildDelta & "]"
151
              If bActive <> "U" Then lastChange = PrettyDelta(delta, daemonState,pkgName )
151
                              If bActive <> "U" Then lastChange = PrettyDelta(delta, daemonState,pkgName )
152
 
152
 
153
              ' --- Now render HTML for this release configuration ---
153
                              ' --- Now render HTML for this release configuration ---
154
              %>
154
                              %>
155
              <tr>
155
                              <tr>
156
                 <td colspan="8" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
156
                                 <td colspan="8" class=body_line></td>
157
              </tr>
157
                              </tr>
158
              <tr>
158
                              <tr>
159
                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
159
                                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
160
                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
160
                                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
161
                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(daemonMode)%></td>
161
                                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(daemonMode)%></td>
162
                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused, daemonState, bActive)%></td>
162
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused, daemonState, bActive)%></td>
163
                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid, daemonState, bActive)%></td>
163
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid, daemonState, bActive)%></td>
164
                 <td nowrap class="body_rowg"><%=estDuration%></td>
164
                                 <td nowrap class="body_rowg"><%=estDuration%></td>
165
                 <td nowrap class="body_rowg"><%=lastChange%></td>
165
                                 <td nowrap class="body_rowg"><%=lastChange%></td>
166
                 <td nowrap class="body_rowg">
166
                                 <td nowrap class="body_rowg">
167
                    <%
167
                                    <%
168
                    If NOT indefinitelyPaused  Then
168
                                    If NOT indefinitelyPaused  Then
169
                       If canActionControlInProject("BuildControl") Then
-
 
170
                          If bActive = "U" Then
169
                                        If bActive = "U" Then
171
                          ElseIf bActive = "N" Then
170
                                        ElseIf bActive = "N" Then
172
                             Call Action_Buttons ( "Daemon Unavailable" )
171
                                            Call Action_Buttons ( "Daemon Unavailable" )
173
                          ElseIf daemonState = 0 Then
172
                                        ElseIf daemonState = 0 Then
174
                             Call Action_Buttons ( "Daemon Pause" )
173
                                            Call Action_Buttons_State ( "Daemon Pause", canControl )
175
                          ElseIf daemonState = 1 Then
174
                                        ElseIf daemonState = 1 Then
176
                             Call Action_Buttons ( "Daemon Resume" )
175
                                            Call Action_Buttons_State ( "Daemon Resume", canControl )
177
                          ElseIf daemonState = 2 Then
176
                                        ElseIf daemonState = 2 Then
178
                             Call Action_Buttons ( "Daemon Start" )
177
                                            Call Action_Buttons_State ( "Daemon Start", canControl )
179
                          Else
178
                                        Else
180
                             Call Action_Buttons ( "Daemon Resume" )
179
                                            Call Action_Buttons_State ( "Daemon Resume", canControl )
181
                          End If
180
                                      End If
182
                       Else
181
                                    Else
183
                          If bActive = "U" Then
182
                                       %>Unavailable<%
184
                          ElseIf bActive = "N" Then
183
                                    End If
185
                             Call Action_Buttons ( "Daemon Unavailable" )
-
 
186
                          ElseIf daemonState = 0 Then
-
 
187
                             Call Action_Buttons ( "Daemon Pause Disabled" )
-
 
188
                          ElseIf daemonState = 1 Then
-
 
189
                             Call Action_Buttons ( "Daemon Resume Disabled" )
-
 
190
                          ElseIf daemonState = 2 Then
184
                                    %>
191
                             Call Action_Buttons ( "Daemon Start Disabled" )
-
 
192
                          Else
185
                                 </td>
193
                             Call Action_Buttons ( "Daemon Resume Disabled" )
-
 
194
                          End If
186
                              </tr>
195
                       End If
187
                              <%
196
                    Else
-
 
197
                       %>Unavailable<%
188
                              rsQry.MoveNext
198
                    End If
189
                           Loop
199
                    %>
190
                           %>
200
                 </td>
-
 
201
              </tr>
-
 
202
              <%
-
 
203
              rsQry.MoveNext
191
                           <tr class=form_bg_light>
204
           Loop
-
 
205
           %>
-
 
206
           <tr>
-
 
207
             <td nowrap background="images/bg_table_col.gif" class="body_col" colspan=7>
192
                             <td nowrap class="body_col" colspan=7>
208
             <%If CheckConfigErrors(parRtagId) OR bInactiveMachine Then%><span class="err_alert">&nbsp;Daemon configuration errors detected</span>
193
                             <%If CheckConfigErrors(parRtagId) OR bInactiveMachine Then%><span class="err_alert">&nbsp;Daemon configuration errors detected</span>
209
                <a class="txt_linked" href="release_config.asp?rtag_id=<%=parRtagId%>">
194
                                <a class="txt_linked" href="release_config.asp?rtag_id=<%=parRtagId%>">
210
                    <img src="images/i_link.gif" hspace="2" border="0" align="absmiddle" title="Goto Configuration">
195
                                    <img src="images/i_link.gif" hspace="2" border="0" align="absmiddle" title="Goto Configuration">
211
                </a>
196
                                </a>
212
             <%End If%>
197
                             <%End If%>
213
             </td>
198
                             </td>
214
             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
199
                             <td valign="bottom" nowrap class="body_col">
215
             <%
200
                             <%
216
               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused Then
201
                               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused Then
217
                 If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
202
                                   Call Action_Buttons_State ( "Daemon Control All", objAccessControl.UserLogedIn AND canControl )
218
                   Call Action_Buttons ( "Daemon Control All" )
203
                               Else
219
                 Else 
204
                                 %>&nbsp<%
220
                   Call Action_Buttons ( "Daemon Control All Disabled" )
205
                               End If
221
                 End If
206
                             %>
222
               Else
207
                             </td>
223
                 %>&nbsp<%
208
                           </tr>
224
               End If
209
                           <%
225
             %>
210
                             rsQry.Close()
226
             </td>
211
                             Set rsQry = nothing
227
           </tr>
212
                           %>
228
           <%
213
                        </table>
229
             rsQry.Close()
214
                    </div>
230
             Set rsQry = nothing
215
                </td>
231
           %>
216
            </tr>
232
        </table>
217
        </table>
233
     </td>
218
    </td>
234
     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
-
 
235
  </tr>
-
 
236
  <tr>
-
 
237
     <input type="hidden" name="action" value="true">
-
 
238
     <%=objPMod.ComposeHiddenTags()%>
-
 
239
  </tr>
-
 
240
</table>
-
 
241
</td>
-
 
242
</table>
219
</table>
243
<%
220
<%
244
End Sub
221
End Sub
245
'-------------------------------------------------
222
'-------------------------------------------------
246
' 
223
'