Skip to content

Commit

Permalink
test timer
Browse files Browse the repository at this point in the history
  • Loading branch information
vuisme committed Jan 18, 2024
1 parent 7c1d305 commit 5755048
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 97 deletions.
8 changes: 8 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ExpandedNodes": [
"",
"\\src"
],
"SelectedNode": "\\package.json",
"PreviewInSolutionExplorer": false
}
Binary file not shown.
Binary file added .vs/escrcpy/v17/.wsuo
Binary file not shown.
Binary file added .vs/slnx.sqlite
Binary file not shown.
10 changes: 10 additions & 0 deletions .vs/tasks.vs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": "0.2.1",
"tasks": [
{
"taskLabel": "task-main",
"appliesTo": "src/main.js",
"type": "launch"
}
]
}
119 changes: 26 additions & 93 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"electron-store": "^8.1.0",
"electron-updater": "^6.1.4",
"element-plus": "^2.4.2",
"eslint": "^8.56.0",
"fix-path": "^4.0.0",
"fs-extra": "^11.1.1",
"hono": "^3.10.1",
Expand Down
21 changes: 17 additions & 4 deletions src/components/Device/components/ControlBar/Timer/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<div>
<div v-if="!countdownStarted">
Tính giờ
</div>
<div v-if="countdown > 0">
Time remaining: {{ formatTime(countdown) }}
Thời gian còn lại: {{ formatTime(countdown) }}
</div>
<el-button
type="primary"
Expand All @@ -18,14 +21,24 @@ export default {
return {
countdown: 0,
countdownTimer: null,
countdownStarted: false,
}
},
methods: {
toggleCountdown() {
if (!this.countdownStarted) {
this.countdownStarted = true;

Check failure on line 30 in src/components/Device/components/ControlBar/Timer/index.vue

View workflow job for this annotation

GitHub Actions / release (ubuntu-latest, arm64, amd64)

Extra semicolon

Check failure on line 30 in src/components/Device/components/ControlBar/Timer/index.vue

View workflow job for this annotation

GitHub Actions / release (ubuntu-latest, arm64, amd64)

Extra semicolon
this.startCountdown();

Check failure on line 31 in src/components/Device/components/ControlBar/Timer/index.vue

View workflow job for this annotation

GitHub Actions / release (ubuntu-latest, arm64, amd64)

Extra semicolon

Check failure on line 31 in src/components/Device/components/ControlBar/Timer/index.vue

View workflow job for this annotation

GitHub Actions / release (ubuntu-latest, arm64, amd64)

Extra semicolon
} else {

Check failure on line 32 in src/components/Device/components/ControlBar/Timer/index.vue

View workflow job for this annotation

GitHub Actions / release (ubuntu-latest, arm64, amd64)

Closing curly brace appears on the same line as the subsequent block

Check failure on line 32 in src/components/Device/components/ControlBar/Timer/index.vue

View workflow job for this annotation

GitHub Actions / release (ubuntu-latest, arm64, amd64)

Closing curly brace appears on the same line as the subsequent block
// Nếu bấm lại khi đang đếm, có thể xử lý tùy ý
}
},
startCountdown() {
this.countdown = 10 * 60
this.countdown = 10 * 60;

Check failure on line 37 in src/components/Device/components/ControlBar/Timer/index.vue

View workflow job for this annotation

GitHub Actions / release (ubuntu-latest, arm64, amd64)

Extra semicolon
this.countdownTimer = setTimeout(() => {
this.handleShell({ command: 'input keyevent 26' })
}, this.countdown * 1000)
this.handleShell({ command: 'input keyevent 26' });

Check failure on line 39 in src/components/Device/components/ControlBar/Timer/index.vue

View workflow job for this annotation

GitHub Actions / release (ubuntu-latest, arm64, amd64)

Extra semicolon
this.countdownStarted = false; // Đặt lại trạng thái khi đếm kết thúc

Check failure on line 40 in src/components/Device/components/ControlBar/Timer/index.vue

View workflow job for this annotation

GitHub Actions / release (ubuntu-latest, arm64, amd64)

Extra semicolon
}, this.countdown * 1000);

Check failure on line 41 in src/components/Device/components/ControlBar/Timer/index.vue

View workflow job for this annotation

GitHub Actions / release (ubuntu-latest, arm64, amd64)

Extra semicolon
},
handleShell(row) {
if (row.label === 'Start') {
Expand Down

0 comments on commit 5755048

Please sign in to comment.