Subversion Repositories DevTools

Rev

Rev 6048 | Rev 6077 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|                ADMIN Page                         |
6
'|               Build Service                       |
7
'|                                                   |
8
'=====================================================
9
%>
10
<%
11
Option explicit
12
' Good idea to set when using redirect
13
Response.Expires = 0   ' always load the page, dont store
14
%>
15
<!--#include file="common/conf.asp"-->
16
<!--#include file="common/globals.asp"-->
17
<!--#include file="common/formating.asp"-->
18
<!--#include file="common/qstr.asp"-->
19
<!--#include file="common/common_subs.asp"-->
20
<!--#include file="sec/Crypt.asp"-->
21
<!--#include file="common/_form_window_common.asp"-->
22
<!--#include file="_action_buttons.asp"-->
23
 
24
<!--#include file="class/classActionButtonControl.asp"-->
25
 
26
<%
27
'------------ ACCESS CONTROL ------------------
28
%>
6048 dpurdie 29
<!--#include file="_access_control_login.asp"-->
5357 dpurdie 30
<!--#include file="_access_control_general.asp"-->
31
<%
32
'------------ Variable Definition -------------
33
Dim objBtnControl
34
Dim Query_String
35
Dim rsTemp
36
Dim scheduled_id
37
'------------ Constants Declaration -----------
38
'------------ Variable Init -------------------
39
Set objBtnControl = New ActionButtonControl
40
'----------------------------------------------
41
%>
42
 
43
<%
44
Sub UpdateBuildInfo()
45
   Dim fList, regexp
46
   Set regexp = new RegExp
47
   regexp.Global = True
48
 
49
   ' Convert the 'fault email address list' into a Nice comma seperated list
50
   regexp.Pattern = "[ ,:]+"
51
   fList = regexp.Replace(Request("fault email address list"), ",")
52
   regexp.Pattern = ",$"
53
   fList = regexp.Replace(fList, "")
54
   regexp.Pattern = "^,"
55
   fList = regexp.Replace(fList, "")
56
 
57
   On Error Resume Next
58
   OraDatabase.Parameters.Add "DATABASE_SERVER",           Request("database server"), ORAPARM_INPUT, ORATYPE_VARCHAR2
59
   OraDatabase.Parameters.Add "ARCHIVE_SERVER",            Request("archive server"),  ORAPARM_INPUT, ORATYPE_VARCHAR2
60
   OraDatabase.Parameters.Add "MAIL_SERVER",               Request("mail server"),     ORAPARM_INPUT, ORATYPE_VARCHAR2
61
   OraDatabase.Parameters.Add "BUILD_FAILURE_MAIL_SENDER", Request("build failure mail sender"),    ORAPARM_INPUT, ORATYPE_VARCHAR2
62
   OraDatabase.Parameters.Add "FAULT_EMAIL_ADDRESS_LIST",  fList,    ORAPARM_INPUT, ORATYPE_VARCHAR2
63
   OraDatabase.Parameters.Add "DISK_SPACE",                Request("dpkg_archive disk space used"), ORAPARM_INPUT, ORATYPE_VARCHAR2
64
   OraDatabase.Parameters.Add "SBOM_MANAGEMENT",           Request("sbom management"), ORAPARM_INPUT, ORATYPE_VARCHAR2
65
 
66
   objEH.TryORA ( OraSession )
67
 
68
   OraDatabase.ExecuteSQL _
69
   "BEGIN PK_BUILDAPI.Update_Build_Service_Info ( " &_ 
70
                ":DATABASE_SERVER, " &_ 
71
                ":ARCHIVE_SERVER, " &_ 
72
                ":MAIL_SERVER, " &_
73
                ":BUILD_FAILURE_MAIL_SENDER, " &_ 
74
                ":FAULT_EMAIL_ADDRESS_LIST, " &_ 
75
                ":DISK_SPACE, " &_ 
76
                ":SBOM_MANAGEMENT ); END;"
