Skip to content

Commit aa4d930

Browse files
author
sheepzh
committed
Deprecate archivement (#141)
1 parent 51df103 commit aa4d930

File tree

4 files changed

+5
-27
lines changed

4 files changed

+5
-27
lines changed

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

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77

88
import type { Ref, SetupContext } from "vue"
99

10-
import { Delete, DocumentAdd } from "@element-plus/icons-vue"
10+
import { Delete } from "@element-plus/icons-vue"
1111
import { defineComponent, h, ref } from "vue"
1212
import TimerDatabase from "@db/timer-database"
13-
import timerService from "@service/timer-service"
1413
import { t } from "@app/locale"
1514
import dateFilter from "./date-filter"
1615
import numberFilter from "./number-filter"
@@ -35,25 +34,6 @@ const filterRefs: BaseFilterProps = {
3534
timeStartRef, timeEndRef,
3635
}
3736

38-
const archiveButton = (onDateChanged: () => void) => operationButton({
39-
...filterRefs,
40-
onDateChanged,
41-
42-
confirm: {
43-
message: 'archiveConfirm',
44-
operation: result => timerService.archive(result),
45-
resultMessage: 'archiveSuccess'
46-
},
47-
48-
button: {
49-
message: 'archive',
50-
icon: DocumentAdd,
51-
type: 'primary'
52-
},
53-
54-
tooltipMessage: 'archiveAlert'
55-
})
56-
5737
const deleteButton = (onDateChanged: () => void) => operationButton({
5838
...filterRefs,
5939
onDateChanged,
@@ -74,9 +54,7 @@ const deleteButton = (onDateChanged: () => void) => operationButton({
7454
const _default = defineComponent((_props, ctx: SetupContext) => {
7555
const onDateChanged = ctx.attrs.onDateChanged as () => void
7656

77-
const buttons = () => [archiveButton(onDateChanged), deleteButton(onDateChanged)]
78-
79-
const footer = () => h('div', { class: 'footer-container filter-container' }, buttons())
57+
const footer = () => h('div', { class: 'footer-container filter-container' }, deleteButton(onDateChanged))
8058

8159
return () => h('div', { class: 'clear-panel' },
8260
[

src/database/archived-database.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { ARCHIVED_PREFIX } from "./common/constant"
1414
* Database of archived site
1515
*
1616
* @since 0.0.9
17+
* @deprecated 1.2.0
1718
*/
1819
class ArchivedDatabase extends BaseDatabase {
1920
async refresh(): Promise<{}> {

src/service/components/immigration.ts

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

88
import packageInfo from "@src/package"
9-
import ArchivedDatabase from "@db/archived-database"
109
import BaseDatabase from "@db/common/base-database"
1110
import StoragePromise from "@db/common/storage-promise"
1211
import IconUrlDatabase from "@db/icon-url-database"
@@ -31,11 +30,10 @@ function initDatabase(storage: chrome.storage.StorageArea): BaseDatabase[] {
3130
new TimerDatabase(storage),
3231
new IconUrlDatabase(storage),
3332
new PeriodDatabase(storage),
34-
new ArchivedDatabase(storage),
3533
new LimitDatabase(storage),
3634
new MergeRuleDatabase(storage),
3735
new WhitelistDatabase(storage),
38-
new HostAliasDatabase(storage)
36+
new HostAliasDatabase(storage),
3937
]
4038

4139
return result

src/service/timer-service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class TimerService {
132132
*
133133
* @param rows rows
134134
* @since 0.0.9
135+
* @deprecated 1.2.0
135136
*/
136137
async archive(rows: timer.stat.Row[]): Promise<void> {
137138
await archivedDatabase.updateArchived(rows)

0 commit comments

Comments
 (0)