diff --git a/.eslintignore b/.eslintignore index 34af3774..381689ca 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1 @@ -build/*.js -config/*.js +build/build.js diff --git a/.gitignore b/.gitignore index be86a2b1..071eee12 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules/ dist/ npm-debug.log +yarn-error.log selenium-debug.log test/unit/coverage test/e2e/reports diff --git a/.travis.yml b/.travis.yml index 1ba79696..b22fb8d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ sudo: false language: node_js node_js: - - "4" - "5" - "6" diff --git a/README.md b/README.md index e24855db..5d3b4814 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,36 @@
-

+

Vue Admin

Vue Admin Panel Framework, - Live Demo + Live Demo

Made with ❤︎ by Fangdun Cai and - contributors + contributors

NPM version MIT License -Linux Build +Linux Build Window Build Gitter

-![](screenshots/app.png) +![](screenshots/preview.jpg) ## Features -* Powered by [Vue][] **2.0** & [Bulma][] **0.2** +* Powered by [Vue][] **2.0** & [Bulma][] **0.3** * Responsive and Flexible Box Layout * [Variety of Charts](doc/charts.md) * [Rich Components](doc/components.md) or See [vue-bulma][] @@ -39,7 +39,77 @@ ## [Backers](backers.md) -Its ongoing development is made possible thanks to the support by these awesome backers. If you'd like to join them, check out [Vue Admin & Vue Bulma](https://www.patreon.com/_fundon)'s Patreon campaign. +Its ongoing development is made possible thanks to the support by these awesome backers. If you'd like to join them, check out: + +* [Patreon campaign](https://www.patreon.com/_fundon) + +* [OpenCollective](https://opencollective.com/vue-admin#backer): Support us with a monthly donation and help us continue our activities + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/vue-admin#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ## [Development](doc/development.md) @@ -47,25 +117,28 @@ Its ongoing development is made possible thanks to the support by these awesome ### Requirements - * NPM v3 + * Node >= v5 + + * NPM >= v3 * Webpack v2 ## Notes - If you want to use Vue Admin with Vue 1.0 version, please checkout the [vue-v1](https://github.com/fundon/vue-admin/tree/vue-v1) branch. + If you want to use Vue Admin with Vue 1.0 version, please checkout the [vue-v1](https://github.com/vue-bulma/vue-admin/tree/vue-v1) branch. + Launch Vue Admin as a desktop application! Please check [Run Project with Electron](https://github.com/vue-bulma/vue-admin/wiki/Guide#run-project-with-electron) ---- -> [fundon.me](https://fundon.me)  ·  -> GitHub [@fundon](https://github.com/fundon)  ·  -> Twitter [@_fundon](https://twitter.com/_fundon) +## Maintainers ++ [fundon](https://github.com/fundon)  ·  [fundon.me](https://fundon.me)  ·  [Twitter@fundon](https://twitter.com/_fundon) ++ [luventa](https://github.com/luventa) -[Live Demo]: https://vue-admin.fundon.me/ +[Live Demo]: https://admin.vuebulma.com/ [Fangdun Cai]: https://twitter.com/_fundon [Vue]: http://vuejs.org [Bulma]: http://bulma.io [Vue-bulma]: https://github.com/vue-bulma + diff --git a/backers.md b/backers.md index e69de29b..02a9d55f 100644 --- a/backers.md +++ b/backers.md @@ -0,0 +1,15 @@ +# Backers + +Thank you for your supports! + +* [WerGimity](https://www.patreon.com/user/creators?u=5268464) + +* [Thomas_Leong](https://www.patreon.com/user/creators?u=5244543) + +* [wen](https://www.patreon.com/user/creators?u=5239734) + +* [Joris Vanhecke](https://www.patreon.com/user/creators?u=5145359) + +* [datastream](https://www.patreon.com/user/creators?u=4315833) + +* [Lê Chương](https://www.patreon.com/user/creators?u=3495305) diff --git a/build/build.js b/build/build.js index 0c104e4f..e9624269 100755 --- a/build/build.js +++ b/build/build.js @@ -1,32 +1,31 @@ // https://github.com/shelljs/shelljs +'use strict' + +require('./check-versions')() require('shelljs/global') -env.NODE_ENV = 'production' -var path = require('path') -var config = require('../config') -var ora = require('ora') -var webpack = require('webpack') -var webpackConfig = require('./webpack.prod.conf') +env.NODE_ENV = 'production' -console.log( - ' Tip:\n' + - ' Built files are meant to be served over an HTTP server.\n' + - ' Opening index.html over file:// won\'t work.\n' -) +const ora = require('ora') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') -var spinner = ora('building for production...') +const spinner = ora('building for production...') spinner.start() -var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) +const assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) rm('-rf', assetsPath) mkdir('-p', assetsPath) -cp('-R', 'assets/', assetsPath) +cp('-R', 'assets/*', assetsPath) const compiler = webpack(webpackConfig) -var ProgressPlugin = require('webpack/lib/ProgressPlugin') +const ProgressPlugin = require('webpack/lib/ProgressPlugin') compiler.apply(new ProgressPlugin()) -compiler.run(function (err, stats) { +compiler.run((err, stats) => { spinner.stop() if (err) throw err process.stdout.write(stats.toString({ @@ -35,5 +34,11 @@ compiler.run(function (err, stats) { children: false, chunks: false, chunkModules: false - }) + '\n') + }) + '\n\n') + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) }) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 00000000..348d8b72 --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,47 @@ +'use strict' + +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') + +const exec = (cmd) => { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + }, + { + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + } +] + +module.exports = () => { + const warnings = [] + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + console.log() + process.exit(1) + } +} diff --git a/build/dev-client.js b/build/dev-client.js index 18aa1e21..cdc79471 100755 --- a/build/dev-client.js +++ b/build/dev-client.js @@ -1,8 +1,10 @@ +'use strict' + /* eslint-disable */ require('eventsource-polyfill') -var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') +const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') -hotClient.subscribe(function (event) { +hotClient.subscribe(event => { if (event.action === 'reload') { window.location.reload() } diff --git a/build/dev-server.js b/build/dev-server.js index ba4a50f9..cf2ab592 100755 --- a/build/dev-server.js +++ b/build/dev-server.js @@ -1,22 +1,29 @@ -var path = require('path') -var express = require('express') -var webpack = require('webpack') -var config = require('../config') -var proxyMiddleware = require('http-proxy-middleware') -var webpackConfig = process.env.NODE_ENV === 'testing' +'use strict' + +require('./check-versions')() + +const path = require('path') +const express = require('express') +const webpack = require('webpack') +const opn = require('opn') +const config = require('../config') +const proxyMiddleware = require('http-proxy-middleware') +const webpackConfig = process.env.NODE_ENV === 'testing' ? require('./webpack.prod.conf') : require('./webpack.dev.conf') // default port where dev server listens for incoming traffic -var port = process.env.PORT || config.dev.port +const port = process.env.PORT || config.dev.port +// automatically open browser, if not set will be false +const autoOpenBrowser = Boolean(config.dev.autoOpenBrowser) // Define HTTP proxies to your custom API backend // https://github.com/chimurai/http-proxy-middleware -var proxyTable = config.dev.proxyTable +const proxyTable = config.dev.proxyTable -var app = express() -var compiler = webpack(webpackConfig) +const app = express() +const compiler = webpack(webpackConfig) -var devMiddleware = require('webpack-dev-middleware')(compiler, { +const devMiddleware = require('webpack-dev-middleware')(compiler, { publicPath: webpackConfig.output.publicPath, stats: { colors: true, @@ -24,22 +31,22 @@ var devMiddleware = require('webpack-dev-middleware')(compiler, { } }) -var hotMiddleware = require('webpack-hot-middleware')(compiler) +const hotMiddleware = require('webpack-hot-middleware')(compiler) // force page reload when html-webpack-plugin template changes -compiler.plugin('compilation', function (compilation) { - compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { +compiler.plugin('compilation', compilation => { + compilation.plugin('html-webpack-plugin-after-emit', (data, cb) => { hotMiddleware.publish({ action: 'reload' }) cb() }) }) // proxy api requests -Object.keys(proxyTable).forEach(function (context) { - var options = proxyTable[context] +Object.keys(proxyTable).forEach(context => { + let options = proxyTable[context] if (typeof options === 'string') { options = { target: options } } - app.use(proxyMiddleware(context, options)) + app.use(proxyMiddleware(options.filter || context, options)) }) // handle fallback for HTML5 history API @@ -53,13 +60,23 @@ app.use(devMiddleware) app.use(hotMiddleware) // serve pure static assets -var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) +const staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) app.use(staticPath, express.static('./assets')) -module.exports = app.listen(port, function (err) { +const uri = 'http://localhost:' + port + +devMiddleware.waitUntilValid(() => { + console.log('> Listening at ' + uri + '\n') +}) + +module.exports = app.listen(port, err => { if (err) { console.log(err) return } - console.log('Listening at http://localhost:' + port + '\n') + + // when env is testing, don't need open it + if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') { + opn(uri) + } }) diff --git a/build/utils.js b/build/utils.js index 93c70bc4..5afbde6a 100755 --- a/build/utils.js +++ b/build/utils.js @@ -1,20 +1,22 @@ -var path = require('path') -var config = require('../config') -var ExtractTextPlugin = require('extract-text-webpack-plugin') +'use strict' -exports.assetsPath = function (_path) { - var assetsSubDirectory = process.env.NODE_ENV === 'production' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') + +exports.assetsPath = _path => { + const assetsSubDirectory = process.env.NODE_ENV === 'production' ? config.build.assetsSubDirectory : config.dev.assetsSubDirectory return path.posix.join(assetsSubDirectory, _path) } -exports.cssLoaders = function (options) { +exports.cssLoaders = options => { options = options || {} // generate loader string to be used with extract text plugin - function generateLoaders (loaders) { - var sourceLoader = loaders.map(function (loader) { - var extraParamChar + const generateLoaders = loaders => { + const sourceLoader = loaders.map(loader => { + let extraParamChar if (/\?/.test(loader)) { loader = loader.replace(/\?/, '-loader?') extraParamChar = '&' @@ -25,10 +27,12 @@ exports.cssLoaders = function (options) { return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '') }).join('!') + // Extract CSS when that option is specified + // (which is the case during production build) if (options.extract) { return ExtractTextPlugin.extract({ - fallbackLoader: 'style-loader', - loader: sourceLoader + use: sourceLoader, + fallback: 'vue-style-loader' }) } else { return ['vue-style-loader', sourceLoader].join('!') @@ -48,11 +52,11 @@ exports.cssLoaders = function (options) { } // Generate loaders for standalone style files (outside of .vue) -exports.styleLoaders = function (options) { - var output = [] - var loaders = exports.cssLoaders(options) - for (var extension in loaders) { - var loader = loaders[extension] +exports.styleLoaders = options => { + const output = [] + const loaders = exports.cssLoaders(options) + for (const extension of Object.keys(loaders)) { + const loader = loaders[extension] output.push({ test: new RegExp('\\.' + extension + '$'), loader: loader diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 00000000..d52eafc9 --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,18 @@ +'use strict' + +const utils = require('./utils') +const config = require('../config') + +const isProduction = process.env.NODE_ENV === 'production' + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: isProduction ? config.build.productionSourceMap : config.dev.cssSourceMap, + extract: isProduction + }), + postcss: [ + require('autoprefixer')({ + browsers: ['last 3 versions'] + }) + ] +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index a730e847..c3ea97fc 100755 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -1,68 +1,72 @@ +'use strict' + const path = require('path') -const webpack = require('webpack') const config = require('../config') const utils = require('./utils') const projectRoot = path.resolve(__dirname, '../') -const isProduction = process.env.NODE_ENV === 'production' - module.exports = { entry: { - app: './client/index.js', - vendor: ['vue', 'vue-router', 'vuex'] + app: ['./client/index.js'], + // If you want to support IE < 11, should add `babel-polyfill` to vendor. + // e.g. ['babel-polyfill', 'vue', 'vue-router', 'vuex'] + vendor: [ + 'vue', + 'vue-router', + 'vuex', + 'vuex-router-sync' + ] }, output: { path: config.build.assetsRoot, - publicPath: isProduction ? config.build.assetsPublicPath : config.dev.assetsPublicPath, + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath, filename: '[name].js' }, resolve: { extensions: ['.js', '.vue', '.css', '.json'], alias: { // https://github.com/vuejs/vue/wiki/Vue-2.0-RC-Starter-Resources - // 'vue': 'vue/dist/vue', - 'src': path.resolve(__dirname, '../client'), - 'assets': path.resolve(__dirname, '../client/assets'), - 'components': path.resolve(__dirname, '../client/components'), - 'views': path.resolve(__dirname, '../client/views'), + // vue: 'vue/dist/vue', + package: path.resolve(__dirname, '../package.json'), + src: path.resolve(__dirname, '../client'), + assets: path.resolve(__dirname, '../client/assets'), + components: path.resolve(__dirname, '../client/components'), + views: path.resolve(__dirname, '../client/views'), // third-party - 'plotly.js': 'plotly.js/dist/plotly' + 'plotly.js': 'plotly.js/dist/plotly', + // vue-addon + 'vuex-store': path.resolve(__dirname, '../client/store') } }, module: { loaders: [ { - test: /\.vue$/, - loader: ['eslint'], - include: projectRoot, - exclude: /node_modules/, - enforce: 'pre' - }, - { - test: /\.js/, - loader: ['eslint'], + test: /\.(js|vue)$/, + loader: 'eslint-loader', include: projectRoot, exclude: /node_modules/, - enforce: 'pre' + enforce: 'pre', + options: { + formatter: require('eslint-friendly-formatter') + } }, { test: /\.vue$/, - loader: ['vue'] + loader: 'vue-loader', + options: require('./vue-loader.conf') }, { test: /\.js$/, - loader: ['babel'], + loader: 'babel-loader', include: projectRoot, // /node_modules\/(?!vue-bulma-.*)/ - exclude: [new RegExp(`node_modules\\${path.sep}\(\?\!vue-bulma-.*\)`)] - }, - { - test: /\.json$/, - loader: 'json' + exclude: [new RegExp(`node_modules\\${path.sep}(?!vue-bulma-.*)`)] }, { test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, - loader: 'url', + loader: 'url-loader', query: { limit: 10000, name: utils.assetsPath('img/[name].[hash:7].[ext]') @@ -70,7 +74,7 @@ module.exports = { }, { test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, - loader: 'url', + loader: 'url-loader', query: { limit: 10000, name: utils.assetsPath('fonts/[name].[hash:7].[ext]') @@ -78,19 +82,8 @@ module.exports = { } ] }, - plugins: [ - new webpack.LoaderOptionsPlugin({ - vue: { - loaders: utils.cssLoaders({ - sourceMap: isProduction, - extract: isProduction - }), - postcss: [ - require('autoprefixer')({ - browsers: ['last 3 versions'] - }) - ] - } - }) - ] + // See https://github.com/webpack/webpack/issues/3486 + performance: { + hints: false + } } diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js index 60f465ed..65019c2b 100755 --- a/build/webpack.dev.conf.js +++ b/build/webpack.dev.conf.js @@ -1,3 +1,5 @@ +'use strict' + const webpack = require('webpack') const merge = require('webpack-merge') const HtmlWebpackPlugin = require('html-webpack-plugin') @@ -6,7 +8,7 @@ const config = require('../config') const utils = require('./utils') // add hot-reload related code to entry chunks -Object.keys(baseWebpackConfig.entry).forEach(function (name) { +Object.keys(baseWebpackConfig.entry).forEach(name => { baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) }) @@ -21,9 +23,8 @@ module.exports = merge(baseWebpackConfig, { 'process.env': config.dev.env }), // https://github.com/glenjamin/webpack-hot-middleware#installation--usage - new webpack.optimize.OccurrenceOrderPlugin(), new webpack.HotModuleReplacementPlugin(), - new webpack.NoErrorsPlugin(), + new webpack.NoEmitOnErrorsPlugin(), // extract vendor chunks for better caching new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index e2b77cba..ea265af6 100755 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -1,3 +1,5 @@ +'use strict' + const path = require('path') const webpack = require('webpack') const merge = require('webpack-merge') @@ -9,6 +11,7 @@ const utils = require('./utils') const env = process.env.NODE_ENV === 'testing' ? require('../config/test.env') : config.build.env +const isELECTRON = process.env.NODE_ELECTRON === 'true' const webpackConfig = merge(baseWebpackConfig, { module: { @@ -20,6 +23,7 @@ const webpackConfig = merge(baseWebpackConfig, { devtool: config.build.productionSourceMap ? '#source-map' : false, output: { path: config.build.assetsRoot, + publicPath: isELECTRON ? path.join(__dirname, '../dist/') : config.build.assetsPublicPath, filename: utils.assetsPath('js/[name].[chunkhash].js'), chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') }, @@ -32,6 +36,7 @@ const webpackConfig = merge(baseWebpackConfig, { minimize: true }), new webpack.optimize.UglifyJsPlugin({ + 'screw-ie8': true, sourceMap: true, compress: { warnings: false @@ -40,7 +45,6 @@ const webpackConfig = merge(baseWebpackConfig, { comments: false } }), - new webpack.optimize.OccurrenceOrderPlugin(), // extract css into its own file new ExtractTextPlugin(utils.assetsPath('css/[name].[contenthash].css')), // generate dist index.html with correct asset hash for caching. @@ -67,7 +71,7 @@ const webpackConfig = merge(baseWebpackConfig, { // split vendor js into its own file new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', - minChunks: function (module, count) { + minChunks (module, count) { // any required modules inside node_modules are extracted to vendor return ( module.resource && @@ -88,7 +92,7 @@ const webpackConfig = merge(baseWebpackConfig, { }) if (config.build.productionGzip) { - var CompressionWebpackPlugin = require('compression-webpack-plugin') + const CompressionWebpackPlugin = require('compression-webpack-plugin') webpackConfig.plugins.push( new CompressionWebpackPlugin({ diff --git a/client/App.vue b/client/App.vue index d555409e..2bf466ae 100755 --- a/client/App.vue +++ b/client/App.vue @@ -2,7 +2,7 @@
- +
@@ -11,6 +11,7 @@ @@ -53,7 +57,7 @@ export default { .animated { animation-duration: .377s; } - +@import '../scss/rtl.scss'; @import '~bulma'; @import '~wysiwyg.css/wysiwyg.sass'; @@ -61,6 +65,10 @@ export default { $fa-font-path: '~font-awesome/fonts/'; @import '~font-awesome/scss/font-awesome'; +html { + background-color: whitesmoke; +} + .nprogress-container { position: fixed !important; width: 100%; diff --git a/client/app.js b/client/app.js index 6678e2d0..9cc0f3fd 100755 --- a/client/app.js +++ b/client/app.js @@ -1,25 +1,47 @@ import Vue from 'vue' -import Resource from 'vue-resource' +import axios from 'axios' +import VueAxios from 'vue-axios' +import VueAuth from '@websanova/vue-auth' import NProgress from 'vue-nprogress' import { sync } from 'vuex-router-sync' import App from './App.vue' import router from './router' import store from './store' import * as filters from './filters' +import { TOGGLE_SIDEBAR } from 'vuex-store/mutation-types' + +Vue.router = router +Vue.use(VueAxios, axios) +Vue.use(VueAuth, { + auth: { + request: function (req, token) { + this.options.http._setHeaders.call(this, req, {Authorization: 'Bearer ' + token}) + }, + response: function (res) { + // Get Token from response body + return res.data + } + }, + http: require('@websanova/vue-auth/drivers/http/axios.1.x.js'), + router: require('@websanova/vue-auth/drivers/router/vue-router.2.x.js'), + loginData: { url: 'http://localhost:6789/login', fetchUser: false }, + refreshData: { enabled: false } +}) -Vue.use(Resource) Vue.use(NProgress) +// Enable devtools +Vue.config.devtools = true + sync(store, router) const nprogress = new NProgress({ parent: '.nprogress-container' }) const { state } = store -const { config } = state router.beforeEach((route, redirect, next) => { - if (config.mobile && config.sidebar) { - config.sidebar = false + if (state.app.device.isMobile && state.app.sidebar.opened) { + store.commit(TOGGLE_SIDEBAR, false) } next() }) diff --git a/client/components/layout/FooterBar.vue b/client/components/layout/FooterBar.vue index 870e9073..9a033b07 100644 --- a/client/components/layout/FooterBar.vue +++ b/client/components/layout/FooterBar.vue @@ -3,7 +3,7 @@

with by fundon.

-

Code licensed under MIT.

+

Code licensed under {{ license }}.

@@ -23,11 +23,24 @@ diff --git a/client/views/auth/Login.vue b/client/views/auth/Login.vue new file mode 100644 index 00000000..615b0762 --- /dev/null +++ b/client/views/auth/Login.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/client/views/axios/index.vue b/client/views/axios/index.vue new file mode 100644 index 00000000..e4c1608a --- /dev/null +++ b/client/views/axios/index.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/client/views/charts/CanvasGauges.vue b/client/views/charts/CanvasGauges.vue deleted file mode 100644 index a28d38b4..00000000 --- a/client/views/charts/CanvasGauges.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - - - diff --git a/client/views/charts/Chartjs.vue b/client/views/charts/Chartjs.vue index 8215bf78..74e0668c 100644 --- a/client/views/charts/Chartjs.vue +++ b/client/views/charts/Chartjs.vue @@ -84,7 +84,7 @@ export default { ], labels_2: ['April', 'May', 'June', 'Jule', 'August', 'September', 'October', 'November', 'December'], - data_2: [1, 9, 3, 4, 5, 6, 7, 8, 2].map(e => Math.sin(e) * 25 + 25), + data_2: [1, 9, 3, 4, 5, 6, 7, 8, 2].map(e => (Math.sin(e) * 25) + 25), labels_3: ['May', 'June', 'Jule', 'August', 'September', 'October', 'November'], data_3: [ diff --git a/client/views/components/Brace.vue b/client/views/components/Brace.vue new file mode 100644 index 00000000..f71c343b --- /dev/null +++ b/client/views/components/Brace.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/client/views/components/Datepicker.vue b/client/views/components/Datepicker.vue index 8d47751a..be74b9f3 100644 --- a/client/views/components/Datepicker.vue +++ b/client/views/components/Datepicker.vue @@ -5,7 +5,7 @@

Basics

- +

@@ -30,68 +30,87 @@

-
+

Form addons

- + -

Inline or embedded calendar

-

- -

+
+

Display week numbers

+
+

Date Range

+

+ +

+
-
+
-

DateTime or Time Picker

+

Preload date and time

- + + +

- +

- + +

+
+
+

UTC mode

+

+

- +

-

Preload date and time

+

Inline or embedded calendar

- +

+
+
+
+ +
+
+
+

DateTime Picker

- +

- +

-

UTC mode

- +

+
+
+

Time Picker

- +

-
- -
-
+

Disable specific dates or date intervals

@@ -101,10 +120,8 @@

-
-
-

Setting options on the fly

+

Setting options dynamically

@@ -128,7 +145,7 @@

Localization

- +

@@ -152,12 +169,12 @@ export default { mounted () { const { checkIn, checkOut } = this.$refs - checkIn.datepicker.set('onChange', (d) => { - checkOut.datepicker.set('minDate', d.fp_incr(1)) + checkIn.datepicker.set('onChange', (selectedDates, dateStr, instance) => { + checkOut.datepicker.set('minDate', selectedDates[0].fp_incr(1)) }) - checkOut.datepicker.set('onChange', (d) => { - checkIn.datepicker.set('maxDate', d) + checkOut.datepicker.set('onChange', (selectedDates, dateStr, instance) => { + checkIn.datepicker.set('maxDate', dateStr) }) }, diff --git a/client/views/components/Default.vue b/client/views/components/Default.vue index 2f75c484..276375b9 100644 --- a/client/views/components/Default.vue +++ b/client/views/components/Default.vue @@ -2,63 +2,66 @@
-
-
-

{{ item.name }}

-
-
-
{{ getDescription(item) }}
-
- -
+ + + + +    + Repository + + + + +    + Demo + +
- +
+ + diff --git a/client/views/components/Modal.vue b/client/views/components/Modal.vue index a61ed41d..c4aed3d9 100644 --- a/client/views/components/Modal.vue +++ b/client/views/components/Modal.vue @@ -1,6 +1,5 @@ @@ -32,25 +32,21 @@ import Modal from './modals/Modal' import ImageModal from './modals/ImageModal' import CardModal from './modals/CardModal' -const ModalComponent = Vue.extend(Modal) const ImageModalComponent = Vue.extend(ImageModal) const CardModalComponent = Vue.extend(CardModal) -const openModal = (propsData = {}) => { - return new ModalComponent({ - el: document.createElement('div'), - propsData - }) -} - -const openImageModal = (propsData = {}) => { +const openImageModal = (propsData = { + visible: true +}) => { return new ImageModalComponent({ el: document.createElement('div'), propsData }) } -const openCardModal = (propsData = {}) => { +const openCardModal = (propsData = { + visible: true +}) => { return new CardModalComponent({ el: document.createElement('div'), propsData @@ -62,19 +58,34 @@ export default { Modal }, + data () { + return { + showModal: true, + cardModal: null, + imageModal: null + } + }, + methods: { openModalBasic () { - openModal() + this.showModal = true + }, + + closeModalBasic () { + this.showModal = false }, openModalImage () { - openImageModal() + const imageModal = this.imageModal || (this.imageModal = openImageModal()) + imageModal.$children[0].active() }, openModalCard () { - openCardModal({ - title: 'Modal title' - }) + const cardModal = this.cardModal || (this.cardModal = openCardModal({ + title: 'Modal title', + url: this.$store.state.pkg.homepage + })) + cardModal.$children[0].active() } } } diff --git a/client/views/components/ProgressTracker.vue b/client/views/components/ProgressTracker.vue index ff755c19..8250b994 100644 --- a/client/views/components/ProgressTracker.vue +++ b/client/views/components/ProgressTracker.vue @@ -6,19 +6,19 @@

Tracker Styles

- + - + - + - + - +
@@ -39,31 +39,31 @@

Tracker Alignments

- + - + - + - + - + - + - + - + - +
diff --git a/client/views/components/Quill.vue b/client/views/components/Quill.vue index 9a2ab40c..481c070e 100644 --- a/client/views/components/Quill.vue +++ b/client/views/components/Quill.vue @@ -1,19 +1,17 @@