77
 
78
   objEH.CatchORA ( OraSession )
79
 
80
   OraDatabase.Parameters.Remove "DATABASE_SERVER"
81
   OraDatabase.Parameters.Remove "ARCHIVE_SERVER"
82
   OraDatabase.Parameters.Remove "MAIL_SERVER"
83
   OraDatabase.Parameters.Remove "BUILD_FAILURE_MAIL_SENDER"
84
   OraDatabase.Parameters.Remove "FAULT_EMAIL_ADDRESS_LIST"
85
   OraDatabase.Parameters.Remove "DISK_SPACE"
86
   OraDatabase.Parameters.Remove "SBOM_MANAGEMENT"
87
End Sub
88
%>
89
<%
90
If Request("action") = "true" Then
91
   Call UpdateBuildInfo()
92
   If objEH.Finally Then
5957 dpurdie 93
      Call Destroy_All_Objects
5357 dpurdie 94
      Response.Redirect("admin_build_service.asp")
95
   End If
96
End If
97
%>
98
<html>
99
<head>
100
 
101
<title>Build Service Administration</title>
102
<link rel="shortcut icon" href="<%=FavIcon%>"/>
103
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
104
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
105
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
106
<link rel="stylesheet" href="images/navigation.css" type="text/css">
107
<script language="JavaScript" src="images/common.js"></script>
108
<!--#include file="_jquery_includes.asp"-->
109
<!-- DROPDOWN MENUS -->
110
<!--#include file="_menu_def.asp"-->
111
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
112
<!-- StyleSheet Extensions -->
113
<style>
114
.pagebody {margin-left:auto; margin-right:auto; width:50%;border-width: 0px;border-spacing: 2px; zbackground-color: rgb(255, 204, 0)}
115
.rounded_table {
116
border-style: solid;
117
border-top-width: 5px;
118
border-bottom-width: 5px;
119
xborder-radius: 13px;
120
border-color: #FFCC00;
121
border-left-width: 5px;
122
border-right-width: 5px;
123
border-spacing: 2px;
124
}
125
 
126
</style>
127
 
128
</head>
129
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
130
<!-- HEADER -->
131
<!--#include file="_header.asp"-->
132
<!-- Body of the page -->
133
<table class="pagebody">
134
   <%
135
   '-- FROM START ---------------------------------------------------------------------------------------------------------
136
   Dim bReadOnly: bReadOnly = NOT canActionControl("ConfigureBuildService")
137
   objFormComponent.FormName = "UpdateBuildServiceConfig"
138
   objFormComponent.Action = ScriptName
139
   objFormComponent.OnSubmit = "ShowProgress();"
140
   ' Page Access Condition
141
   If bReadOnly Then
142
     objFormComponent.IsReadonlyAction = enumDB_YES
143
   End If
144
 
145
   Call objFormComponent.FormStart()
146
   %>
147
   <tr>
148
      <td>
149
         <table width="100%"  class="embedded_table">
150
            <tr>
151
               <td><%=ProgressBar%></td>
152
               <td align="right">&nbsp;          </td>
153
            </tr>
154
         </table>
155
      </td>
156
   </tr>
157
   <tr>
158
      <td>
159
         <table width="100%" bgcolor="#FFCC00" class="embedded_table rounded_table">
160
            <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
161
            <%If NOT objEH.Finally Then%>
162
               <tr>
163
                  <td class="form_iname">&nbsp;</td>
164
                  <td>
165
                     <%objEH.DisplayMessage()%>
166
                  </td>
167
                  <td class="val_err"></td>
168
               </tr>
169
            <%End If%>
170
            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
171
            <tr>
172
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">BUILD SERVICE</td>
173
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">CONFIGURATION</td>
174
            </tr>
175
            <%
176
 
177
            Dim rsQry, query
178
 
179
            query = "SELECT * FROM BUILD_SERVICE_CONFIG WHERE service NOT IN ('MUTEX','WEB SERVER')"
