feat: 主界面调整、日志打印、代理测试、关于页、弹窗工具、清理代码

This commit is contained in:
2024-09-15 02:25:00 +08:00
parent d65990791a
commit 7c051bbf44
49 changed files with 1745 additions and 656 deletions

View File

@ -0,0 +1,31 @@
/**************************************************
* Admin Password Panel
**************************************************/
#admin-panel {
-fx-background-color: -color-bg-default;
-fx-background-radius: 15;
-fx-border-radius: 15;
.header {
.label {
-fx-font-size: 20;
}
.button, .button.ikonli-font-icon {
-fx-background-radius: 15;
}
}
.admin-field {
-fx-spacing: 10;
.text-field {
-fx-pref-width: 100;
}
&-value {
//-fx-padding: 5 10;
}
}
}

View File

@ -14,24 +14,27 @@
-fx-border-radius: 10;
}
.control-menu, #startButton, #passwordButton, #restartButton, #moreButton {
.control-menu, #moreButton {
-fx-font-size: 15;
-fx-background-radius: 15;
-fx-padding: 10 40 10 40;
-fx-padding: 10 40;
-fx-border-radius: 15;
-fx-border-width: 2;
}
#startButton {
-color-button-bg-hover: -color-button-bg;
-color-button-bg-focused: -color-button-bg;
-fx-border-color: -color-button-bg;
-fx-border-color-hover: -color-button-bg;
}
#passwordButton {
-color-button-bg: -color-success-3;
-color-button-bg-hover: -color-button-bg;
-color-button-bg-focused: -color-button-bg;
-color-button-bg-focused: -color-success-3;
-color-button-bg-pressed: -color-button-bg;
-fx-border-color: -color-button-bg;
-fx-border-color: -color-success-3;
}
#restartButton {
@ -43,12 +46,20 @@
}
#moreButton {
-color-button-bg-focused: transparent;
-color-button-bg-pressed: transparent;
-color-button-bg-hover: -color-chart-6-alpha20;
-color-button-border: -color-chart-6;
-fx-border-color: -color-chart-6;
-color-button-border-hover: -color-chart-6-alpha70;
-fx-padding: 2 30;
-fx-background-color: transparent;
-fx-border-color: -color-chart-6-alpha70;
&:hover {
-fx-background-color: -color-chart-6-alpha20;
-fx-border-color: -color-chart-6-alpha70;
}
.context-menu, .menu-item {
-fx-background-radius: 15;
-fx-border-radius: 15;
}
}
.logArea {

View File

@ -91,23 +91,22 @@
#windowFooter {
.button {
-fx-font-size: 15;
-fx-background-color: transparent;
-fx-text-alignment: CENTER;
}
#document {
-fx-text-fill: -color-success-5;
}
#github {
-fx-text-fill: -color-accent-5;
}
#sponsor {
-fx-text-fill: -color-danger-emphasis;
}
.ikonli-font-icon {
-fx-font-size: 15;
}
}
/**************************************************
* Modal Pane
**************************************************/
.modal-pane {
-fx-background-radius: 15;
.scrollable-content {
-fx-background-radius: 15;
}
}

View File

@ -1,10 +1,12 @@
/**************************************************
* Root
**************************************************/
.root {
-fx-font-size: 15;
-fx-font-weight: bolder;
}
.root-pane {
-fx-font-size: 15;
-fx-font-weight: normal;
-fx-background-radius: 15;
-fx-border-radius: 15;

View File

@ -29,6 +29,6 @@
<Label styleClass="shield-name" text="%about.app.version"/>
<Label styleClass="shield-version" text="v${project.version}"/>
</HBox>
<Button fx:id="checkAppVersion" styleClass="flat" text="%about.app.update"/>
<Button fx:id="checkAListVersion" styleClass="flat" onAction="#checkAListUpdate" text="%about.alist.update"/>
<Button fx:id="checkAppVersion" onAction="#checkGuiUpdate" styleClass="flat" text="%about.app.update"/>
<Button fx:id="checkAListVersion" onAction="#checkAListUpdate" styleClass="flat" text="%about.alist.update"/>
</VBox>

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import atlantafx.base.layout.InputGroup?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import org.kordamp.ikonli.javafx.*?>
<AnchorPane id="admin-panel" fx:id="adminPanel" maxHeight="250" maxWidth="520" prefHeight="250.0" prefWidth="520.0"
stylesheets="@../css/admin-panel.css" xmlns="http://javafx.com/javafx/11.0.14-internal"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="cn.octopusyan.alistgui.controller.PasswordController">
<AnchorPane styleClass="header" prefWidth="520" AnchorPane.leftAnchor="0" AnchorPane.rightAnchor="0"
AnchorPane.topAnchor="0">
<Label text="%admin.pwd.title" AnchorPane.leftAnchor="10" AnchorPane.topAnchor="10"/>
<Button onAction="#close" styleClass="flat" AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0">
<graphic>
<FontIcon iconLiteral="fa-remove"/>
</graphic>
</Button>
</AnchorPane>
<VBox alignment="CENTER" spacing="10" AnchorPane.bottomAnchor="30" AnchorPane.leftAnchor="0"
AnchorPane.rightAnchor="0">
<Label style="-fx-background-radius: 10;-fx-background-color: -color-button-bg-hover;"
styleClass="button, flat, danger" text="%admin.pwd.toptip"/>
<HBox alignment="CENTER" styleClass="admin-field">
<Label text="%admin.pwd.user-field"/>
<InputGroup fx:id="userField" styleClass="admin-field-value">
<TextField fx:id="usernameField" text="admin" editable="false"/>
<Button fx:id="copyUsername" onAction="#copyUsername">
<graphic>
<FontIcon iconLiteral="fa-copy"/>
</graphic>
</Button>
</InputGroup>
</HBox>
<HBox alignment="CENTER" styleClass="admin-field">
<Label text="%admin.pwd.pwd-field"/>
<InputGroup styleClass="admin-field-value">
<PasswordField fx:id="passwordField" editable="false"/>
<Button fx:id="refreshPassword" onAction="#savePassword" visible="false" managed="false">
<graphic>
<FontIcon iconLiteral="fa-refresh"/>
</graphic>
</Button>
<Button fx:id="savePassword" onAction="#savePassword" visible="false" managed="false">
<graphic>
<FontIcon iconLiteral="fa-save"/>
</graphic>
</Button>
<Button fx:id="copyPassword" onAction="#copyPassword">
<graphic>
<FontIcon iconLiteral="fa-copy"/>
</graphic>
</Button>
</InputGroup>
</HBox>
</VBox>
</AnchorPane>

View File

@ -5,13 +5,14 @@
<?import javafx.scene.layout.*?>
<VBox fx:id="mainView" prefHeight="700" prefWidth="720" stylesheets="@../css/main-view.css"
xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1"
alignment="TOP_CENTER"
fx:controller="cn.octopusyan.alistgui.controller.MainController">
<padding>
<Insets left="10.0" right="10.0" top="10.0"/>
</padding>
<HBox alignment="TOP_CENTER" prefWidth="Infinity">
<Label fx:id="homeLabel" alignment="CENTER" text="AList GUI"/>
<Button fx:id="statusLabel" styleClass="success" alignment="TOP_CENTER" text="%main.status.label-running">
<Button fx:id="statusLabel" styleClass="danger" alignment="TOP_CENTER" text="%main.status.label-stop">
<HBox.margin>
<Insets left="-10.0" top="-5"/>
</HBox.margin>
@ -24,12 +25,19 @@
<VBox.margin>
<Insets bottom="10.0" top="10.0"/>
</VBox.margin>
<Button fx:id="startButton" styleClass="large, control-menu, success" onAction="#start"
<Button fx:id="startButton" onAction="#start" styleClass="control-menu, success"
text="%main.control.start"/>
<Button fx:id="passwordButton" styleClass="large, control-menu, success" text="%main.control.password"/>
<Button fx:id="restartButton" styleClass="large, control-menu, success" onAction="#restart"
<Button fx:id="passwordButton" onAction="#adminPassword" styleClass="control-menu, success"
text="%main.control.password"/>
<Button fx:id="restartButton" onAction="#restart" styleClass="control-menu, success"
text="%main.control.restart"/>
<Button fx:id="moreButton" styleClass="large, control-menu, button-outlined" text="%main.control.more"/>
<MenuButton fx:id="moreButton" styleClass="button-outlined, no-arrow" text="%main.control.more">
<items>
<MenuItem fx:id="browserButton" onAction="#openInBrowser" disable="true" text="%main.more.browser"/>
<MenuItem onAction="#openConfig" text="%main.more.open-config"/>
<MenuItem onAction="#openLogFolder" text="%main.more.open-log"/>
</items>
</MenuButton>
</HBox>
<ScrollPane fx:id="logAreaSp" fitToWidth="true" prefHeight="499.0" prefWidth="Infinity"
styleClass="logArea" VBox.vgrow="ALWAYS">

View File

@ -2,55 +2,60 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.layout.*?>
<?import org.kordamp.ikonli.javafx.*?>
<VBox fx:id="rootPane" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"
alignment="TOP_CENTER" prefHeight="720.0" prefWidth="770.0" spacing="10.0"
styleClass="root-pane" stylesheets="@../css/root-view.css"
fx:controller="cn.octopusyan.alistgui.controller.RootController">
<StackPane fx:id="rootPane" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"
prefHeight="720.0" prefWidth="770.0"
styleClass="root-pane" stylesheets="@../css/root-view.css"
fx:controller="cn.octopusyan.alistgui.controller.RootController">
<HBox fx:id="windowHeader" alignment="CENTER_RIGHT" prefWidth="Infinity" spacing="10.0">
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
<FontIcon fx:id="alwaysOnTopIcon" styleClass="icon-button"/>
<FontIcon fx:id="minimizeIcon" styleClass="icon-button"/>
<FontIcon fx:id="closeIcon" styleClass="icon-button"/>
</HBox>
<VBox prefHeight="720.0" prefWidth="770.0" spacing="10.0">
<TabPane fx:id="tabPane" prefWidth="Infinity" tabClosingPolicy="UNAVAILABLE" VBox.vgrow="ALWAYS">
<padding>
<Insets left="20.0" right="20.0"/>
</padding>
<Tab text="%root.tab.main">
<graphic>
<FontIcon iconColor="white" iconLiteral="fa-th-large"/>
</graphic>
<!-- 引入主页 -->
<fx:include fx:id="mainController" source="main-view.fxml" prefWidth="Infinity" prefHeight="-Infinity"/>
</Tab>
<Tab text="%root.tab.setup">
<graphic>
<FontIcon iconColor="white" iconLiteral="fa-cog"/>
</graphic>
<!-- 引入设置页 -->
<fx:include fx:id="setupController" source="setup-view.fxml" prefWidth="Infinity" prefHeight="-Infinity"/>
</Tab>
<Tab text="%root.tab.about">
<graphic>
<FontIcon iconColor="white" iconLiteral="fa-info-circle"/>
</graphic>
<!-- 引入关于页 -->
<fx:include fx:id="aboutController" source="about-view.fxml" prefWidth="Infinity" prefHeight="-Infinity"/>
</Tab>
</TabPane>
<HBox fx:id="windowFooter" alignment="CENTER" prefWidth="Infinity" spacing="25.0">
<padding>
<Insets bottom="30.0"/>
</padding>
<Button fx:id="document" text="%root.foot.doc"/>
<Button fx:id="github" text="%root.foot.github"/>
<Button fx:id="sponsor" text="%root.foot.sponsor"/>
</HBox>
</VBox>
<HBox fx:id="windowHeader" alignment="CENTER_RIGHT" prefWidth="Infinity" spacing="10.0">
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
<FontIcon fx:id="alwaysOnTopIcon" styleClass="icon-button"/>
<FontIcon fx:id="minimizeIcon" styleClass="icon-button"/>
<FontIcon fx:id="closeIcon" styleClass="icon-button"/>
</HBox>
<TabPane fx:id="tabPane" prefWidth="Infinity" tabClosingPolicy="UNAVAILABLE" VBox.vgrow="ALWAYS">
<padding>
<Insets left="20.0" right="20.0"/>
</padding>
<Tab text="%root.tab.main">
<graphic>
<FontIcon iconColor="white" iconLiteral="fa-th-large"/>
</graphic>
<!-- 引入主页 -->
<fx:include fx:id="mainController" source="main-view.fxml" prefWidth="Infinity" prefHeight="-Infinity"/>
</Tab>
<Tab text="%root.tab.setup">
<graphic>
<FontIcon iconColor="white" iconLiteral="fa-cog"/>
</graphic>
<!-- 引入设置页 -->
<fx:include fx:id="setupController" source="setup-view.fxml" prefWidth="Infinity"
prefHeight="-Infinity"/>
</Tab>
<Tab text="%root.tab.about">
<graphic>
<FontIcon iconColor="white" iconLiteral="fa-info-circle"/>
</graphic>
<!-- 引入关于页 -->
<fx:include fx:id="aboutController" source="about-view.fxml" prefWidth="Infinity"
prefHeight="-Infinity"/>
</Tab>
</TabPane>
<HBox fx:id="windowFooter" alignment="CENTER" prefWidth="Infinity" spacing="25.0">
<padding>
<Insets bottom="30.0"/>
</padding>
<Button fx:id="document" onAction="#openDocument" styleClass="success, flat" text="%root.foot.doc"/>
<Button fx:id="github" onAction="#openGithub" styleClass="accent, flat" text="%root.foot.github"/>
<Button fx:id="sponsor" styleClass="danger, flat" text="%root.foot.sponsor"
visible="false" managed="false"/>
</HBox>
</VBox>
</StackPane>

View File

@ -13,6 +13,7 @@ main.control.more=\u66F4\u591A
main.status.label-running=\u8FD0\u884C\u4E2D
main.status.label-stop=\u5DF2\u505C\u6B62
main.more.browser=\u5728\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00
main.more.open-config=\u6253\u5F00\u914D\u7F6E\u6587\u4EF6
main.more.open-log=\u6253\u5F00\u65E5\u5FD7\u6587\u4EF6\u5939
alist.status.start.running=AList \u6B63\u5728\u8FD0\u884C\u3002\u3002\u3002
alist.status.start=\u6B63\u5728\u542F\u52A8 AList
@ -37,10 +38,16 @@ about.app.version=GUI \u7248\u672C
about.alist.update=\u68C0\u67E5 AList \u7248\u672C
about.app.update=\u68C0\u67E5 GUI \u7248\u672C
setup.theme=\u4E3B\u9898
update.current=\u5F53\u524D
update.remote=\u6700\u65B0
update.current=\u5F53\u524D\u7248\u672C
update.remote=\u6700\u65B0\u7248\u672C
update.upgrade.not=\u5DF2\u662F\u6700\u65B0\u7248\u672C
update.upgrade.new=\u68C0\u67E5\u5230\u65B0\u7248\u672C
msg.alist.download.notfile=\u6CA1\u68C0\u6D4B\u5230AList\u6587\u4EF6\uFF0C\u662F\u5426\u73B0\u5728\u4E0B\u8F7D\uFF1F
msg.alist.pwd.copy=\u590D\u5236\u6210\u529F
admin.pwd.title=\u7BA1\u7406\u5458\u5BC6\u7801
admin.pwd.toptip=\u65B0\u5BC6\u7801\u53EA\u4F1A\u663E\u793A\u4E00\u6B21
admin.pwd.user-field=\u7528\u6237\uFF1A
admin.pwd.pwd-field=\u5BC6\u7801\uFF1A

View File

@ -13,6 +13,7 @@ main.control.more=More
main.status.label-running=Running
main.status.label-stop=Stoped
main.more.browser=Open in browser
main.more.open-config=Open configuration file
main.more.open-log=Open the log folder
alist.status.start=Starting AList
alist.status.start.running=AList is running...
@ -37,9 +38,15 @@ about.app.version=GUI Version
about.alist.update=Check AList Version
about.app.update=Check GUI Version
setup.theme=Theme
update.current=Current
update.remote=Latest
update.current=Current Version
update.remote=Latest Version
update.upgrade.not=It is already the latest version
update.upgrade.new=Detected a new version
msg.alist.download.notfile=AList file not detected, download now?
msg.alist.pwd.copy=Copy successful
admin.pwd.title=Admin Password
admin.pwd.toptip=The new password will only be displayed once
admin.pwd.user-field=User:
admin.pwd.pwd-field=Password :

View File

@ -13,6 +13,7 @@ main.control.more=\u66F4\u591A
main.status.label-running=\u8FD0\u884C\u4E2D
main.status.label-stop=\u5DF2\u505C\u6B62
main.more.browser=\u5728\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00
main.more.open-config=\u6253\u5F00\u914D\u7F6E\u6587\u4EF6
main.more.open-log=\u6253\u5F00\u65E5\u5FD7\u6587\u4EF6\u5939
alist.status.stop.stopped=AList \u5DF2\u505C\u6B62
alist.status.start=\u6B63\u5728\u542F\u52A8 AList
@ -37,9 +38,15 @@ about.app.version=GUI \u7248\u672C
about.alist.update=\u68C0\u67E5 AList \u7248\u672C
about.app.update=\u68C0\u67E5 GUI \u7248\u672C
setup.theme=\u4E3B\u9898
update.current=\u5F53\u524D
update.remote=\u6700\u65B0
update.current=\u5F53\u524D\u7248\u672C
update.remote=\u6700\u65B0\u7248\u672C
update.upgrade.not=\u5DF2\u662F\u6700\u65B0\u7248\u672C
update.upgrade.new=\u68C0\u67E5\u5230\u65B0\u7248\u672C
msg.alist.download.notfile=\u6CA1\u68C0\u6D4B\u5230AList\u6587\u4EF6\uFF0C\u662F\u5426\u73B0\u5728\u4E0B\u8F7D\uFF1F
msg.alist.pwd.copy=\u590D\u5236\u6210\u529F
admin.pwd.title=\u7BA1\u7406\u5458\u5BC6\u7801
admin.pwd.toptip=\u65B0\u5BC6\u7801\u53EA\u4F1A\u663E\u793A\u4E00\u6B21
admin.pwd.user-field=\u7528\u6237\uFF1A
admin.pwd.pwd-field=\u5BC6\u7801\uFF1A