项目作者: topfullstack

项目描述 :
An Admin Dashboard based on Vuetify material
高级语言: Vue
项目地址: git://github.com/topfullstack/adminify.git
创建时间: 2017-05-24T13:10:07Z
项目社区:https://github.com/topfullstack/adminify

开源协议:MIT License

下载


Adminify

[Deprecated]: Please check REST-ADMIN - admin dashboard based on vue 2 and bootstrap v4

Join the chat at https://gitter.im/vue-adminify/Lobby

  • An Admin dashboard based on Vuetify .
  • Data in demo use axios-mock-adapter
  • Better Server API is built on AdonisJs .
  • Also welcome to Adonis China .

Live Demo

http://adminify.genyii.com

Features

  • Vue + Vue Router + Vuex + Axios.
  • Material Design Style - Vuetify
  • Data Grid with server side sort,search,pagination and json config.
  • Dynamic Form Builder with text,textarea,radios,checkboxes,select,html input types and json config.
  • Built in localStorage proxy for any data types.
  • Axios Mock with axios-mock-adapter
  • Configurable side menu with json
  • i18n with vue-i18n
  • Basic and Main layouts
  • Stylus processor
  • And more of your requests.

Getting start

  1. git clone https://github.com/wxs77577/adminify.git
  2. Copy src/config.sample.js to src/config.js
  3. npm install
  4. npm run dev
  5. Remove line:6 ~ line:9 in /src/http.js to speed up page loading if you don’t need http mock.

Use cnpm instead npm in China

Screenshots

1.png 2.png
3.png 4.png
5.png 6.png
7.png
Wechat Group Free Videos

Config

src/config.js

  1. const baseUrl = 'http://localhost:3333'
  2. const config = {
  3. locale: 'en-US', //en-US, zh-CN
  4. url: baseUrl,
  5. debug: {
  6. mock: 1, //enable mock
  7. http: true, //http request log
  8. },
  9. api: `${baseUrl}/admin/api`
  10. // locale: 'en', //en
  11. // api: 'http://192.168.1.108:3333/admin/api'
  12. }

Menu Config

src/menu.js
```javascript
export default [
{ “href”: “/“, “title”: “Home”, “icon”: “home” },
{ “href”: “/crud/types”, “title”: “Types”, “icon”: “view_list” },
{ “href”: “/crud/posts”, “title”: “Posts”, “icon”: “view_list” },
{ “href”: “/crud/posts/create”, “title”: “Create Post”, “icon”: “note_add” },

{ “href”: “/crud/comments”, “title”: “Comments”, “icon”: “view_list” },
{ “href”: “/crud/users”, “title”: “Users”, “icon”: “people” },

{ “href”: “/chat”, “title”: “Chat”, “icon”: “chat” },
{
“title”: “Pages”,
“icon”: “domain”,
“items”: [
{ “href”: “/example”, “title”: “Example” },
{ “href”: “/about”, “title”: “About” }
]
},
{ “href”: “/settings”, “title”: “Settings”, “icon”: “settings” },

{ “href”: “/login”, “icon”: “lock”, “title”: “Logout” }
]

  1. > No more explaination needed right?
  2. ## Routes
  3. > Part of `src/router.js`
  4. ```javascript
  5. // The signature of `route` function :
  6. function route(path, file, name, children) {}
  7. //routes
  8. [
  9. route('/login', 'Login', 'login'),
  10. route('/error', 'Error', 'error'),
  11. //path, file(*.vue), name, children
  12. route('/', 'Main', null, [
  13. route('/', 'Home', 'home'),
  14. route('/crud/:resource', 'CrudGrid', 'grid'),
  15. route('/crud/:resource/:id/edit', 'CrudForm', 'edit'),
  16. route('/crud/:resource/create', 'CrudForm', 'create'),
  17. route('/crud/:resource/:id/:action', 'CrudForm', 'action'),
  18. route('/crud/:resource/:action', 'CrudForm', 'indexAction'),
  19. route('/example', 'Example'),
  20. route('/settings', 'Settings'),
  21. route('/theme', 'Theme'),
  22. route('/chat', 'Chat'),
  23. route('/about', 'About'),
  24. ]),
  25. // Global redirect for 404
  26. { path: '*', redirect: '/error', query: {code: 404, message: 'Page Not Found.'} }
  27. ]

Grid View Config

src/mock/index.js

  1. mock.onGet('/types/grid').reply(200, {
  2. "options": {
  3. "sort": "id", //default sort column
  4. "create": false, //show Create button
  5. "update": true, //show update button
  6. "delete": false //show delete button
  7. },
  8. "filters": {
  9. "model": {
  10. "name": "",
  11. "created_at": ""
  12. },
  13. "fields": { //filters fields config
  14. "name": {
  15. "label": "Name"
  16. },
  17. "created_at": {
  18. "label": "Created At",
  19. "type": "date"
  20. }
  21. },
  22. "rules": {}
  23. },
  24. "columns": [ //columns config
  25. {
  26. "text": "Id", //column header text
  27. "value": "id" //field name
  28. },
  29. {
  30. "text": "Name",
  31. left: true, //make text align left, default is right
  32. "value": "name"
  33. }
  34. ]
  35. });

Grid View Data

src/mock/index.js

  1. mock.onGet(/\/(posts|users|types|comments)$/).reply(({ params = { page: 1, perPage: 10 }, url }) => {
  2. let resource = url.split('/')[1]
  3. let offset = (params.page - 1) * params.perPage
  4. let models = data[resource]
  5. return [200, { //return like this format
  6. currentPage: params.page,
  7. lastPage: Math.ceil(models.length / params.perPage),
  8. perPage: params.perPage,
  9. total: data[resource].length,
  10. data: models.slice(offset, offset + params.perPage)
  11. }]
  12. });

Form Builder Config

src/mock/index.js

  1. mock.onGet('/settings/form').reply(({ params }) => {
  2. return [200, {
  3. "model": { //form model
  4. name: 'Adminify',
  5. logo: 'http://placeimg.com/128/128/any',
  6. date: null,
  7. type: 1,
  8. status: 1,
  9. tags: [],
  10. description: 'An Awesome Site',
  11. intro: '',
  12. },
  13. "fields": { //form fields
  14. "name": {label: 'Name'}, //default type is 'text'
  15. "logo": {label: 'Logo', type: 'image'}, //working in progress
  16. "date": {label: 'Created At', type: 'date'},
  17. "type": {label: 'Type', type: 'select', options: [
  18. {text: 'Blog', value: 1},
  19. {text: 'Company', value: 2},
  20. {text: 'Game', value: 3},
  21. ]},
  22. "status": {label: 'Status', type: 'radios', width: 'md3', options: [
  23. {text: 'Enabled', value: 1},
  24. {text: 'Disabled', value: 2}
  25. ]},
  26. "tags": {label: 'Tags', type: 'checkboxes', width: 'md3', options: [
  27. {text: 'Enabled', value: 1},
  28. {text: 'Disabled', value: 2}
  29. ]},
  30. "description": {label: 'Description', type: 'textarea'},
  31. "intro": {label: 'Intro', type: 'html'},
  32. }
  33. }]
  34. })

Comunication

Gitter IM

https://gitter.im/vue-adminify/