Subversion Repositories DevTools

Rev

Rev 7063 | Rev 7288 | 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="common/_form_window_common.asp"-->
21
<!--#include file="_action_buttons.asp"-->
22
 
23
<!--#include file="class/classActionButtonControl.asp"-->
24
 
25
<%
26
'------------ ACCESS CONTROL ------------------
27
%>
6181 dpurdie 28
<!--#include file="_access_control_login_optional.asp"-->
5357 dpurdie 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
6077 dpurdie 64
   OraDatabase.Parameters.Add "LXR_SERVER",                Request("lxr server"), ORAPARM_INPUT, ORATYPE_VARCHAR2
5357 dpurdie 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, " &_ 
6077 dpurdie 76
                ":SBOM_MANAGEMENT, " &_
77
                ":LXR_SERVER ); END;"
5357 dpurdie 78
 
79
   objEH.CatchORA ( OraSession )
80
 
81
   OraDatabase.Parameters.Remove "DATABASE_SERVER"
82
   OraDatabase.Parameters.Remove "ARCHIVE_SERVER"
83
   OraDatabase.Parameters.Remove "MAIL_SERVER"
84
   OraDatabase.Parameters.Remove "BUILD_FAILURE_MAIL_SENDER"
85
   OraDatabase.Parameters.Remove "FAULT_EMAIL_ADDRESS_LIST"
86
   OraDatabase.Parameters.Remove "DISK_SPACE"
87
   OraDatabase.Parameters.Remove "SBOM_MANAGEMENT"
6077 dpurdie 88
   OraDatabase.Parameters.Remove "LXR_SERVER"
5357 dpurdie 89
End Sub
90
%>
91
<%
92
If Request("action") = "true" Then
93
   Call UpdateBuildInfo()
94
   If objEH.Finally Then
5957 dpurdie 95
      Call Destroy_All_Objects
5357 dpurdie 96
      Response.Redirect("admin_build_service.asp")
97
   End If
98
End If
99
%>
100
<html>
101
<head>
102
 
103
<title>Build Service Administration</title>
104
<link rel="shortcut icon" href="<%=FavIcon%>"/>
105
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
106
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 107
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
108
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
109
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 110
<!--#include file="_jquery_includes.asp"-->
111
<!-- DROPDOWN MENUS -->
112
<!--#include file="_menu_def.asp"-->
6579 dpurdie 113
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 114
</head>
6878 dpurdie 115
<body>
5357 dpurdie 116
<!-- HEADER -->
117
<!--#include file="_header.asp"-->
118
<!-- Body of the page -->
6878 dpurdie 119
<div class="bg_grey">
120
<table style='margin-left: auto;margin-right: auto;'>
5357 dpurdie 121
   <%
122
   '-- FROM START ---------------------------------------------------------------------------------------------------------
123
   Dim bReadOnly: bReadOnly = NOT canActionControl("ConfigureBuildService")
124
   objFormComponent.FormName = "UpdateBuildServiceConfig"
125
   objFormComponent.Action = ScriptName
126
   objFormComponent.OnSubmit = "ShowProgress();"
127
   ' Page Access Condition
128
   If bReadOnly Then
129
     objFormComponent.IsReadonlyAction = enumDB_YES
130
   End If
131
 
132
   Call objFormComponent.FormStart()
133
   %>
134
   <tr>
135
      <td>
136
         <table width="100%"  class="embedded_table">
137
            <tr>
138
               <td><%=ProgressBar%></td>
139
               <td align="right">&nbsp;          </td>
140
            </tr>
141
         </table>
142
      </td>
143
   </tr>
144
   <tr>
145
      <td>
6916 dpurdie 146
         <table width="100%" border="0" cellspacing="1" cellpadding="2" class="rounded_box lhsGrey rounded_box_pad">
6878 dpurdie 147
             <caption>Build Service Configuration</caption>
5357 dpurdie 148
            <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
149
            <%If NOT objEH.Finally Then%>
150
               <tr>
