#feature: add project&cronjob management
This commit is contained in:
@@ -20,6 +20,58 @@
|
||||
<!-- 导航菜单 -->
|
||||
<nav class="mt-6 px-3 flex flex-col flex-1">
|
||||
<div class="space-y-1 flex-1">
|
||||
<!-- 项目配置 - 置顶 -->
|
||||
<a
|
||||
href="#"
|
||||
@click.prevent="setActiveMenu('projects')"
|
||||
v-if="isAdmin"
|
||||
:class="[
|
||||
'group flex items-center px-3 py-2 text-sm font-medium rounded-lg transition-colors duration-200',
|
||||
activeMenu === 'projects'
|
||||
? 'bg-blue-50 text-blue-700 border-r-2 border-blue-700'
|
||||
: 'text-gray-700 hover:bg-gray-50 hover:text-gray-900'
|
||||
]"
|
||||
>
|
||||
<svg
|
||||
:class="[
|
||||
'mr-3 h-5 w-5 transition-colors duration-200',
|
||||
activeMenu === 'projects' ? 'text-blue-500' : 'text-gray-400 group-hover:text-gray-500'
|
||||
]"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/>
|
||||
</svg>
|
||||
项目配置
|
||||
</a>
|
||||
|
||||
<!-- 定时任务管理 -->
|
||||
<a
|
||||
href="#"
|
||||
@click.prevent="setActiveMenu('scheduled-tasks')"
|
||||
v-if="isAdmin"
|
||||
:class="[
|
||||
'group flex items-center px-3 py-2 text-sm font-medium rounded-lg transition-colors duration-200',
|
||||
activeMenu === 'scheduled-tasks'
|
||||
? 'bg-blue-50 text-blue-700 border-r-2 border-blue-700'
|
||||
: 'text-gray-700 hover:bg-gray-50 hover:text-gray-900'
|
||||
]"
|
||||
>
|
||||
<svg
|
||||
:class="[
|
||||
'mr-3 h-5 w-5 transition-colors duration-200',
|
||||
activeMenu === 'scheduled-tasks' ? 'text-blue-500' : 'text-gray-400 group-hover:text-gray-500'
|
||||
]"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
定时任务
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="#"
|
||||
@click.prevent="setActiveMenu('env')"
|
||||
@@ -287,6 +339,7 @@
|
||||
</svg>
|
||||
IP 用户映射
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 底部信息 -->
|
||||
@@ -345,7 +398,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
setActiveMenu(menu) {
|
||||
if (menu === 'ip-mappings' && !this.isAdmin) {
|
||||
if ((menu === 'ip-mappings' || menu === 'projects' || menu === 'scheduled-tasks') && !this.isAdmin) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -382,9 +435,13 @@ export default {
|
||||
menu = 'logs';
|
||||
} else if (path === '/ip-mappings') {
|
||||
menu = 'ip-mappings';
|
||||
} else if (path === '/projects') {
|
||||
menu = 'projects';
|
||||
} else if (path === '/scheduled-tasks') {
|
||||
menu = 'scheduled-tasks';
|
||||
}
|
||||
|
||||
if (menu === 'ip-mappings' && !this.isAdmin) {
|
||||
if ((menu === 'ip-mappings' || menu === 'projects' || menu === 'scheduled-tasks') && !this.isAdmin) {
|
||||
menu = 'env';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user