Skip to content

Commit

Permalink
feat: 支持站点分组
Browse files Browse the repository at this point in the history
* 从站点设置里面读取标签作为分组依据
* 设置优先级后, 标签顺序和站点默认排序按优先级从小到大
  • Loading branch information
IITII committed Oct 12, 2023
1 parent 5807ebe commit 8f212a9
Show file tree
Hide file tree
Showing 6 changed files with 223 additions and 33 deletions.
12 changes: 11 additions & 1 deletion resource/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
"home": {
"title": "My Data",
"getInfos": "Refresh my data",
"getGroupInfos": "Refresh group data",
"cancelRequest": "Cancel request",
"requesting": "Requesting",
"siteName": "Site name",
Expand All @@ -171,11 +172,12 @@
"showHnR": "H&R",
"showLastUpdateTimeAsRelativeTime":"Last update time as relative time",
"selectColumns": "Select Columns",
"selectedTags": "Selected Tags",
"week": "Expressed in weeks",
"timeline": "Time line",
"settings": "Settings",
"statistic": "Statistic",
"openAllSites": "Open all sites",
"openAllSites": "Open group sites",
"openAllUnReadMsg": "Open a site with unread messages",
"openAllStatusErr": "Open a site with abnormal status",
"newMessage": "New message",
Expand All @@ -191,6 +193,12 @@
"control_panel": "ControlPanel",
"security": "Security",
"2FA": "2FA",
"tags": {
"__all__": "ALL",
"__unTagged__": "UnTagged",
"__unReadMsg__": "UnReadMsg",
"__statusError__": "StatusError"
},
"headers": {
"date": "Date",
"site": "Site",
Expand Down Expand Up @@ -731,6 +739,8 @@
"editor": {
"defaultClient": "Download server (if not selected, the default download server of the basic settings will prevail)",
"name": "Site name",
"siteGroup": "Site Group",
"siteGroupTip": "Press Enter to add multiple group.",
"tags": "Tags",
"inputTags": "press Enter to add multiple",
"schema": "Site schema",
Expand Down
12 changes: 11 additions & 1 deletion resource/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
"home": {
"title": "我的数据",
"getInfos": "刷新我的数据",
"getGroupInfos": "刷新分组数据",
"cancelRequest": "取消请求",
"requesting": "正在请求",
"siteName": "网站名称",
Expand All @@ -168,11 +169,12 @@
"showHnR": "H&R",
"showLastUpdateTimeAsRelativeTime": "最后更新时间显示为相对时间",
"selectColumns": "过滤列",
"selectedTags": "标签分组过滤",
"week": "时间显示为周数",
"timeline": "时间轴",
"settings": "参数",
"statistic": "数据图表",
"openAllSites": "打开所有站点",
"openAllSites": "打开分组站点",
"openAllUnReadMsg": "打开有未读消息的站点",
"openAllStatusErr": "打开状态异常的站点",
"newMessage": "新消息",
Expand All @@ -188,6 +190,12 @@
"control_panel": "控制面板",
"security": "安全设置",
"2FA": "2FA",
"tags": {
"__all__": "全部",
"__unTagged__": "未加标签",
"__unReadMsg__": "未读消息",
"__statusError__": "状态异常"
},
"headers": {
"date": "日期",
"site": "站点",
Expand Down Expand Up @@ -727,6 +735,8 @@
"editor": {
"defaultClient": "指定下载服务器(如不选择则以基本设置的默认下载服务器为准)",
"name": "站点名称",
"siteGroup": "站点分组",
"siteGroupTip": "分组输入完成后按回车添加,可添加多个",
"tags": "站点标签",
"inputTags": "标签输入完成后按回车添加,可添加多个",
"schema": "网站架构",
Expand Down
2 changes: 2 additions & 0 deletions src/interface/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ export interface Site {
// 启用默认快捷链接
enableDefaultQuickLink?: boolean;
userQuickLinks?: UserQuickLink[];
// 使用站点标签进行分组
// siteGroups?: string[];
}

/**
Expand Down
14 changes: 14 additions & 0 deletions src/interface/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,3 +446,17 @@ export enum ERestoreError {
needSecretKey = "needSecretKey",
errorSecretKey = "errorSecretKey"
}

export enum ETagType {
all = "__all__",
unTagged = "__unTagged__",
unReadMsg = "__unReadMsg__",
statusError = "__statusError__",
}

export enum EOpenType {
openAllSites = "openAllSites",
openAllUnReadMsg = "openAllUnReadMsg",
openAllStatusErr = "openAllStatusErr",
}

Loading

0 comments on commit 8f212a9

Please sign in to comment.