151
                  <td class="form_iname">&nbsp;</td>
152
                  <td>
153
                     <%objEH.DisplayMessage()%>
154
                  </td>
155
                  <td class="val_err"></td>
156
               </tr>
157
            <%End If%>
158
            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
6878 dpurdie 159
            <thead>
160
               <th class='tleft' nowrap>Item</th>
161
               <th class='tleft' nowrap>Value</th>
162
            </thead>
5357 dpurdie 163
            <%
164
 
165
            Dim rsQry, query
166
 
167
            query = "SELECT * FROM BUILD_SERVICE_CONFIG WHERE service NOT IN ('MUTEX','WEB SERVER')"
168
 
169
            Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
170
 
171
            While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
172
            %>
173
               <tr>
6878 dpurdie 174
                  <td nowrap valign="top"><%=rsQry("service")%></td>
175
                  <td nowrap valign="top" >
5357 dpurdie 176
                     <%If Len(rsQry("config")) < 60 Then%>
6878 dpurdie 177
                        <%=objFormComponent.TextBox (rsQry("service"), rsQry("config"), "size='60'" )%>
5357 dpurdie 178
                     <%Else%>
6878 dpurdie 179
                        <%=objFormComponent.TextArea (rsQry("service"), rsQry("config"), 5, 60, "" )%>
5357 dpurdie 180
                     <%End If%>
181
                  </td>
182
               </tr>
183
               <%
184
               rsQry.MoveNext()
185
            Wend
186
 
187
            rsQry.Close()
188
            Set rsQry = Nothing
189
            %>
190
            <tr>
6878 dpurdie 191
               <td nowrap>&nbsp;</td>
192
               <td nowrap class="val_err hdr">
5357 dpurdie 193
               <%If bReadOnly Then%>
194
                  <input name="btn" type="submit" class="form_btn" value="Update" disabled>
195
               <%Else%>
196
                  <input name="btn" type="submit" class="form_btn" value="Update">
197
               <%End If%>
198
               </td>
199
            </tr>
200
         </table>
201
      </td>
202
  </tr>
203
  <%=objPMod.ComposeHiddenTags()%>
204
  <input type="hidden" name="action" value="true">
205
  <%
206
  Call objFormComponent.FormEnd()
207
  '-- FROM END ----------------------------------------------------------------------------------------------------------------
208
   %>
209
    <tr>
210
        <td style="padding-top: 20px;">
6878 dpurdie 211
         <table width="100%" bgcolor="#FFCC00" class="embedded_table rounded_box">
212
         <caption>Build Daemon Control</caption>
5357 dpurdie 213
   <form name="run_level_schedule">
214
      <tr>
215
         <td>
216
          <fieldset>
7063 dpurdie 217
          <legend class="body_txt">Build Daemon Control</legend>
6878 dpurdie 218
            <table width="100%"  class="embedded_table" >
5357 dpurdie 219
               <!-- BUTTONS CONTROL +++++++++++++++++++ -->
220
               <tr>
221
                  <td>
222
                  <%
7063 dpurdie 223
                  If IndefPause Then
224
                        Call Action_Buttons_State ( "Resume", NOT bReadOnly )
225
                  Else
6786 dpurdie 226
                        Call Action_Buttons_State ( "Indefinite Pause", NOT bReadOnly )
5357 dpurdie 227
                  End If
228
                  %>
229
               </tr>
230
            </table>
231
            </fieldset>
232
            <%
233
            On Error Resume Next
234
            objEH.TryORA ( OraSession )
235
            OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.DELETE_OUT_OF_DATE_SCHEDULE;   END;"
236
            objEH.CatchORA ( OraSession )
237
            %>
238
            <!-- +++++++++++++++++++++++++++++++++++ -->
239
            <%
240
            ' Load some action buttons
241
            Call objBtnControl.LoadActionButtons ( Array("btnDeleteSchedule"), OraDatabase )
242
            objBtnControl.ButtonSpacer = 1
