2022-08-17 17:46:49 +08:00
|
|
|
<template>
|
2022-10-08 18:32:02 +08:00
|
|
|
<div>
|
|
|
|
<el-card class="topCard">
|
2022-12-28 11:54:26 +08:00
|
|
|
<el-radio-group :model-value="props.activeName" @change="handleChange">
|
|
|
|
<el-radio-button class="topButton" size="large" label="container">
|
2022-10-08 18:32:02 +08:00
|
|
|
{{ $t('container.container') }}
|
|
|
|
</el-radio-button>
|
2022-12-28 11:54:26 +08:00
|
|
|
<el-radio-button class="topButton" size="large" label="compose">
|
2022-12-05 11:12:07 +08:00
|
|
|
{{ $t('container.compose') }}
|
|
|
|
</el-radio-button>
|
2022-12-28 11:54:26 +08:00
|
|
|
<el-radio-button class="topButton" size="large" label="image">
|
2022-10-08 18:32:02 +08:00
|
|
|
{{ $t('container.image') }}
|
|
|
|
</el-radio-button>
|
2022-12-28 11:54:26 +08:00
|
|
|
<el-radio-button class="topButton" size="large" label="network">
|
2022-10-08 18:32:02 +08:00
|
|
|
{{ $t('container.network') }}
|
|
|
|
</el-radio-button>
|
2022-12-28 11:54:26 +08:00
|
|
|
<el-radio-button class="topButton" size="large" label="volume">
|
2022-10-11 17:46:52 +08:00
|
|
|
{{ $t('container.volume') }}
|
2022-10-08 18:32:02 +08:00
|
|
|
</el-radio-button>
|
2022-12-28 11:54:26 +08:00
|
|
|
<el-radio-button class="topButton" size="large" label="repo">
|
2022-10-09 16:17:15 +08:00
|
|
|
{{ $t('container.repo') }}
|
|
|
|
</el-radio-button>
|
2022-12-28 11:54:26 +08:00
|
|
|
<el-radio-button class="topButton" size="large" label="template">
|
2022-10-17 09:10:06 +08:00
|
|
|
{{ $t('container.composeTemplate') }}
|
2022-10-08 18:32:02 +08:00
|
|
|
</el-radio-button>
|
2022-12-28 11:54:26 +08:00
|
|
|
<el-radio-button class="topButton" size="large" label="setting">
|
2022-11-14 19:19:42 +08:00
|
|
|
{{ $t('container.setting') }}
|
|
|
|
</el-radio-button>
|
2022-10-08 18:32:02 +08:00
|
|
|
</el-radio-group>
|
|
|
|
</el-card>
|
|
|
|
</div>
|
2022-08-17 17:46:49 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2022-10-17 16:04:39 +08:00
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
const router = useRouter();
|
2022-12-28 11:54:26 +08:00
|
|
|
|
2022-10-17 16:04:39 +08:00
|
|
|
interface MenuProps {
|
|
|
|
activeName: string;
|
|
|
|
}
|
|
|
|
const props = withDefaults(defineProps<MenuProps>(), {
|
|
|
|
activeName: 'container',
|
|
|
|
});
|
|
|
|
|
|
|
|
const routerTo = (path: string) => {
|
|
|
|
router.push({ path: path });
|
|
|
|
};
|
2022-12-28 11:54:26 +08:00
|
|
|
|
|
|
|
const handleChange = (val: string) => {
|
|
|
|
switch (val) {
|
|
|
|
case 'container':
|
|
|
|
routerTo('/containers');
|
|
|
|
break;
|
|
|
|
case 'compose':
|
|
|
|
routerTo('/containers/compose');
|
|
|
|
break;
|
|
|
|
case 'image':
|
|
|
|
routerTo('/containers/image');
|
|
|
|
break;
|
|
|
|
case 'network':
|
|
|
|
routerTo('/containers/network');
|
|
|
|
break;
|
|
|
|
case 'volume':
|
|
|
|
routerTo('/containers/volume');
|
|
|
|
break;
|
|
|
|
case 'repo':
|
|
|
|
routerTo('/containers/repo');
|
|
|
|
break;
|
|
|
|
case 'template':
|
|
|
|
routerTo('/containers/template');
|
|
|
|
break;
|
|
|
|
case 'setting':
|
|
|
|
routerTo('/containers/setting');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
};
|
2022-08-17 17:46:49 +08:00
|
|
|
</script>
|
2022-10-08 18:32:02 +08:00
|
|
|
|
|
|
|
<style>
|
|
|
|
.topCard {
|
|
|
|
--el-card-border-color: var(--el-border-color-light);
|
|
|
|
--el-card-border-radius: 4px;
|
|
|
|
--el-card-padding: 0px;
|
|
|
|
--el-card-bg-color: var(--el-fill-color-blank);
|
|
|
|
}
|
|
|
|
.topButton .el-radio-button__inner {
|
|
|
|
display: inline-block;
|
|
|
|
line-height: 1;
|
|
|
|
white-space: nowrap;
|
|
|
|
vertical-align: middle;
|
|
|
|
background: var(--el-button-bg-color, var(--el-fill-color-blank));
|
|
|
|
border: 0;
|
|
|
|
font-weight: 350;
|
|
|
|
border-left: 0;
|
|
|
|
color: var(--el-button-text-color, var(--el-text-color-regular));
|
|
|
|
text-align: center;
|
|
|
|
box-sizing: border-box;
|
|
|
|
outline: 0;
|
|
|
|
margin: 0;
|
|
|
|
position: relative;
|
|
|
|
cursor: pointer;
|
|
|
|
transition: var(--el-transition-all);
|
|
|
|
-webkit-user-select: none;
|
|
|
|
user-select: none;
|
|
|
|
padding: 8px 15px;
|
|
|
|
font-size: var(--el-font-size-base);
|
|
|
|
border-radius: 0;
|
|
|
|
}
|
|
|
|
</style>
|