Skip to content

Commit e6d15de

Browse files
authored
Merge pull request #4 from spikeninja/dev
feat: version 1.1.0
2 parents ec1424f + 3f169b7 commit e6d15de

File tree

8 files changed

+91
-33
lines changed

8 files changed

+91
-33
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024-2025 Artur Samvelian
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
## Broker-agnostic admin pangel for Taskiq
22

3+
Standalone admin panel with all data stored in SQLite database
4+
5+
6+
- [Broker-agnostic admin pangel for Taskiq](#broker-agnostic-admin-pangel-for-taskiq)
7+
- [Previews](#previews)
8+
- [Usage](#usage)
9+
- [Development](#development)
10+
11+
### Previews
312
Tasks Page | Task Details Page
413
:-------------------------:|:-------------------------:
514
![Alt text](./docs/images/preview1.png) | ![Alt text](./docs/images/preview2.png)
@@ -67,7 +76,7 @@ class TaskiqAdminMiddleware(TaskiqMiddleware):
6776
return super().post_execute(message, result)
6877
```
6978

70-
2) Pull the image from DockerHub: `docker pull artur10/taskiq-admin:1.0.0`
79+
2) Pull the image from DockerHub: `docker pull artur10/taskiq-admin:1.1.0`
7180

7281
3) Replace `ACCESS_TOKEN` with any secret enough string and run:
7382
```bash
@@ -76,7 +85,12 @@ docker run -d --rm \
7685
-v ./taskiq-admin-data/:/usr/database/ \
7786
-e TASKIQ_ADMIN_API_TOKEN=supersecret \
7887
--name taskiq-admin \
79-
artur10/taskiq-admin:1.0.0
88+
artur10/taskiq-admin:1.1.0
8089
```
8190

82-
4) Go to `http://localhost:3000/tasks`
91+
4) Go to `http://localhost:3000/tasks`
92+
93+
### Development
94+
1) Run `pnpm install` to install all dependencies
95+
2) Run `pnpm db:push` to create the sqlite database if needed
96+
3) Run `pnpm dev` to run the project

docs/images/preview1.png

-35.3 KB
Loading

docs/images/preview2.png

468 Bytes
Loading

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
"name": "nuxt-app",
33
"private": true,
44
"type": "module",
5-
"version": "1.0.2",
5+
"version": "1.1.0",
66
"scripts": {
77
"build": "nuxt build",
88
"dev": "nuxt dev",
99
"generate": "nuxt generate",
1010
"preview": "nuxt preview",
11-
"postinstall": "nuxt prepare"
11+
"postinstall": "nuxt prepare",
12+
"db:push": "drizzle-kit push"
1213
},
1314
"dependencies": {
1415
"better-sqlite3": "^11.6.0",

src/pages/tasks/index.vue

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,44 +39,55 @@ function limitText(text: string, length: number) {
3939
}
4040
4141
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+
}
4951
}
5052
5153
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+
}
5963
}
6064
</script>
6165

6266
<template>
6367
<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>
7687
</div>
7788
</div>
78-
</div>
79-
</form>
89+
</form>
90+
</div>
8091

8192
<div class="table-responsive">
8293
<table class="table table-striped table-hover">

src/server/api/tasks/backup.get.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
})

src/server/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export const envVariables = {
2+
dbFilePath: process.env.DB_FILE_PATH!,
23
taskiqAdminApiToken: process.env.TASKIQ_ADMIN_API_TOKEN!,
34
}

0 commit comments

Comments
 (0)