router: "images" -> "user"
This commit is contained in:
parent
d7818ac93a
commit
60a451a426
6 changed files with 10 additions and 10 deletions
|
@ -1,8 +1,8 @@
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
|
|
||||||
from . import admin, images
|
from . import admin, user
|
||||||
|
|
||||||
router = APIRouter(prefix="/api")
|
router = APIRouter(prefix="/api")
|
||||||
|
|
||||||
router.include_router(admin.router)
|
router.include_router(admin.router)
|
||||||
router.include_router(images.router)
|
router.include_router(user.router)
|
||||||
|
|
|
@ -7,14 +7,14 @@ from ..core.depends import get_day_image
|
||||||
from ..core.helpers import api_return_image, load_image
|
from ..core.helpers import api_return_image, load_image
|
||||||
from ._security import user_can_view_day, user_is_admin
|
from ._security import user_can_view_day, user_is_admin
|
||||||
|
|
||||||
router = APIRouter(prefix="/images", tags=["images"])
|
router = APIRouter(prefix="/user", tags=["user"])
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/background",
|
"/background_image",
|
||||||
response_class=StreamingResponse,
|
response_class=StreamingResponse,
|
||||||
)
|
)
|
||||||
async def get_background(
|
async def get_background_image(
|
||||||
cal_cfg: CalendarConfig = Depends(get_calendar_config),
|
cal_cfg: CalendarConfig = Depends(get_calendar_config),
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
|
@ -25,7 +25,7 @@ async def get_background(
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/{day}",
|
"/image_{day}",
|
||||||
response_class=StreamingResponse,
|
response_class=StreamingResponse,
|
||||||
)
|
)
|
||||||
async def get_image_for_day(
|
async def get_image_for_day(
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
<figure>
|
<figure>
|
||||||
<div class="image is-unselectable">
|
<div class="image is-unselectable">
|
||||||
<img :src="$advent22.api_url('images/background')" />
|
<img :src="$advent22.api_url('user/background_image')" />
|
||||||
<ThouCanvas>
|
<ThouCanvas>
|
||||||
<CalendarDoor
|
<CalendarDoor
|
||||||
v-for="(door, index) in doors"
|
v-for="(door, index) in doors"
|
||||||
|
|
|
@ -25,7 +25,7 @@ export default class extends Vue {
|
||||||
this.$emit("doorClick");
|
this.$emit("doorClick");
|
||||||
|
|
||||||
this.$advent22
|
this.$advent22
|
||||||
.api_get_blob(`images/${this.door.day}`)
|
.api_get_blob(`user/image_${this.door.day}`)
|
||||||
.then((data) => this.$emit("doorSuccess", this.door.day, data))
|
.then((data) => this.$emit("doorSuccess", this.door.day, data))
|
||||||
.catch(([reason]) => {
|
.catch(([reason]) => {
|
||||||
let msg = "Unbekannter Fehler, bitte wiederholen!";
|
let msg = "Unbekannter Fehler, bitte wiederholen!";
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<figure class="image is-unselectable">
|
<figure class="image is-unselectable">
|
||||||
<img :src="$advent22.api_url('images/background')" />
|
<img :src="$advent22.api_url('user/background_image')" />
|
||||||
<ThouCanvas>
|
<ThouCanvas>
|
||||||
<PreviewDoor
|
<PreviewDoor
|
||||||
v-for="(_, index) in doors"
|
v-for="(_, index) in doors"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<figure class="image is-unselectable">
|
<figure class="image is-unselectable">
|
||||||
<img :src="$advent22.api_url('images/background')" />
|
<img :src="$advent22.api_url('user/background_image')" />
|
||||||
<RectangleCanvas
|
<RectangleCanvas
|
||||||
:rectangles="rectangles"
|
:rectangles="rectangles"
|
||||||
@draw="on_draw"
|
@draw="on_draw"
|
||||||
|
|
Loading…
Reference in a new issue