<%@ Page Language="C#" MasterPageFile="~/UGCCNG.Master" AutoEventWireup="true" CodeBehind="ugcc.aspx.cs"
    Inherits="UGCC_Sharp.newugcc" Title="Server Managment" meta:resourcekey="PageResource1" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ID="lblError" runat="server" Width="100%" Style="text-align: center" meta:resourcekey="lblErrorResource1"
        CssClass="alert alert-info" Visible="False"></asp:Label>
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h4>
                <asp:Label ID="lblConnectInfo" runat="server" Font-Bold="False" Font-Underline="False"
                    meta:resourcekey="lblConnectInfoResource1"></asp:Label><div class="pull-right">
                        <div id="divStatus" runat="server" class="label label-success">
                            Running!
                        </div>
                    </div>
            </h4>
        </div>
        <div class="panel-body text-center">
            <div class="row">
                <div class="col-xs-12 col-sm-3">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <asp:Localize ID="Localize2" runat="server" meta:resourcekey="Localize2Resource1"
                                Text="Control"></asp:Localize>
                        </div>
                        <div class="panel-body">
                            <asp:LinkButton ID="lnkStart" runat="server" class="btn btn-success" ToolTip="Start server"
                                meta:resourcekey="startSrv1Resource1" OnClick="LinkButton1_Click"><span class="glyphicon glyphicon-play"></span></asp:LinkButton>
                            <asp:LinkButton ID="lnkStop" runat="server" class="btn btn-danger" ToolTip="Stop server"
                                meta:resourcekey="stopSrv1Resource1" OnClick="LinkButton2_Click"><span class="glyphicon glyphicon-stop"></span></asp:LinkButton>
                            <asp:LinkButton ID="lntRestart" runat="server" class="btn btn-warning" ToolTip="Restart server"
                                meta:resourcekey="ibtnRestartResource1" OnClick="LinkButton3_Click"><span class="glyphicon glyphicon-repeat"></span></asp:LinkButton>
                            <asp:LinkButton ID="lnkRefresh" runat="server" class="btn btn-info" ToolTip="Refresh server status"
                                meta:resourcekey="Button3Resource1" OnClick="LinkButton4_Click"><span class="glyphicon glyphicon-refresh"></span></asp:LinkButton>
                        </div>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-9">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <asp:Localize ID="Localize3" runat="server" meta:resourcekey="Localize3Resource1"
                                Text="Tools"></asp:Localize>
                        </div>
                        <div class="panel-body">
                            <div class="btn-group">
                                <div id="output" runat="server">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="panel-footer text-center" style="font-size: 133%" id="divMenuFooter" runat="server">
        </div>
    </div>
    <asp:Panel ID="pnlAdminNotes" runat="server" Visible="False">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseAdminNote" aria-expanded="false" aria-controls="collapseAdminNote">
                        <span id="adminNoteSpan" class="glyphicon glyphicon-menu-down"></span>
                        Admin Notes
                    </a>
                </h3>
            </div>
            <div id="collapseAdminNote" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingAdminNote">
                <div class="panel-body">
                    <div id="divAdminNotesTxt" runat="server">
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>
    <div id="pnlCmd" runat="server" visible="False">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseCmd" aria-expanded="false" aria-controls="collapseCmd">
                        <span id="cmdSpan" class="glyphicon glyphicon-menu-down"></span>
                        <asp:Localize ID="Localize4" runat="server" meta:resourcekey="Localize4"></asp:Localize>
                    </a>
                </h3>
            </div>
            <div id="collapseCmd" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingCmd">
                <div class="panel-body">
                    <asp:Label runat="server" ID="lblHidden" Visible="false">Hidden command line:</asp:Label>
                    <asp:TextBox ID="txtHidden" runat="server" CssClass="form-control" Height="50px" TextMode="MultiLine" ToolTip="Your server's hidden command line is displayed here" Visible="False"></asp:TextBox>
                    <asp:Label runat="server" ID="lblVisible" Visible="false">Visible command line:</asp:Label>
                    <asp:TextBox ID="TextBox1" runat="server" CssClass="form-control" Height="50px" meta:resourcekey="TextBox1Resource1" TextMode="MultiLine" ToolTip="Your server's command line is displayed here"></asp:TextBox>
                    <br />
                    <asp:Button ID="btnGetCmd" runat="server" CssClass="btn btn-default" meta:resourcekey="btnGetCmdResource1"
                        OnClick="BtnGetCmd_Click" Text="Get commandline" />
                    &nbsp;<asp:Button ID="btnSaveCmd" runat="server" CssClass="btn btn-default" meta:resourcekey="btnSaveCmdResource1"
                        OnClick="BtnSaveCmd_Click" Text="Save" />
                </div>
            </div>
        </div>
    </div>
    <div id="pnlRestart" runat="server" visible="False">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
                        <span id="restartSpan" class="glyphicon glyphicon-menu-down"></span>
                        <asp:Localize ID="Localize5" runat="server" meta:resourcekey="Localize5"></asp:Localize>
                    </a>
                </h3>
            </div>
            <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
                <div class="panel-body">
                    <span class="checkbox checkbox-inline text-center">
                        <asp:CheckBox ID="chkRestartEnable" runat="server" Checked="True" type="checkbox"
                            Text="Enable auto restart system" AutoPostBack="true" OnCheckedChanged="chkRestartEnable_CheckedChanged" />
                    </span>
                    <br />
                    <br />
                    <asp:DropDownList ID="ddlTimed" runat="server" AutoPostBack="True" CssClass="btn btn-default btn-sm"
                        OnSelectedIndexChanged="DdlTimed_SelectedIndexChanged" meta:resourcekey="ddlTimedResource1"
                        class="form-control">
                        <asp:ListItem Value="0" meta:resourcekey="ListItemResource1">00</asp:ListItem>
                        <asp:ListItem Value="1" meta:resourcekey="ListItemResource2">01</asp:ListItem>
                        <asp:ListItem Value="2" meta:resourcekey="ListItemResource3">02</asp:ListItem>
                        <asp:ListItem Value="3" meta:resourcekey="ListItemResource4">03</asp:ListItem>
                        <asp:ListItem Value="4" meta:resourcekey="ListItemResource5">04</asp:ListItem>
                        <asp:ListItem Value="5" meta:resourcekey="ListItemResource6">05</asp:ListItem>
                        <asp:ListItem Value="6" meta:resourcekey="ListItemResource7">06</asp:ListItem>
                        <asp:ListItem Value="7" meta:resourcekey="ListItemResource8">07</asp:ListItem>
                        <asp:ListItem Value="8" meta:resourcekey="ListItemResource9">08</asp:ListItem>
                        <asp:ListItem Value="9" meta:resourcekey="ListItemResource10">09</asp:ListItem>
                        <asp:ListItem Value="10" meta:resourcekey="ListItemResource11">10</asp:ListItem>
                        <asp:ListItem Value="11" meta:resourcekey="ListItemResource12">11</asp:ListItem>
                        <asp:ListItem Value="12" meta:resourcekey="ListItemResource13">12</asp:ListItem>
                        <asp:ListItem Value="13" meta:resourcekey="ListItemResource14">13</asp:ListItem>
                        <asp:ListItem Value="14" meta:resourcekey="ListItemResource15">14</asp:ListItem>
                        <asp:ListItem Value="15" meta:resourcekey="ListItemResource16">15</asp:ListItem>
                        <asp:ListItem Value="16" meta:resourcekey="ListItemResource17">16</asp:ListItem>
                        <asp:ListItem Value="17" meta:resourcekey="ListItemResource18">17</asp:ListItem>
                        <asp:ListItem Value="18" meta:resourcekey="ListItemResource19">18</asp:ListItem>
                        <asp:ListItem Value="19" meta:resourcekey="ListItemResource20">19</asp:ListItem>
                        <asp:ListItem Value="20" meta:resourcekey="ListItemResource21">20</asp:ListItem>
                        <asp:ListItem Value="21" meta:resourcekey="ListItemResource22">21</asp:ListItem>
                        <asp:ListItem Value="22" meta:resourcekey="ListItemResource23">22</asp:ListItem>
                        <asp:ListItem Value="23" meta:resourcekey="ListItemResource24">23</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;<b>:</b>&nbsp;<asp:DropDownList ID="ddlMin" runat="server" CssClass="btn btn-default btn-sm" OnSelectedIndexChanged="DdlMin_SelectedIndexChanged"
                        AutoPostBack="True" class="form-control" meta:resourceKey="ddlMinResource1">
                        <asp:ListItem Value="0" meta:resourceKey="ListItemResource33">00</asp:ListItem>
                        <asp:ListItem meta:resourceKey="ListItemResource34">10</asp:ListItem>
                        <asp:ListItem meta:resourceKey="ListItemResource35">20</asp:ListItem>
                        <asp:ListItem meta:resourceKey="ListItemResource36">30</asp:ListItem>
                        <asp:ListItem meta:resourceKey="ListItemResource37">40</asp:ListItem>
                        <asp:ListItem meta:resourceKey="ListItemResource38">50</asp:ListItem>
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlDay" runat="server" AutoPostBack="True" CssClass="btn btn-default btn-sm"
                        OnSelectedIndexChanged="DdlDay_SelectedIndexChanged" meta:resourcekey="ddlDayResource1"
                        class="form-control">
                        <asp:ListItem Value="0" meta:resourcekey="ListItemResource25" Text="Sunday"></asp:ListItem>
                        <asp:ListItem Value="1" meta:resourcekey="ListItemResource26" Text="Monday"></asp:ListItem>
                        <asp:ListItem Value="2" meta:resourcekey="ListItemResource27" Text="Tuesday"></asp:ListItem>
                        <asp:ListItem Value="3" meta:resourcekey="ListItemResource28" Text="Wednesday"></asp:ListItem>
                        <asp:ListItem Value="4" meta:resourcekey="ListItemResource29" Text="Thursday"></asp:ListItem>
                        <asp:ListItem Value="5" meta:resourcekey="ListItemResource30" Text="Friday"></asp:ListItem>
                        <asp:ListItem Value="6" meta:resourcekey="ListItemResource31" Text="Saturday"></asp:ListItem>
                        <asp:ListItem Value="7" meta:resourcekey="ListItemResource32" Text="Everyday"></asp:ListItem>
                    </asp:DropDownList>
                    <br />
                    <span class="help-block">
                        <asp:Localize ID="lclAutoRestart" Text="This server will automatically restart at the specified time"
                            runat="server" meta:resourcekey="lclAutoRestart"></asp:Localize></span>
                    <asp:DropDownList ID="ddlHourly" runat="server" AutoPostBack="True" CssClass="btn btn-default btn-sm"
                        OnSelectedIndexChanged="DdlHourly_SelectedIndexChanged" meta:resourcekey="ddlTimedResource1"
                        class="form-control">
                        <asp:ListItem Value="0">0</asp:ListItem>
                        <asp:ListItem Value="1">1</asp:ListItem>
                        <asp:ListItem Value="2">2</asp:ListItem>
                        <asp:ListItem Value="3">3</asp:ListItem>
                        <asp:ListItem Value="4">4</asp:ListItem>
                        <asp:ListItem Value="5">5</asp:ListItem>
                        <asp:ListItem Value="6">6</asp:ListItem>
                        <asp:ListItem Value="7">7</asp:ListItem>
                        <asp:ListItem Value="8">8</asp:ListItem>
                        <asp:ListItem Value="9">9</asp:ListItem>
                        <asp:ListItem Value="10">10</asp:ListItem>
                        <asp:ListItem Value="11">11</asp:ListItem>
                        <asp:ListItem Value="12">12</asp:ListItem>
                    </asp:DropDownList>
                    <span class="help-block">
                        <asp:Localize ID="Localize6" Text="If greater than zero, the server will automatically restart every specified hours after above time."
                            runat="server" meta:resourcekey="lclAutoRestartHourly"></asp:Localize></span>
                    <br />
                    <div class="row">
                        <div class="col-lg-6">
                            <div class="input-group">
                                <asp:TextBox runat="server" ID="txtMinPlayers" CssClass="form-control"></asp:TextBox>
                                <span class="input-group-btn">
                                    <asp:Button ID="btnSaveMinPlayer" runat="server" CssClass="btn btn-default" meta:resourcekey="btnSaveCmdResource1"
                                        OnClick="btnSaveMinPlayer_Click" Text="Save" />
                                </span>
                            </div>
                            <!-- /input-group -->
                        </div>
                        <!-- /.col-lg-6 -->
                    </div>
                    <span class="help-block">
                        <asp:Localize ID="Localize7" Text="If player count on server is greater than or equal to this value, the server restart will be delayed until player count falls below this threshold.&nbsp; Set to '0' to disable."
                            runat="server" meta:resourcekey="lclMinPlayers"></asp:Localize></span>
                </div>
            </div>
        </div>
    </div>
    <asp:Panel ID="pnlNotes" runat="server" meta:resourcekey="pnlNotesResource1" Visible="False">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseNote" aria-expanded="false" aria-controls="collapseNote">
                        <span id="noteSpan" class="glyphicon glyphicon-menu-down"></span>
                        <asp:Localize ID="Localize1" runat="server" Text="Notes" meta:resourcekey="lclNotes"></asp:Localize>
                    </a>
                </h3>
            </div>
            <div id="collapseNote" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingNote">
                <div class="panel-body">
                    <div id="divNotes" runat="server">
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>
    <script type="text/javascript" src="js/ugcc.js"></script>
    <script type="text/javascript">
        $(document).ready(
            go()
        );
        function go() {
            if ($('#restartSpan').length > 0) {
                $('#collapseOne').on('hidden.bs.collapse', function (e) {
                    localStorage.setItem('restart', true);  //is hidden
                    $('#restartSpan')[0].className = 'glyphicon glyphicon-menu-down';
                })
                $('#collapseOne').on('shown.bs.collapse', function (e) {
                    localStorage.setItem('restart', false);  //is hidden
                    $('#restartSpan')[0].className = 'glyphicon glyphicon-menu-up';
                })
            }
            if ($('#cmdSpan').length > 0) {
                $('#collapseCmd').on('hidden.bs.collapse', function (e) {
                    localStorage.setItem('cmd', true);  //is hidden
                    $('#cmdSpan')[0].className = 'glyphicon glyphicon-menu-down';
                })
                $('#collapseCmd').on('shown.bs.collapse', function (e) {
                    localStorage.setItem('cmd', false);  //is hidden
                    $('#cmdSpan')[0].className = 'glyphicon glyphicon-menu-up';
                })
            }
            if ($('#noteSpan').length > 0) {
                $('#collapseNote').on('hidden.bs.collapse', function (e) {
                    localStorage.setItem('note', true);  //is hidden
                    $('#noteSpan')[0].className = 'glyphicon glyphicon-menu-down';
                })
                $('#collapseNote').on('shown.bs.collapse', function (e) {
                    localStorage.setItem('note', false);  //is hidden
                    $('#noteSpan')[0].className = 'glyphicon glyphicon-menu-up';
                })
            }
            if ($('#adminNoteSpan').length > 0) {
                $('#collapseAdminNote').on('hidden.bs.collapse', function (e) {
                    localStorage.setItem('adminnote', true);  //is hidden
                    $('#adminNoteSpan')[0].className = 'glyphicon glyphicon-menu-down';
                })
                $('#collapseAdminNote').on('shown.bs.collapse', function (e) {
                    localStorage.setItem('adminnote', false);  //is hidden
                    $('#adminNoteSpan')[0].className = 'glyphicon glyphicon-menu-up';
                })
            }
            updateUgccMenuItem();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="head">
</asp:Content>
