Skip to content

Commit

Permalink
Merge pull request #8 from spikeninja/dev
Browse files Browse the repository at this point in the history
feat: version 1.1.2
  • Loading branch information
spikeninja authored Dec 8, 2024
2 parents c884c08 + 08fa5bc commit 308a3aa
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class TaskiqAdminMiddleware(TaskiqMiddleware):
return super().post_execute(message, result)
```

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

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

4) Go to `http://localhost:3000/tasks`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nuxt-app",
"private": true,
"type": "module",
"version": "1.1.1",
"version": "1.1.2",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
Expand Down
42 changes: 27 additions & 15 deletions src/pages/tasks/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ if (!route.query.page) {
const perPage = 10
const searchRef = ref("")
const search = computed(() => route.query.search || "")
const page = computed(() => Number(route.query.page) || 1)
const search = computed(() => Number(route.query.search) || "")
const { data } = useAsyncData(
"tasks",
Expand All @@ -38,6 +38,18 @@ function limitText(text: string, length: number) {
return text
}
function searchSubmit() {
if (searchRef.value) {
router.push({
path: "/tasks",
query: {
page: 1,
search: searchRef.value,
},
})
}
}
function handleNext() {
if (page.value < totalPages.value) {
router.push({
Expand Down Expand Up @@ -71,22 +83,22 @@ function handlePrev() {
<NuxtLink to="/api/tasks/backup" target="_blank"> Backup </NuxtLink>
</button>
</div>
<form method="get" action="">
<div class="row mb-3">
<div class="col">
<div class="d-flex justify-content-end">
<input
type="search"
name="search"
class="form-control w-auto"
placeholder="Search tasks..."
v-model="searchRef"
/>
<button type="submit" class="btn btn-primary ml-2">Search</button>
</div>
<div class="row mb-3">
<div class="col">
<div class="d-flex justify-content-end">
<input
type="search"
name="search"
class="form-control w-auto"
placeholder="Search tasks..."
v-model="searchRef"
/>
<button @click="searchSubmit" class="btn btn-primary ml-2">
Search
</button>
</div>
</div>
</form>
</div>
</div>

<div class="table-responsive">
Expand Down
4 changes: 2 additions & 2 deletions src/server/repositories/tasks.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { db } from "../db"
import { tasksTable } from "../db/schema"
import { count, eq, desc, ilike } from "drizzle-orm"
import { takeUniqueOrThrow } from "../utils"
import { count, eq, desc, like } from "drizzle-orm"

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

class TasksRepository {
async getAll(name: string | null, limit: number, offset: number) {
const whereCondition = name
? ilike(tasksTable.name, `%${name}%`)
? like(tasksTable.name, `%${name.toLowerCase()}%`)
: undefined

const countResult = await db
Expand Down

0 comments on commit 308a3aa

Please sign in to comment.