# --
# AdminGenericInterfaceDebugger.dtl - provides HTML form for AdminLog
# Copyright (C) 2001-2011 OTRS AG, http://otrs.org/
# --
# $Id: AdminGenericInterfaceDebugger.dtl,v 1.21 2011-11-21 19:21:32 mb Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --
<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst AdminGenericInterfaceDebugger">
    <h1>$Text{"GenericInterface Debugger for Web Service %s", "$Data{"WebserviceName"}"}</h1>
<!-- breadcrumb -->
    <div class="GenericInterfaceWebserviceConfigPath">
        <h3>
            $Config{"GenericInterface::Webservice::Path::Separator"}
            <a href="$Env{"Baselink"}Action=AdminGenericInterfaceWebservice">$Text{"Web Services"}</a>

            $Config{"GenericInterface::Webservice::Path::Separator"}
            <a href="$Env{"Baselink"}Action=AdminGenericInterfaceWebservice;Subaction=Change;WebserviceID=$QData{"WebserviceID"}">$QData{"WebserviceName"}</a>

            $Config{"GenericInterface::Webservice::Path::Separator"}
            $Text{"Debugger"}
        </h3>
    </div>

    <div class="SidebarColumn">
        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Actions"}</h2>
            </div>
            <div class="Content">
                <ul class="ActionList">
                    <li>
                        <a href="$Env{"Baselink"}Action=AdminGenericInterfaceWebservice;Subaction=Change;WebserviceID=$LQData{"WebserviceID"}" class="CallForAction"><span>$Text{"Go back to web service"}</span></a>
                    </li>
                    <li>
                        <button class="CallForAction Trash W75pc" type="button" id="DeleteButton"><span>$Text{"Clear"}</span></button>
                        <div class="Hidden" id="DeleteDialogContainer">
                            <span class="WarningDialog ">&nbsp;</span>
                            <p id="DeleteDialog" class="Center Warning">
                                $Text{"Do you really want to clear the debug log of this web service?"}
                            </p>
                            <div class="SpacingTop"></div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="ContentColumn">

        <div class="WidgetSimple RequestListWidget">
            <div class="Header">
                <h2>
                    $Text{"Request List"}
                </h2>
            </div>
            <div class="Content">
                <div class="LayoutGrid ColumnsWithSpacing">
                    <div class="Size1of2">
                        <div class="ListContainer"><!-- needed for CSS to limit table height -->
                            <table class="DataTable" id="RequestList" summary="List of webservice communications recorded by the debugger with the applied filter">
                                <thead>
                                    <tr>
                                        <th>$Text{"Type"}</th>
                                        <th>$Text{"Time"}</th>
                                        <th>$Text{"Remote IP"}</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td colspan="3">$Text{"Loading"}...</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <p class="FieldExplanation">$Text{"Select a single request to see its details."}</p>
                    </div>
                    <div class="Size1of2">
                        <fieldset class="TableLike">
                            <label for="FilterType">$Text{"Filter by type"}:</label>
                            <div class="Field">
                                $Data{"FilterTypeStrg"}
                            </div>
                            <div class="Clear"></div>

                            <label>$Text{"Filter from"}:</label>
                            <div class="Field">
                                $Data{"FilterFromStrg"}
                            </div>
                            <div class="Clear"></div>

                            <label>$Text{"Filter to"}:</label>
                            <div class="Field">
                                $Data{"FilterToStrg"}
                            </div>
                            <div class="Clear"></div>

                            <label for="FilterRemoteIP">$Text{"Filter by remote IP"}:</label>
                            <div class="Field">
                                <input type="text" class="w50pc" id="FilterRemoteIP" />
                            </div>
                            <div class="Clear"></div>

                            <div class="Field">
                                <button type="button" id="FilterRefresh" value="$Text{"Refresh"}">$Text{"Refresh"}</button>
                            </div>
                            <div class="Clear"></div>
                        </fieldset>

                    </div>
                    <div class="Clear"></div>
                </div>
            </div>
        </div>

        <div class="WidgetSimple Hidden" id="CommunicationDetails">
            <div class="Header">
                <h2>$Text{"Request Details"}</h2>
            </div>
            <div class="Content"></div>
        </div>
    </div>
    <div class="Clear"></div>
</div>

<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[

Core.Agent.Admin.GenericInterfaceDebugger.Init({
    WebserviceID: $QData{"WebserviceID"},
    Localization: {
        CommunicationErrorMsg: '$JSText{"An error occurred during communication."}',
        NoDataFoundMsg: '$JSText{"No data found."}',
        ToggleContentMsg: '$JSText{"Show or hide the content"}.',
        ClearDebugLogMsg: '$JSText{"Clear debug log"}',
        ClearMsg: '$JSText{"Clear"}',
        CancelMsg: '$JSText{"Cancel"}'
    }
});

$('#FilterRefresh').bind('click', Core.Agent.Admin.GenericInterfaceDebugger.GetRequestList);
$('#DeleteButton').bind('click', Core.Agent.Admin.GenericInterfaceDebugger.ShowDeleteDialog);

//Load Request list on startup without active filter
Core.Agent.Admin.GenericInterfaceDebugger.GetRequestList();

//]]></script>
<!-- dtl:js_on_document_complete -->
