feat: add settings seed action and remove login credentials
SuperAdmins can seed once from Settings, and the login page no longer exposes default credentials.
This commit is contained in:
@@ -22,11 +22,14 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { usePermissionStore } from '@/stores/permissionStore';
|
||||
|
||||
const route = useRoute();
|
||||
const permissionStore = usePermissionStore();
|
||||
|
||||
const menuItems = [
|
||||
const baseMenuItems = [
|
||||
{ label: 'داشبورد اصلی', icon: 'pi pi-home', to: '/' },
|
||||
{ label: 'مدیریت کاربران', icon: 'pi pi-users', to: '/users' },
|
||||
{ label: 'مدیریت اساتید', icon: 'pi pi-id-card', to: '/professors' },
|
||||
@@ -40,6 +43,14 @@ const menuItems = [
|
||||
{ label: 'نقشها و دسترسیها', icon: 'pi pi-shield', to: '/roles' }
|
||||
];
|
||||
|
||||
const menuItems = computed(() => {
|
||||
const items = [...baseMenuItems];
|
||||
if (permissionStore.roleName === 'SuperAdmin') {
|
||||
items.push({ label: 'تنظیمات', icon: 'pi pi-cog', to: '/settings' });
|
||||
}
|
||||
return items;
|
||||
});
|
||||
|
||||
function isMenuActive(to) {
|
||||
if (to === '/') {
|
||||
return route.path === '/';
|
||||
|
||||
Reference in New Issue
Block a user