243
            objBtnControl.ReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_DISABLE
244
            if bReadOnly Then objBtnControl.IsReadonlyAction = enumDB_YES
245
            %>
246
 
247
            <fieldset>
248
            <legend class="body_txt">Scheduled Outages</legend>
249
 
6878 dpurdie 250
            <table width="100%"  class="embedded_table stdGrey" border="0" cellspacing="1" cellpadding="2">
251
               <thead>
252
                  <th>Scheduled Pause</th>
253
                  <th>Scheduled Resume</th>
254
                  <th>Repeat</th>
255
                  <th>Opr</th>
256
               </thead>
5357 dpurdie 257
 
258
               <%Set rsQry = OraDatabase.DbCreateDynaset( "select rs.*," &_
259
                        " TO_CHAR(SCHEDULED_PAUSE ,'Dy DD-Mon-YY HH:MI:SS AM') as fmt_pause," &_
260
                        " TO_CHAR(SCHEDULED_RESUME ,'Dy DD-Mon-YY HH:MI:SS AM') as fmt_resume," &_
261
                        " TO_CHAR(SCHEDULED_PAUSE ,'HH:MI:SS AM') as fmt_pause_time," &_
262
                        " TO_CHAR(SCHEDULED_RESUME ,'HH:MI:SS AM') as fmt_resume_time," &_
263
                        " TO_CHAR(SCHEDULED_PAUSE ,'Dy HH:MI:SS AM') as fmt_pause_day," &_
264
                        " TO_CHAR(SCHEDULED_RESUME ,'Dy HH:MI:SS AM') as fmt_resume_day" &_
265
                        " from run_level_schedule rs order by rs.SCHEDULED_PAUSE", ORADYN_DEFAULT )
266
 
267
 
268
               '--- Render rows ---
269
               Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
270
                  scheduled_id = rsQry("scheduled_id")
271
 
272
                  If NOT IsNull(rsQry("scheduled_resume")) Then
273
                    Dim tpause,tresume, trepeat
274
                    If rsQry("repeat") = 1  Then
275
                        tpause = rsQry("fmt_pause_time")
276
                        tresume = rsQry("fmt_resume_time")
277
                        trepeat = "Daily"
278
                    ElseIf rsQry("repeat") = 7  Then
279
                        tpause = rsQry("fmt_pause_day")
280
                        tresume = rsQry("fmt_resume_time")
281
                        trepeat = "Weekly"
282
                    ElseIf rsQry("repeat") = 0  Then
283
                        tpause = rsQry("fmt_pause")
284
                        tresume = rsQry("fmt_resume")
285
                        trepeat = "Once Only"
286
                    Else
287
                        tpause = rsQry("fmt_pause")
288
                        tresume = rsQry("fmt_resume")
289
                        trepeat = rsQry("repeat")
290
                    End If
291
                  %>
292
 
6878 dpurdie 293
                     <tr class=lined>
294
                        <td nowrap><%=tpause%></td>
295
                        <td nowrap><%=tresume%></td>
296
                        <td nowrap><%=trepeat%></td>
297
                        <td nowrap><%Call objBtnControl.Render  ( Array("btnDeleteSchedule"), objAccessControl )%></td>
5357 dpurdie 298
                     </tr>
299
                  <%
300
                  End If
301
                  rsQry.MoveNext
302
               Loop
303
 
304
               rsQry.Close()
305
               Set rsQry = Nothing
306
               %>
6878 dpurdie 307
                <tr>
308
                    <td colspan=4><hr></td>
309
                </tr>
310
                <tr>
311
                    <% Call Action_Buttons_State ( "Add Schedule", NOT bReadOnly )%>
312
                </tr>
5357 dpurdie 313
            </table>
314
            </fieldset>
315
         </td>
316
      </tr>
317
   </form>
318
</table>
319
</table>
6878 dpurdie 320
</div>
5357 dpurdie 321
<!-- FOOTER -->
322
<!--#include file="_footer.asp"-->
323
</body>
324
</html>