refactor: XIAOMUSIC_HOSTNAME 携带端口号友好提醒并处理 (#303)

* refactor: XIAOMUSIC_HOSTNAME 携带端口号友好提醒并处理

* refactor: input/select宽度对齐
This commit is contained in:
52fisher 2024-12-09 23:19:32 +08:00 committed by GitHub
parent c1994b5bc6
commit 5fbaf89d1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 0 deletions

View File

@ -191,4 +191,14 @@ $(function(){
$("#clear_cache").on("click", () => {
localStorage.clear();
});
$("#hostname").on("change", function(){
const hostname = $(this).val();
// 检查是否包含端口号1到5位数字
if (hostname.match(/:\d{1,5}$/)) {
alert("hostname禁止带端口号");
// 移除端口号
$(this).val(hostname.replace(/:\d{1,5}$/,""));
}
});
});

View File

@ -191,4 +191,13 @@ $(function(){
$("#clear_cache").on("click", () => {
localStorage.clear();
});
$("#hostname").on("change", function(){
const hostname = $(this).val();
// 检查是否包含端口号1到5位数字
if (hostname.match(/:\d{1,5}$/)) {
alert("hostname禁止带端口号");
// 移除端口号
$(this).val(hostname.replace(/:\d{1,5}$/,""));
}
});
});

View File

@ -30,6 +30,7 @@ input,select {
width: 90%;
max-width: 400px;
height: 40px;
box-sizing: border-box;
}
.rows {