Skip to content

Commit 4ec8d1b

Browse files
committed
FEAT: manage site name (#34)
RECONSTRUCTURE: domain => host
1 parent cf58447 commit 4ec8d1b

File tree

93 files changed

+810
-551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+810
-551
lines changed

global.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @since 0.3.0
66
*/
77
declare namespace Timer {
8-
type SiteItem = 'total' | 'focus' | 'time'
8+
type DataDimension = 'total' | 'focus' | 'time'
99
/**
1010
* Options used for the popup page
1111
*/
@@ -17,9 +17,9 @@ declare namespace Timer {
1717
/**
1818
* The default to display
1919
*/
20-
defaultType: SiteItem
20+
defaultType: DataDimension
2121
/**
22-
* Replace the domain name with site name which is detected automatically from the title of site homepages,
22+
* Replace the host name with site name which is detected automatically from the title of site homepages,
2323
* or modified manually by the user
2424
*
2525
* @since 0.4.1

jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Config } from '@jest/types'
1+
import type { Config } from "@jest/types"
22

33
const config: Config.InitialOptions = {
44
roots: [

public/popup.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
</div>
2828
</div>
2929
</div>
30-
<!-- merge domain -->
30+
<!-- merge host -->
3131
<div
32-
id="merge-domain-switch"
32+
id="merge-host-switch"
3333
class="el-switch option-right"
3434
role="switch"
3535
style="margin-left: 10px"
@@ -169,7 +169,7 @@
169169
</div>
170170
<!-- Switch popup -->
171171
<div
172-
id="merge-domain-popup-container"
172+
id="merge-host-popup-container"
173173
class="el-popper is-dark"
174174
style="
175175
z-index: 2012;
@@ -180,7 +180,7 @@
180180
display: none;
181181
"
182182
>
183-
<a id="merge-domain-popup-info">
183+
<a id="merge-host-popup-info">
184184
<!-- 合并子域名 -->
185185
</a>
186186
<div

src/api/version.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* https://opensource.org/licenses/MIT
66
*/
77

8-
import axios, { AxiosResponse } from 'axios'
9-
import { IS_CHROME, IS_EDGE, IS_FIREFOX } from '../util/constant/environment'
8+
import axios, { AxiosResponse } from "axios"
9+
import { IS_CHROME, IS_EDGE, IS_FIREFOX } from "../util/constant/environment"
1010

1111
async function getFirefoxVersion(): Promise<string | null> {
1212
const response: AxiosResponse<any> = await axios.get('https://addons.mozilla.org/api/v3/addons/addon/2690100')

src/app/components/common/editable-tag.sass

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,12 @@
2424
margin-bottom: 9px
2525
line-height: 32px !important
2626

27-
.origin-domain-input
27+
.origin-host-input
2828
.el-input__inner
2929
border-bottom-right-radius: 0
3030
border-top-right-radius: 0
3131
border-right: 0
3232

33-
.merged-domain-input
34-
margin-right: 5px
35-
.el-input__inner
36-
border-bottom-left-radius: 0
37-
border-top-left-radius: 0
38-
3933
.el-alert
4034
margin-bottom: 20px
4135

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { ElPagination } from "element-plus"
99
import { h, UnwrapRef } from "vue"
10-
import { PaginationInfo, QueryData } from "../common/constants"
10+
import { PaginationInfo, QueryData } from "./constants"
1111

1212
export type PaginationProps = {
1313
queryData: QueryData

src/app/components/data-manage/clear/filter/operation-button.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { ElButton, ElMessage, ElMessageBox, ElTooltip } from "element-plus"
99
import { Ref, h } from "vue"
1010
import TimerDatabase, { TimerCondition } from "../../../../../database/timer-database"
11-
import SiteInfo from "../../../../../entity/dto/site-info"
11+
import DataItem from "../../../../../entity/dto/data-item"
1212
import { ItemMessage } from "../../../../../util/i18n/components/item"
1313
import { t } from "../../../../locale"
1414
import { DataManageMessage } from "../../../../locale/components/data-manage"
@@ -30,7 +30,7 @@ type _Props = BaseFilterProps & {
3030

3131
confirm: {
3232
message: keyof DataManageMessage
33-
operation: (result: SiteInfo[]) => Promise<any>
33+
operation: (result: DataItem[]) => Promise<any>
3434
resultMessage: keyof DataManageMessage
3535
}
3636

@@ -103,7 +103,7 @@ const generateParamAndSelect = (props: _Props) => {
103103
}
104104

105105
const handleClick = async (props: _Props) => {
106-
const result: SiteInfo[] = await generateParamAndSelect(props)
106+
const result: DataItem[] = await generateParamAndSelect(props)
107107

108108
const count = result.length
109109
ElMessageBox.confirm(t(msg => msg.dataManage[props.confirm.message], { count }))

src/app/components/data-manage/clear/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ElAlert, ElCard } from "element-plus"
99
import { h } from "vue"
1010
import { t } from "../../../locale"
1111
import { alertProps, bodyStyle } from "../common"
12-
import Filter from './filter'
12+
import Filter from "./filter"
1313

1414
type _Props = {
1515
queryData: () => Promise<void> | void

src/app/components/data-manage/memory-info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import { ElAlert, ElCard, ElProgress } from "element-plus"
9-
import { h, Ref } from 'vue'
9+
import { h, Ref } from "vue"
1010
import { t } from "../../locale"
1111
import { alertProps, bodyStyle } from "./common"
1212

src/app/components/habit/chart/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
* https://opensource.org/licenses/MIT
66
*/
77

8-
import { ElCard } from 'element-plus'
9-
import { h, Ref } from 'vue'
10-
import { contentContainerCardStyle } from '../../common/content-container'
8+
import { ElCard } from "element-plus"
9+
import { h, Ref } from "vue"
10+
import { contentContainerCardStyle } from "../../common/content-container"
1111

1212
export type ChartProps = {
1313
chartRef: Ref<HTMLDivElement>

0 commit comments

Comments
 (0)