Skip to content

Commit

Permalink
Merge pull request #130 from LYOfficial/dev
Browse files Browse the repository at this point in the history
合并 Dev 更改
  • Loading branch information
sheep-realms authored Mar 24, 2024
2 parents c445f1c + 14464a1 commit f159a83
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
| - | - | - |
| `title` | String | 网站名称。 |
| `url` | String | 网站 URL 地址。 |
| `state` | String | 网站状态:<br>`up` - 正常运行<br>`down` - 停摆<br>`failure` - 存在故障或访问困难<br>`unknow` - 未知 |
| `state` | String | 网站状态:<br>`up` - 正常运行<br>`down` - 停摆<br>`failure` - 存在故障或访问困难<br>`close` - 已宣布关闭或不再提供论坛服务<br>`unknow` - 未知 |
| `createdAt` | String | 网站创建时间,格式为 `yyyy/MM/dd`。<br>请勿填写 “未知” 等其他格式的数据,未知请填写更新时间并在备注中注明。 |
| `closedAt` | String | 网站关闭时间,格式同上,仅在 `state` 值为 `close` 时显示,可不填。 |
| `updatedAt` | String | 最后更新时间,格式同上。 |
| `hasICP` | String | 是否 ICP 备案:<br>`yes` - 已备案<br>`no` - 未备案<br>`in_progress` - 备案中 |
| `hasNetSec` | String | 是否网安备案,同上。 |
Expand Down
12 changes: 10 additions & 2 deletions res/class/DOMConstructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class DOMForumList {
up: 'check',
down: 'close',
failure: 'alert',
close: 'nuke',
unknow: 'help'
}
let icon = '';
Expand All @@ -19,6 +20,7 @@ class DOMForumList {
up: '正常运行',
down: '停摆',
failure: '存在故障或访问困难',
close: '已宣布关闭或不再提供论坛服务',
unknow: '未知'
}

Expand All @@ -27,6 +29,7 @@ class DOMForumList {
url: "https://www.example.com",
state: "unknow",
createdAt: "1970/01/01",
closedAt: "1970/01/01",
updatedAt: "1970/01/01",
hasICP: "no",
hasNetSec: "no",
Expand Down Expand Up @@ -59,7 +62,12 @@ class DOMForumList {
</div>
<div class="time-box">
<div class="date-icon-text created-at" title="网站创建时间">${Icon.flag()} ${item.createdAt}</div>
<div class="date-icon-text updated-at" title="最后更新时间">${Icon.clockEditOutline()} ${item.updatedAt}</div>
<div
class="date-icon-text ${ item.state == 'close' ? 'closed-at' : 'updated-at' }"
title="${ item.state == 'close' ? '网站关闭时间' : '最后更新时间' }"
>
${ item.state == 'close' ? Icon.nuke() : Icon.clockEditOutline() } ${ item.state == 'close' ? item.closedAt : item.updatedAt }
</div>
</div>
<div class="action-box">
<a href="${item.url}" target="_blank" rel="noopener noreferrer">访问网站 ${Icon.openInNew()}</a>
Expand Down Expand Up @@ -229,7 +237,7 @@ class DOMForumList {
return e.state == 'failure';
}).length,
downCount = items.filter((e) => {
return e.state == 'down';
return e.state == 'down' || e.state == 'close';
}).length,
unknowCount = items.filter((e) => {
return e.state == 'unknow';
Expand Down
5 changes: 3 additions & 2 deletions res/data/forums.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,13 @@ const db_forums = [
{
title: "EmeraldBBS",
url: "http://feiyutang.cn",
state: "down",
state: "close",
createdAt: "2024/02/20",
closedAt: "2024/03/24",
updatedAt: "2024/03/24",
hasICP: "no",
hasNetSec: "no",
note: "非大陆服务器,原名MineFriend,SC论坛。",
note: "非大陆服务器,原名MineFriend,SC论坛。现已改为 Minecraft 镜像下载站。",
reference: [
{
title: "闲来无事搭建的MC论坛(?",
Expand Down
14 changes: 12 additions & 2 deletions res/style/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ nav.in-sticky {
background-color: #faad1405;
}

.forum-item.forum-state-down .forum-item-bg {
.forum-item.forum-state-down .forum-item-bg,
.forum-item.forum-state-close .forum-item-bg {
z-index: 0;
position: absolute;
top: 0;
Expand All @@ -366,6 +367,14 @@ nav.in-sticky {
background-color: #ff4d4f0a;
}

.forum-item.forum-state-close .closed-at {
color: var(--ant-color-error);
}

.forum-item.forum-state-close .closed-at svg {
fill: var(--ant-color-error);
}

.forum-item>*:not(.forum-item-bg) {
z-index: 1;
}
Expand All @@ -380,7 +389,8 @@ nav.in-sticky {
--state-color: var(--ant-color-success);
}

.forum-item.forum-state-down {
.forum-item.forum-state-down,
.forum-item.forum-state-close {
--state-color: var(--ant-color-error);
}

Expand Down

0 comments on commit f159a83

Please sign in to comment.