Subversion Repositories DevTools

Rev

Rev 5957 | Rev 6070 | 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
<!-- MENU LAYERS -------------------------------------->
131
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)">
132
</div>
133
<!-- TIPS LAYERS -------------------------------------->
134
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
135
<!-- HEADER -->
136
<!--#include file="_header.asp"-->
137
<!-- Body of the page -->
138
<table class="pagebody">
139
   <%
140
   '-- FROM START ---------------------------------------------------------------------------------------------------------
141
   Dim bReadOnly: bReadOnly = NOT canActionControl("ConfigureBuildService")
142
   objFormComponent.FormName = "UpdateBuildServiceConfig"
143
   objFormComponent.Action = ScriptName
144
   objFormComponent.OnSubmit = "ShowProgress();"
145
   ' Page Access Condition
146
   If bReadOnly Then
147
     objFormComponent.IsReadonlyAction = enumDB_YES
148
   End If
149
 
150
   Call objFormComponent.FormStart()
151
   %>
152
   <tr>
153
      <td>
154
         <table width="100%"  class="embedded_table">
155
            <tr>
156
               <td><%=ProgressBar%></td>
157
               <td align="right">&nbsp;          </td>
158
            </tr>
159
         </table>
160
      </td>
161
   </tr>
162
   <tr>
163
      <td>
164
         <table width="100%" bgcolor="#FFCC00" class="embedded_table rounded_table">
165
            <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
166
            <%If NOT objEH.Finally Then%>
167
               <tr>
168
                  <td class="form_iname">&nbsp;</td>
169
                  <td>
170
                     <%objEH.DisplayMessage()%>
171
                  </td>
172
                  <td class="val_err"></td>
173
               </tr>
174
            <%End If%>
175
            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
176
            <tr>
177
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">BUILD SERVICE</td>
178
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">CONFIGURATION</td>
179
            </tr>
180
            <%
181
 
182
            Dim rsQry, query
183
 
184
            query = "SELECT * FROM BUILD_SERVICE_CONFIG WHERE service NOT IN ('MUTEX','WEB SERVER')"
185
 
186
            Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
187
 
188
            While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
189
            %>
190
               <tr>
191
                  <td nowrap class="form_iname" valign="top"><%=rsQry("service")%></td>
192
                  <td nowrap valign="top">
193
                     <%If Len(rsQry("config")) < 60 Then%>
194
                        <%=objFormComponent.TextBox (rsQry("service"), rsQry("config"), "size='60' class='form_ivalue'" )%>
195
                     <%Else%>
196
                        <%=objFormComponent.TextArea (rsQry("service"), rsQry("config"), 5, 60, "class='form_ivalue'" )%>
197
                     <%End If%>
198
                  </td>
199
               </tr>
200
               <%
201
               rsQry.MoveNext()
202
            Wend
203
 
204
            rsQry.Close()
205
            Set rsQry = Nothing
206
            %>
207
            <tr>
208
               <td nowrap class="form_iname">&nbsp;</td>
209
               <td nowrap class="val_err">
210
               <%If bReadOnly Then%>
211
                  <input name="btn" type="submit" class="form_btn" value="Update" disabled>
212
               <%Else%>
213
                  <input name="btn" type="submit" class="form_btn" value="Update">
214
               <%End If%>
215
               </td>
216
            </tr>
217
         </table>
218
      </td>
219
  </tr>
220
  <%=objPMod.ComposeHiddenTags()%>
221
  <input type="hidden" name="action" value="true">
222
  <%
223
  Call objFormComponent.FormEnd()
224
  '-- FROM END ----------------------------------------------------------------------------------------------------------------
225
   %>
226
    <tr>
227
        <td style="padding-top: 20px;">
228
         <table width="100%" bgcolor="#FFCC00" class="embedded_table rounded_table">
229
 
230
   <form name="run_level_schedule">
231
      <tr>
232
         <td>
233
          <%
234
          Dim rsInfinite, infiniteValue
235
          Set rsInfinite = OraDatabase.DbCreateDynaset( "select * from run_level_schedule where indefinite_pause is not null", ORADYN_DEFAULT )
236
          infiniteValue = rsInfinite.RecordCount
237
          %>
238
          <fieldset>
239
          <legend class="body_txt">Build Daemon Control
240
          <%If infiniteValue <> 0 Then%>
241
            <b><span class='err_alert'>WARNING!!! </span>Daemons Set To Indefinite Pause.</b>
242
          <%End If%>
243
          </legend>
244
            <table width="100%"  class="embedded_table">
245
               <!-- BUTTONS CONTROL +++++++++++++++++++ -->
246
               <tr>
247
                  <td>
248
                  <%
249
                  If infiniteValue = 0 Then
250
                      If bReadOnly Then
251
                        Call Action_Buttons ( "Indefinite Pause Disable" )
252
                      Else
253
                        Call Action_Buttons ( "Indefinite Pause" )
254
                      End If
255
                  Else
