diff --git a/ui/quasar.config.js.temporary.compiled.1778148063194.mjs b/ui/quasar.config.js.temporary.compiled.1778148063194.mjs deleted file mode 100644 index 16944ba..0000000 --- a/ui/quasar.config.js.temporary.compiled.1778148063194.mjs +++ /dev/null @@ -1,135 +0,0 @@ -/* eslint-disable */ -/** - * THIS FILE IS GENERATED AUTOMATICALLY. - * 1. DO NOT edit this file directly as it won't do anything. - * 2. EDIT the original quasar.config file INSTEAD. - * 3. DO NOT git commit this file. It should be ignored. - * - * This file is still here because there was an error in - * the original quasar.config file and this allows you to - * investigate the Node.js stack error. - * - * After you fix the original file, this file will be - * deleted automatically. - **/ - - -// quasar.config.js -import { defineConfig } from "@quasar/app-webpack/wrappers"; -var quasar_config_default = defineConfig(() => { - const apiBaseUrl = (process.env.VITE_API_BASE_URL || "/api").trim(); - return { - /* ===================================================== - APP INFO - ===================================================== */ - productName: "Baggi BSS", - productDescription: "Baggi Tekstil Business Support System", - /* ===================================================== - BOOT FILES - ===================================================== */ - boot: ["dayjs", "locale", "resizeObserverGuard"], - /* ===================================================== - GLOBAL CSS - ===================================================== */ - css: ["app.css"], - /* ===================================================== - ICONS / FONTS - ===================================================== */ - extras: [ - "roboto-font", - "material-icons" - ], - /* ===================================================== - BUILD (PRODUCTION) - ===================================================== */ - build: { - vueRouterMode: "hash", - env: { - VITE_API_BASE_URL: apiBaseUrl - }, - esbuildTarget: { - browser: ["es2022", "firefox115", "chrome115", "safari14"], - node: "node20" - }, - // Cache & performance - gzip: true, - preloadChunks: true - }, - /* ===================================================== - DEV SERVER (LOCAL) - ===================================================== */ - devServer: { - server: { type: "http" }, - port: 9e3, - open: true, - client: { - overlay: { - errors: true, - warnings: false, - runtimeErrors: false - } - }, - // DEV proxy (CORS'suz) - proxy: [ - { - context: ["/api"], - target: "http://localhost:8080", - changeOrigin: true, - secure: false, - ws: true, - timeout: 0, - proxyTimeout: 0 - } - ] - }, - /* ===================================================== - QUASAR FRAMEWORK - ===================================================== */ - framework: { - config: { - notify: { - position: "top", - timeout: 2500 - } - }, - lang: "tr", - plugins: [ - "Loading", - "Dialog", - "Notify" - ] - }, - animations: [], - /* ===================================================== - SSR / PWA (DISABLED) - ===================================================== */ - ssr: { - prodPort: 3e3, - middlewares: ["render"], - pwa: false - }, - pwa: { - workboxMode: "GenerateSW" - }, - /* ===================================================== - MOBILE / DESKTOP - ===================================================== */ - capacitor: { - hideSplashscreen: true - }, - electron: { - preloadScripts: ["electron-preload"], - inspectPort: 5858, - bundler: "packager", - builder: { - appId: "baggisowtfaresystem" - } - }, - bex: { - extraScripts: [] - } - }; -}); -export { - quasar_config_default as default -}; diff --git a/ui/src/layouts/MainLayout.vue b/ui/src/layouts/MainLayout.vue index 92608b3..992b259 100644 --- a/ui/src/layouts/MainLayout.vue +++ b/ui/src/layouts/MainLayout.vue @@ -173,6 +173,7 @@ import { usePermissionStore } from 'stores/permissionStore' import { useI18n } from 'src/composables/useI18n' import { UI_LANGUAGE_OPTIONS } from 'src/i18n/languages' import { useLocaleStore } from 'src/stores/localeStore' +import { activityLogsMenuItem, getAuthUserId } from 'src/modules/activityLogs' /* ================= STORES ================= */ @@ -365,18 +366,6 @@ const menuItems = [ permission: 'system:update' }, - { - label: 'Loglar', - to: '/app/activity-logs', - permission: 'system:read' - }, - - { - label: 'Test Mail', - to: '/app/test-mail', - permission: 'system:update' - }, - { label: 'Piyasa Mail Eşleştirme', to: '/app/market-mail-mapping', @@ -385,6 +374,27 @@ const menuItems = [ ] }, + + { + label: 'SüperAdmin', + icon: 'admin_panel_settings', + onlyUserIds: activityLogsMenuItem.onlyUserIds, + + children: [ + { + label: 'Log İzleme', + to: activityLogsMenuItem.to, + permission: activityLogsMenuItem.permission, + onlyUserIds: activityLogsMenuItem.onlyUserIds + }, + { + label: 'Test Mail', + to: '/app/test-mail', + permission: 'system:update', + onlyUserIds: activityLogsMenuItem.onlyUserIds + } + ] + }, { label: 'Dil Çeviri', icon: 'translate', @@ -416,6 +426,16 @@ const menuItems = [ /* ================= FILTERED MENU ================= */ +function isAllowedForUser (item) { + const only = item?.onlyUserIds + if (!Array.isArray(only) || only.length === 0) return true + + const id = getAuthUserId(auth.user) + if (id == null) return false + + return only.includes(id) +} + const filteredMenu = computed(() => { if (!perm.loaded) return [] @@ -424,9 +444,10 @@ const filteredMenu = computed(() => { .map(item => { if (item.children) { + if (!isAllowedForUser(item)) return null const children = item.children.filter(c => - perm.hasApiPermission(c.permission) + isAllowedForUser(c) && perm.hasApiPermission(c.permission) ) if (!children.length) return null @@ -437,6 +458,10 @@ const filteredMenu = computed(() => { } } + if (!isAllowedForUser(item)) { + return null + } + if (!perm.hasApiPermission(item.permission)) { return null } diff --git a/ui/src/pages/ActivityLogs.vue b/ui/src/pages/ActivityLogs.vue index 5569058..843a064 100644 --- a/ui/src/pages/ActivityLogs.vue +++ b/ui/src/pages/ActivityLogs.vue @@ -1,5 +1,5 @@