Subversion Repositories DevTools

Rev

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

Rev 6070 Rev 6166
Line 15... Line 15...
15
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/qstr.asp"-->
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="common/common_daemon.asp"-->
20
<%
21
<%
21
'------------ ACCESS CONTROL ------------------
22
'------------ ACCESS CONTROL ------------------
22
%>
23
%>
23
<!--#include file="_access_control_login.asp"-->
24
<!--#include file="_access_control_login.asp"-->
24
<!--#include file="_access_control_general.asp"-->
25
<!--#include file="_access_control_general.asp"-->
Line 41... Line 42...
41
Dim bShowIdleBuilds           ' Indicates if idle builds must be shown during filtering
42
Dim bShowIdleBuilds           ' Indicates if idle builds must be shown during filtering
42
Dim bShowPausedBuilds         ' Indicates if paused builds must be shown during filtering
43
Dim bShowPausedBuilds         ' Indicates if paused builds must be shown during filtering
43
 
44
 
44
'------------ Constants Declaration -----------
45
'------------ Constants Declaration -----------
45
Const Min_Refresh_Time = 10         ' Seconds
46
Const Min_Refresh_Time = 10         ' Seconds
46
Const Max_Delta = 600               ' Seconds
-
 
47
Const Max_DeltaBuild = 31           ' Days
47
Const Max_DeltaBuild = 31           ' Days
48
'------------ Variable Init -------------------
48
'------------ Variable Init -------------------
49
 
49
 
50
styleAlt1="class='body_rowg1'"
50
styleAlt1="class='body_rowg1'"
51
styleAlt2="class='body_rowg2'"
51
styleAlt2="class='body_rowg2'"
Line 216... Line 216...
216
   Else
216
   Else
217
      styleNow = styleAlt1
217
      styleNow = styleAlt1
218
   End If
218
   End If
219
End Sub
219
End Sub
220
'--------------------------------------------------------------------------------------------------------------------------
220
'--------------------------------------------------------------------------------------------------------------------------
221
' Convert run level into a meaningful string
-
 
222
Function Get_Run_Level( nLevel, indefinitePause, astate)
-
 
223
 
-
 
224
   If indefinitePause Then
-
 
225
      Get_Run_Level = "<span class='err_alert'>Stopped</span>"
-
 
226
   ElseIf astate = 1 Then      ' if build daemon paused
-
 
227
      Get_Run_Level = "Paused"
-
 
228
   ElseIf astate = 2 Then      ' if build daemon disabled
-
 
229
      Get_Run_Level = "Disabled"
-
 
230
   ElseIf astate = 0 Then     ' if build daemon enabled
-
 
231
      If nLevel = 1 Then
-
 
232
         Get_Run_Level = "Cannot Continue"
-
 
233
      ElseIf nLevel = 2 Then
-
 
234
         Get_Run_Level = "Paused"
-
 
235
      ElseIf nLevel = 3 Then
-
 
236
         Get_Run_Level = "Building"
-
 
237
      ElseIf nLevel = 4 Then
-
 
238
         Get_Run_Level = "Idle"
-
 
239
      ElseIf nLevel = 5 Then
-
 
240
         Get_Run_Level = "Waiting"
-
 
241
      ElseIf nLevel = 6 Then
-
 
242
         Get_Run_Level = "Publishing"
-
 
243
      Else
-
 
244
         Get_Run_Level = "<span class='err_alert'>Unknown!</span>"
-
 
245
      End If
-
 
246
   End If
-
 
247
End Function
-
 
248
 
-
 
249
'--------------------------------------------------------------------------------------------------------------------------
-
 
250
' Convert run level into a meaningful filter state as a string
221
' Convert run level into a meaningful filter state as a string
251
' Will be one of: active, idle, paused, disabled, problem, unknown
222
' Will be one of: active, idle, paused, disabled, problem, unknown
252
Function Classify_Run_Level( nLevel, indefinitePause, astate, nDelta, pkgId)
223
Function Classify_Run_Level( nLevel, indefinitePause, astate, nDelta, pkgId)
253
 
224
 
254
   If indefinitePause Then
225
   If indefinitePause Then
Line 279... Line 250...
279
      End If
250
      End If
280
   End If