256
                      If bReadOnly Then
5931 dpurdie 257
                        Call Action_Buttons ( "Resume Disable" )
5357 dpurdie 258
                      Else
259
                        Call Action_Buttons ( "Resume" )
260
                      End If
261
                  End If
262
                  %>
263
               </tr>
264
            </table>
265
            </fieldset>
266
            <%
267
            rsInfinite.Close()
268
            Set rsInfinite = Nothing
269
 
270
            On Error Resume Next
271
            objEH.TryORA ( OraSession )
272
            OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.DELETE_OUT_OF_DATE_SCHEDULE;   END;"
273
            objEH.CatchORA ( OraSession )
274
            %>
275
            <!-- +++++++++++++++++++++++++++++++++++ -->
276
            <%
277
            ' Load some action buttons
278
            Call objBtnControl.LoadActionButtons ( Array("btnDeleteSchedule"), OraDatabase )
279
            objBtnControl.ButtonSpacer = 1
280
            objBtnControl.ReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_DISABLE
281
            if bReadOnly Then objBtnControl.IsReadonlyAction = enumDB_YES
282
            %>
283
 
284
            <fieldset>
285
            <legend class="body_txt">Scheduled Outages</legend>
286
 
287
            <table width="100%"  class="embedded_table" bgcolor="#FFCC00">
288
               <tr>
289
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">SCHEDULED PAUSE</td>
290
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">SCHEDULED RESUME</td>
291
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">REPEAT</td>
292
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">OPR</td>
293
 
294
                  <td valign="top"></td>
295
               </tr>
296
 
297
               <%Set rsQry = OraDatabase.DbCreateDynaset( "select rs.*," &_
298
                        " TO_CHAR(SCHEDULED_PAUSE ,'Dy DD-Mon-YY HH:MI:SS AM') as fmt_pause," &_
299
                        " TO_CHAR(SCHEDULED_RESUME ,'Dy DD-Mon-YY HH:MI:SS AM') as fmt_resume," &_
300
                        " TO_CHAR(SCHEDULED_PAUSE ,'HH:MI:SS AM') as fmt_pause_time," &_
301
                        " TO_CHAR(SCHEDULED_RESUME ,'HH:MI:SS AM') as fmt_resume_time," &_
302
                        " TO_CHAR(SCHEDULED_PAUSE ,'Dy HH:MI:SS AM') as fmt_pause_day," &_
303
                        " TO_CHAR(SCHEDULED_RESUME ,'Dy HH:MI:SS AM') as fmt_resume_day" &_
304
                        " from run_level_schedule rs order by rs.SCHEDULED_PAUSE", ORADYN_DEFAULT )
305
 
306
 
307
               '--- Render rows ---
308
               Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
309
                  scheduled_id = rsQry("scheduled_id")
310
 
311
                  If NOT IsNull(rsQry("scheduled_resume")) Then
312
                    Dim tpause,tresume, trepeat
313
                    If rsQry("repeat") = 1  Then
314
                        tpause = rsQry("fmt_pause_time")
315
                        tresume = rsQry("fmt_resume_time")
316
                        trepeat = "Daily"
317
                    ElseIf rsQry("repeat") = 7  Then
318
                        tpause = rsQry("fmt_pause_day")
319
                        tresume = rsQry("fmt_resume_time")
320
                        trepeat = "Weekly"
321
                    ElseIf rsQry("repeat") = 0  Then
322
                        tpause = rsQry("fmt_pause")
323
                        tresume = rsQry("fmt_resume")
324
                        trepeat = "Once Only"
325
                    Else
326
                        tpause = rsQry("fmt_pause")
327
                        tresume = rsQry("fmt_resume")
328
                        trepeat = rsQry("repeat")
329
                    End If
330
                  %>
331
 
332
                     <tr>
333
                        <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
334
                     </tr>
335
                     <tr>
336
                        <td nowrap class="body_rowg"><%=tpause%></td>
337
                        <td nowrap class="body_rowg"><%=tresume%></td>
338
                        <td nowrap class="body_rowg"><%=trepeat%></td>
339
                        <td nowrap class="body_rowg"><%Call objBtnControl.Render  ( Array("btnDeleteSchedule"), objAccessControl )%></td>
340
                     </tr>
341
                  <%
342
                  End If
343
                  rsQry.MoveNext
344
               Loop
345
 
346
               rsQry.Close()
347
               Set rsQry = Nothing
348
               %>
349
            <tr><td colspan=4><hr><tr>
350
                <%
351
                If bReadOnly Then
352
                    Call Action_Buttons ( "Add Schedule Disable" )
353
                Else
354
                    Call Action_Buttons ( "Add Schedule" )
355
                End If
356
                %>
357
            </tr>
358
            </table>
359
            </fieldset>
360
         </td>
361
      </tr>
362
   </form>
363
</table>
364
</table>
365
<!-- FOOTER -->
366
<!--#include file="_footer.asp"-->
367
</body>
368
</html>