Subversion Repositories DevTools

Rev

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

Rev 6549 Rev 6566
Line 90... Line 90...
90
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Est Duration<%=Quick_Help("h_buildtime")%></td>
90
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Est Duration<%=Quick_Help("h_buildtime")%></td>
91
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<%=Quick_Help("h_lastchange")%></td>
91
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<%=Quick_Help("h_lastchange")%></td>
92
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
92
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
93
           </tr>
93
           </tr>
94
           <%
94
           <%
95
           ' Get the number of release configurations for this RTAG_ID, and iterate through them
95
           ' Get Build Information for this Release
-
 
96
           query_string = _
96
           query_string = " select rc.rcon_id, display_name, gbe_value, daemon_mode, NVL(ACTIVE, 'U') as ACTIVE" &_
97
                "SELECT rc.rcon_id, display_name, gbe_value, daemon_mode, NVL(ACTIVE, 'U') AS ACTIVE," &_
-
 
98
                "       rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) AS delta," &_
-
 
99
                "       pk.pkg_name, rl.current_pv_id, pv.build_time, TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) AS build_delta" &_
-
 
100
                " FROM release_config rc," &_
-
 
101
                "   gbe_machtype gm," &_
97
                          " from release_config rc, gbe_machtype gm, build_machine_config bm"&_
102
                "   build_machine_config bm," &_
-
 
103
                "   run_level rl," &_
-
 
104
                "   packages pk," &_
-
 
105
                "   package_versions pv" &_
98
                          "  where rc.rtag_id = "& parRtagId &_
106
                " WHERE rc.rtag_id     = " & parRtagId &_
99
                          "    and gm.gbe_id = rc.gbe_id"&_
107
                "  AND gm.gbe_id        = rc.gbe_id" &_
-
 
108
                "  AND rl.rcon_id       = rc.rcon_id" &_
100
                          "    and rc.bmcon_id=bm.bmcon_id(+)" &_
109
                "  AND rc.bmcon_id      =bm.bmcon_id(+)" &_
-
 
110
                "  AND pk.pkg_id(+)     = rl.current_pkg_id_being_built" &_
-
 
111
                "  AND rl.current_pv_id = pv.pv_id(+)" &_
101
                          "  order by bm.display_name, rc.rcon_id"
112
                " ORDER BY bm.display_name, rc.rcon_id"
102
 
113
 
103
           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
114
           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
104
 
115
 
105
           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
116
           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
106
              rcon_id = rsQry("rcon_id")
-
 
107
 
-
 
108
              Dim pkgName
117
              Dim pkgName
109
              Dim pkgPvid
118
              Dim pkgPvid
110
              Dim pkgBuildTime
119
              Dim pkgBuildTime
111
              Dim currentRunLevel
120
              Dim currentRunLevel
112
              Dim daemonState
121
              Dim daemonState
113
              Dim delta
122
              Dim delta
-
 
123
              Dim PkgBuildDelta
114
              Dim pkgId
124
              Dim pkgId
115
              Dim bActive : bActive = rsQry("active")
-
 
116
              If bActive = "N" Then bInactiveMachine = true
-
 
117
 
-
 
118
              ' For this release configuration, get its entry from the run_level table. This table may not
-
 
119
              ' have an entry so we must handle that outcome too.
-
 
120
              query_string = " select rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, "&_
-
 
121
                             "        TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
-
 
122
                             "   from run_level rl"&_
-
 
123
                             "  where rl.rcon_id = "& rcon_id
-
 
124
 
-
 
125
              Dim rsQry2
125
              Dim bActive
126
              Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
-
 
127
 
-
 
128
              currentRunLevel = -1
-
 
129
              pkgId = Null
-
 
130
              pkgName = NULL
-
 
131
              pkgPvid = NULL
126
              Dim estDuration
132
              pkgBuildTime = NULL
-
 
133
              daemonState = 0
127
              Dim daemonMode 
134
              delta = NULL
128
              Dim lastChange
135
 
129
 
-
 
130
              rcon_id = rsQry("rcon_id")
136
              If (rsQry2.RecordCount > 0) Then
131
              ' = rsQry("display_name")
137
                ' Get the run level from the run_level table
132
              ' = rsQry("gbe_value")
138
                currentRunLevel = rsQry2("current_run_level")
133
              daemonMode = rsQry("daemon_mode")
139
                pkgId = rsQry2("current_pkg_id_being_built")
134
              bActive = rsQry("ACTIVE")
140
 
-
 
141
                daemonState = rsQry2("pause")
135
              daemonState = rsQry("pause")
142
                If IsNull(daemonState) Then daemonState = 0
