From a8068553be63aa7789792bcd40e8f8d108517092 Mon Sep 17 00:00:00 2001 From: "rahmat.suwardianto.1807" Date: Thu, 10 Jul 2025 15:06:05 +0700 Subject: [PATCH] tambah menu sideBarMenu , middleware definepagemeta --- .../full/vertical-sidebar/sidebarItem.ts | 1387 +++++++++-------- components/table/EditableTable.vue | 221 +++ components/table/Table1.vue | 58 + components/table/Table2.vue | 67 + components/table/Table3.vue | 92 ++ components/table/Table4.vue | 73 + components/table/Table5.vue | 77 + composables/sidebarMenu/usePagePermission.ts | 5 - composables/useAccess.ts | 2 +- pages/Sample-Page.vue | 3 +- pages/tables/TableBasic.vue | 51 + pages/tables/TableDark.vue | 84 + pages/tables/TableDensity.vue | 79 + pages/tables/TableEditable.vue | 38 + pages/tables/TableHeaderFixed.vue | 90 ++ pages/tables/TableHeight.vue | 95 ++ pages/tables/datatables/BasicTable.vue | 99 ++ pages/tables/datatables/CrudTable.vue | 272 ++++ pages/tables/datatables/Filtering.vue | 109 ++ pages/tables/datatables/Grouping.vue | 43 + pages/tables/datatables/HeaderTables.vue | 40 + pages/tables/datatables/Pagination.vue | 58 + pages/tables/datatables/Selectable.vue | 60 + pages/tables/datatables/Slots.vue | 50 + pages/tables/datatables/SortingTable.vue | 53 + stores/apps/blog.ts | 51 + stores/apps/chat.ts | 59 + stores/apps/contact.ts | 23 + stores/apps/eCommerce.ts | 122 ++ stores/apps/email.ts | 49 + stores/apps/invoice/index.ts | 69 + stores/apps/kanban/task.ts | 82 + stores/apps/notes.ts | 60 + stores/apps/tickets.ts | 62 + stores/apps/userprofile/followers.ts | 23 + stores/apps/userprofile/friends.ts | 23 + stores/apps/userprofile/gallery.ts | 23 + stores/apps/userprofile/photos.ts | 23 + stores/apps/userprofile/posts.ts | 54 + stores/rolePages.ts | 7 +- 40 files changed, 3234 insertions(+), 702 deletions(-) create mode 100644 components/table/EditableTable.vue create mode 100644 components/table/Table1.vue create mode 100644 components/table/Table2.vue create mode 100644 components/table/Table3.vue create mode 100644 components/table/Table4.vue create mode 100644 components/table/Table5.vue delete mode 100644 composables/sidebarMenu/usePagePermission.ts create mode 100644 pages/tables/TableBasic.vue create mode 100644 pages/tables/TableDark.vue create mode 100644 pages/tables/TableDensity.vue create mode 100644 pages/tables/TableEditable.vue create mode 100644 pages/tables/TableHeaderFixed.vue create mode 100644 pages/tables/TableHeight.vue create mode 100644 pages/tables/datatables/BasicTable.vue create mode 100644 pages/tables/datatables/CrudTable.vue create mode 100644 pages/tables/datatables/Filtering.vue create mode 100644 pages/tables/datatables/Grouping.vue create mode 100644 pages/tables/datatables/HeaderTables.vue create mode 100644 pages/tables/datatables/Pagination.vue create mode 100644 pages/tables/datatables/Selectable.vue create mode 100644 pages/tables/datatables/Slots.vue create mode 100644 pages/tables/datatables/SortingTable.vue create mode 100644 stores/apps/blog.ts create mode 100644 stores/apps/chat.ts create mode 100644 stores/apps/contact.ts create mode 100644 stores/apps/eCommerce.ts create mode 100644 stores/apps/email.ts create mode 100644 stores/apps/invoice/index.ts create mode 100644 stores/apps/kanban/task.ts create mode 100644 stores/apps/notes.ts create mode 100644 stores/apps/tickets.ts create mode 100644 stores/apps/userprofile/followers.ts create mode 100644 stores/apps/userprofile/friends.ts create mode 100644 stores/apps/userprofile/gallery.ts create mode 100644 stores/apps/userprofile/photos.ts create mode 100644 stores/apps/userprofile/posts.ts diff --git a/components/layout/full/vertical-sidebar/sidebarItem.ts b/components/layout/full/vertical-sidebar/sidebarItem.ts index 9f1f4de..e17992b 100755 --- a/components/layout/full/vertical-sidebar/sidebarItem.ts +++ b/components/layout/full/vertical-sidebar/sidebarItem.ts @@ -19,706 +19,707 @@ export interface menu { } const sidebarItem: menu[] = [ { - header: "dashboards", - id: 1, - + header: "dashboards", + id: 1, + + children: [ + { + title: "Dashboard1", + icon: "widget-add-line-duotone", + to: "/dashboards/dashboard1", + // role: ['admin'], + //permission: ['view', 'update', 'create', 'delete'], + }, + { + title: "Dashboard2", + icon: "chart-line-duotone", + to: "/dashboards/dashboard2", + // role: ['admin','user'], + //permission: ['view', 'update', 'create', 'delete'], + }, + { + title: "Dashboard3", + icon: "screencast-2-line-duotone", + to: "/dashboards/dashboard3", + }, + { + title: "Front Pages", + icon: "home-angle-linear", + to: "/", + children: [ + { + title: "Homepage", + to: "/front-page/homepage", + //role: ['admin','user'], + //permission: ['view', 'update', 'create', 'delete'], + }, + { + title: "About Us", + to: "/front-page/about-us", + //role: ['admin','user'], + //permission: ['view', 'update', 'create', 'delete'], + }, + { + title: "Blog Details", + to: "/front-page/blog/early-black-friday-amazon-deals-cheap-tvs-headphones", + }, + { + title: "Contact Us", + to: "/front-page/contact-us", + }, + { + title: "Portfolio", + to: "/front-page/portfolio", + }, + { + title: "Pricing", + to: "/front-page/pricing", + }, + { + title: "Sample Page", + to: "/sample-page", + }, + { + title: "Sample Page Copy", + to: "/sample-page-copy", + }, + ], + }, + { + title: "Sample Editable Table", + icon: "document-add-linear", + to: "/tables/TableEditable", + }, + ], + }, + + { + header: "apps", + id: 1, + children: [ + { + title: "ECommerce", + icon: "cart-3-line-duotone", + to: "/ecommerce/", + children: [ + { + title: "Shop", + to: "/ecommerce/products", + }, + { + title: "Detail", + to: "/ecommerce/product/detail/1", + }, + { + title: "List", + to: "/ecommerce/productlist", + }, + { + title: "Checkout", + to: "/ecommerce/checkout", + }, + { + title: "Add Product", + to: "/ecommerce/add-product", + }, + { + title: "Edit Product", + to: "/ecommerce/edit-product", + }, + ], + }, + { + title: "Blog", + icon: "widget-4-line-duotone", + to: "/", + children: [ + { + title: "Blog Posts", + to: "/apps/blog/posts", + }, + { + title: "Blog Details", + to: "/apps/blog/early-black-friday-amazon-deals-cheap-tvs-headphones", + }, + ], + }, + { + title: "User Profile", + icon: "shield-user-line-duotone", + to: "/", + children: [ + { + title: "Profile", + to: "/apps/user/profile", + }, + { + title: "Followers", + to: "/apps/user/profile/followers", + }, + { + title: "Friends", + to: "/apps/user/profile/friends", + }, + { + title: "Gallery", + to: "/apps/user/profile/gallery", + }, + ], + }, + { + title: "Invoice", + icon: "bill-check-outline", + to: "/", + children: [ + { + title: "List", + to: "/apps/invoice", + }, + { + title: "Details", + to: "/apps/invoice/details/102", + }, + { + title: "Create", + to: "/apps/invoice/create", + }, + { + title: "Edit", + to: "/apps/invoice/edit/102", + }, + ], + }, + { + title: "Calendar", + icon: "calendar-mark-line-duotone", + to: "/apps/calendar", + }, + { + title: "Email", + icon: "letter-linear", + to: "/apps/email", + }, + { + title: "Chats", + icon: "chat-round-line-line-duotone", + to: "/apps/chats", + }, + { + title: "Notes", + icon: "document-text-line-duotone", + to: "/apps/notes", + }, + { + title: "Kanban", + icon: "airbuds-case-minimalistic-line-duotone", + to: "/apps/kanban", + }, + { + title: "Contact", + icon: "iphone-line-duotone", + to: "/apps/contacts", + }, + { + title: "Tickets", + icon: "ticker-star-outline", + to: "/apps/tickets", + }, + ], + }, + + { + header: "pages", + id: 2, + children: [ + { + title: "Account Setting", + icon: "settings-minimalistic-line-duotone", + to: "/pages/account-settings", + }, + { + title: "Banners Widgets", + icon: "align-vertical-spacing-line-duotone", + to: "/widgets/banners", + }, + { + title: "Cards Widgets", + icon: "cardholder-line-duotone", + to: "/widgets/cards", + }, + { + title: "Charts Widgets", + icon: "chart-square-line-duotone", + to: "/widgets/charts", + }, + { + title: "FAQ", + icon: "question-circle-line-duotone", + to: "/pages/faq", + }, + { + title: "Gallery Lightbox", + icon: "gallery-bold-duotone", + to: "/pages/gallery-lightbox", + }, + { + title: "Landing Page", + icon: "passport-line-duotone", + to: "/", + }, + { + title: "Pricing", + icon: "dollar-line-duotone", + to: "/pages/pricing", + }, + { + title: "Search Results", + icon: "card-search-line-duotone", + to: "/pages/search-results", + }, + { + title: "Social Contacts", + icon: "chat-round-like-linear", + to: "/pages/social-media-contacts", + }, + { + title: "Treeview", + icon: "transmission-line-duotone", + to: "/pages/treeview", + }, + ], + }, + { + header: "icons", + id: 2, + children: [ + { + title: "Tabler Icons", + icon: "sticker-smile-circle-2-line-duotone", + to: "/icons/tabler", + }, + { + title: "Solar Icons", + icon: "sticker-smile-circle-2-line-duotone", + to: "/icons/solar", + }, + ], + }, + + { + header: "Forms", + id: 3, + children: [ + { + title: "Form Elements", + icon: "text-selection-line-duotone", + to: "/components/", + children: [ + { + title: "Autocomplete", + to: "/forms/form-elements/autocomplete", + }, + { + title: "Combobox", + to: "/forms/form-elements/combobox", + }, + { + title: "Button", + to: "/forms/form-elements/button", + }, + { + title: "Checkbox", + to: "/forms/form-elements/checkbox", + }, + { + title: "Custom Inputs", + to: "/forms/form-elements/custominputs", + }, + { + title: "File Inputs", + to: "/forms/form-elements/fileinputs", + }, + { + title: "Radio", + to: "/forms/form-elements/radio", + }, + { + title: "Date Time", + to: "/forms/form-elements/date-time", + }, + { + title: "Select", + to: "/forms/form-elements/select", + }, + { + title: "Slider", + to: "/forms/form-elements/slider", + }, + { + title: "Switch", + to: "/forms/form-elements/switch", + }, + { + title: "Time Picker", + to: "/forms/form-elements/time-picker", + }, + + { + title: "Stepper", + to: "/forms/form-elements/stepper", + }, + ], + }, + { + title: "Form Layout", + icon: "layers-minimalistic-outline", + to: "/forms/form-layouts", + }, + { + title: "Form Horizontal", + icon: "password-minimalistic-input-line-duotone", + to: "/forms/form-horizontal", + }, + { + title: "Form Vertical", + icon: "slider-vertical-line-duotone", + to: "/forms/form-vertical", + }, + { + title: "Form Custom", + icon: "clapperboard-play-outline", + to: "/forms/form-custom", + }, + { + title: "Form Validation", + icon: "soundwave-square-line-duotone", + to: "/forms/form-validation", + }, + { + title: "Editor", + icon: "clapperboard-edit-line-duotone", + to: "/forms/editor", + }, + ], + }, + + { + header: "tables", + id: 4, + children: [ + { + title: "Basic Table", + icon: "tablet-line-duotone", + to: "/tables/basic", + }, + { + title: "Dark Table", + icon: "bedside-table-4-outline", + to: "/tables/dark", + }, + { + title: "Density Table", + icon: "bedside-table-3-linear", + to: "/tables/density", + }, + { + title: "Fixed Header Table", + icon: "archive-up-minimlistic-broken", + to: "/tables/fixed-header", + }, + { + title: "Height Table", + icon: "archive-down-minimlistic-broken", + to: "/tables/height", + }, + { + title: "Editable Table", + icon: "document-add-linear", + to: "/tables/editable", + }, + ], + }, + + { + header: "datatables", + id: 4, + children: [ + { + title: "Basic Table", + icon: "database-outline", + to: "/tables/datatables/basic", + }, + { + title: "Header Table", + icon: "folder-open-broken", + to: "/tables/datatables/header", + }, + { + title: "Selection Table", + icon: "chart-square-broken", + to: "/tables/datatables/selection", + }, + { + title: "Sorting Table", + icon: "card-send-line-duotone", + to: "/tables/datatables/sorting", + }, + { + title: "Pagination Table", + icon: "tag-horizontal-broken", + to: "/tables/datatables/pagination", + }, + { + title: "Filtering Table", + icon: "tuning-square-2-line-duotone", + to: "/tables/datatables/filtering", + }, + { + title: "Grouping Table", + icon: "tuning-square-2-line-duotone", + to: "/tables/datatables/grouping", + }, + { + title: "Table Slots", + icon: "closet-line-duotone", + to: "/tables/datatables/slots", + }, + { + title: "CRUD Table", + icon: "text-underline-cross-broken", + to: "/tables/datatables/crudtable", + }, + ], + }, + + { + header: "Charts", + id: 5, + children: [ + { + title: "Line", + icon: "chat-square-2-outline", + to: "/charts/line-chart", + }, + { + title: "Gredient", + icon: "round-graph-linear", + to: "/charts/gredient-chart", + }, + { + title: "Area", + icon: "graph-up-linear", + to: "/charts/area-chart", + }, + { + title: "Candlestick", + icon: "chandelier-broken", + to: "/charts/candlestick-chart", + }, + { + title: "Column", + icon: "colour-tuneing-broken", + to: "/charts/column-chart", + }, + { + title: "Doughnut & Pie", + icon: "pie-chart-2-linear", + to: "/charts/doughnut-pie-chart", + }, + { + title: "Radialbar & Radar", + icon: "radar-2-outline", + to: "/charts/radialbar-chart", + }, + ], + }, + + { + header: "UI", + id: 6, + children: [ + { + title: "Alert", + icon: "info-circle-linear", + to: "/ui-components/alert", + }, + { + title: "Accordion", + icon: "waterdrops-line-duotone", + to: "/ui-components/accordion", + }, + { + title: "Avatar", + icon: "expressionless-circle-outline", + to: "/ui-components/avatar", + }, + { + title: "Chip", + icon: "tag-horizontal-line-duotone", + to: "/ui-components/chip", + }, + { + title: "Dialog", + icon: "bolt-line-duotone", + to: "/ui-components/dialogs", + }, + { + title: "List", + icon: "checklist-bold-duotone", + to: "/ui-components/list", + }, + { + title: "Menus", + icon: "menu-dots-circle-outline", + to: "/ui-components/menus", + }, + { + title: "Rating", + icon: "shield-star-outline", + to: "/ui-components/rating", + }, + { + title: "Tabs", + icon: "box-minimalistic-line-duotone", + to: "/ui-components/tabs", + }, + { + title: "Tooltip", + icon: "transmission-square-outline", + to: "/ui-components/tooltip", + }, + { + title: "Typography", + icon: "text-circle-linear", + to: "/ui-components/typography", + }, + ], + }, + + { + header: "Auth", + id: 7, + children: [ + { + title: "Error", + icon: "bug-minimalistic-line-duotone", + to: "/auth/404", + }, + { + title: "Side Login", + icon: "login-3-line-duotone", + to: "/auth/login", + }, + { + title: "Boxed Login", + icon: "login-3-line-duotone", + to: "/auth/login2", + }, + { + title: "Side Register", + icon: "user-plus-rounded-line-duotone", + to: "/auth/register", + }, + { + title: "Boxed Register", + icon: "user-plus-rounded-line-duotone", + to: "/auth/register2", + }, + { + title: "Side Forgot Pwd", + icon: "password-outline", + to: "/auth/forgot-password", + }, + { + title: "Boxed Forgot Pwd", + icon: "password-outline", + to: "/auth/forgot-password2", + }, + { + title: "Side Two Steps", + icon: "siderbar-line-duotone", + to: "/auth/two-step", + }, + { + title: "Boxed Two Steps", + icon: "siderbar-line-duotone", + to: "/auth/two-step2", + }, + { + title: "Maintenance", + icon: "settings-line-duotone", + to: "/auth/maintenance", + }, + ], + }, + { + header: "Multi Level", + id: 8, + children: [ + { + title: "Menu Level", + icon: "align-left-line-duotone", + to: "#", + id: 8, + children: [ + { + title: "Level 1", + to: "/level1", + }, + { + title: "Level 1 ", + to: "/2level", children: [ - { - title: 'Dashboard1', - icon: 'widget-add-line-duotone', - to: '/dashboards/dashboard1', - // role: ['admin'], - //permission: ['view', 'update', 'create', 'delete'], - }, - { - title: 'Dashboard2', - icon: 'chart-line-duotone', - to: '/dashboards/dashboard2', - // role: ['admin','user'], - //permission: ['view', 'update', 'create', 'delete'], - }, - { - title: 'Dashboard3', - icon: 'screencast-2-line-duotone', - to: '/dashboards/dashboard3' - }, - { - title: 'Front Pages', - icon: 'home-angle-linear', - to: '/', - children: [ + { + title: "Level 2", + to: "/barry", + }, + { + title: "Level 2", + to: "/2.2level", + children: [ { - title: 'Homepage', - to: '/front-page/homepage', - //role: ['admin','user'], - //permission: ['view', 'update', 'create', 'delete'], + title: "Level 3", + to: "/barry", }, - { - title: 'About Us', - to: '/front-page/about-us', - //role: ['admin','user'], - //permission: ['view', 'update', 'create', 'delete'], - }, - { - title: 'Blog Details', - to: '/front-page/blog/early-black-friday-amazon-deals-cheap-tvs-headphones' - }, - { - title: 'Contact Us', - to: '/front-page/contact-us' - }, - { - title: 'Portfolio', - to: '/front-page/portfolio' - }, - { - title: 'Pricing', - to: '/front-page/pricing' - }, - { - title: 'Sample Page', - to: '/sample-page' - }, - { - title: 'Sample Page Copy', - to: '/sample-page-copy' - } - ] + ], + }, + ], }, - ] - }, - - { - header: 'apps', - id: 1, - children: [ - { - title: 'ECommerce', - icon: 'cart-3-line-duotone', - to: '/ecommerce/', - children: [ - { - title: 'Shop', - to: '/ecommerce/products' - }, - { - title: 'Detail', - to: '/ecommerce/product/detail/1' - }, - { - title: 'List', - to: '/ecommerce/productlist' - }, - { - title: 'Checkout', - to: '/ecommerce/checkout' - }, - { - title: 'Add Product', - to: '/ecommerce/add-product' - }, - { - title: 'Edit Product', - to: '/ecommerce/edit-product' - } - ] - }, - { - title: 'Blog', - icon: 'widget-4-line-duotone', - to: '/', - children: [ - { - title: 'Blog Posts', - to: '/apps/blog/posts' - }, - { - title: 'Blog Details', - to: '/apps/blog/early-black-friday-amazon-deals-cheap-tvs-headphones' - } - ] - }, - { - title: 'User Profile', - icon: 'shield-user-line-duotone', - to: '/', - children: [ - { - title: 'Profile', - to: '/apps/user/profile' - }, - { - title: 'Followers', - to: '/apps/user/profile/followers' - }, - { - title: 'Friends', - to: '/apps/user/profile/friends' - }, - { - title: 'Gallery', - to: '/apps/user/profile/gallery' - } - ] - }, - { - title: 'Invoice', - icon: 'bill-check-outline', - to: '/', - children: [ - { - title: 'List', - to: '/apps/invoice' - }, - { - title: 'Details', - to: '/apps/invoice/details/102' - }, - { - title: 'Create', - to: '/apps/invoice/create' - }, - { - title: 'Edit', - to: '/apps/invoice/edit/102' - } - ] - }, - { - title: 'Calendar', - icon: 'calendar-mark-line-duotone', - to: '/apps/calendar' - }, - { - title: 'Email', - icon: 'letter-linear', - to: '/apps/email' - }, - { - title: 'Chats', - icon: 'chat-round-line-line-duotone', - to: '/apps/chats' - }, - { - title: 'Notes', - icon: 'document-text-line-duotone', - to: '/apps/notes' - }, - { - title: 'Kanban', - icon: 'airbuds-case-minimalistic-line-duotone', - to: '/apps/kanban' - }, - { - title: 'Contact', - icon: 'iphone-line-duotone', - to: '/apps/contacts' - }, - { - title: 'Tickets', - icon: 'ticker-star-outline', - to: '/apps/tickets' - }, - ] - }, - - { - header: 'pages', - id: 2, - children: [ - - { - title: 'Account Setting', - icon: 'settings-minimalistic-line-duotone', - to: '/pages/account-settings' - }, - { - title: 'Banners Widgets', - icon: 'align-vertical-spacing-line-duotone', - to: '/widgets/banners' - }, - { - title: 'Cards Widgets', - icon: 'cardholder-line-duotone', - to: '/widgets/cards' - }, - { - title: 'Charts Widgets', - icon: 'chart-square-line-duotone', - to: '/widgets/charts' - }, - { - title: 'FAQ', - icon: 'question-circle-line-duotone', - to: '/pages/faq' - }, - { - title: 'Gallery Lightbox', - icon: 'gallery-bold-duotone', - to: '/pages/gallery-lightbox', - }, - { - title: 'Landing Page', - icon: 'passport-line-duotone', - to: '/' - }, - { - title: 'Pricing', - icon: 'dollar-line-duotone', - to: '/pages/pricing' - }, - { - title: 'Search Results', - icon: 'card-search-line-duotone', - to: '/pages/search-results' - }, - { - title: 'Social Contacts', - icon: 'chat-round-like-linear', - to: '/pages/social-media-contacts' - }, - { - title: 'Treeview', - icon: 'transmission-line-duotone', - to: '/pages/treeview' - }, - - - - ] + ], + }, + ], }, { - header: 'icons', - id: 2, - children: [ - { - title: 'Tabler Icons', - icon: 'sticker-smile-circle-2-line-duotone', - to: '/icons/tabler' - }, - { - title: 'Solar Icons', - icon: 'sticker-smile-circle-2-line-duotone', - to: '/icons/solar' - } - ] + header: "More Options", + id: 8, + children: [ + { + title: "Applications", + icon: "check-circle-bold", + BgColor: "primary", + }, + { + title: "Form Options", + icon: "check-circle-bold", + BgColor: "secondary", + }, + { + title: "Table Variations", + icon: "check-circle-bold", + BgColor: "error", + }, + { + title: "Charts Selection", + icon: "check-circle-bold", + BgColor: "warning", + }, + { + title: "Widgets", + icon: "check-circle-bold", + BgColor: "success", + }, + ], }, - - { - header: 'Forms', - id: 3, - children: [ - { - title: 'Form Elements', - icon: 'text-selection-line-duotone', - to: '/components/', - children: [ - { - title: 'Autocomplete', - to: '/forms/form-elements/autocomplete' - }, - { - title: 'Combobox', - to: '/forms/form-elements/combobox' - }, - { - title: 'Button', - to: '/forms/form-elements/button' - }, - { - title: 'Checkbox', - to: '/forms/form-elements/checkbox' - }, - { - title: 'Custom Inputs', - to: '/forms/form-elements/custominputs' - }, - { - title: 'File Inputs', - to: '/forms/form-elements/fileinputs' - }, - { - title: 'Radio', - to: '/forms/form-elements/radio' - }, - { - title: 'Date Time', - to: '/forms/form-elements/date-time' - }, - { - title: 'Select', - to: '/forms/form-elements/select' - }, - { - title: 'Slider', - to: '/forms/form-elements/slider' - }, - { - title: 'Switch', - to: '/forms/form-elements/switch' - }, - { - title: 'Time Picker', - to: '/forms/form-elements/time-picker' - }, - - { - title: 'Stepper', - to: '/forms/form-elements/stepper' - } - ] - }, - { - title: 'Form Layout', - icon: 'layers-minimalistic-outline', - to: '/forms/form-layouts' - }, - { - title: 'Form Horizontal', - icon: 'password-minimalistic-input-line-duotone', - to: '/forms/form-horizontal' - }, - { - title: 'Form Vertical', - icon: 'slider-vertical-line-duotone', - to: '/forms/form-vertical' - }, - { - title: 'Form Custom', - icon: 'clapperboard-play-outline', - to: '/forms/form-custom' - }, - { - title: 'Form Validation', - icon: 'soundwave-square-line-duotone', - to: '/forms/form-validation' - }, - { - title: 'Editor', - icon: 'clapperboard-edit-line-duotone', - to: '/forms/editor' - } - ] - }, - - { - header: 'tables', - id: 4, - children: [ - { - title: 'Basic Table', - icon: 'tablet-line-duotone', - to: '/tables/basic' - }, - { - title: 'Dark Table', - icon: 'bedside-table-4-outline', - to: '/tables/dark' - }, - { - title: 'Density Table', - icon: 'bedside-table-3-linear', - to: '/tables/density' - }, - { - title: 'Fixed Header Table', - icon: 'archive-up-minimlistic-broken', - to: '/tables/fixed-header' - }, - { - title: 'Height Table', - icon: 'archive-down-minimlistic-broken', - to: '/tables/height' - }, - { - title: 'Editable Table', - icon: 'document-add-linear', - to: '/tables/editable' - } - ] - }, - - { - header: 'datatables', - id: 4, - children: [ - { - title: 'Basic Table', - icon: 'database-outline', - to: '/tables/datatables/basic' - }, - { - title: 'Header Table', - icon: 'folder-open-broken', - to: '/tables/datatables/header' - }, - { - title: 'Selection Table', - icon: 'chart-square-broken', - to: '/tables/datatables/selection' - }, - { - title: 'Sorting Table', - icon: 'card-send-line-duotone', - to: '/tables/datatables/sorting' - }, - { - title: 'Pagination Table', - icon: 'tag-horizontal-broken', - to: '/tables/datatables/pagination' - }, - { - title: 'Filtering Table', - icon: 'tuning-square-2-line-duotone', - to: '/tables/datatables/filtering' - }, - { - title: 'Grouping Table', - icon: 'tuning-square-2-line-duotone', - to: '/tables/datatables/grouping' - }, - { - title: 'Table Slots', - icon: 'closet-line-duotone', - to: '/tables/datatables/slots' - }, - { - title: 'CRUD Table', - icon: 'text-underline-cross-broken', - to: '/tables/datatables/crudtable' - } - ] - }, - - { - header: 'Charts', - id: 5, - children: [ - { - title: 'Line', - icon: 'chat-square-2-outline', - to: '/charts/line-chart' - }, - { - title: 'Gredient', - icon: 'round-graph-linear', - to: '/charts/gredient-chart' - }, - { - title: 'Area', - icon: 'graph-up-linear', - to: '/charts/area-chart' - }, - { - title: 'Candlestick', - icon: 'chandelier-broken', - to: '/charts/candlestick-chart' - }, - { - title: 'Column', - icon: 'colour-tuneing-broken', - to: '/charts/column-chart' - }, - { - title: 'Doughnut & Pie', - icon: 'pie-chart-2-linear', - to: '/charts/doughnut-pie-chart' - }, - { - title: 'Radialbar & Radar', - icon: 'radar-2-outline', - to: '/charts/radialbar-chart' - } - ] - }, - - { - header: 'UI', - id: 6, - children: [ - { - title: 'Alert', - icon: 'info-circle-linear', - to: '/ui-components/alert' - }, - { - title: 'Accordion', - icon: 'waterdrops-line-duotone', - to: '/ui-components/accordion' - }, - { - title: 'Avatar', - icon: 'expressionless-circle-outline', - to: '/ui-components/avatar' - }, - { - title: 'Chip', - icon: 'tag-horizontal-line-duotone', - to: '/ui-components/chip' - }, - { - title: 'Dialog', - icon: 'bolt-line-duotone', - to: '/ui-components/dialogs' - }, - { - title: 'List', - icon: 'checklist-bold-duotone', - to: '/ui-components/list' - }, - { - title: 'Menus', - icon: 'menu-dots-circle-outline', - to: '/ui-components/menus' - }, - { - title: 'Rating', - icon: 'shield-star-outline', - to: '/ui-components/rating' - }, - { - title: 'Tabs', - icon: 'box-minimalistic-line-duotone', - to: '/ui-components/tabs' - }, - { - title: 'Tooltip', - icon: 'transmission-square-outline', - to: '/ui-components/tooltip' - }, - { - title: 'Typography', - icon: 'text-circle-linear', - to: '/ui-components/typography' - } - ] - }, - - { - header: 'Auth', - id: 7, - children: [ - { - title: 'Error', - icon: 'bug-minimalistic-line-duotone', - to: '/auth/404' - }, - { - title: 'Side Login', - icon: 'login-3-line-duotone', - to: '/auth/login' - }, - { - title: 'Boxed Login', - icon: 'login-3-line-duotone', - to: '/auth/login2' - }, - { - title: 'Side Register', - icon: 'user-plus-rounded-line-duotone', - to: '/auth/register' - }, - { - title: 'Boxed Register', - icon: 'user-plus-rounded-line-duotone', - to: '/auth/register2' - }, - { - title: 'Side Forgot Pwd', - icon: 'password-outline', - to: '/auth/forgot-password' - }, - { - title: 'Boxed Forgot Pwd', - icon: 'password-outline', - to: '/auth/forgot-password2' - }, - { - title: 'Side Two Steps', - icon: 'siderbar-line-duotone', - to: '/auth/two-step' - }, - { - title: 'Boxed Two Steps', - icon: 'siderbar-line-duotone', - to: '/auth/two-step2' - }, - { - title: 'Maintenance', - icon: 'settings-line-duotone', - to: '/auth/maintenance' - } - ] - }, - { - header: 'Multi Level', - id: 8, - children: [ - { - title: 'Menu Level', - icon: 'align-left-line-duotone', - to: '#', - id: 8, - children: [ - { - title: 'Level 1', - to: '/level1' - }, - { - title: 'Level 1 ', - to: '/2level', - children: [ - { - title: 'Level 2', - to: '/barry' - }, - { - title: 'Level 2', - to: '/2.2level', - children: [ - { - title: 'Level 3', - to: '/barry' - } - ] - } - ] - } - ] - } - ] - }, - { - header: 'More Options', - id: 8, - children: [ - { - title: 'Applications', - icon: 'check-circle-bold', - BgColor: 'primary' - }, - { - title: 'Form Options', - icon: 'check-circle-bold', - BgColor: 'secondary' - }, - { - title: 'Table Variations', - icon: 'check-circle-bold', - BgColor: 'error' - }, - { - title: 'Charts Selection', - icon: 'check-circle-bold', - BgColor: 'warning' - }, - { - title: 'Widgets', - icon: 'check-circle-bold', - BgColor: 'success' - } - ] - } ]; export default sidebarItem; diff --git a/components/table/EditableTable.vue b/components/table/EditableTable.vue new file mode 100644 index 0000000..a23eec6 --- /dev/null +++ b/components/table/EditableTable.vue @@ -0,0 +1,221 @@ + + diff --git a/components/table/Table1.vue b/components/table/Table1.vue new file mode 100644 index 0000000..f1bef6f --- /dev/null +++ b/components/table/Table1.vue @@ -0,0 +1,58 @@ + + diff --git a/components/table/Table2.vue b/components/table/Table2.vue new file mode 100644 index 0000000..478c36d --- /dev/null +++ b/components/table/Table2.vue @@ -0,0 +1,67 @@ + + + diff --git a/components/table/Table3.vue b/components/table/Table3.vue new file mode 100644 index 0000000..e60c462 --- /dev/null +++ b/components/table/Table3.vue @@ -0,0 +1,92 @@ + + + + diff --git a/components/table/Table4.vue b/components/table/Table4.vue new file mode 100644 index 0000000..de35591 --- /dev/null +++ b/components/table/Table4.vue @@ -0,0 +1,73 @@ + + + diff --git a/components/table/Table5.vue b/components/table/Table5.vue new file mode 100644 index 0000000..78f697b --- /dev/null +++ b/components/table/Table5.vue @@ -0,0 +1,77 @@ + + + diff --git a/composables/sidebarMenu/usePagePermission.ts b/composables/sidebarMenu/usePagePermission.ts deleted file mode 100644 index 3dade97..0000000 --- a/composables/sidebarMenu/usePagePermission.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { useAccess } from "~/composables/useAccess"; - -export function usePagePermission(dataUser : string) { - -} \ No newline at end of file diff --git a/composables/useAccess.ts b/composables/useAccess.ts index 6cc93fd..9d0adb4 100644 --- a/composables/useAccess.ts +++ b/composables/useAccess.ts @@ -5,7 +5,7 @@ import type { PageAccess } from "~/types/menuAkses/access"; export const useAccess = (pageRoute: string , userRole: string) => { //const route = useRoute(); - const getRole = "admin"; + const getRole = userRole; //const meta = route.path; //halaman yang sedang diakses const meta = pageRoute diff --git a/pages/Sample-Page.vue b/pages/Sample-Page.vue index a7c4bbd..70fe87d 100755 --- a/pages/Sample-Page.vue +++ b/pages/Sample-Page.vue @@ -7,12 +7,11 @@ const aksesMenu = useHakAksesStore(); console.log('masuk pages', route.meta ,aksesMenu.permissionPage); -//const permission = ["view"]; definePageMeta({ middleware: ["auth-menu"], role: ['superadmin','admin'], - //permission: [permission], + //permission: ['view','update','create','delete'], }); const permissions = route.meta || [] diff --git a/pages/tables/TableBasic.vue b/pages/tables/TableBasic.vue new file mode 100644 index 0000000..1702f37 --- /dev/null +++ b/pages/tables/TableBasic.vue @@ -0,0 +1,51 @@ + + + diff --git a/pages/tables/TableDark.vue b/pages/tables/TableDark.vue new file mode 100644 index 0000000..190ae5d --- /dev/null +++ b/pages/tables/TableDark.vue @@ -0,0 +1,84 @@ + + + diff --git a/pages/tables/TableDensity.vue b/pages/tables/TableDensity.vue new file mode 100644 index 0000000..3f62330 --- /dev/null +++ b/pages/tables/TableDensity.vue @@ -0,0 +1,79 @@ + + + diff --git a/pages/tables/TableEditable.vue b/pages/tables/TableEditable.vue new file mode 100644 index 0000000..40884f5 --- /dev/null +++ b/pages/tables/TableEditable.vue @@ -0,0 +1,38 @@ + + + diff --git a/pages/tables/TableHeaderFixed.vue b/pages/tables/TableHeaderFixed.vue new file mode 100644 index 0000000..821afc5 --- /dev/null +++ b/pages/tables/TableHeaderFixed.vue @@ -0,0 +1,90 @@ + + + diff --git a/pages/tables/TableHeight.vue b/pages/tables/TableHeight.vue new file mode 100644 index 0000000..f8036bb --- /dev/null +++ b/pages/tables/TableHeight.vue @@ -0,0 +1,95 @@ + + + diff --git a/pages/tables/datatables/BasicTable.vue b/pages/tables/datatables/BasicTable.vue new file mode 100644 index 0000000..af5d928 --- /dev/null +++ b/pages/tables/datatables/BasicTable.vue @@ -0,0 +1,99 @@ + + + diff --git a/pages/tables/datatables/CrudTable.vue b/pages/tables/datatables/CrudTable.vue new file mode 100644 index 0000000..d307a1c --- /dev/null +++ b/pages/tables/datatables/CrudTable.vue @@ -0,0 +1,272 @@ + + + + + \ No newline at end of file diff --git a/pages/tables/datatables/Filtering.vue b/pages/tables/datatables/Filtering.vue new file mode 100644 index 0000000..9ea903d --- /dev/null +++ b/pages/tables/datatables/Filtering.vue @@ -0,0 +1,109 @@ + + + diff --git a/pages/tables/datatables/Grouping.vue b/pages/tables/datatables/Grouping.vue new file mode 100644 index 0000000..880b2d8 --- /dev/null +++ b/pages/tables/datatables/Grouping.vue @@ -0,0 +1,43 @@ + + + diff --git a/pages/tables/datatables/HeaderTables.vue b/pages/tables/datatables/HeaderTables.vue new file mode 100644 index 0000000..1e2f838 --- /dev/null +++ b/pages/tables/datatables/HeaderTables.vue @@ -0,0 +1,40 @@ + + + diff --git a/pages/tables/datatables/Pagination.vue b/pages/tables/datatables/Pagination.vue new file mode 100644 index 0000000..85a7aa0 --- /dev/null +++ b/pages/tables/datatables/Pagination.vue @@ -0,0 +1,58 @@ + + + diff --git a/pages/tables/datatables/Selectable.vue b/pages/tables/datatables/Selectable.vue new file mode 100644 index 0000000..c263123 --- /dev/null +++ b/pages/tables/datatables/Selectable.vue @@ -0,0 +1,60 @@ + + + diff --git a/pages/tables/datatables/Slots.vue b/pages/tables/datatables/Slots.vue new file mode 100644 index 0000000..be18bd2 --- /dev/null +++ b/pages/tables/datatables/Slots.vue @@ -0,0 +1,50 @@ + + + diff --git a/pages/tables/datatables/SortingTable.vue b/pages/tables/datatables/SortingTable.vue new file mode 100644 index 0000000..efc9d1a --- /dev/null +++ b/pages/tables/datatables/SortingTable.vue @@ -0,0 +1,53 @@ + + + diff --git a/stores/apps/blog.ts b/stores/apps/blog.ts new file mode 100644 index 0000000..4a87a2b --- /dev/null +++ b/stores/apps/blog.ts @@ -0,0 +1,51 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; +import type { blogpostType } from '@/types/apps/BlogTypes'; + +interface blogTypeDe { + blogposts: blogpostType[]; + recentPosts: blogpostType[]; + blogSearch: string; + sortBy: string; + selectedPost: blogpostType[] | any; +} + +export const useBlogStore = defineStore({ + id: 'blog', + + state: (): blogTypeDe => ({ + blogposts: [], + recentPosts: [], + blogSearch: '', + sortBy: 'newest', + selectedPost: [] + }), + getters: { + // Get Post from Getters + getPosts(state) { + return state.blogposts; + } + }, + actions: { + // Fetch Blog from action + async fetchPosts() { + try { + const data = await axios.get('/api/data/blog/BlogPosts'); + this.blogposts = data.data; + } catch (error) { + alert(error); + console.log(error); + } + }, + async fetchPost(title: string) { + try { + const response = await axios.post('/api/data/blog/post', { title }); + this.selectedPost = response.data.post; + } catch (error) { + alert(error); + console.log(error); + } + } + } +}); diff --git a/stores/apps/chat.ts b/stores/apps/chat.ts new file mode 100644 index 0000000..72c7c20 --- /dev/null +++ b/stores/apps/chat.ts @@ -0,0 +1,59 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; +import { uniqueId } from 'lodash'; +import { sub } from 'date-fns'; + +interface chatType { + chats: any; + chatContent: any; +} + +export const useChatStore = defineStore({ + id: 'chat', + state: (): chatType => ({ + chats: [], + chatContent: 1 + }), + getters: { + // Get Chats from Getters + // getChats(state) { + // return state.chats; + // } + }, + actions: { + // Fetch Chat from action + async fetchChats() { + try { + const data = await axios.get('/api/data/chat/ChatData'); + this.chats = data.data; + } catch (error) { + alert(error); + console.log(error); + } + }, + //select chat + SelectChat(itemID: number) { + this.chatContent = itemID; + }, + sendMsg(itemID: number, item: string) { + const newMessage = { + id: itemID, + msg: item, + type: 'text', + attachments: [], + createdAt: sub(new Date(), { seconds: 1 }), + senderId: itemID + }; + + this.chats = this.chats.filter((chat: any) => { + return chat.id === itemID + ? { + ...chat, + ...chat.chatHistory.push(newMessage) + } + : chat; + }); + } + } +}); diff --git a/stores/apps/contact.ts b/stores/apps/contact.ts new file mode 100644 index 0000000..d1e3fed --- /dev/null +++ b/stores/apps/contact.ts @@ -0,0 +1,23 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; + +export const useContactStore = defineStore({ + id: 'Contact', + state: () => ({ + contacts: [] + }), + getters: {}, + actions: { + // Fetch followers from action + async fetchContacts() { + try { + const response = await axios.get('/api/contacts'); + this.contacts = response.data.contacts; + } catch (error) { + alert(error); + console.log(error); + } + } + } +}); diff --git a/stores/apps/eCommerce.ts b/stores/apps/eCommerce.ts new file mode 100644 index 0000000..60a8198 --- /dev/null +++ b/stores/apps/eCommerce.ts @@ -0,0 +1,122 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; +// types +import type { ProductStateProps } from '@/types/apps/EcommerceType'; +import { filter, map, sum } from 'lodash'; + +export const useEcomStore = defineStore({ + id: 'eCommerceone', + state: (): ProductStateProps => ({ + products: [], + cart: [], + gender: '', + category: [], + price: '', + subTotal: 0, + discount: 5, + total: 0, + addresses: [], + color: 'All', + }), + getters: {}, + actions: { + // Fetch Customers from action + async fetchProducts() { + try { + const data = await axios.get('/api/products/list'); + this.products = data.data; + } catch (error) { + alert(error); + console.log(error); + } + }, + // Fetch Customers from addresses + async fetchAddress() { + try { + const data = await axios.get('/api/address/list'); + this.addresses = data.data; + } catch (error) { + alert(error); + console.log(error); + } + }, + //select gender + SelectGender(items: any) { + this.gender = items; + }, + sortByColor(itemcolor: string) { + this.color = itemcolor; + }, + //select category + SelectCategory(items: any) { + this.category = items; + }, + //select Price + SelectPrice(items: any) { + this.price = items; + }, + //AddToCart + AddToCart(item: any) { + const product = item; + this.cart = [...this.cart, product]; + }, + //qty + incrementQty(item: any) { + const productId = item; + const updateCart = map(this.cart, (product: any) => { + if (product.id === productId) { + return { + ...product, + qty: product.qty + 1 + }; + } + return product; + }); + this.cart = updateCart; + this.subTotal = sum(this.cart.map((product: any) => product.salePrice * product.qty)); + this.discount = Math.round(this.subTotal * (5 / 100)); + this.total = this.subTotal - this.discount; + }, + //qty + decrementQty(item: any) { + const productId = item; + const updateCart = map(this.cart, (product: any) => { + if (product.id === productId) { + return { + ...product, + qty: product.qty - 1 + }; + } + return product; + }); + this.cart = updateCart; + this.subTotal = sum(this.cart.map((product: any) => product.salePrice * product.qty)); + this.subTotal = sum(this.cart.map((product: any) => product.salePrice * product.qty)); + this.discount = Math.round(this.subTotal * (5 / 100)); + this.total = this.subTotal - this.discount; + }, + // delete Cart + deleteCart(item: any) { + const updateCart = filter(this.cart, (p) => p.id !== item); + this.cart = updateCart; + }, + //subtotal + getsubTotal() { + this.subTotal = sum(this.cart.map((product: any) => product.salePrice * product.qty)); + }, + //total + getTotal() { + this.total = this.subTotal - this.discount; + }, + //discount + getDiscount() { + this.discount = Math.round(this.subTotal * (5 / 100)); + }, + + //Reset Filter + filterReset(){} + + + } +}); diff --git a/stores/apps/email.ts b/stores/apps/email.ts new file mode 100644 index 0000000..f2074ca --- /dev/null +++ b/stores/apps/email.ts @@ -0,0 +1,49 @@ +import { defineStore } from "pinia"; +import axios from "@/utils/axios"; +import { uniqueId } from "lodash"; +import { sub } from "date-fns"; + +interface EmailType { + emails: any[]; + selectedEmail: any | null; // Add this line to hold the selected email +} + +export const useEmailStore = defineStore({ + id: "email", + state: (): EmailType => ({ + emails: [], + selectedEmail: null, // Initialize as null + }), + actions: { + toggleStarred(emailId: number) { + const email = this.emails.find((e) => e.id === emailId); + if (email) { + email.starred = !email.starred; + } + }, + toggleImportant(emailId: number) { + const email = this.emails.find((e) => e.id === emailId); + if (email) { + email.important = !email.important; + } + }, + async fetchEmails() { + try { + const data = await axios.get("/api/data/email/EmailData"); + this.emails = data.data; + } catch (error) { + alert(error); + console.log(error); + } + }, + selectEmail(email: any) { + // Update the method to accept an email object + this.selectedEmail = email; // Store the selected email + }, + deleteEmail(id: number) { + this.emails = this.emails.filter((email) => email.id !== id); + this.selectedEmail = null; // Clear selected email after deletion + }, + + }, +}); diff --git a/stores/apps/invoice/index.ts b/stores/apps/invoice/index.ts new file mode 100644 index 0000000..d438023 --- /dev/null +++ b/stores/apps/invoice/index.ts @@ -0,0 +1,69 @@ +import { defineStore } from 'pinia'; +import axios from '@/utils/axios'; +import type { InvoiceType } from '@/types/apps/InvoiceTypes'; + +interface InvoiceState { + invoice: InvoiceType[]; + invoiceContent: number; + invoiceSearch: string; +} + +export const useInvoicestore = defineStore({ + id: 'invoices', + state: (): InvoiceState => ({ + invoice: [], + invoiceContent: 1, + invoiceSearch: '', + }), + getters: { + grandTotal: (state) => (invoice: InvoiceType) => { + const subtotal = (invoice.orders ?? []).reduce((sum, order) => { + return sum + (order.unitPrice ?? 0) * (order.units ?? 0); + }, 0); + const vatRate = 0.1; + const vat = subtotal * vatRate; + return subtotal + vat; + } + }, + actions: { + async fetchinvoice() { + try { + const response = await axios.get('/api/data/invoices/invoiceData'); + this.invoice = response.data; // Ensure data is structured correctly + } catch (error) { + console.error(error); + alert('Failed to fetch invoices'); + } + }, + async addInvoice(invoice: InvoiceType) { + try { + const response = await axios.post('/api/data/invoices/invoiceData', invoice); + this.invoice.push(response.data); + + return response.data; + } catch (error) { + console.error('Error adding invoice:', error); + } + }, + async updateInvoice(updatedInvoice: InvoiceType) { + try { + const response = await axios.put(`/api/data/invoices/invoiceData/${updatedInvoice.id}`, updatedInvoice); + console.log('Response from update:', response); // This will show the updated data + + const index = this.invoice.findIndex(inv => inv.id === updatedInvoice.id); + if (index !== -1) { + this.invoice[index] = response.data; // Update the local store + } + return response.data; + } catch (error) { + console.error('Error updating invoice:', error); + } + }, + + + + deleteinvoice(itemID: number) { + this.invoice = this.invoice.filter((invoice) => invoice.id !== itemID); + }, + }, +}); diff --git a/stores/apps/kanban/task.ts b/stores/apps/kanban/task.ts new file mode 100644 index 0000000..f966711 --- /dev/null +++ b/stores/apps/kanban/task.ts @@ -0,0 +1,82 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; +import { map } from 'lodash'; +import { uniqueId } from 'lodash'; +import { sub } from 'date-fns'; +import type { Ref } from 'vue'; + + +interface TaskType { + id?: string | any; + title?: string; + subtitle?: string; + datef?: Date | any; + cardbg?: string; + deleted?: boolean; + taskimg?: string; + date?: Date | any; + category?: string; + categorybg?: string; + tasks?: TaskType[]; +} + +interface taskType { + tasks: TaskType[]; + taskContent: string; +} + +export const useTaskStore = defineStore({ + id: 'tasks', + state: (): taskType => ({ + tasks: [], + taskContent: '1' + }), + actions: { + // Fetch tasks + async fetchTasks() { + try { + const data = await axios.get('/api/data/task/TaskData'); + this.tasks = data.data; + } catch (error) { + alert(error); + console.log(error); + } + }, + + //select chat + SelectTask(itemID: string) { + this.taskContent = itemID; + }, + + deleteTask(itemID: string) { + const taskObj = this.tasks.map((task) => { + const tasks = task.tasks?.filter((t) => t.id !== itemID); + return { + ...task, + tasks + }; + }); + this.tasks = taskObj; + }, + addTask(columnId:string, title:string, subtitle:string, category:string, categorybg:string) { + const newTask = { + id: uniqueId('#task_'), + title: title, + subtitle: subtitle, + category:category, + date: sub(new Date(), { seconds: 1 }), + categorybg:categorybg + }; + this.tasks = map(this.tasks, (task: any) => { + if (task.id === columnId) { + return { + ...task, + ...task.tasks.push(newTask) + }; + } + return task; + }); + } + } +}); diff --git a/stores/apps/notes.ts b/stores/apps/notes.ts new file mode 100644 index 0000000..6f8e696 --- /dev/null +++ b/stores/apps/notes.ts @@ -0,0 +1,60 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; +import { map } from 'lodash'; + +interface NotesType { + id?: number | any; + color?: string; + title?: string; + datef?: Date | any; + deleted?: boolean; +} + +interface noteType { + notes: NotesType[]; + notesContent: number; + noteSearch: string; +} + +export const useNoteStore = defineStore({ + id: 'notes', + state: (): noteType => ({ + notes: [], + notesContent: 1, + noteSearch: '' + }), + actions: { + // Fetch notes + async fetchNotes() { + try { + const data = await axios.get('/api/data/notes/NotesData'); + this.notes = data.data; + } catch (error) { + alert(error); + console.log(error); + } + }, + + //select chat + SelectNote(itemID: number) { + this.notesContent = itemID; + }, + + deleteNote(itemID: number) { + const index = this.notes.findIndex((p) => p.id == itemID); + this.notes.splice(index, 1); + }, + updateNote(itemID: number, itemColor: any) { + this.notes = map(this.notes, (note: any) => { + if (note.id === itemID) { + return { + ...note, + color: itemColor + }; + } + return note; + }); + } + } +}); diff --git a/stores/apps/tickets.ts b/stores/apps/tickets.ts new file mode 100644 index 0000000..cf429d7 --- /dev/null +++ b/stores/apps/tickets.ts @@ -0,0 +1,62 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; +import { map } from 'lodash'; + +interface TicketType { + Id?: number | any; + ticketTitle?: string; + ticketDescription?: string; + Status?: string; + Label?:string; + thumb?:string; + AgentName?:string; + Date?: string | Date; +} + +interface ticketType { + ticket: TicketType[]; + ticketContent: number; + ticketearch: string; +} + +export const useTicketstore = defineStore({ + id: 'tickets', + state: (): ticketType => ({ + ticket: [], + ticketContent: 1, + ticketearch: '' + }), + actions: { + // Fetch ticket + async fetchTicket() { + try { + const data = await axios.get('/api/data/tickets/TicketData'); + this.ticket = data.data; + console.log(data); + } catch (error) { + alert(error); + console.log(error); + } + }, + + //select chat + SelectTicket(itemID: number) { + this.ticketContent = itemID; + }, + + + deleteTicket(itemID: number) { + const index = this.ticket.findIndex((p) => p.Id == itemID); + if (index !== -1) { + this.ticket = [...this.ticket.slice(0, index), ...this.ticket.slice(index + 1)]; + } + }, + // Add new ticket + addTicket(newTicket: TicketType) { + // You might want to assign an Id based on the current length or other logic + newTicket.Id = this.ticket.length > 0 ? Math.max(...this.ticket.map(t => t.Id)) + 1 : 1; // Auto-increment Id + this.ticket.push(newTicket); + } + } +}); diff --git a/stores/apps/userprofile/followers.ts b/stores/apps/userprofile/followers.ts new file mode 100644 index 0000000..447274f --- /dev/null +++ b/stores/apps/userprofile/followers.ts @@ -0,0 +1,23 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; + +export const useFollowersStore = defineStore({ + id: 'followers', + state: () => ({ + followers: [] + }), + getters: {}, + actions: { + // Fetch followers from action + async fetchFollowers() { + try { + const response = await axios.get('/api/followers/list'); + this.followers = response.data.followers; + } catch (error) { + alert(error); + console.log(error); + } + } + } +}); diff --git a/stores/apps/userprofile/friends.ts b/stores/apps/userprofile/friends.ts new file mode 100644 index 0000000..d760686 --- /dev/null +++ b/stores/apps/userprofile/friends.ts @@ -0,0 +1,23 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; + +export const useFrinedsStore = defineStore({ + id: 'Frineds', + state: () => ({ + friends: [] + }), + getters: {}, + actions: { + // Fetch followers from action + async fetchFrineds() { + try { + const response = await axios.get('/api/friends/list'); + this.friends = response.data.friends; + } catch (error) { + alert(error); + console.log(error); + } + } + } +}); diff --git a/stores/apps/userprofile/gallery.ts b/stores/apps/userprofile/gallery.ts new file mode 100644 index 0000000..7d3248b --- /dev/null +++ b/stores/apps/userprofile/gallery.ts @@ -0,0 +1,23 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; + +export const useGalleryStore = defineStore({ + id: 'Gallery', + state: () => ({ + gallery: [] + }), + getters: {}, + actions: { + // Fetch followers from action + async fetchGallery() { + try { + const response = await axios.get('/api/gallery/list'); + this.gallery = response.data.gallery; + } catch (error) { + alert(error); + console.log(error); + } + } + } +}); diff --git a/stores/apps/userprofile/photos.ts b/stores/apps/userprofile/photos.ts new file mode 100644 index 0000000..4e509ca --- /dev/null +++ b/stores/apps/userprofile/photos.ts @@ -0,0 +1,23 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; + +export const usePhotosStore = defineStore({ + id: 'Photos', + state: () => ({ + photos: [] + }), + getters: {}, + actions: { + // Fetch followers from action + async fetchPhotos() { + try { + const response = await axios.get('/api/photos'); + this.photos = response.data.photos; + } catch (error) { + alert(error); + console.log(error); + } + } + } +}); diff --git a/stores/apps/userprofile/posts.ts b/stores/apps/userprofile/posts.ts new file mode 100644 index 0000000..94be451 --- /dev/null +++ b/stores/apps/userprofile/posts.ts @@ -0,0 +1,54 @@ +import { defineStore } from 'pinia'; +// project imports +import axios from '@/utils/axios'; +import type { Reply } from '@/types/apps/PostType'; + +export const usePostsStore = defineStore({ + id: 'post', + state: () => ({ + posts: [] + }), + getters: {}, + actions: { + // Fetch Posts from action + async fetchPosts() { + try { + const response = await axios.get('/api/posts/list'); + this.posts = response.data; + } catch (error) { + alert(error); + console.log(error); + } + }, + // like post + async likePost(postId: string) { + try { + const response = await axios.post('/api/posts/list/like', { postId }); + this.posts = response.data.posts; + } catch (error) { + alert(error); + console.log(error); + } + }, + // add Comment + async addComment(postId: string, comment: Reply) { + try { + const response = await axios.post('/api/comments/add', { postId, comment }); + this.posts = response.data.posts; + } catch (error) { + alert(error); + console.log(error); + } + }, + // add Comment + async addReply(postId: string, commentId: string, reply: Reply) { + try { + const response = await axios.post('/api/replies/add', { postId, commentId, reply }); + this.posts = response.data.posts; + } catch (error) { + alert(error); + console.log(error); + } + } + } +}); diff --git a/stores/rolePages.ts b/stores/rolePages.ts index 812a556..4b6e86b 100644 --- a/stores/rolePages.ts +++ b/stores/rolePages.ts @@ -71,7 +71,12 @@ const rolePages = [ { title: "Sample Page Copy", path: "/sample-page-copy", - permissions: ["create", "view", "update", "delete"], + permissions: ["create", "view", "update"], + }, + { + title: "Sample Editable Table", + path: "/tables/TableEditable", + permissions: ["create", "view", "update"], }, ], },