Skip to content

Commit 308a3aa

Browse files
authored
Merge pull request #8 from spikeninja/dev
feat: version 1.1.2
2 parents c884c08 + 08fa5bc commit 308a3aa

File tree

4 files changed

+32
-20
lines changed

4 files changed

+32
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class TaskiqAdminMiddleware(TaskiqMiddleware):
7676
return super().post_execute(message, result)
7777
```
7878

79-
2) Pull the image from DockerHub: `docker pull artur10/taskiq-admin:1.1.1`
79+
2) Pull the image from DockerHub: `docker pull artur10/taskiq-admin:1.1.2`
8080

8181
3) Replace `ACCESS_TOKEN` with any secret enough string and run:
8282
```bash
@@ -85,7 +85,7 @@ docker run -d --rm \
8585
-v ./taskiq-admin-data/:/usr/database/ \
8686
-e TASKIQ_ADMIN_API_TOKEN=supersecret \
8787
--name taskiq-admin \
88-
artur10/taskiq-admin:1.1.1
88+
artur10/taskiq-admin:1.1.2
8989
```
9090

9191
4) Go to `http://localhost:3000/tasks`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nuxt-app",
33
"private": true,
44
"type": "module",
5-
"version": "1.1.1",
5+
"version": "1.1.2",
66
"scripts": {
77
"build": "nuxt build",
88
"dev": "nuxt dev",

src/pages/tasks/index.vue

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ if (!route.query.page) {
1111
const perPage = 10
1212
const searchRef = ref("")
1313
14+
const search = computed(() => route.query.search || "")
1415
const page = computed(() => Number(route.query.page) || 1)
15-
const search = computed(() => Number(route.query.search) || "")
1616
1717
const { data } = useAsyncData(
1818
"tasks",
@@ -38,6 +38,18 @@ function limitText(text: string, length: number) {
3838
return text
3939
}
4040
41+
function searchSubmit() {
42+
if (searchRef.value) {
43+
router.push({
44+
path: "/tasks",
45+
query: {
46+
page: 1,
47+
search: searchRef.value,
48+
},
49+
})
50+
}
51+
}
52+
4153
function handleNext() {
4254
if (page.value < totalPages.value) {
4355
router.push({
@@ -71,22 +83,22 @@ function handlePrev() {
7183
<NuxtLink to="/api/tasks/backup" target="_blank"> Backup </NuxtLink>
7284
</button>
7385
</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>
86+
<div class="row mb-3">
87+
<div class="col">
88+
<div class="d-flex justify-content-end">
89+
<input
90+
type="search"
91+
name="search"
92+
class="form-control w-auto"
93+
placeholder="Search tasks..."
94+
v-model="searchRef"
95+
/>
96+
<button @click="searchSubmit" class="btn btn-primary ml-2">
97+
Search
98+
</button>
8799
</div>
88100
</div>
89-
</form>
101+
</div>
90102
</div>
91103

92104
<div class="table-responsive">

src/server/repositories/tasks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { db } from "../db"
22
import { tasksTable } from "../db/schema"
3-
import { count, eq, desc, ilike } from "drizzle-orm"
43
import { takeUniqueOrThrow } from "../utils"
4+
import { count, eq, desc, like } from "drizzle-orm"
55

66
export type TaskState = "pending" | "success" | "failed"
77

88
class TasksRepository {
99
async getAll(name: string | null, limit: number, offset: number) {
1010
const whereCondition = name
11-
? ilike(tasksTable.name, `%${name}%`)
11+
? like(tasksTable.name, `%${name.toLowerCase()}%`)
1212
: undefined
1313

1414
const countResult = await db

0 commit comments

Comments
 (0)