136
              currentRunLevel = rsQry("current_run_level")
143
                If daemonState = "2" Then pkgId = Null
137
              pkgId = rsQry("current_pkg_id_being_built")
144
 
-
 
145
                delta = rsQry2("delta")
138
              delta = rsQry("delta")
146
 
-
 
147
              End If
139
              pkgName = rsQry("pkg_name")
148
 
-
 
149
              ' If we got an entry from the run_level table, try and use the pkg_id it contains, to obtain a
140
              pkgPvid = rsQry("current_pv_id")
150
              ' package name from the packages table
141
              pkgBuildTime = rsQry("build_time")
151
              Dim rsQry3
142
              PkgBuildDelta = rsQry("build_delta")
152
              If NOT IsNull(pkgId) Then
143
              lastChange = NULL
153
                 query_string = " select pkg_name,rl.current_pv_id, pv.build_time from run_level rl, packages pk, package_versions pv"&_
-
 
154
                                "  where rl.rcon_id = "& rcon_id &_
144
              bInactiveMachine = FALSE
155
                                "   and  rl.current_pkg_id_being_built = pk.pkg_id" &_
-
 
156
                                "   and  rl.current_pv_id = pv.pv_id"
145
              estDuration = NULL
157
 
146
 
158
                 Set rsQry3 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
147
              If bActive = "N" Then bInactiveMachine = true
159
                 If (rsQry3.RecordCount > 0) Then
148
              If IsNull(daemonState) Then daemonState = 0
160
                    pkgName = rsQry3("pkg_name")
149
              If daemonState = "2" Then pkgId = Null
161
                    pkgPvid = rsQry3("current_pv_id")
150
              If IsNull(currentRunLevel) Then currentRunLevel = -1
162
                    pkgBuildTime = rsQry3("build_time")
151
              If daemonMode = "M" AND not IsNull(pkgName) Then estDuration = pkgBuildTime & "[" & PkgBuildDelta & "]"
163
                 End If
-
 
164
                 rsQry3.Close()
-
 
165
                 Set rsQry3 = nothing
152
              If bActive <> "U" Then lastChange = PrettyDelta(delta, daemonState,pkgName )
166
              End If
-
 
167
 
153
 
168
              ' --- Now render HTML for this release configuration ---
154
              ' --- Now render HTML for this release configuration ---
169
              %>
155
              %>
170
              <tr>
156
              <tr>
171
                 <td colspan="8" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
157
                 <td colspan="8" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
172
              </tr>
158
              </tr>
173
              <tr>
159
              <tr>
174
                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
160
                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
175
                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
161
                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
176
                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
162
                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(daemonMode)%></td>
177
                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused, daemonState, bActive)%></td>
163
                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused, daemonState, bActive)%></td>
178
                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid, bActive)%></td>
164
                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid, bActive)%></td>
179
                 <td nowrap class="body_rowg"><%=IIF(rsQry("daemon_mode") = "M", pkgBuildTime, "")%></td>
165
                 <td nowrap class="body_rowg"><%=estDuration%></td>
180
                 <td nowrap class="body_rowg"><%=PrettyDelta(delta, daemonState,pkgName )%></td>
166
                 <td nowrap class="body_rowg"><%=lastChange%></td>
181
                 <td nowrap class="body_rowg">
167
                 <td nowrap class="body_rowg">
182
                    <%
168
                    <%
183
                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
169
                    If NOT indefinitelyPaused  Then
184
                       If canActionControlInProject("BuildControl") Then
170
                       If canActionControlInProject("BuildControl") Then
185
                          If bActive = "U" Then
171
                          If bActive = "U" Then
186
                          ElseIf bActive = "N" Then
172
                          ElseIf bActive = "N" Then
187
                             Call Action_Buttons ( "Daemon Unavailable" )
173
                             Call Action_Buttons ( "Daemon Unavailable" )
188
                          ElseIf daemonState = 0 Then
174
                          ElseIf daemonState = 0 Then
Line 213... Line 199...
213
                    End If
199
                    End If
214
                    %>
200
                    %>
215
                 </td>
201
                 </td>
216
              </tr>
202
              </tr>
217
              <%
203
              <%
218
              rsQry2.Close()
-
 
219
              Set rsQry2 = nothing
-
 
220
              rsQry.MoveNext
204
              rsQry.MoveNext
221
           Loop
205
           Loop
222
           %>
206
           %>
223
           <tr>
207
           <tr>
224
             <td nowrap background="images/bg_table_col.gif" class="body_col" colspan=7>
208
             <td nowrap background="images/bg_table_col.gif" class="body_col" colspan=7>