180
 
181
            Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
182
 
183
            While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
184
            %>
185
               <tr>
186
                  <td nowrap class="form_iname" valign="top"><%=rsQry("service")%></td>
187
                  <td nowrap valign="top">
188
                     <%If Len(rsQry("config")) < 60 Then%>
189
                        <%=objFormComponent.TextBox (rsQry("service"), rsQry("config"), "size='60' class='form_ivalue'" )%>
190
                     <%Else%>
191
                        <%=objFormComponent.TextArea (rsQry("service"), rsQry("config"), 5, 60, "class='form_ivalue'" )%>
192
                     <%End If%>
193
                  </td>
194
               </tr>
195
               <%
196
               rsQry.MoveNext()
197
            Wend
198
 
199
            rsQry.Close()
200
            Set rsQry = Nothing
201
            %>
202
            <tr>
203
               <td nowrap class="form_iname">&nbsp;</td>
204
               <td nowrap class="val_err">
205
               <%If bReadOnly Then%>
206
                  <input name="btn" type="submit" class="form_btn" value="Update" disabled>
207
               <%Else%>
208
                  <input name="btn" type="submit" class="form_btn" value="Update">
209
               <%End If%>
210
               </td>
211
            </tr>
212
         </table>
213
      </td>
214
  </tr>
215
  <%=objPMod.ComposeHiddenTags()%>
216
  <input type="hidden" name="action" value="true">
217
  <%
218
  Call objFormComponent.FormEnd()
219
  '-- FROM END ----------------------------------------------------------------------------------------------------------------
220
   %>
221
    <tr>
222
        <td style="padding-top: 20px;">
223
         <table width="100%" bgcolor="#FFCC00" class="embedded_table rounded_table">
224
 
225
   <form name="run_level_schedule">
226
      <tr>
227
         <td>
228
          <%
229
          Dim rsInfinite, infiniteValue
230
          Set rsInfinite = OraDatabase.DbCreateDynaset( "select * from run_level_schedule where indefinite_pause is not null", ORADYN_DEFAULT )
231
          infiniteValue = rsInfinite.RecordCount
232
          %>
233
          <fieldset>
234
          <legend class="body_txt">Build Daemon Control
235
          <%If infiniteValue <> 0 Then%>
236
            <b><span class='err_alert'>WARNING!!! </span>Daemons Set To Indefinite Pause.</b>
237
          <%End If%>
238
          </legend>
239
            <table width="100%"  class="embedded_table">
240
               <!-- BUTTONS CONTROL +++++++++++++++++++ -->
241
               <tr>
242
                  <td>
243
                  <%
244
                  If infiniteValue = 0 Then
245
                      If bReadOnly Then
246
                        Call Action_Buttons ( "Indefinite Pause Disable" )
247
                      Else
248
                        Call Action_Buttons ( "Indefinite Pause" )
249
                      End If
250
                  Else
251
                      If bReadOnly Then
5931 dpurdie 252
                        Call Action_Buttons ( "Resume Disable" )
5357 dpurdie 253
                      Else
254
                        Call Action_Buttons ( "Resume" )
255
                      End If
256
                  End If
257
                  %>
258
               </tr>
259
            </table>
260
            </fieldset>
261
            <%
262
            rsInfinite.Close()
263
            Set rsInfinite = Nothing
264
 
265
            On Error Resume Next
266
            objEH.TryORA ( OraSession )
267
            OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.DELETE_OUT_OF_DATE_SCHEDULE;   END;"
268
            objEH.CatchORA ( OraSession )
269
            %>
270
            <!-- +++++++++++++++++++++++++++++++++++ -->
271
            <%
272
            ' Load some action buttons
273
            Call objBtnControl.LoadActionButtons ( Array("btnDeleteSchedule"), OraDatabase )
274
            objBtnControl.ButtonSpacer = 1
275
            objBtnControl.ReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_DISABLE
