Author SHA1 Message Date
klemek 478091b0ba chore: 1.0.3
Python Lint CI / ruff (push) Successful in 3m12s
Python Lint CI / ty (push) Successful in 8m28s
Python Lint CI / ruff-format-check (push) Successful in 8m46s
TS Lint / ESLint (push) Successful in 7m22s
TS Lint / Oxlint (push) Failing after 2m3s
TS Lint / TypeScript (push) Successful in 2m8s
Docker Build / build (push) Successful in 11m59s
2026-07-14 18:17:58 +02:00
klemek 08b3b06089 feat: better task item name input
Docker Build / build (push) Has been cancelled
TS Lint / ESLint (push) Has been cancelled
TS Lint / Oxlint (push) Has been cancelled
TS Lint / TypeScript (push) Has been cancelled
2026-07-14 18:17:50 +02:00
klemek 1c7d38fc15 chore: 1.0.2
Python Lint CI / ruff-format-check (push) Successful in 5m3s
Python Lint CI / ruff (push) Successful in 5m4s
Python Lint CI / ty (push) Successful in 4m29s
Docker Build / build (push) Successful in 9m50s
TS Lint / ESLint (push) Successful in 6m54s
TS Lint / Oxlint (push) Successful in 6m57s
TS Lint / TypeScript (push) Successful in 6m43s
2026-07-14 17:44:58 +02:00
klemek 350da88802 fix: max limit on list name
Docker Build / build (push) Has been cancelled
Python Lint CI / ruff (push) Has been cancelled
Python Lint CI / ruff-format-check (push) Has been cancelled
Python Lint CI / ty (push) Has been cancelled
TS Lint / ESLint (push) Has been cancelled
TS Lint / Oxlint (push) Has been cancelled
TS Lint / TypeScript (push) Has been cancelled
2026-07-14 17:44:52 +02:00
klemek 29cdf7bb7e fix: remove uselesse EXPOSE 2026-07-14 17:37:22 +02:00
9 changed files with 75 additions and 30 deletions
-1
View File
@@ -25,7 +25,6 @@ RUN uv pip install . --system
ENV APP_ENV=production ENV APP_ENV=production
ENV PORT=5000 ENV PORT=5000
EXPOSE ${PORT}
ENV BIND=0.0.0.0 ENV BIND=0.0.0.0
COPY --from=front-end /app/dist ./dist COPY --from=front-end /app/dist ./dist
+21
View File
@@ -0,0 +1,21 @@
from tortoise import migrations
from tortoise.migrations import operations as ops
from tortoise import fields
class Migration(migrations.Migration):
dependencies = [('models', '0001_initial')]
initial = False
operations = [
ops.AlterField(
model_name='Task',
name='list_name',
field=fields.CharField(db_index=True, max_length=128),
),
ops.AlterField(
model_name='Task',
name='reset_cron',
field=fields.CharField(null=True, max_length=64),
),
]
+1 -1
View File
@@ -10,7 +10,7 @@ CRONTAB_REGEX = r"^(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@eve
class Task(AbstractModel): class Task(AbstractModel):
list_name = tortoise.fields.CharField(max_length=32, db_index=True, null=False) list_name = tortoise.fields.CharField(max_length=128, db_index=True, null=False)
name = tortoise.fields.TextField(null=False) name = tortoise.fields.TextField(null=False)
reset_cron = tortoise.fields.CharField( reset_cron = tortoise.fields.CharField(
max_length=64, max_length=64,
+2 -2
View File
@@ -58,13 +58,13 @@ class Server(gunicorn.app.base.BaseApplication):
@self.app.route("/api/lists/<list_name>/tasks", methods=["GET"]) @self.app.route("/api/lists/<list_name>/tasks", methods=["GET"])
async def get_tasks(list_name: str) -> list: async def get_tasks(list_name: str) -> list:
return await Task.filter(list_name=list_name).values() return await Task.filter(list_name=list_name[:128]).values()
@self.app.route("/api/lists/<list_name>/tasks", methods=["POST"]) @self.app.route("/api/lists/<list_name>/tasks", methods=["POST"])
async def post_task(list_name: str) -> typing.Any: async def post_task(list_name: str) -> typing.Any:
data = flask.request.get_json() data = flask.request.get_json()
logging.getLogger(self.__class__.__name__).info("%s", data) logging.getLogger(self.__class__.__name__).info("%s", data)
data["list_name"] = list_name data["list_name"] = list_name[:128]
parsed_data = Task.validate_create(data) parsed_data = Task.validate_create(data)
if parsed_data is None: if parsed_data is None:
flask.abort(400) flask.abort(400)
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "tout-doux", "name": "tout-doux",
"version": "1.0.1", "version": "1.0.3",
"private": true, "private": true,
"type": "module", "type": "module",
"engines": { "engines": {
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "tout-doux" name = "tout-doux"
version = "1.0.1" version = "1.0.3"
description = "" description = ""
requires-python = ">=3.14" requires-python = ">=3.14"
dependencies = [ dependencies = [
+32 -7
View File
@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { onBeforeMount, ref, watch, computed, defineAsyncComponent } from "vue"; import { onBeforeMount, ref, watch, computed, defineAsyncComponent, nextTick } from "vue";
import type { Task } from "@/types"; import type { Task } from "@/types";
import { CopyIcon, TrashIcon, SaveIcon, XIcon } from "@lucide/vue"; import { CopyIcon, TrashIcon, SaveIcon, XIcon } from "@lucide/vue";
import { updateTask } from "@/api/tasks"; import { updateTask } from "@/api/tasks";
@@ -11,7 +11,8 @@ import { relativeTime } from "@/lib/dates";
import { useAlertStore } from "@/stores/alerts"; import { useAlertStore } from "@/stores/alerts";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
const emit = defineEmits<(e: "clone" | "delete" | "updated", task: Task) => void>(); const emit =
defineEmits<(e: "clone" | "delete" | "updated", task: Task) => void>();
const task = defineModel<Task>({ required: true }); const task = defineModel<Task>({ required: true });
defineProps<{ showLastChecked: boolean; showNextReset: boolean }>(); defineProps<{ showLastChecked: boolean; showNextReset: boolean }>();
@@ -20,6 +21,7 @@ const editMode = ref<boolean>(false);
const editName = ref<string>(""); const editName = ref<string>("");
const editCron = ref<string | null>(null); const editCron = ref<string | null>(null);
const refreshKey = ref<number>(0); const refreshKey = ref<number>(0);
const editNameInput = ref<HTMLInputElement | null>(null);
const checked = computed<boolean>(() => taskCompleted(task.value)); const checked = computed<boolean>(() => taskCompleted(task.value));
const nextReset = computed<Date | null>(() => taskNextReset(task.value)); const nextReset = computed<Date | null>(() => taskNextReset(task.value));
@@ -28,13 +30,22 @@ const i18n = useI18n();
const { alertSuccess, alertError } = useAlertStore(); const { alertSuccess, alertError } = useAlertStore();
async function onOpen() {
editMode.value = true;
await nextTick();
editNameInput.value?.focus();
}
function onClose() { function onClose() {
editName.value = task.value.name;
editCron.value = task.value.reset_cron;
editMode.value = false; editMode.value = false;
} }
function onSave() { function onSave() {
if (editName.value.trim()) {
updateTask(task.value.id, { updateTask(task.value.id, {
name: editName.value, name: editName.value.trim(),
reset_cron: editCron.value, reset_cron: editCron.value,
}) })
.then((newTask) => { .then((newTask) => {
@@ -48,6 +59,7 @@ function onSave() {
task.value.name = editName.value; task.value.name = editName.value;
task.value.reset_cron = editCron.value; task.value.reset_cron = editCron.value;
editMode.value = false; editMode.value = false;
}
} }
function onCheck() { function onCheck() {
@@ -117,7 +129,7 @@ watch(task, () => {
</div> </div>
<div <div
class="cursor-pointer text-lg select-none" class="cursor-pointer text-lg select-none"
@click.prevent="editMode = true" @click.prevent="onOpen"
> >
<div>{{ task.name }}</div> <div>{{ task.name }}</div>
<div <div
@@ -131,7 +143,8 @@ watch(task, () => {
v-if="showNextReset && checked && nextReset" v-if="showNextReset && checked && nextReset"
class="font-light text-xs italic" class="font-light text-xs italic"
> >
{{ $t("resets") }} {{ relativeTime(nextReset, $i18n.locale) }} {{ $t("resets") }}
{{ relativeTime(nextReset, $i18n.locale) }}
</div> </div>
</div> </div>
</template> </template>
@@ -141,7 +154,13 @@ watch(task, () => {
<button class="btn btn-square me-1" @click="onClose"> <button class="btn btn-square me-1" @click="onClose">
<x-icon /> <x-icon />
</button> </button>
<button class="btn btn-square me-1" @click="onSave"> <button
class="btn btn-square me-1"
:class="
editName.trim().length === 0 ? 'btn-disabled' : ''
"
@click="onSave"
>
<save-icon /> <save-icon />
</button> </button>
<button class="btn btn-square me-1" @click="onClone"> <button class="btn btn-square me-1" @click="onClone">
@@ -151,7 +170,13 @@ watch(task, () => {
<trash-icon /> <trash-icon />
</button> </button>
</div> </div>
<input v-model="editName" type="text" class="input w-full" /> <input
ref="editNameInput"
v-model="editName"
type="text"
class="input w-full"
@keyup.enter="onSave"
/>
<cron-input v-model="editCron" :edit-mode="editMode" /> <cron-input v-model="editCron" :edit-mode="editMode" />
</div> </div>
</template> </template>
+2 -2
View File
@@ -150,12 +150,12 @@ function updateTitle() {
} }
onBeforeMount(() => { onBeforeMount(() => {
list.value = route.params.list as string; list.value = (route.params.list as string).slice(0, 128);
fetchTasks(); fetchTasks();
}); });
onBeforeRouteUpdate((to) => { onBeforeRouteUpdate((to) => {
list.value = to.params.list as string; list.value = (to.params.list as string).slice(0, 128);
fetchTasks(); fetchTasks();
}); });
</script> </script>
Generated
+1 -1
View File
@@ -323,7 +323,7 @@ asyncpg = [
[[package]] [[package]]
name = "tout-doux" name = "tout-doux"
version = "1.0.1" version = "1.0.3"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "flask", extra = ["async"] }, { name = "flask", extra = ["async"] },