Skip to content

Commit

Permalink
upd: 新增loading展示
Browse files Browse the repository at this point in the history
  • Loading branch information
mayinrain committed Dec 23, 2024
1 parent 817c450 commit aecbf02
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
:visualParams="visualParams"
/>
<ViewLog ref="logPanel" :inHistory="true" v-show="tabName === 'engineLog' && hasEngine" @back="showviewlog = false" />
<term ref="termRef" v-if="tabName === 'terminal'" :logs="termLogs" :script-view-state="scriptViewState" />
<term ref="termRef" v-if="tabName === 'terminal'" :logs="termLogs" :script-view-state="scriptViewState" :loading="termLogLoading" />
</div>
</template>
<script>
Expand Down Expand Up @@ -109,6 +109,7 @@ export default {
},
codes: { code: '' },
termLogs: '',
termLogLoading: false,
engineLogs: '',
fromLine: 1,
isAdminModel: false,
Expand Down Expand Up @@ -211,7 +212,9 @@ export default {
} else if(name === 'terminal') {
if (['Scheduled', 'Running'].includes(this.$route.query.status) || !this.termLogs) {
try {
this.termLogLoading = true;
const res = await api.fetch(`/jobhistory/diagnosis-query?taskID=${this.$route.query.taskID}`, 'get')
this.termLogLoading = false;
const { diagnosisMsg } = res;
this.termLogs = diagnosisMsg;
} catch (err) {
Expand Down
22 changes: 17 additions & 5 deletions linkis-web/src/components/consoleComponent/term.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@
~ limitations under the License.
-->
<template>
<div
ref="terminal"
class="terminal-container"
:style="{ height: terminalHeight + 'px' }"
></div>
<div>
<div
ref="terminal"
class="terminal-container"
:style="{ height: terminalHeight + 'px' }"
>
<Spin
v-show="loading"
size="large"
fix/>
</div>
</div>

</template>

<script>
Expand All @@ -39,6 +47,10 @@ export default {
default: () => {
return {};
},
},
loading: {
type: Boolean,
default: false
}
},

Expand Down

0 comments on commit aecbf02

Please sign in to comment.