diff --git a/frontend/src/routers/index.ts b/frontend/src/routers/index.ts index 6fe149b76..365551266 100644 --- a/frontend/src/routers/index.ts +++ b/frontend/src/routers/index.ts @@ -73,8 +73,6 @@ router.afterEach((to) => { localStorage.setItem('cachedRoute' + to.meta.activeMenu, '/cronjobs/cronjob'); } else if (to.meta.activeMenu === '/containers' && to.path === '/containers/container/operate') { localStorage.setItem('cachedRoute' + to.meta.activeMenu, '/containers/container'); - } else if (to.meta.activeMenu === '/containers' && to.path === '/containers/compose/detail') { - localStorage.setItem('cachedRoute' + to.meta.activeMenu, '/containers/compose'); } else if (to.meta.activeMenu === '/toolbox' && to.path === '/toolbox/clam/setting') { localStorage.setItem('cachedRoute' + to.meta.activeMenu, '/toolbox/clam'); } else { diff --git a/frontend/src/routers/modules/container.ts b/frontend/src/routers/modules/container.ts index c66b6af6e..7cdc31eeb 100644 --- a/frontend/src/routers/modules/container.ts +++ b/frontend/src/routers/modules/container.ts @@ -56,18 +56,6 @@ const containerRouter = { ignoreTab: true, }, }, - { - path: 'compose/detail', - name: 'ComposeDetail', - component: () => import('@/views/container/compose/detail/index.vue'), - props: true, - hidden: true, - meta: { - activeMenu: '/containers', - requiresAuth: false, - ignoreTab: true, - }, - }, { path: 'image', name: 'Image', diff --git a/frontend/src/views/app-store/installed/index.vue b/frontend/src/views/app-store/installed/index.vue index 4d21a1aaf..4bc1ba87c 100644 --- a/frontend/src/views/app-store/installed/index.vue +++ b/frontend/src/views/app-store/installed/index.vue @@ -154,18 +154,13 @@ @@ -709,6 +704,10 @@ const buttons = [ }, ]; +const toContainer = async (row: App.AppInstalled) => { + routerToNameWithQuery('ContainerItem', { filters: 'com.docker.compose.project=' + row.name, uncached: true }); +}; + const openBackups = (key: string, name: string, status: string) => { let params = { type: 'app', diff --git a/frontend/src/views/container/compose/detail/index.vue b/frontend/src/views/container/compose/detail/index.vue deleted file mode 100644 index 5639e9664..000000000 --- a/frontend/src/views/container/compose/detail/index.vue +++ /dev/null @@ -1,304 +0,0 @@ - - - - - diff --git a/frontend/src/views/container/compose/index.vue b/frontend/src/views/container/compose/index.vue index 2eb71a6e1..bb2479d5b 100644 --- a/frontend/src/views/container/compose/index.vue +++ b/frontend/src/views/container/compose/index.vue @@ -61,19 +61,27 @@ {{ $t('container.exited') }} - - {{ $t('container.running', [row.runningCount, row.containerCount]) }} - + + +
+ {{ item.name }} + +
+
+ @@ -93,12 +102,13 @@ import { reactive, ref } from 'vue'; import EditDialog from '@/views/container/compose/edit/index.vue'; import CreateDialog from '@/views/container/compose/create/index.vue'; import DeleteDialog from '@/views/container/compose/delete/index.vue'; +import ComposeLogs from '@/components/log/compose/index.vue'; import { composeOperator, inspect, searchCompose } from '@/api/modules/container'; import DockerStatus from '@/views/container/docker-status/index.vue'; import i18n from '@/lang'; import { Container } from '@/api/interface/container'; import { routerToFileWithPath, routerToNameWithQuery } from '@/utils/router'; -import { MsgInfo, MsgSuccess } from '@/utils/message'; +import { MsgSuccess } from '@/utils/message'; const data = ref(); const selects = ref([]); @@ -112,6 +122,8 @@ const paginationConfig = reactive({ }); const searchName = ref(); +const composeLogRef = ref(); + const isActive = ref(false); const isExist = ref(false); @@ -141,7 +153,7 @@ const search = async () => { }; const loadDetail = async (row: Container.ComposeInfo) => { - routerToNameWithQuery('ComposeDetail', { name: row.name }); + routerToNameWithQuery('ContainerItem', { filters: 'com.docker.compose.project=' + row.name }); }; const dialogRef = ref(); @@ -172,10 +184,6 @@ const onEdit = async (row: Container.ComposeInfo) => { }; const onComposeOperate = async (operation: string, row: any) => { - if (row.createdBy !== '1Panel' && row.createdBy !== 'App') { - MsgInfo(i18n.global.t('container.composeDetailHelper')); - return; - } let mes = operation === 'down' ? i18n.global.t('container.composeDownHelper', [row.name]) @@ -207,6 +215,14 @@ const onComposeOperate = async (operation: string, row: any) => { }); }; +const openLog = (row: any) => { + composeLogRef.value.acceptParams({ + compose: row.path, + resource: row.name, + container: row.container, + }); +}; + const buttons = [ { label: i18n.global.t('commons.button.edit'), @@ -217,6 +233,12 @@ const buttons = [ return row.createdBy === 'Local'; }, }, + { + label: i18n.global.t('commons.button.log'), + click: (row: Container.ComposeInfo) => { + openLog(row); + }, + }, { label: i18n.global.t('commons.operate.start'), click: (row: Container.ComposeInfo) => { diff --git a/frontend/src/views/container/container/index.vue b/frontend/src/views/container/container/index.vue index a1c2d9808..9a8583a28 100644 --- a/frontend/src/views/container/container/index.vue +++ b/frontend/src/views/container/container/index.vue @@ -376,6 +376,7 @@ import i18n from '@/lang'; import { MsgWarning } from '@/utils/message'; import { GlobalStore } from '@/store'; import { routerToName, routerToNameWithQuery } from '@/utils/router'; +import router from '@/routers'; const globalStore = GlobalStore(); const mobile = computed(() => { @@ -441,7 +442,7 @@ const search = async (column?: any) => { return; } localStorage.setItem('includeAppStore', includeAppStore.value ? 'true' : 'false'); - let filterItem = props.filters ? props.filters : ''; + let filterItem = (router.currentRoute.value.query?.filters as string) || ''; paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy; paginationConfig.order = column?.order ? column.order : paginationConfig.order; let params = { diff --git a/frontend/src/views/toolbox/clam/index.vue b/frontend/src/views/toolbox/clam/index.vue index 651541308..2fe117575 100644 --- a/frontend/src/views/toolbox/clam/index.vue +++ b/frontend/src/views/toolbox/clam/index.vue @@ -29,6 +29,8 @@ {{ $t('toolbox.clam.notStart') }}