Subversion Repositories DevTools

Rev

Rev 6916 | Rev 7225 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                ADMIN Page                         |
'|               Build Service                       |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0   ' always load the page, dont store
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="sec/Crypt.asp"-->
<!--#include file="common/_form_window_common.asp"-->
<!--#include file="_action_buttons.asp"-->

<!--#include file="class/classActionButtonControl.asp"-->

<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login_optional.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim objBtnControl
Dim Query_String
Dim rsTemp
Dim scheduled_id
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
Set objBtnControl = New ActionButtonControl
'----------------------------------------------
%>

<%
Sub UpdateBuildInfo()
   Dim fList, regexp
   Set regexp = new RegExp
   regexp.Global = True

   ' Convert the 'fault email address list' into a Nice comma seperated list
   regexp.Pattern = "[ ,:]+"
   fList = regexp.Replace(Request("fault email address list"), ",")
   regexp.Pattern = ",$"
   fList = regexp.Replace(fList, "")
   regexp.Pattern = "^,"
   fList = regexp.Replace(fList, "")

   On Error Resume Next
   OraDatabase.Parameters.Add "DATABASE_SERVER",           Request("database server"), ORAPARM_INPUT, ORATYPE_VARCHAR2
   OraDatabase.Parameters.Add "ARCHIVE_SERVER",            Request("archive server"),  ORAPARM_INPUT, ORATYPE_VARCHAR2
   OraDatabase.Parameters.Add "MAIL_SERVER",               Request("mail server"),     ORAPARM_INPUT, ORATYPE_VARCHAR2
   OraDatabase.Parameters.Add "BUILD_FAILURE_MAIL_SENDER", Request("build failure mail sender"),    ORAPARM_INPUT, ORATYPE_VARCHAR2
   OraDatabase.Parameters.Add "FAULT_EMAIL_ADDRESS_LIST",  fList,    ORAPARM_INPUT, ORATYPE_VARCHAR2
   OraDatabase.Parameters.Add "DISK_SPACE",                Request("dpkg_archive disk space used"), ORAPARM_INPUT, ORATYPE_VARCHAR2
   OraDatabase.Parameters.Add "SBOM_MANAGEMENT",           Request("sbom management"), ORAPARM_INPUT, ORATYPE_VARCHAR2
   OraDatabase.Parameters.Add "LXR_SERVER",                Request("lxr server"), ORAPARM_INPUT, ORATYPE_VARCHAR2

   objEH.TryORA ( OraSession )

   OraDatabase.ExecuteSQL _
   "BEGIN PK_BUILDAPI.Update_Build_Service_Info ( " &_ 
                ":DATABASE_SERVER, " &_ 
                ":ARCHIVE_SERVER, " &_ 
                ":MAIL_SERVER, " &_
                ":BUILD_FAILURE_MAIL_SENDER, " &_ 
                ":FAULT_EMAIL_ADDRESS_LIST, " &_ 
                ":DISK_SPACE, " &_ 
                ":SBOM_MANAGEMENT, " &_
                ":LXR_SERVER ); END;"

   objEH.CatchORA ( OraSession )

   OraDatabase.Parameters.Remove "DATABASE_SERVER"
   OraDatabase.Parameters.Remove "ARCHIVE_SERVER"
   OraDatabase.Parameters.Remove "MAIL_SERVER"
   OraDatabase.Parameters.Remove "BUILD_FAILURE_MAIL_SENDER"
   OraDatabase.Parameters.Remove "FAULT_EMAIL_ADDRESS_LIST"
   OraDatabase.Parameters.Remove "DISK_SPACE"
   OraDatabase.Parameters.Remove "SBOM_MANAGEMENT"
   OraDatabase.Parameters.Remove "LXR_SERVER"
End Sub
%>
<%
If Request("action") = "true" Then
   Call UpdateBuildInfo()
   If objEH.Finally Then
      Call Destroy_All_Objects
      Response.Redirect("admin_build_service.asp")
   End If
