Subversion Repositories DevTools

Rev

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