<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?import org.kordamp.ikonli.javafx.FontIcon?>
<StackPane fx:id="root" prefHeight="700.0" prefWidth="750.0" stylesheets="@../css/main.css"
           xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1"
           fx:controller="top.octopusyan.controller.MainController">

    <VBox fx:id="MainPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
          prefHeight="700.0" prefWidth="750.0">
        <AnchorPane fx:id="MainTopPane" prefHeight="35.0" prefWidth="750.0">
            <JFXButton fx:id="titleLable" disable="true" prefHeight="35.0" prefWidth="90.0" text="Yan Frp"/>
            <JFXButton fx:id="minimizeBtn" layoutX="678.0" prefHeight="35.0" prefWidth="36.0" text="—"/>
            <JFXButton fx:id="closeBtn" layoutX="714.0" prefHeight="35.0" prefWidth="36.0" text="X"/>
            <JFXComboBox fx:id="proxyServerComboBox" layoutX="90.0" prefHeight="36.0" prefWidth="90.0">
                <cursor>
                    <Cursor fx:constant="HAND"/>
                </cursor>
            </JFXComboBox>
        </AnchorPane>
        <GridPane fx:id="MainBottomPane" hgap="10.0" prefHeight="684.0" prefWidth="750.0" vgap="10.0">
            <columnConstraints>
                <ColumnConstraints hgrow="SOMETIMES" maxWidth="539.0" minWidth="10.0" prefWidth="520.0"/>
                <ColumnConstraints hgrow="SOMETIMES" maxWidth="370.0" minWidth="10.0" prefWidth="200.0"/>
            </columnConstraints>
            <rowConstraints>
                <RowConstraints maxHeight="493.0" minHeight="10.0" prefHeight="404.0" vgrow="SOMETIMES"/>
                <RowConstraints maxHeight="337.0" minHeight="10.0" prefHeight="231.0" vgrow="SOMETIMES"/>
            </rowConstraints>
            <children>
                <VBox fx:id="proxySetupPane" prefHeight="200.0" prefWidth="100.0" styleClass="mainPane">
                    <padding>
                        <Insets left="10.0"/>
                    </padding>
                    <HBox alignment="CENTER_RIGHT" prefHeight="50.0" prefWidth="520.0">
                        <padding>
                            <Insets bottom="10.0" top="10.0"/>
                        </padding>
                        <JFXButton fx:id="resetProxyBtn" prefHeight="Infinity" text="重置">
                            <HBox.margin>
                                <Insets right="10.0"/>
                            </HBox.margin>
                            <cursor>
                                <Cursor fx:constant="HAND"/>
                            </cursor>
                        </JFXButton>
                    </HBox>
                    <HBox alignment="CENTER_LEFT" prefHeight="50.0" prefWidth="520.0">
                        <padding>
                            <Insets bottom="10.0" top="10.0"/>
                        </padding>
                        <Label alignment="CENTER_RIGHT" prefHeight="Infinity" prefWidth="100.0"
                               styleClass="proxySetupLabel" text="隧道名称">
                            <HBox.margin>
                                <Insets right="20.0"/>
                            </HBox.margin>
                        </Label>
                        <JFXTextField fx:id="proxyNameTextField" prefHeight="Infinity" prefWidth="320.0"
                                      styleClass="inputText">
                            <HBox.margin>
                                <Insets right="20.0"/>
                            </HBox.margin>
                            <padding>
                                <Insets left="15.0"/>
                            </padding>
                            <font>
                                <Font size="14.0"/>
                            </font>
                        </JFXTextField>
                    </HBox>
                    <HBox alignment="CENTER_LEFT" prefHeight="50.0" prefWidth="520.0">
                        <padding>
                            <Insets bottom="10.0" top="10.0"/>
                        </padding>
                        <Label alignment="CENTER_RIGHT" prefHeight="Infinity" prefWidth="100.0"
                               styleClass="proxySetupLabel" text="是否启用">
                            <HBox.margin>
                                <Insets right="20.0"/>
                            </HBox.margin>
                        </Label>
                        <HBox alignment="CENTER_LEFT" prefHeight="Infinity" prefWidth="320.0">
                            <JFXRadioButton fx:id="openProxyRBtn" text="启用">
                                <HBox.margin>
                                    <Insets right="20.0"/>
                                </HBox.margin>
                                <cursor>
                                    <Cursor fx:constant="HAND"/>
                                </cursor>
                            </JFXRadioButton>
                            <JFXRadioButton fx:id="closeProxyRBtn" text="停用">
                                <cursor>
                                    <Cursor fx:constant="HAND"/>
                                </cursor>
                            </JFXRadioButton>
                        </HBox>
                    </HBox>
                    <HBox alignment="CENTER_LEFT" prefHeight="50.0" prefWidth="520.0">
                        <padding>
                            <Insets bottom="10.0" top="10.0"/>
                        </padding>
                        <Label alignment="CENTER_RIGHT" prefHeight="Infinity" prefWidth="100.0"
                               styleClass="proxySetupLabel" text="协议类型">
                            <HBox.margin>
                                <Insets right="20.0"/>
                            </HBox.margin>
                        </Label>
                        <JFXComboBox fx:id="proxyProtocolComboBox" prefHeight="Infinity" prefWidth="320.0"
                                     styleClass="inputText">
                            <cursor>
                                <Cursor fx:constant="HAND"/>
                            </cursor>
                        </JFXComboBox>
                    </HBox>
                    <HBox alignment="CENTER_LEFT" prefHeight="50.0" prefWidth="520.0">
                        <padding>
                            <Insets bottom="10.0" top="10.0"/>
                        </padding>
                        <Label alignment="CENTER_RIGHT" prefHeight="Infinity" prefWidth="100.0"
                               styleClass="proxySetupLabel" text="内网服务地址">
                            <HBox.margin>
                                <Insets right="20.0"/>
                            </HBox.margin>
                        </Label>
                        <HBox prefHeight="Infinity" prefWidth="320.0">
                            <JFXTextField fx:id="localHostTextField" alignment="CENTER" prefWidth="220.0"
                                          promptText="内网服务IP (IPV4)" styleClass="inputText-left" text="127.0.0.1">
                                <font>
                                    <Font size="14.0"/>
                                </font>
                            </JFXTextField>
                            <JFXTextField fx:id="localPortTextField" alignment="CENTER" minWidth="70.0"
                                          prefWidth="100.0" promptText="端口" styleClass="inputText-right" text="80">
                                <font>
                                    <Font size="14.0"/>
                                </font>
                            </JFXTextField>
                        </HBox>
                    </HBox>
                    <HBox fx:id="domainPane" alignment="CENTER_LEFT" prefHeight="40.0" prefWidth="520.0">
                        <padding>
                            <Insets top="10.0"/>
                        </padding>
                        <Label alignment="CENTER_RIGHT" prefHeight="Infinity" prefWidth="100.0"
                               styleClass="proxySetupLabel" text="外网访问地址">
                            <HBox.margin>
                                <Insets right="20.0"/>
                            </HBox.margin>
                        </Label>
                        <AnchorPane maxHeight="30.0" prefHeight="30" prefWidth="320.0">
                            <JFXTextField fx:id="domainTextField" prefHeight="31.0" prefWidth="320.0"
                                          promptText="自定义子域名大于3位" styleClass="inputText">
                                <font>
                                    <Font size="14.0"/>
                                </font>
                                <padding>
                                    <Insets left="15.0"/>
                                </padding>
                            </JFXTextField>
                            <JFXTextField fx:id="domainSuffixTextField" alignment="CENTER" disable="true"
                                          layoutX="165.0" prefHeight="30.0" prefWidth="155.0"
                                          styleClass="inputText-right" text=".frp.octopusyan.top">
                                <font>
                                    <Font size="14.0"/>
                                </font>
                            </JFXTextField>
                        </AnchorPane>
                        <JFXButton fx:id="customizeDomainBtn" prefHeight="Infinity" text="自定义">
                            <HBox.margin>
                                <Insets left="5.0"/>
                            </HBox.margin>
                            <cursor>
                                <Cursor fx:constant="HAND"/>
                            </cursor>
                        </JFXButton>
                    </HBox>
                    <Label fx:id="domainHtinTextField" alignment="CENTER" prefHeight="20.0" prefWidth="320.0"
                           text="Label" visible="false">
                        <VBox.margin>
                            <Insets left="120.0"/>
                        </VBox.margin>
                        <font>
                            <Font size="14.0"/>
                        </font>
                    </Label>
                    <HBox fx:id="proxyStatusPane" alignment="CENTER" prefHeight="40.0" prefWidth="520.0">
                        <padding>
                            <Insets bottom="10.0"/>
                        </padding>
                        <Label alignment="CENTER_RIGHT" prefHeight="30.0" styleClass="proxySetupLabel"
                               text="启动成功！立即访问 ">
                            <HBox.margin>
                                <Insets/>
                            </HBox.margin>
                        </Label>
                        <Hyperlink fx:id="domainLink" prefHeight="30.0"/>
                        <JFXButton fx:id="copyDomainBtn" prefHeight="30.0" text="复制"/>
                    </HBox>
                </VBox>
                <VBox fx:id="proxyListPane" prefHeight="Infinity" prefWidth="Infinity" GridPane.columnIndex="1">
                    <JFXListView fx:id="proxyListView" prefHeight="360.0" prefWidth="Infinity"/>
                    <JFXButton fx:id="addProxyBtn" prefHeight="45.0" prefWidth="Infinity" text="新增连接">
                        <graphic>
                            <FontIcon iconColor="white" iconLiteral="fa-plus"/>
                        </graphic>
                        <cursor>
                            <Cursor fx:constant="HAND"/>
                        </cursor>
                    </JFXButton>
                </VBox>
                <AnchorPane prefHeight="Infinity" prefWidth="Infinity" GridPane.rowIndex="1">
                    <JFXTabPane fx:id="tabPane" prefHeight="230" prefWidth="520.0" styleClass="mainPane">
                        <tabs>
                            <Tab fx:id="proxyLogPane" text="  日志  "/>
                            <Tab text="常见问题">
                                <VBox minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                                    <padding>
                                        <Insets left="20.0" top="20.0"/>
                                    </padding>
                                    <HBox prefHeight="30.0" prefWidth="Infinity" visible="false">
                                        <Label prefHeight="Infinity" text="* 若启动后无法通过外网访问，请点击"/>
                                        <Hyperlink prefHeight="Infinity" text="此处"/>
                                        <Label prefHeight="Infinity" text="排查问题"/>
                                    </HBox>
                                    <Label prefHeight="30" text="* 修改配置信息后，必须重启才能生效"/>
                                    <Label prefHeight="30" text="* 只有启动或重启内网穿透服务时，配置信息才会被保存"/>
                                    <Label prefHeight="30" text="* 同一个账号在同一时间只能在一台电脑上登录使用"/>
                                    <Label prefHeight="30" text="* 请勿将非法、暴力、色情等信息映射到外网上去，一经发现立即封号"/>
                                </VBox>
                            </Tab>
                            <!--                            TODO 使用场景 -->
                            <!--                            <Tab text="使用场景">-->
                            <!--                                <VBox minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">-->

                            <!--                                </VBox>-->
                            <!--                            </Tab>-->
                        </tabs>
                    </JFXTabPane>
                    <JFXButton fx:id="clearLogBtn" layoutX="480.0" layoutY="-1.0" prefHeight="35.0" prefWidth="26.0"
                               text="">
                        <graphic>
                            <FontIcon iconColor="white" iconLiteral="fa-trash-o" iconSize="18"/>
                        </graphic>
                        <cursor>
                            <Cursor fx:constant="HAND"/>
                        </cursor>
                    </JFXButton>
                </AnchorPane>
                <VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="1"
                      GridPane.rowIndex="1">
                    <JFXButton fx:id="startProxyBtn" buttonType="RAISED" prefHeight="44.0" prefWidth="202.0"
                               styleClass="startProxyBtn" text="启动">
                        <cursor>
                            <Cursor fx:constant="HAND"/>
                        </cursor>
                    </JFXButton>
                    <JFXButton fx:id="logoutBtn" text="退出登录">
                        <VBox.margin>
                            <Insets top="20.0"/>
                        </VBox.margin>
                        <cursor>
                            <Cursor fx:constant="HAND"/>
                        </cursor>
                    </JFXButton>
                </VBox>
            </children>
        </GridPane>
    </VBox>

</StackPane>
