mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-22 01:15:25 +03:00
fix: normalize server name
This commit is contained in:
parent
fdf2d75d86
commit
32f22f81d9
4 changed files with 6 additions and 4 deletions
|
@ -110,7 +110,7 @@ onMounted(async () => {
|
||||||
<div
|
<div
|
||||||
absolute left-6em right-0 top="100%"
|
absolute left-6em right-0 top="100%"
|
||||||
bg-base rounded border="~ base"
|
bg-base rounded border="~ base"
|
||||||
text-left
|
text-left z-10 shadow
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-for="server, idx in filteredServers"
|
v-for="server, idx in filteredServers"
|
||||||
|
|
|
@ -3,7 +3,8 @@ import { createError, defineEventHandler, getRouterParams } from 'h3'
|
||||||
import { getApp, getRedirectURI } from '~/server/shared'
|
import { getApp, getRedirectURI } from '~/server/shared'
|
||||||
|
|
||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
const { server } = getRouterParams(event)
|
let { server } = getRouterParams(event)
|
||||||
|
server = server.toLocaleLowerCase().trim()
|
||||||
const app = await getApp(server)
|
const app = await getApp(server)
|
||||||
|
|
||||||
if (!app) {
|
if (!app) {
|
||||||
|
|
|
@ -3,7 +3,8 @@ import { createError, defineEventHandler, getQuery, getRouterParams, sendRedirec
|
||||||
import { getApp, getRedirectURI } from '~/server/shared'
|
import { getApp, getRedirectURI } from '~/server/shared'
|
||||||
|
|
||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
const { server } = getRouterParams(event)
|
let { server } = getRouterParams(event)
|
||||||
|
server = server.toLocaleLowerCase().trim()
|
||||||
const app = await getApp(server)
|
const app = await getApp(server)
|
||||||
|
|
||||||
if (!app) {
|
if (!app) {
|
||||||
|
|
|
@ -73,7 +73,7 @@ export async function listServers() {
|
||||||
continue
|
continue
|
||||||
const id = key.split(':').pop()!.replace(/\.json$/, '')
|
const id = key.split(':').pop()!.replace(/\.json$/, '')
|
||||||
if (id)
|
if (id)
|
||||||
servers.add(id)
|
servers.add(id.toLocaleLowerCase())
|
||||||
}
|
}
|
||||||
return Array.from(servers).sort()
|
return Array.from(servers).sort()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue