File tree Expand file tree Collapse file tree 3 files changed +50
-28
lines changed Expand file tree Collapse file tree 3 files changed +50
-28
lines changed Original file line number Diff line number Diff line change @@ -39,44 +39,55 @@ function limitText(text: string, length: number) {
39
39
}
40
40
41
41
function handleNext() {
42
- router .push ({
43
- path: " /tasks" ,
44
- query: {
45
- page: page .value + 1 ,
46
- search: searchRef .value || undefined ,
47
- },
48
- })
42
+ if (page .value < totalPages .value ) {
43
+ router .push ({
44
+ path: " /tasks" ,
45
+ query: {
46
+ page: page .value + 1 ,
47
+ search: searchRef .value || undefined ,
48
+ },
49
+ })
50
+ }
49
51
}
50
52
51
53
function handlePrev() {
52
- router .push ({
53
- path: " /tasks" ,
54
- query: {
55
- page: page .value - 1 ,
56
- search: searchRef .value || undefined ,
57
- },
58
- })
54
+ if (page .value > 1 ) {
55
+ router .push ({
56
+ path: " /tasks" ,
57
+ query: {
58
+ page: page .value - 1 ,
59
+ search: searchRef .value || undefined ,
60
+ },
61
+ })
62
+ }
59
63
}
60
64
</script >
61
65
62
66
<template >
63
67
<div class =" container-fluid py-4" >
64
- <form method =" get" action =" " >
65
- <div class =" row mb-3" >
66
- <div class =" col" >
67
- <div class =" d-flex justify-content-end" >
68
- <input
69
- type =" search"
70
- name =" search"
71
- class =" form-control w-auto"
72
- placeholder =" Search tasks..."
73
- v-model =" searchRef"
74
- />
75
- <button type =" submit" class =" btn btn-primary ml-2" >Search</button >
68
+ <div class =" flex justify-between" >
69
+ <div >
70
+ <button class =" btn btn-outline-primary" >
71
+ <NuxtLink to =" /api/tasks/backup" target =" _blank" > Backup </NuxtLink >
72
+ </button >
73
+ </div >
74
+ <form method =" get" action =" " >
75
+ <div class =" row mb-3" >
76
+ <div class =" col" >
77
+ <div class =" d-flex justify-content-end" >
78
+ <input
79
+ type =" search"
80
+ name =" search"
81
+ class =" form-control w-auto"
82
+ placeholder =" Search tasks..."
83
+ v-model =" searchRef"
84
+ />
85
+ <button type =" submit" class =" btn btn-primary ml-2" >Search</button >
86
+ </div >
76
87
</div >
77
88
</div >
78
- </div >
79
- </form >
89
+ </form >
90
+ </div >
80
91
81
92
<div class =" table-responsive" >
82
93
<table class =" table table-striped table-hover" >
Original file line number Diff line number Diff line change
1
+ import fs from "fs"
2
+ import { envVariables } from "~/server/env"
3
+
4
+ export default defineEventHandler ( async ( event ) => {
5
+ const stream = fs . createReadStream ( envVariables . dbFilePath )
6
+ setHeader ( event , "Content-Type" , "application/octet-stream" )
7
+ setHeader ( event , "Content-Disposition" , 'attachment; filename="database.db"' )
8
+
9
+ return sendStream ( event , stream )
10
+ } )
Original file line number Diff line number Diff line change 1
1
export const envVariables = {
2
+ dbFilePath : process . env . DB_FILE_PATH ! ,
2
3
taskiqAdminApiToken : process . env . TASKIQ_ADMIN_API_TOKEN ! ,
3
4
}
You can’t perform that action at this time.
0 commit comments