fix some view problem
All checks were successful
Java CI-CD with Maven / build (push) Successful in 2h34m9s

This commit is contained in:
zhangyuheng 2024-01-10 20:49:35 +08:00
parent 0c9d16bc1b
commit c71266627f
3 changed files with 6 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>MiniPlayerTitle</artifactId>
<version>2.1</version>
<version>2.3</version>
<packaging>jar</packaging>
<name>MiniPlayerTitle</name>

View File

@ -17,7 +17,7 @@ public class ConfigManager {
_debug = _file.getBoolean("Debug", false);
_db_host = _file.getString("Database.Host", "localhost");
_db_port = _file.getString("Database.Port", "5432");
_db_name = _file.getString("Database.Name", "newbtitle");
_db_name = _file.getString("Database.Name", "miniplayertitle");
_db_user = _file.getString("Database.User", "postgres");
_db_pass = _file.getString("Database.Pass", "postgres");
_prefix = _file.getString("Prefix", "[");

View File

@ -51,6 +51,10 @@ public class ListView {
public void showOn(Player player, Integer page) {
int offset = (page - 1) * page_size;
if (lines.isEmpty()) {
Notification.warn(player, "没有数据");
return;
}
if (offset >= lines.size() || offset < 0) {
Notification.error(player, "页数超出范围");
return;