mirror of https://github.com/1Panel-dev/1Panel
fix: 二级导航菜单控件控制台警告处理
parent
ab5841e85b
commit
b4ff5463a0
|
@ -1,11 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card class="topCard">
|
<el-card class="topCard">
|
||||||
<el-radio-group v-model="activeName">
|
<el-radio-group v-model="activeName" @change="handleChange">
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/apps/all')" label="all">
|
<el-radio-button class="topButton" size="large" label="all">
|
||||||
{{ $t('app.all') }}
|
{{ $t('app.all') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/apps/installed')" label="installed">
|
<el-radio-button class="topButton" size="large" label="installed">
|
||||||
{{ $t('app.installed') }}
|
{{ $t('app.installed') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
@ -29,6 +29,17 @@ const routerTo = (path: string) => {
|
||||||
router.push({ path: path });
|
router.push({ path: path });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleChange = (val: string) => {
|
||||||
|
switch (val) {
|
||||||
|
case 'all':
|
||||||
|
routerTo('/apps/all');
|
||||||
|
break;
|
||||||
|
case 'installed':
|
||||||
|
routerTo('/apps/installed');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const path = router.currentRoute.value.path;
|
const path = router.currentRoute.value.path;
|
||||||
if (path === '/apps/all') {
|
if (path === '/apps/all') {
|
||||||
|
|
|
@ -1,49 +1,29 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card class="topCard">
|
<el-card class="topCard">
|
||||||
<el-radio-group v-model="active">
|
<el-radio-group :model-value="props.activeName" @change="handleChange">
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/containers')" label="container">
|
<el-radio-button class="topButton" size="large" label="container">
|
||||||
{{ $t('container.container') }}
|
{{ $t('container.container') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button
|
<el-radio-button class="topButton" size="large" label="compose">
|
||||||
class="topButton"
|
|
||||||
size="large"
|
|
||||||
@click="routerTo('/containers/compose')"
|
|
||||||
label="compose"
|
|
||||||
>
|
|
||||||
{{ $t('container.compose') }}
|
{{ $t('container.compose') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/containers/image')" label="image">
|
<el-radio-button class="topButton" size="large" label="image">
|
||||||
{{ $t('container.image') }}
|
{{ $t('container.image') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button
|
<el-radio-button class="topButton" size="large" label="network">
|
||||||
class="topButton"
|
|
||||||
size="large"
|
|
||||||
@click="routerTo('/containers/network')"
|
|
||||||
label="network"
|
|
||||||
>
|
|
||||||
{{ $t('container.network') }}
|
{{ $t('container.network') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/containers/volume')" label="volume">
|
<el-radio-button class="topButton" size="large" label="volume">
|
||||||
{{ $t('container.volume') }}
|
{{ $t('container.volume') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/containers/repo')" label="repo">
|
<el-radio-button class="topButton" size="large" label="repo">
|
||||||
{{ $t('container.repo') }}
|
{{ $t('container.repo') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button
|
<el-radio-button class="topButton" size="large" label="template">
|
||||||
class="topButton"
|
|
||||||
size="large"
|
|
||||||
@click="routerTo('/containers/template')"
|
|
||||||
label="template"
|
|
||||||
>
|
|
||||||
{{ $t('container.composeTemplate') }}
|
{{ $t('container.composeTemplate') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button
|
<el-radio-button class="topButton" size="large" label="setting">
|
||||||
class="topButton"
|
|
||||||
size="large"
|
|
||||||
@click="routerTo('/containers/setting')"
|
|
||||||
label="setting"
|
|
||||||
>
|
|
||||||
{{ $t('container.setting') }}
|
{{ $t('container.setting') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
@ -52,9 +32,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from 'vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
interface MenuProps {
|
interface MenuProps {
|
||||||
activeName: string;
|
activeName: string;
|
||||||
}
|
}
|
||||||
|
@ -62,17 +42,38 @@ const props = withDefaults(defineProps<MenuProps>(), {
|
||||||
activeName: 'container',
|
activeName: 'container',
|
||||||
});
|
});
|
||||||
|
|
||||||
const active = ref('container');
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (props.activeName) {
|
|
||||||
active.value = props.activeName;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const routerTo = (path: string) => {
|
const routerTo = (path: string) => {
|
||||||
router.push({ path: path });
|
router.push({ path: path });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -1,20 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card class="topCard">
|
<el-card class="topCard">
|
||||||
<el-radio-group v-model="active">
|
<el-radio-group :model-value="props.activeName" @change="handleChange">
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/databases')" label="mysql">
|
<el-radio-button class="topButton" size="large" label="mysql">Mysql</el-radio-button>
|
||||||
Mysql
|
<el-radio-button class="topButton" size="large" label="redis">Redis</el-radio-button>
|
||||||
</el-radio-button>
|
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/databases/redis')" label="redis">
|
|
||||||
Redis
|
|
||||||
</el-radio-button>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from 'vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
interface MenuProps {
|
interface MenuProps {
|
||||||
|
@ -24,17 +19,20 @@ const props = withDefaults(defineProps<MenuProps>(), {
|
||||||
activeName: 'mysql',
|
activeName: 'mysql',
|
||||||
});
|
});
|
||||||
|
|
||||||
const active = ref('mysql');
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (props.activeName) {
|
|
||||||
active.value = props.activeName;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const routerTo = (path: string) => {
|
const routerTo = (path: string) => {
|
||||||
router.push({ path: path });
|
router.push({ path: path });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleChange = (val: string) => {
|
||||||
|
switch (val) {
|
||||||
|
case 'mysql':
|
||||||
|
routerTo('/databases');
|
||||||
|
break;
|
||||||
|
case 'redis':
|
||||||
|
routerTo('/databases/redis');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card class="topCard">
|
<el-card class="topCard">
|
||||||
<el-radio-group v-model="active">
|
<el-radio-group :model-value="props.activeName" @change="handleChange">
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/logs')" label="operation">
|
<el-radio-button class="topButton" size="large" label="operation">
|
||||||
{{ $t('logs.operation') }}
|
{{ $t('logs.operation') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/logs/login')" label="login">
|
<el-radio-button class="topButton" size="large" label="login">
|
||||||
{{ $t('logs.login') }}
|
{{ $t('logs.login') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/logs/system')" label="system">
|
<el-radio-button class="topButton" size="large" label="system">
|
||||||
{{ $t('logs.system') }}
|
{{ $t('logs.system') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
@ -17,9 +17,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from 'vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
interface MenuProps {
|
interface MenuProps {
|
||||||
activeName: string;
|
activeName: string;
|
||||||
}
|
}
|
||||||
|
@ -27,17 +27,23 @@ const props = withDefaults(defineProps<MenuProps>(), {
|
||||||
activeName: 'operation',
|
activeName: 'operation',
|
||||||
});
|
});
|
||||||
|
|
||||||
const active = ref('operation');
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (props.activeName) {
|
|
||||||
active.value = props.activeName;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const routerTo = (path: string) => {
|
const routerTo = (path: string) => {
|
||||||
router.push({ path: path });
|
router.push({ path: path });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleChange = (val: string) => {
|
||||||
|
switch (val) {
|
||||||
|
case 'operation':
|
||||||
|
routerTo('/logs');
|
||||||
|
break;
|
||||||
|
case 'login':
|
||||||
|
routerTo('/logs/login');
|
||||||
|
break;
|
||||||
|
case 'system':
|
||||||
|
routerTo('/logs/system');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -1,25 +1,20 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card class="topCard">
|
<el-card class="topCard">
|
||||||
<el-radio-group v-model="active">
|
<el-radio-group :model-value="props.activeName" @change="handleChange">
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/setting')" label="panel">
|
<el-radio-button class="topButton" size="large" label="panel">
|
||||||
{{ $t('setting.panel') }}
|
{{ $t('setting.panel') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/setting/safe')" label="safe">
|
<el-radio-button class="topButton" size="large" label="safe">
|
||||||
{{ $t('setting.safe') }}
|
{{ $t('setting.safe') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button
|
<el-radio-button class="topButton" size="large" label="backupaccount">
|
||||||
class="topButton"
|
|
||||||
@click="routerTo('/setting/backupaccount')"
|
|
||||||
size="large"
|
|
||||||
label="backupaccount"
|
|
||||||
>
|
|
||||||
{{ $t('setting.backupAccount') }}
|
{{ $t('setting.backupAccount') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/setting/monitor')" label="monitor">
|
<el-radio-button class="topButton" size="large" label="monitor">
|
||||||
{{ $t('menu.monitor') }}
|
{{ $t('menu.monitor') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button class="topButton" size="large" @click="routerTo('/setting/about')" label="about">
|
<el-radio-button class="topButton" size="large" label="about">
|
||||||
{{ $t('setting.about') }}
|
{{ $t('setting.about') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
@ -28,7 +23,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted } from 'vue';
|
|
||||||
import router from '@/routers';
|
import router from '@/routers';
|
||||||
|
|
||||||
interface MenuProps {
|
interface MenuProps {
|
||||||
|
@ -38,16 +32,29 @@ const props = withDefaults(defineProps<MenuProps>(), {
|
||||||
activeName: 'all',
|
activeName: 'all',
|
||||||
});
|
});
|
||||||
|
|
||||||
const active = ref('all');
|
|
||||||
const routerTo = (path: string) => {
|
const routerTo = (path: string) => {
|
||||||
router.push({ path: path });
|
router.push({ path: path });
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
const handleChange = (val: string) => {
|
||||||
if (props.activeName) {
|
switch (val) {
|
||||||
active.value = props.activeName;
|
case 'panel':
|
||||||
|
routerTo('/setting');
|
||||||
|
break;
|
||||||
|
case 'safe':
|
||||||
|
routerTo('/setting/safe');
|
||||||
|
break;
|
||||||
|
case 'backupaccount':
|
||||||
|
routerTo('/setting/backupaccount');
|
||||||
|
break;
|
||||||
|
case 'monitor':
|
||||||
|
routerTo('/setting/monitor');
|
||||||
|
break;
|
||||||
|
case 'about':
|
||||||
|
routerTo('/setting/about');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Reference in New Issue