Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c7d38fc15 | ||
|
|
350da88802 | ||
|
|
29cdf7bb7e | ||
|
|
105a879948 | ||
|
|
1b972ad65b |
+1
-1
@@ -7,6 +7,7 @@ COPY *.json bun.lock ./
|
||||
RUN bun ci
|
||||
|
||||
COPY *.ts index.html ./
|
||||
COPY public ./public
|
||||
COPY resources ./resources
|
||||
|
||||
RUN bun run build
|
||||
@@ -24,7 +25,6 @@ RUN uv pip install . --system
|
||||
|
||||
ENV APP_ENV=production
|
||||
ENV PORT=5000
|
||||
EXPOSE ${PORT}
|
||||
ENV BIND=0.0.0.0
|
||||
|
||||
COPY --from=front-end /app/dist ./dist
|
||||
|
||||
@@ -155,7 +155,8 @@ docker-build: ## docker build
|
||||
|
||||
.PHONY: docker-run
|
||||
docker-run: ## docker run
|
||||
$(DOCKER) run -p $(PORT):5000 -v db.sqlite:/app/db.sqlite $(DOCKER_TAG)
|
||||
touch db.sqlite
|
||||
$(DOCKER) run -p $(PORT):5000 -v $(PWD)/db.sqlite:/app/db.sqlite $(DOCKER_TAG)
|
||||
|
||||
.PHONY: tortoise-%
|
||||
tortoise-%: .venv ## tortoise (command)
|
||||
|
||||
@@ -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
@@ -10,7 +10,7 @@ CRONTAB_REGEX = r"^(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@eve
|
||||
|
||||
|
||||
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)
|
||||
reset_cron = tortoise.fields.CharField(
|
||||
max_length=64,
|
||||
|
||||
+2
-2
@@ -58,13 +58,13 @@ class Server(gunicorn.app.base.BaseApplication):
|
||||
|
||||
@self.app.route("/api/lists/<list_name>/tasks", methods=["GET"])
|
||||
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"])
|
||||
async def post_task(list_name: str) -> typing.Any:
|
||||
data = flask.request.get_json()
|
||||
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)
|
||||
if parsed_data is None:
|
||||
flask.abort(400)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tout-doux",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.2",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"engines": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "tout-doux"
|
||||
version = "1.0.0"
|
||||
version = "1.0.2"
|
||||
description = ""
|
||||
requires-python = ">=3.14"
|
||||
dependencies = [
|
||||
|
||||
@@ -150,12 +150,12 @@ function updateTitle() {
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
list.value = route.params.list as string;
|
||||
list.value = (route.params.list as string).slice(0, 128);
|
||||
fetchTasks();
|
||||
});
|
||||
|
||||
onBeforeRouteUpdate((to) => {
|
||||
list.value = to.params.list as string;
|
||||
list.value = (to.params.list as string).slice(0, 128);
|
||||
fetchTasks();
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user