diff --git a/frontend/src/components/codemirror-dialog/codemirror.vue b/frontend/src/components/codemirror-dialog/codemirror.vue index 3ecb55b60..ac9614d8b 100644 --- a/frontend/src/components/codemirror-dialog/codemirror.vue +++ b/frontend/src/components/codemirror-dialog/codemirror.vue @@ -11,7 +11,7 @@ placeholder="None data" :indent-with-tab="true" :tabSize="4" - style="max-height: 500px" + style="max-height: 500px; min-height: 200px; width: 100%" :lineWrapping="true" :matchBrackets="true" theme="cobalt" diff --git a/frontend/src/components/container-log/index.vue b/frontend/src/components/container-log/index.vue index 581512a5d..2d0fb001b 100644 --- a/frontend/src/components/container-log/index.vue +++ b/frontend/src/components/container-log/index.vue @@ -23,6 +23,7 @@ theme="cobalt" :styleActiveLine="true" :extensions="extensions" + @ready="handleReady" v-model="logInfo" :readOnly="true" /> @@ -33,7 +34,7 @@ import { logContainer } from '@/api/modules/container'; import i18n from '@/lang'; import { dateFromatForName } from '@/utils/util'; -import { reactive, ref } from 'vue'; +import { nextTick, reactive, ref, shallowRef } from 'vue'; import { Codemirror } from 'vue-codemirror'; import { javascript } from '@codemirror/lang-javascript'; import { oneDark } from '@codemirror/theme-one-dark'; @@ -41,6 +42,11 @@ import { oneDark } from '@codemirror/theme-one-dark'; const extensions = [javascript(), oneDark]; const logInfo = ref(); +const view = shallowRef(); +const handleReady = (payload) => { + view.value = payload.view; +}; + const logSearch = reactive({ isWatch: false, container: '', @@ -78,6 +84,13 @@ const onCloseLog = async () => { const searchLogs = async () => { const res = await logContainer(logSearch); logInfo.value = res.data; + nextTick(() => { + const state = view.value.state; + view.value.dispatch({ + selection: { anchor: state.doc.length, head: state.doc.length }, + scrollIntoView: true, + }); + }); }; const onDownload = async () => { diff --git a/frontend/src/views/container/compose/create/index.vue b/frontend/src/views/container/compose/create/index.vue index ffaf7e910..f5b7aa6d2 100644 --- a/frontend/src/views/container/compose/create/index.vue +++ b/frontend/src/views/container/compose/create/index.vue @@ -39,7 +39,7 @@ placeholder="None data" :indent-with-tab="true" :tabSize="4" - style="max-height: 500px; width: 100%" + style="max-height: 500px; width: 100%; min-height: 200px" :lineWrapping="true" :matchBrackets="true" theme="cobalt" diff --git a/frontend/src/views/container/compose/detail/index.vue b/frontend/src/views/container/compose/detail/index.vue index 7b421d78c..fdc2041ae 100644 --- a/frontend/src/views/container/compose/detail/index.vue +++ b/frontend/src/views/container/compose/detail/index.vue @@ -2,11 +2,13 @@
- {{ $t('container.start') }} - {{ $t('container.stop') }} - - {{ $t('container.remove') }} - + + {{ $t('container.start') }} + {{ $t('container.stop') }} + + {{ $t('container.remove') }} + +
diff --git a/frontend/src/views/container/compose/edit/index.vue b/frontend/src/views/container/compose/edit/index.vue index 216da6da1..e8a6a3379 100644 --- a/frontend/src/views/container/compose/edit/index.vue +++ b/frontend/src/views/container/compose/edit/index.vue @@ -7,12 +7,11 @@
{ - return row.createdBy !== 'Local'; + return row.createdBy !== '1Panel'; }, }, { @@ -179,7 +179,7 @@ const buttons = [ onDelete(row); }, disabled: (row: any) => { - return row.createdBy === 'Apps'; + return row.createdBy !== '1Panel'; }, }, ]; diff --git a/frontend/src/views/container/container/log/index.vue b/frontend/src/views/container/container/log/index.vue index 759afc840..2cc449459 100644 --- a/frontend/src/views/container/container/log/index.vue +++ b/frontend/src/views/container/container/log/index.vue @@ -35,6 +35,7 @@ :styleActiveLine="true" :extensions="extensions" v-model="logInfo" + @ready="handleReady" :readOnly="true" />