End If
%>
<html>
<head>

<title>Build Service Administration</title>
<link rel="shortcut icon" href="<%=FavIcon%>"/>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
<!--#include file="_jquery_includes.asp"-->
<!-- DROPDOWN MENUS -->
<!--#include file="_menu_def.asp"-->
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
</head>
<body>
<!-- HEADER -->
<!--#include file="_header.asp"-->
<!-- Body of the page -->
<div class="bg_grey">
<table style='margin-left: auto;margin-right: auto;'>
   <%
   '-- FROM START ---------------------------------------------------------------------------------------------------------
   Dim bReadOnly: bReadOnly = NOT canActionControl("ConfigureBuildService")
   objFormComponent.FormName = "UpdateBuildServiceConfig"
   objFormComponent.Action = ScriptName
   objFormComponent.OnSubmit = "ShowProgress();"
   ' Page Access Condition
   If bReadOnly Then
     objFormComponent.IsReadonlyAction = enumDB_YES
   End If

   Call objFormComponent.FormStart()
   %>
   <tr>
      <td>
         <table width="100%"  class="embedded_table">
            <tr>
               <td><%=ProgressBar%></td>
               <td align="right">&nbsp;          </td>
            </tr>
         </table>
      </td>
   </tr>
   <tr>
      <td>
         <table width="100%" border="0" cellspacing="1" cellpadding="2" class="rounded_box lhsGrey rounded_box_pad">
             <caption>Build Service Configuration</caption>
            <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <%If NOT objEH.Finally Then%>
               <tr>
                  <td class="form_iname">&nbsp;</td>
                  <td>
                     <%objEH.DisplayMessage()%>
                  </td>
                  <td class="val_err"></td>
               </tr>
            <%End If%>
            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <thead>
               <th class='tleft' nowrap>Item</th>
               <th class='tleft' nowrap>Value</th>
            </thead>
            <%

            Dim rsQry, query

            query = "SELECT * FROM BUILD_SERVICE_CONFIG WHERE service NOT IN ('MUTEX','WEB SERVER')"

            Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )

            While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
            %>
               <tr>
                  <td nowrap valign="top"><%=rsQry("service")%></td>
                  <td nowrap valign="top" >
                     <%If Len(rsQry("config")) < 60 Then%>
                        <%=objFormComponent.TextBox (rsQry("service"), rsQry("config"), "size='60'" )%>
                     <%Else%>
                        <%=objFormComponent.TextArea (rsQry("service"), rsQry("config"), 5, 60, "" )%>
                     <%End If%>
                  </td>
               </tr>
               <%
               rsQry.MoveNext()
            Wend

            rsQry.Close()
            Set rsQry = Nothing
            %>
            <tr>
               <td nowrap>&nbsp;</td>
               <td nowrap class="val_err hdr">
               <%If bReadOnly Then%>
                  <input name="btn" type="submit" class="form_btn" value="Update" disabled>
               <%Else%>
                  <input name="btn" type="submit" class="form_btn" value="Update">
               <%End If%>
               </td>
            </tr>
         </table>
      </td>
  </tr>
  <%=objPMod.ComposeHiddenTags()%>
  <input type="hidden" name="action" value="true">
  <%
  Call objFormComponent.FormEnd()
  '-- FROM END ----------------------------------------------------------------------------------------------------------------
   %>
    <tr>
        <td style="padding-top: 20px;">
         <table width="100%" bgcolor="#FFCC00" class="embedded_table rounded_box">
         <caption>Build Daemon Control</caption>
   <form name="run_level_schedule">
      <tr>
         <td>
          <fieldset>
          <legend class="body_txt">Build Daemon Control</legend>
            <table width="100%"  class="embedded_table" >
               <!-- BUTTONS CONTROL +++++++++++++++++++ -->
               <tr>
                  <td>
                  <%
                  If IndefPause Then
                        Call Action_Buttons_State ( "Resume", NOT bReadOnly )
                  Else
                        Call Action_Buttons_State ( "Indefinite Pause", NOT bReadOnly )
                  End If
                  %>
               </tr>
            </table>
            </fieldset>
            <%
            On Error Resume Next
            objEH.TryORA ( OraSession )
            OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.DELETE_OUT_OF_DATE_SCHEDULE;   END;"
            objEH.CatchORA ( OraSession )
            %>
            <!-- +++++++++++++++++++++++++++++++++++ -->
            <%
            ' Load some action buttons
            Call objBtnControl.LoadActionButtons ( Array("btnDeleteSchedule"), OraDatabase )
            objBtnControl.ButtonSpacer = 1
            objBtnControl.ReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_DISABLE
            if bReadOnly Then objBtnControl.IsReadonlyAction = enumDB_YES
            %>

            <fieldset>
            <legend class="body_txt">Scheduled Outages</legend>

            <table width="100%"  class="embedded_table stdGrey" border="0" cellspacing="1" cellpadding="2">
               <thead>
                  <th>Scheduled Pause</th>
                  <th>Scheduled Resume</th>
                  <th>Repeat</th>
                  <th>Opr</th>
               </thead>

               <%Set rsQry = OraDatabase.DbCreateDynaset( "select rs.*," &_
                        " TO_CHAR(SCHEDULED_PAUSE ,'Dy DD-Mon-YY HH:MI:SS AM') as fmt_pause," &_
                        " TO_CHAR(SCHEDULED_RESUME ,'Dy DD-Mon-YY HH:MI:SS AM') as fmt_resume," &_
                        " TO_CHAR(SCHEDULED_PAUSE ,'HH:MI:SS AM') as fmt_pause_time," &_
                        " TO_CHAR(SCHEDULED_RESUME ,'HH:MI:SS AM') as fmt_resume_time," &_
                        " TO_CHAR(SCHEDULED_PAUSE ,'Dy HH:MI:SS AM') as fmt_pause_day," &_
                        " TO_CHAR(SCHEDULED_RESUME ,'Dy HH:MI:SS AM') as fmt_resume_day" &_
                        " from run_level_schedule rs order by rs.SCHEDULED_PAUSE", ORADYN_DEFAULT )


               '--- Render rows ---
               Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                  scheduled_id = rsQry("scheduled_id")

                  If NOT IsNull(rsQry("scheduled_resume")) Then
                    Dim tpause,tresume, trepeat
                    If rsQry("repeat") = 1  Then
                        tpause = rsQry("fmt_pause_time")
                        tresume = rsQry("fmt_resume_time")
                        trepeat = "Daily"
                    ElseIf rsQry("repeat") = 7  Then
                        tpause = rsQry("fmt_pause_day")
                        tresume = rsQry("fmt_resume_time")
                        trepeat = "Weekly"
                    ElseIf rsQry("repeat") = 0  Then
                        tpause = rsQry("fmt_pause")
                        tresume = rsQry("fmt_resume")
                        trepeat = "Once Only"
                    Else
                        tpause = rsQry("fmt_pause")
                        tresume = rsQry("fmt_resume")
                        trepeat = rsQry("repeat")
                    End If
                  %>

                     <tr class=lined>
                        <td nowrap><%=tpause%></td>
                        <td nowrap><%=tresume%></td>
                        <td nowrap><%=trepeat%></td>
                        <td nowrap><%Call objBtnControl.Render  ( Array("btnDeleteSchedule"), objAccessControl )%></td>
                     </tr>
                  <%
                  End If
                  rsQry.MoveNext
               Loop

               rsQry.Close()
               Set rsQry = Nothing
               %>
                <tr>
                    <td colspan=4><hr></td>
                </tr>
                <tr>
                    <% Call Action_Buttons_State ( "Add Schedule", NOT bReadOnly )%>
                </tr>
            </table>
            </fieldset>
         </td>
      </tr>
   </form>
</table>
</table>
</div>
<!-- FOOTER -->
<!--#include file="_footer.asp"-->
</body>
</html>