Skip to content

Commit a836758

Browse files
committed
feat: add terminal icon for installed App
1 parent bd3c829 commit a836758

File tree

1 file changed

+32
-0
lines changed
  • frontend/src/views/app-store/installed

1 file changed

+32
-0
lines changed

frontend/src/views/app-store/installed/index.vue

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,25 @@
138138
</el-button>
139139
</el-tooltip>
140140
</span>
141+
<span class="ml-1">
142+
<el-tooltip
143+
v-if="mode !== 'upgrade'"
144+
effect="dark"
145+
:content="$t('menu.terminal')"
146+
placement="top"
147+
>
148+
<el-button
149+
type="primary"
150+
link
151+
@click="openTerminal(installed)"
152+
:disabled="installed.status !== 'Running'"
153+
>
154+
<el-icon>
155+
<SvgIcon iconName="p-terminal2" />
156+
</el-icon>
157+
</el-button>
158+
</el-tooltip>
159+
</span>
141160
<span class="ml-1" v-if="mode === 'installed'">
142161
<el-tooltip
143162
effect="dark"
@@ -392,6 +411,7 @@
392411
<PortJumpDialog ref="dialogPortJumpRef" />
393412
<AppIgnore ref="ignoreRef" @close="search" />
394413
<ComposeLogs ref="composeLogRef" />
414+
<TerminalDialog ref="dialogTerminalRef" />
395415
<TaskLog ref="taskLogRef" @close="search" />
396416
<Detail ref="detailRef" />
397417
<IgnoreApp ref="ignoreAppRef" @close="search" />
@@ -411,6 +431,7 @@ import AppParams from './detail/index.vue';
411431
import AppUpgrade from './upgrade/index.vue';
412432
import AppIgnore from './ignore/index.vue';
413433
import ComposeLogs from '@/components/log/compose/index.vue';
434+
import TerminalDialog from '@/views/container/container/terminal/index.vue';
414435
import { App } from '@/api/interface/app';
415436
import Status from '@/components/status/index.vue';
416437
import { getAge, jumpToPath, toLink } from '@/utils/util';
@@ -422,6 +443,7 @@ import Detail from '@/views/app-store/detail/index.vue';
422443
import IgnoreApp from '@/views/app-store/installed/ignore/create/index.vue';
423444
import { getAgentSettingByKey } from '@/api/modules/setting';
424445
import Tags from '@/views/app-store/components/tag.vue';
446+
import SvgIcon from '@/components/svg-icon/svg-icon.vue';
425447
426448
const data = ref<any>();
427449
const loading = ref(false);
@@ -449,6 +471,7 @@ const upgradeRef = ref();
449471
const ignoreRef = ref();
450472
const dialogPortJumpRef = ref();
451473
const composeLogRef = ref();
474+
const dialogTerminalRef = ref();
452475
const taskLogRef = ref();
453476
const searchReq = reactive({
454477
page: 1,
@@ -707,6 +730,10 @@ const openLog = (row: any) => {
707730
}
708731
};
709732
733+
const openTerminal = (row: any) => {
734+
dialogTerminalRef.value!.acceptParams({ containerID: row.container, container: row.container });
735+
};
736+
710737
const getConfig = async () => {
711738
try {
712739
const res = await getAgentSettingByKey('SystemIP');
@@ -785,4 +812,9 @@ onUnmounted(() => {
785812
margin-left: 0;
786813
}
787814
}
815+
.svg-icon {
816+
width: 100%;
817+
height: 100%;
818+
padding: 0;
819+
}
788820
</style>

0 commit comments

Comments
 (0)