From beb0e25ad93b7588d54667a34c1120b031d2d2d0 Mon Sep 17 00:00:00 2001 From: Last2014 Date: Sun, 24 May 2026 17:04:11 +0900 Subject: [PATCH] =?UTF-8?q?Chg:=20MikroORM=E3=81=AEinfo=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=82=92Logger=E3=81=A7=E3=82=82INFO=E3=81=A8=E3=81=97?= =?UTF-8?q?=E3=81=A6=E6=89=B1=E3=81=86=E3=82=88=E3=81=86=E3=81=AB=20/=20Ch?= =?UTF-8?q?g:=20MikroORM=E3=81=AEdiscovery=E3=83=AD=E3=82=B0=E3=82=92Logge?= =?UTF-8?q?r=E3=81=A7INFO=E3=81=A8=E3=81=97=E3=81=A6=E6=89=B1=E3=81=86?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=20/=20New:=20=E5=B7=A6=E5=81=B4?= =?UTF-8?q?=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=81=ABtitle=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E3=82=92=E8=BF=BD=E5=8A=A0=20/=20Del:=20=E6=9C=80?= =?UTF-8?q?=E4=B8=8A=E4=BD=8DRouterView=E3=81=AEkey=20/=20Fix:=20.route-ma?= =?UTF-8?q?in=E3=81=AEflex-direction=E3=81=8Ccolumn=E5=87=BA=E3=81=AA?= =?UTF-8?q?=E3=81=84=E5=95=8F=E9=A1=8C=20/=20Fix:=20.route-main=E3=81=AE?= =?UTF-8?q?=E9=AB=98=E3=81=95=E6=8C=87=E5=AE=9A=E3=81=8Cmin-height?= =?UTF-8?q?=E3=81=A7=E3=81=82=E3=82=8B=E5=95=8F=E9=A1=8C=20/=20Feat:=20?= =?UTF-8?q?=E3=82=B3=E3=83=9F=E3=83=A5=E3=83=8B=E3=83=86=E3=82=A3=E3=81=AE?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=A7=E3=83=81=E3=83=A3=E3=83=B3?= =?UTF-8?q?=E3=83=8D=E3=83=AB=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=20/=20Feat:=20=E3=83=81?= =?UTF-8?q?=E3=83=A3=E3=83=B3=E3=83=8D=E3=83=AB=E3=83=9A=E3=83=BC=E3=82=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/mikro-orm.config.ts | 14 +- packages/frontend/src/Layout.vue | 37 +++-- packages/frontend/src/lib/account.ts | 1 + packages/frontend/src/main.ts | 22 ++- .../frontend/src/routes/community/channel.vue | 113 ++++++++++++++++ .../src/routes/community/index.inner.vue | 2 + .../frontend/src/routes/community/index.vue | 126 +++++++++++++++++- 7 files changed, 300 insertions(+), 15 deletions(-) create mode 100644 packages/frontend/src/routes/community/channel.vue create mode 100644 packages/frontend/src/routes/community/index.inner.vue diff --git a/packages/backend/src/mikro-orm.config.ts b/packages/backend/src/mikro-orm.config.ts index fb6c0ec..a5a65e7 100644 --- a/packages/backend/src/mikro-orm.config.ts +++ b/packages/backend/src/mikro-orm.config.ts @@ -20,7 +20,19 @@ export default defineConfig({ metadataProvider: TsMorphMetadataProvider, debug: process.env.NODE_ENV !== "production", logger: (message) => { - logger.log(message); + const smartMsg = message.replace("[MikroORM] ", ""); + + switch (true) { + case smartMsg.startsWith("[info]"): + logger.info(message.replace("[info] ", "")); + break; + case smartMsg.startsWith("[discovery]"): + logger.info(message); + break; + default: + logger.log(message); + break; + } }, dbName: config.database.database, diff --git a/packages/frontend/src/Layout.vue b/packages/frontend/src/Layout.vue index b6148d9..a886fb8 100755 --- a/packages/frontend/src/Layout.vue +++ b/packages/frontend/src/Layout.vue @@ -14,6 +14,7 @@ :class='$route.path === "/" ? "isActive" : ""' + title="ホーム" > -
- +
+
@@ -151,10 +156,16 @@ main.layout { .route-main { display: flex; + flex-direction: column; padding: 1.25rem; padding-bottom: 0; overflow: scroll; - min-height: 100%; + height: 100%; +} + +.content-main .route-main.full-route { + padding: 0; + overflow: hidden; } .router-progress { @@ -190,14 +201,24 @@ import routerStatus, { title } from "@/lib/router"; import { Icon } from "@iconify/vue"; import Progress from "@/components/Progress.vue"; import { communitys, serverInfo } from "@/lib/account"; -import { onBeforeUnmount, onMounted, watch } from "vue"; +import { computed, onBeforeUnmount, onMounted, watch } from "vue"; import { createModal } from "@/lib/modal"; import ErrorModal from "@/components/Modal/Error.vue"; const router = useRouter(); const route = useRoute(); -watch(route, () => { +const isFullRoute = computed(() => route.meta.isFullRoute === true); + +watch(route, (to, from) => { + if ( + to.matched[0]?.path === from.matched[0]?.path && + from.meta.canReloadTitle === false + ) { + routerStatus.isLoad = false; + return false; + } + if (typeof route.meta.title === "string") title.value = route.meta.title; }); diff --git a/packages/frontend/src/lib/account.ts b/packages/frontend/src/lib/account.ts index 7e9d3f8..a04dc51 100644 --- a/packages/frontend/src/lib/account.ts +++ b/packages/frontend/src/lib/account.ts @@ -6,6 +6,7 @@ await initClient(); export let serverInfo = ref(await client.value.request("server-info")); export let account = ref(await client.value.request("me")); +export let presentCommunity = ref["communitys"][number]>(); let communitys = ref["communitys"]>([]); let lastLoadedCommunity = ref(); diff --git a/packages/frontend/src/main.ts b/packages/frontend/src/main.ts index 7a2e535..a9ea957 100755 --- a/packages/frontend/src/main.ts +++ b/packages/frontend/src/main.ts @@ -47,11 +47,23 @@ const router = createRouter({ component: () => import("@/routes/signin.vue"), }, { - path: "/community/:id", + path: "/community/:communityId", meta: { title: "コミュニティ", + isFullRoute: true, + canReloadTitle: false, }, component: () => import("@/routes/community/index.vue"), + children: [ + { + path: "", + component: () => import("@/routes/community/index.inner.vue"), + }, + { + path: ":channelId", + component: () => import("@/routes/community/channel.vue"), + }, + ], }, { path: "/:NotFound(.*)*", @@ -75,6 +87,14 @@ router.afterEach((to, from) => { return false; } + if ( + to.matched[0]?.path === from.matched[0]?.path && + from.meta.canReloadTitle === false + ) { + routerStatus.isLoad = false; + return false; + } + const title = to.meta.title; let serverName = "LynqChat"; diff --git a/packages/frontend/src/routes/community/channel.vue b/packages/frontend/src/routes/community/channel.vue new file mode 100644 index 0000000..f909a3c --- /dev/null +++ b/packages/frontend/src/routes/community/channel.vue @@ -0,0 +1,113 @@ + + + + + \ No newline at end of file diff --git a/packages/frontend/src/routes/community/index.inner.vue b/packages/frontend/src/routes/community/index.inner.vue new file mode 100644 index 0000000..ba53413 --- /dev/null +++ b/packages/frontend/src/routes/community/index.inner.vue @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/packages/frontend/src/routes/community/index.vue b/packages/frontend/src/routes/community/index.vue index d64750f..c39ae0d 100644 --- a/packages/frontend/src/routes/community/index.vue +++ b/packages/frontend/src/routes/community/index.vue @@ -1,32 +1,128 @@ \ No newline at end of file