mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
fix: create config file with an incorrect path #521
This commit is contained in:
parent
c2e395463b
commit
e93455a302
3 changed files with 56 additions and 28 deletions
|
@ -35,7 +35,7 @@ provide('breadList', breadList)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ALayout class="min-h-screen">
|
<ALayout class="full-screen-wrapper min-h-screen">
|
||||||
<div class="drawer-sidebar">
|
<div class="drawer-sidebar">
|
||||||
<ADrawer
|
<ADrawer
|
||||||
v-model:open="drawer_visible"
|
v-model:open="drawer_visible"
|
||||||
|
@ -192,4 +192,16 @@ body {
|
||||||
.ant-layout-footer {
|
.ant-layout-footer {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (orientation: landscape) {
|
||||||
|
.full-screen-wrapper {
|
||||||
|
padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (orientation: portrait) {
|
||||||
|
.full-screen-wrapper {
|
||||||
|
padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
import { message } from 'ant-design-vue'
|
import { message } from 'ant-design-vue'
|
||||||
import type { Ref } from 'vue'
|
import type { Ref } from 'vue'
|
||||||
import { InfoCircleOutlined } from '@ant-design/icons-vue'
|
import { InfoCircleOutlined } from '@ant-design/icons-vue'
|
||||||
|
import _ from 'lodash'
|
||||||
import { formatDateTime } from '@/lib/helper'
|
import { formatDateTime } from '@/lib/helper'
|
||||||
import FooterToolBar from '@/components/FooterToolbar/FooterToolBar.vue'
|
import FooterToolBar from '@/components/FooterToolbar/FooterToolBar.vue'
|
||||||
import type { Config } from '@/api/config'
|
import type { Config } from '@/api/config'
|
||||||
|
@ -26,7 +27,7 @@ const errors = ref({})
|
||||||
|
|
||||||
const basePath = computed(() => {
|
const basePath = computed(() => {
|
||||||
if (route.query.basePath)
|
if (route.query.basePath)
|
||||||
return route?.query?.basePath?.toString().replaceAll('/', '')
|
return _.trim(route?.query?.basePath?.toString(), '/')
|
||||||
else if (typeof route.params.name === 'object')
|
else if (typeof route.params.name === 'object')
|
||||||
return (route.params.name as string[]).slice(0, -1).join('/')
|
return (route.params.name as string[]).slice(0, -1).join('/')
|
||||||
else
|
else
|
||||||
|
@ -64,18 +65,25 @@ async function init() {
|
||||||
historyChatgptRecord.value = r.chatgpt_messages
|
historyChatgptRecord.value = r.chatgpt_messages
|
||||||
modifiedAt.value = r.modified_at
|
modifiedAt.value = r.modified_at
|
||||||
|
|
||||||
const path = data.value.filepath
|
const filteredPath = _.trimEnd(data.value.filepath
|
||||||
.replaceAll(`${nginxConfigBase.value}/`, '')
|
.replaceAll(`${nginxConfigBase.value}/`, ''), data.value.name)
|
||||||
.replaceAll(data.value.name, '')
|
|
||||||
.split('/')
|
.split('/')
|
||||||
.filter(v => v)
|
.filter(v => v)
|
||||||
.map(v => {
|
|
||||||
|
const path = filteredPath.map((v, k) => {
|
||||||
|
let dir = v
|
||||||
|
|
||||||
|
if (k > 0) {
|
||||||
|
dir = filteredPath.slice(0, k).join('/')
|
||||||
|
dir += `/${v}`
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: 'Manage Configs',
|
name: 'Manage Configs',
|
||||||
translatedName: () => v,
|
translatedName: () => v,
|
||||||
path: '/config',
|
path: '/config',
|
||||||
query: {
|
query: {
|
||||||
dir: v,
|
dir,
|
||||||
},
|
},
|
||||||
hasChildren: false,
|
hasChildren: false,
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,16 +37,24 @@ const refInspectConfig = ref()
|
||||||
const breadcrumbs = useBreadcrumbs()
|
const breadcrumbs = useBreadcrumbs()
|
||||||
|
|
||||||
function updateBreadcrumbs() {
|
function updateBreadcrumbs() {
|
||||||
const path = basePath.value
|
const filteredPath = basePath.value
|
||||||
.split('/')
|
.split('/')
|
||||||
.filter(v => v)
|
.filter(v => v)
|
||||||
.map(v => {
|
|
||||||
|
const path = filteredPath.map((v, k) => {
|
||||||
|
let dir = v
|
||||||
|
|
||||||
|
if (k > 0) {
|
||||||
|
dir = filteredPath.slice(0, k).join('/')
|
||||||
|
dir += `/${v}`
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: 'Manage Configs',
|
name: 'Manage Configs',
|
||||||
translatedName: () => v,
|
translatedName: () => v,
|
||||||
path: '/config',
|
path: '/config',
|
||||||
query: {
|
query: {
|
||||||
dir: v,
|
dir,
|
||||||
},
|
},
|
||||||
hasChildren: false,
|
hasChildren: false,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue