mirror of
https://github.com/octopusYan/alist-gui.git
synced 2025-12-10 01:51:56 +08:00
Initial commit
This commit is contained in:
3
src/main/resources/application.properties
Normal file
3
src/main/resources/application.properties
Normal file
@ -0,0 +1,3 @@
|
||||
app.name=${project.name}
|
||||
app.title=alist gui
|
||||
app.version=${project.version}
|
||||
176
src/main/resources/css/root-view.css
Normal file
176
src/main/resources/css/root-view.css
Normal file
@ -0,0 +1,176 @@
|
||||
@import "root.css";
|
||||
|
||||
/**************************************************
|
||||
* Window Header
|
||||
**************************************************/
|
||||
#windowHeader .iconButton {
|
||||
/*-fx-max-height: 5px;*/
|
||||
/*-fx-max-width: 5px;*/
|
||||
-fx-border-radius: 15;
|
||||
}
|
||||
|
||||
#rootPane #closeIcon {
|
||||
-fx-color: #fa6057;
|
||||
-fx-opacity: 0.5;
|
||||
}
|
||||
|
||||
#rootPane #closeIcon:hover {
|
||||
-fx-opacity: 1.0;
|
||||
}
|
||||
|
||||
#rootPane #minimizeIcon {
|
||||
-fx-color: #fbbc2e;
|
||||
-fx-opacity: 0.5;
|
||||
}
|
||||
|
||||
#rootPane #minimizeIcon:hover {
|
||||
-fx-opacity: 1.0;
|
||||
}
|
||||
|
||||
#rootPane #alwaysOnTopIcon {
|
||||
-fx-color: #27c940;
|
||||
-fx-opacity: 0.5;
|
||||
}
|
||||
|
||||
#rootPane #alwaysOnTopIcon:hover {
|
||||
-fx-opacity: 1.0;
|
||||
}
|
||||
|
||||
#rootPane #alwaysOnTopIcon:always-on-top {
|
||||
-fx-opacity: 1.0;
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* Tab label
|
||||
**************************************************/
|
||||
|
||||
#tabPane .tab-header-area {
|
||||
-fx-background-radius: 10;
|
||||
-fx-background-color: #0000;
|
||||
}
|
||||
|
||||
#tabPane .headers-region {
|
||||
-fx-alignment: TOP_CENTER;
|
||||
-fx-background-color: #18181a;
|
||||
-fx-background-radius: 10;
|
||||
-fx-padding: 5 0 5 0;
|
||||
}
|
||||
|
||||
#tabPane .tab-header-background {
|
||||
-fx-background-color: #0000;
|
||||
}
|
||||
|
||||
#tabPane .tab {
|
||||
-fx-text-fill: white;
|
||||
-fx-padding: 10 20 10 20;
|
||||
-fx-background-radius: 10;
|
||||
-fx-background-color: #0000;
|
||||
-fx-border-width: 0;
|
||||
}
|
||||
|
||||
#tabPane .tab-label {
|
||||
-fx-font-size: 15px;
|
||||
-fx-text-fill: #707079;
|
||||
}
|
||||
|
||||
#tabPane .tab:selected {
|
||||
-fx-background-color: #2c69e0;
|
||||
}
|
||||
|
||||
#tabPane .tab:selected .tab-label {
|
||||
-fx-text-fill: white;
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* Main View
|
||||
**************************************************/
|
||||
#homeLabel {
|
||||
-fx-font-size: 35px;
|
||||
-fx-font-weight: bold;
|
||||
-fx-text-fill: white;
|
||||
-fx-font-family: 'JetBrains Mono';
|
||||
}
|
||||
|
||||
#statusLabel {
|
||||
-fx-padding: 2 5 2 5;
|
||||
-fx-text-fill: black;
|
||||
-fx-background-color: #1bc964;
|
||||
-fx-background-radius: 10;
|
||||
-fx-text-alignment: CENTER;
|
||||
-fx-border-radius: 10;
|
||||
-fx-border-color: black;
|
||||
}
|
||||
|
||||
.controlMenu {
|
||||
-fx-font-size: 15;
|
||||
-fx-background-radius: 10px;
|
||||
-fx-padding: 10 40 10 40;
|
||||
-fx-border-radius: 10;
|
||||
}
|
||||
|
||||
.controlMenu:focused {
|
||||
-fx-opacity: 0.5;
|
||||
}
|
||||
|
||||
#startButton {
|
||||
-fx-background-color: #fa6057;
|
||||
-fx-text-fill: white;
|
||||
-fx-opacity: 1.0;
|
||||
}
|
||||
|
||||
#passwordButton {
|
||||
-fx-background-color: #1bc964;
|
||||
-fx-opacity: 1.0;
|
||||
}
|
||||
|
||||
#restartButton {
|
||||
-fx-background-color: linear-gradient(#57b4f2, #9198e5);
|
||||
-fx-text-fill: white;
|
||||
-fx-opacity: 1.0;
|
||||
}
|
||||
|
||||
#moreButton {
|
||||
-fx-background-color: #0000;
|
||||
-fx-text-fill: #9254d1;
|
||||
-fx-border-color: #9254d1;
|
||||
-fx-border-width: 2px;
|
||||
-fx-opacity: 1.0;
|
||||
}
|
||||
|
||||
#tabPane .tab:selected .focus-indicator {
|
||||
-fx-border-width: 0;
|
||||
-fx-border-color: #0000;
|
||||
}
|
||||
|
||||
#logArea {
|
||||
-fx-text-fill: #e3e4e4;
|
||||
-fx-font-family: 'JetBrains Mono';
|
||||
-fx-font-size: 20;
|
||||
-fx-background-radius: 15;
|
||||
-fx-border-radius: 15;
|
||||
-fx-border-color: transparent;
|
||||
-fx-background-insets: 0;
|
||||
-fx-background-color: #18181c;
|
||||
}
|
||||
|
||||
#logArea .content {
|
||||
-fx-padding: 15;
|
||||
-fx-background-radius: 15;
|
||||
-fx-background-color: #18181c;
|
||||
-fx-border-radius: 15;
|
||||
-fx-border-color: transparent;
|
||||
}
|
||||
|
||||
#logArea .scroll-pane {
|
||||
-fx-background-color: transparent;
|
||||
}
|
||||
#logArea .scroll-pane .viewport{
|
||||
-fx-background-color: transparent;
|
||||
}
|
||||
|
||||
#logArea:focused {
|
||||
-fx-background-radius: 15;
|
||||
-fx-border-radius: 15;
|
||||
-fx-border-color: transparent;
|
||||
-fx-background-color: #18181c;
|
||||
}
|
||||
15
src/main/resources/css/root.css
Normal file
15
src/main/resources/css/root.css
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
/**************************************************
|
||||
* Root
|
||||
**************************************************/
|
||||
|
||||
.rootPane {
|
||||
-fx-background-color: black;
|
||||
-fx-background-radius: 10;
|
||||
-fx-border-radius: 10;
|
||||
}
|
||||
|
||||
.root {
|
||||
-fx-font-family: "Comic Sans MS";
|
||||
}
|
||||
|
||||
90
src/main/resources/fxml/root-view.fxml
Normal file
90
src/main/resources/fxml/root-view.fxml
Normal file
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import org.kordamp.ikonli.javafx.*?>
|
||||
<VBox fx:id="rootPane" styleClass="rootPane" alignment="TOP_CENTER" prefHeight="620.0" prefWidth="700.0" spacing="10.0"
|
||||
stylesheets="@../css/root-view.css" xmlns="http://javafx.com/javafx/11.0.14-internal"
|
||||
xmlns:fx="http://javafx.com/fxml/1" fx:controller="cn.octopusyan.alistgui.controller.MainController">
|
||||
|
||||
|
||||
<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>
|
||||
<Button fx:id="alwaysOnTopIcon" styleClass="iconButton"/>
|
||||
<Button fx:id="minimizeIcon" styleClass="iconButton"/>
|
||||
<Button fx:id="closeIcon" styleClass="iconButton"/>
|
||||
</HBox>
|
||||
|
||||
<TabPane fx:id="tabPane" prefWidth="Infinity" VBox.vgrow="ALWAYS" tabClosingPolicy="UNAVAILABLE">
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="20.0" right="20.0" top="10.0"/>
|
||||
</padding>
|
||||
<Tab text="主页">
|
||||
<graphic>
|
||||
<FontIcon iconLiteral="cil-library" iconColor="white"/>
|
||||
</graphic>
|
||||
<VBox>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||
</padding>
|
||||
<HBox styleClass="mainViewHeader" prefWidth="Infinity" alignment="TOP_CENTER">
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||
</padding>
|
||||
<Label fx:id="homeLabel" text="AList GUI" alignment="CENTER"/>
|
||||
<Label fx:id="statusLabel" text="运行中" alignment="TOP_CENTER">
|
||||
<HBox.margin>
|
||||
<Insets left="-10.0" top="-5"/>
|
||||
</HBox.margin>
|
||||
</Label>
|
||||
</HBox>
|
||||
<HBox prefWidth="Infinity" alignment="TOP_CENTER" spacing="25.0">
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||
</padding>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" top="10.0"/>
|
||||
</VBox.margin>
|
||||
<Button fx:id="startButton" styleClass="controlMenu" text="开始"/>
|
||||
<Button fx:id="passwordButton" styleClass="controlMenu" text="密码"/>
|
||||
<Button fx:id="restartButton" styleClass="controlMenu" text="重启"/>
|
||||
<Button fx:id="moreButton" styleClass="controlMenu" text="更多"/>
|
||||
</HBox>
|
||||
<TextArea fx:id="logArea" editable="false" wrapText="true" prefWidth="Infinity" VBox.vgrow="ALWAYS"
|
||||
text="123d1a32s1d3as21d3a2s1d3a2s1d3a2s1d3a2s1d3a2s1d3a2s1d32aasda3s21da32s1d32a1sd">
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" top="10.0"/>
|
||||
</VBox.margin>
|
||||
</TextArea>
|
||||
<HBox prefWidth="Infinity" alignment="CENTER" spacing="25.0">
|
||||
<padding>
|
||||
<Insets bottom="10.0" top="30.0"/>
|
||||
</padding>
|
||||
<Button fx:id="docmentLabel" text="文档" textAlignment="CENTER">
|
||||
<graphic>
|
||||
<FontIcon iconLiteral="cib-readme"/>
|
||||
</graphic>
|
||||
</Button>
|
||||
<Button fx:id="gethubLabel" text="Github" textAlignment="CENTER">
|
||||
<graphic>
|
||||
<FontIcon iconLiteral="cib-github"/>
|
||||
</graphic>
|
||||
</Button>
|
||||
<Button fx:id="otherLabel" text="赞助" textAlignment="CENTER">
|
||||
<graphic>
|
||||
<FontIcon iconLiteral="cib-buy-me-a-coffee"/>
|
||||
</graphic>
|
||||
</Button>
|
||||
</HBox>
|
||||
</VBox>
|
||||
</Tab>
|
||||
<Tab fx:id="setupTab" text="设置">
|
||||
<graphic>
|
||||
<FontIcon iconLiteral="cil-settings" iconColor="white"/>
|
||||
</graphic>
|
||||
</Tab>
|
||||
</TabPane>
|
||||
</VBox>
|
||||
98
src/main/resources/logback.xml
Normal file
98
src/main/resources/logback.xml
Normal file
@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
|
||||
<property name="logback.logdir" value="log"/>
|
||||
<property name="CHARSET" value="utf-8"/>
|
||||
<property name="logback.app" value="alist-gui"/>
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN" value="%highlight(%d{HH:mm:ss.SSS}) ${logback.app} %boldYellow([%thread]) %highlight(%-5level) %cyan(%logger{36}) - %mdc{client} [%X{trace_id}] %msg%n"/>
|
||||
|
||||
<!--输出到控制台 ConsoleAppender-->
|
||||
<appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
<charset>${CHARSET}</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!--输出到文件 fileLog-->
|
||||
<appender name="fileLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<!--如果只是想要 Error 级别的日志,那么需要过滤一下,默认是 info 级别的,ThresholdFilter-->
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"/>
|
||||
<File>${logback.logdir}/${logback.app}.info.log</File>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!--文件路径,定义了日志的切分方式——把每一天的日志归档到一个文件中,以防止日志填满整个磁盘空间-->
|
||||
<FileNamePattern>${logback.logdir}/${logback.app}_%d{yyyy-MM-dd}.info.log</FileNamePattern>
|
||||
<!--只保留最近30天的日志-->
|
||||
<maxHistory>30</maxHistory>
|
||||
<!--用来指定日志文件的上限大小,那么到了这个值,就会删除旧的日志-->
|
||||
<totalSizeCap>1GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<!--日志输出编码格式化-->
|
||||
<encoder>
|
||||
<charset>${CHARSET}</charset>
|
||||
<pattern>%d [%thread] %-5level %logger{36} %line - %mdc{client} [%X{trace_id}] %msg%n</pattern>
|
||||
</encoder>
|
||||
<!--只打印错误日志-->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>INFO</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="fileLog-debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<!--如果只是想要 Error 级别的日志,那么需要过滤一下,默认是 info 级别的,ThresholdFilter-->
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"/>
|
||||
<File>${logback.logdir}/${logback.app}.debug.log</File>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!--文件路径,定义了日志的切分方式——把每一天的日志归档到一个文件中,以防止日志填满整个磁盘空间-->
|
||||
<FileNamePattern>${logback.logdir}/${logback.app}_%d{yyyy-MM-dd}.debug.log</FileNamePattern>
|
||||
<!--只保留最近30天的日志-->
|
||||
<maxHistory>30</maxHistory>
|
||||
<!--用来指定日志文件的上限大小,那么到了这个值,就会删除旧的日志-->
|
||||
<totalSizeCap>1GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<!--日志输出编码格式化-->
|
||||
<encoder>
|
||||
<charset>UTF-8</charset>
|
||||
<pattern>%d [%thread] %-5level %logger{36} %line - %mdc{client} [%X{trace_id}] %msg%n</pattern>
|
||||
</encoder>
|
||||
<!--只打印错误日志-->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>DEBUG</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 错误日志 -->
|
||||
<appender name="fileLog-err" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<File>${logback.logdir}/${logback.app}.err.log</File>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<FileNamePattern>${logback.logdir}/${logback.app}_%d{yyyy-MM-dd}.err.log</FileNamePattern>
|
||||
<maxHistory>7</maxHistory>
|
||||
<totalSizeCap>1GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<charset>UTF-8</charset>
|
||||
<pattern>%d [%thread] %-5level %logger{36} %line - %mdc{client} [%X{trace_id}] %msg%n</pattern>
|
||||
</encoder>
|
||||
<!--只打印错误日志-->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>ERROR</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!--指定最基础的日志输出级别-->
|
||||
<root level="INFO">
|
||||
<!--appender将会添加到这个logger-->
|
||||
<appender-ref ref="consoleLog"/>
|
||||
<appender-ref ref="fileLog"/>
|
||||
<appender-ref ref="fileLog-debug"/>
|
||||
<appender-ref ref="fileLog-err"/>
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user