276
            if bReadOnly Then objBtnControl.IsReadonlyAction = enumDB_YES
277
            %>
278
 
279
            <fieldset>
280
            <legend class="body_txt">Scheduled Outages</legend>
281
 
282
            <table width="100%"  class="embedded_table" bgcolor="#FFCC00">
283
               <tr>
284
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">SCHEDULED PAUSE</td>
285
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">SCHEDULED RESUME</td>
286
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">REPEAT</td>
287
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">OPR</td>
288
 
289
                  <td valign="top"></td>
290
               </tr>
291
 
292
               <%Set rsQry = OraDatabase.DbCreateDynaset( "select rs.*," &_
293
                        " TO_CHAR(SCHEDULED_PAUSE ,'Dy DD-Mon-YY HH:MI:SS AM') as fmt_pause," &_
294
                        " TO_CHAR(SCHEDULED_RESUME ,'Dy DD-Mon-YY HH:MI:SS AM') as fmt_resume," &_
295
                        " TO_CHAR(SCHEDULED_PAUSE ,'HH:MI:SS AM') as fmt_pause_time," &_
296
                        " TO_CHAR(SCHEDULED_RESUME ,'HH:MI:SS AM') as fmt_resume_time," &_
297
                        " TO_CHAR(SCHEDULED_PAUSE ,'Dy HH:MI:SS AM') as fmt_pause_day," &_
298
                        " TO_CHAR(SCHEDULED_RESUME ,'Dy HH:MI:SS AM') as fmt_resume_day" &_
299
                        " from run_level_schedule rs order by rs.SCHEDULED_PAUSE", ORADYN_DEFAULT )
300
 
301
 
302
               '--- Render rows ---
303
               Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
304
                  scheduled_id = rsQry("scheduled_id")
305
 
306
                  If NOT IsNull(rsQry("scheduled_resume")) Then
307
                    Dim tpause,tresume, trepeat
308
                    If rsQry("repeat") = 1  Then
309
                        tpause = rsQry("fmt_pause_time")
310
                        tresume = rsQry("fmt_resume_time")
311
                        trepeat = "Daily"
312
                    ElseIf rsQry("repeat") = 7  Then
313
                        tpause = rsQry("fmt_pause_day")
314
                        tresume = rsQry("fmt_resume_time")
315
                        trepeat = "Weekly"
316
                    ElseIf rsQry("repeat") = 0  Then
317
                        tpause = rsQry("fmt_pause")
318
                        tresume = rsQry("fmt_resume")
319
                        trepeat = "Once Only"
320
                    Else
321
                        tpause = rsQry("fmt_pause")
322
                        tresume = rsQry("fmt_resume")
323
                        trepeat = rsQry("repeat")
324
                    End If
325
                  %>
326
 
327
                     <tr>
328
                        <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
329
                     </tr>
330
                     <tr>
331
                        <td nowrap class="body_rowg"><%=tpause%></td>
332
                        <td nowrap class="body_rowg"><%=tresume%></td>
333
                        <td nowrap class="body_rowg"><%=trepeat%></td>
334
                        <td nowrap class="body_rowg"><%Call objBtnControl.Render  ( Array("btnDeleteSchedule"), objAccessControl )%></td>
335
                     </tr>
336
                  <%
337
                  End If
338
                  rsQry.MoveNext
339
               Loop
340
 
341
               rsQry.Close()
342
               Set rsQry = Nothing
343
               %>
344
            <tr><td colspan=4><hr><tr>
345
                <%
346
                If bReadOnly Then
347
                    Call Action_Buttons ( "Add Schedule Disable" )
348
                Else
349
                    Call Action_Buttons ( "Add Schedule" )
350
                End If
351
                %>
352
            </tr>
353
            </table>
354
            </fieldset>
355
         </td>
356
      </tr>
357
   </form>
358
</table>
359
</table>
360
<!-- FOOTER -->
361
<!--#include file="_footer.asp"-->
362
</body>
363
</html>