Skip to content

Commit

Permalink
feat: update refresh mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bitxeno committed Jun 25, 2024
1 parent 8507538 commit 40ab7b7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/app/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var saveTimer *time.Timer = time.NewTimer(math.MaxInt64)

const (
OneDayAgoMode TaskMode = "1"
DailyMode TaskMode = "2"
CustomMode TaskMode = "2"
)

type TaskMode string
Expand Down
4 changes: 2 additions & 2 deletions internal/task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func (t *Task) checkNeedRefresh(v model.InstalledApp) bool {
}
}

// 每天安装
if app.Settings.Task.Mode == app.DailyMode {
// today has refreshed will ignore
if app.Settings.Task.Mode == app.CustomMode {
if v.RefreshedDate.Format("2006-01-02") != now.Format("2006-01-02") {
return true
}
Expand Down
4 changes: 2 additions & 2 deletions web/static/src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"notify_success": "Notification Sent Successfully"
},
"notification": {
"title": "Notifications",
"title": "Installation Failure Notification",
"toggle": {
"label": "Enable"
},
Expand All @@ -158,7 +158,7 @@
"mode": {
"label": "Refresh Mode",
"day_before_expired": "One day before expiration",
"daily": "Daily"
"custom": "Custom"
},
"run_time": {
"label": "Running Time Period",
Expand Down
4 changes: 2 additions & 2 deletions web/static/src/locales/zh_cn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"notify_success": "推送成功"
},
"notification": {
"title": "通知",
"title": "安装失败通知",
"toggle": {
"label": "启用"
},
Expand All @@ -158,7 +158,7 @@
"mode": {
"label": "刷新模式",
"day_before_expired": "过期前一天",
"daily": "每天"
"custom": "自定义"
},
"run_time": {
"label": "运行时间段",
Expand Down
2 changes: 1 addition & 1 deletion web/static/src/page/install/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default {
_this.log.output = "";
_this.log.show = true;
_this.log.output += "Checking afc service status...\n";
_this.log.output += "checking afc service status...\n";
let data = await api.checkAfcService(_this.id);
if (data != "success") {
_this.log.output += data;
Expand Down
2 changes: 1 addition & 1 deletion web/static/src/page/settings/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
value="2"
/>
<span class="label-text">{{
$t("settings.refresh.mode.daily")
$t("settings.refresh.mode.custom")
}}</span>
</label>
</div>
Expand Down

0 comments on commit 40ab7b7

Please sign in to comment.