Subversion Repositories DevTools

Rev

Rev 6579 | Rev 6916 | 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>
<!-- StyleSheet Extensions -->
<style>
.pagebody {margin-left:auto; margin-right:auto; width:50%;border-width: 0px;border-spacing: 2px; zbackground-color: rgb(255, 204, 0)}
.rounded_table {
border-style: solid;
border-top-width: 5px;
border-bottom-width: 5px;
xborder-radius: 13px;
border-color: #FFCC00;
border-left-width: 5px;
border-right-width: 5px;
border-spacing: 2px;
}

</style>

</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
<!-- HEADER -->
<!--#include file="_header.asp"-->
<!-- Body of the page -->
<table class="pagebody">
   <%
   '-- 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%" bgcolor="#FFCC00" class="embedded_table rounded_table">
            <!-- 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%>
            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">BUILD SERVICE</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">CONFIGURATION</td>
            </tr>
            <%

            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 class="form_iname" valign="top"><%=rsQry("service")%></td>
                  <td nowrap valign="top">
                     <%If Len(rsQry("config")) < 60 Then%>
                        <%=objFormComponent.TextBox (rsQry("service"), rsQry("config"), "size='60' class='form_ivalue'" )%>
                     <%Else%>
                        <%=objFormComponent.TextArea (rsQry("service"), rsQry("config"), 5, 60, "class='form_ivalue'" )%>
                     <%End If%>
                  </td>
               </tr>
               <%
               rsQry.MoveNext()
            Wend

            rsQry.Close()
            Set rsQry = Nothing
            %>
            <tr>
               <td nowrap class="form_iname">&nbsp;</td>
               <td nowrap class="val_err">
               <%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_table">

   <form name="run_level_schedule">
      <tr>
         <td>
          <%
          Dim rsInfinite, infiniteValue
          Set rsInfinite = OraDatabase.DbCreateDynaset( "select * from run_level_schedule where indefinite_pause is not null", ORADYN_DEFAULT )
          infiniteValue = rsInfinite.RecordCount
          %>
          <fieldset>
          <legend class="body_txt">Build Daemon Control
          <%If infiniteValue <> 0 Then%>
            <b><span class='err_alert'>WARNING!!! </span>Daemons Set To Indefinite Pause.</b>
          <%End If%>
          </legend>
            <table width="100%"  class="embedded_table">
               <!-- BUTTONS CONTROL +++++++++++++++++++ -->
               <tr>
                  <td>
                  <%
                  If infiniteValue = 0 Then
                        Call Action_Buttons_State ( "Indefinite Pause", NOT bReadOnly )
                  Else
                        Call Action_Buttons_State ( "Resume", NOT bReadOnly )
                  End If
                  %>
               </tr>
            </table>
            </fieldset>
            <%
            rsInfinite.Close()
            Set rsInfinite = Nothing

            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" bgcolor="#FFCC00">
               <tr>
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">SCHEDULED PAUSE</td>
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">SCHEDULED RESUME</td>
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">REPEAT</td>
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">OPR</td>

                  <td valign="top"></td>
               </tr>

               <%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>
                        <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
                     </tr>
                     <tr>
                        <td nowrap class="body_rowg"><%=tpause%></td>
                        <td nowrap class="body_rowg"><%=tresume%></td>
                        <td nowrap class="body_rowg"><%=trepeat%></td>
                        <td nowrap class="body_rowg"><%Call objBtnControl.Render  ( Array("btnDeleteSchedule"), objAccessControl )%></td>
                     </tr>
                  <%
                  End If
                  rsQry.MoveNext
               Loop

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