251
   End If
281
End Function
252
End Function
282
 
253
 
283
'--------------------------------------------------------------------------------------------------------------------------
254
'--------------------------------------------------------------------------------------------------------------------------
284
' Convert daemon mode into a meaningful string
-
 
285
Function Get_Daemon_Mode( nMode )
-
 
286
   If nMode = "M" Then
-
 
287
      Get_Daemon_Mode = "Master"
-
 
288
   ElseIf nMode = "S" Then
-
 
289
      Get_Daemon_Mode = "Slave"
-
 
290
   Else
-
 
291
      Get_Daemon_Mode = "?"
-
 
292
   End If
-
 
293
End Function
-
 
294
'--------------------------------------------------------------------------------------------------------------------------
-
 
295
' Use this function to determine the state of a specified project checkbox
255
' Use this function to determine the state of a specified project checkbox
296
Function Is_Project_Checked( nProjId )
256
Function Is_Project_Checked( nProjId )
297
   Dim hiddenProjects_arr
257
   Dim hiddenProjects_arr
298
   Dim hiddenProjects
258
   Dim hiddenProjects
299
   Dim str
259
   Dim str
Line 353... Line 313...
353
    Else
313
    Else
354
          Filter_Is_On = False
314
          Filter_Is_On = False
355
    End If
315
    End If
356
End Function
316
End Function
357
'--------------------------------------------------------------------------------------------------------------------------
317
'--------------------------------------------------------------------------------------------------------------------------
358
Function Indefinitely_Paused()
-
 
359
   Dim rsQry2
-
 
360
   Dim query_string2
-
 
361
 
-
 
362
   Indefinitely_Paused = False
-
 
363
 
-
 
364
   query_string2 = " select * from run_level_schedule rls where rls.indefinite_pause = 'P'"
-
 
365
 
-
 
366
   Set rsQry2 = OraDatabase.DbCreateDynaset( query_string2, ORADYN_DEFAULT )
-
 
367
   If rsQry2.RecordCount > 0 Then
-
 
368
      Indefinitely_Paused = True
-
 
369
   End If
-
 
370
End Function
-
 
371
'--------------------------------------------------------------------------------------------------------------------------
-
 
372
Function PrettyDelta( delta, daemonState,pkgId )
-
 
373
    Dim style,nDelta
-
 
374
    style = ""
-
 
375
 
-
 
376
    If delta = "" Then delta = 0
-
 
377
    delta = Int(delta)
-
 
378
    nDelta = delta
-
 
379
 
-
 
380
    If (delta > Max_Delta) AND (IsNull(pkgId) OR pkgId = "") Then
-
 
381
      style = "style=color:Red"
-
 
382
      If (delta > 86400 ) Then
-
 
383
        Dim bdate, dd,mm,yy
-
 
384
        bdate = DateAdd("s", - delta,Now())
-
 
385
        dd = Day(bdate)
-
 
386
        mm = MonthName(Month(bdate),1)
-
 
387
        yy = Year( bdate)
-
 
388
        delta = dd & "-" & mm & "-" & yy
-
 
389
        If ( daemonState >= 2 ) Then
-
 
390
            style = ""
-
 
391
        End If
-
 
392
      ElseIf ( delta > 60*60 ) Then
-
 
393
        'Dim bdate, hh, mins, ss
-
 
394
        bdate = DateAdd("s", - delta,Now())
-
 
395
        delta = TimeValue( bdate)
-
 
396
        'delta = hh & ":" & mins & ":" & ss
-
 
397
      End If
-
 
398
    End If
-
 
399
 
-
 
400
    If style <> "" Then
-
 
401
        delta = "<span " & style & ">" & delta & "</span>"
-
 
402
    End If
-
 
403
    PrettyDelta = delta 
-
 
404
End Function
-
 
405
 
-
 
406
'--------------------------------------------------------------------------------------------------------------------------
-
 
407
 
-
 
408
%>
318
%>
409
<%
319
<%
410
'------------ RUN BEFORE PAGE RENDER ----------
320
'------------ RUN BEFORE PAGE RENDER ----------
411
 
321
 
412
' Default values for Auto Refresh checkbox and edit input box
322
' Default values for Auto Refresh checkbox and edit input box