1.0.0 • Published 1 year ago

terminal-dashboard v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Terminal Ads Dashboard

Table Of Content


Dependency.

  1. Vue.
  2. Vue Router.
  3. Axios.
  4. Vuetify.

Usage.

First clone this repository in your project or add as submodule.

git clone git@github.com:farbodpm/core-dashboard.git

or

git submodule add git@github.com:farbodpm/core-dashboard.git path/where/you/want

#for example.
git submodule add git@github.com:farbodpm/core-dashboard.git src/core/plugins/TerminalDashboard

#if module dosen`t clone successfuly try these 2 stpes.
git submodule init
git submodule update

then import install.js in main.js.

import TerminalDashboard from "./core/plugins/TerminalDashboard/install";

after that you must use this as plugin.

Vue.use(TerminalDashboard, ({
    store,
    config: () => ({                                                        // global configs for layout & dashboard
        dashboardConfig,                                                    // dashboard data
        static_top_menu,                                                    // links in top of menu
        header_logo: store.getters.headerLogo                               // set a getter in config.getters store
            || 'url',                                                       // or set a string
    }),
    headers: {
        Authorization: "Bearer " + localStorage.getItem("id_token"),        // send Authorization with Bearer anytime.
        Accept: 'application/json',
        "Access-Control-Allow-Origin": "*",
        'Content-Type': 'application/json',
    },
    permissions: () => window.Vue.$ability.j[0].actions,                    // this plugin need user permission for check user access.
    core_url: process.env.VUE_APP_CoreLandUrl,
    front_url: 'https://core.terminalads.com',
    sid: 2                                                                  // send ID for each project
}))

notice *

config field must have objects like this:
let dashboardConfig = {
    announcement: {
        img: 'https://core-robot.terminalads.com/advertisement-billboard-6097659-5013090.png', // url
        data: '12', // any
        text: 'آگهی ثبت شده', // any
        url: router.resolve({name: 'send.sms.divar'}).href // page to go
    },
    numbers: {
        img: require('./assets/img/rp.png'), // require from local assets
        data: '13',
        text: 'شماره ها',
        url: router.resolve({name: 'divar.report'}).href
    }
}

let static_top_menu = [
   {name: 'تعرفه', slug: 'https://google.com'},
]

now It's ready for use in router.js

find redirect: "/dashboard" and set this lines

routes: [
    {
        path: "/",
        redirect: "/dashboard",
        component: () => import("./core/plugins/TerminalDashboard/index"), // set Layoiut component from TerminalDashboard
        children: [
            {
                path: "/dashboard",
                name: "dashboard",
                component: () => import("./core/plugins/TerminalDashboard/Dashboard") // set Dashboard component from TerminalDashboard
            },
            ...{} // other children
        ],
    },
    ...{} // other routes
]
// other file contents

Update.

git submodule update --remote

Tips

On each installation of your project you need to run these steps.

git submodule init
git submodule update
1.0.0

1 year ago