[
  {
    "path": ".babelrc",
    "content": "{\n  \"comments\": false,\n  \"env\": {\n    \"test\": {\n      \"presets\": [\n        [\"env\", {\n          \"targets\": { \"node\": 7 }\n        }],\n        \"stage-0\"\n      ],\n      \"plugins\": [\"istanbul\"]\n    },\n    \"main\": {\n      \"presets\": [\n        [\"env\", {\n          \"targets\": { \"node\": 7 }\n        }],\n        \"stage-0\"\n      ]\n    },\n    \"renderer\": {\n      \"presets\": [\n        [\"env\", {\n          \"modules\": false\n        }],\n        \"stage-0\"\n      ]\n    },\n    \"web\": {\n      \"presets\": [\n        [\"env\", {\n          \"modules\": false\n        }],\n        \"stage-0\"\n      ]\n    }\n  },\n  \"plugins\": [\"transform-runtime\"]\n}\n"
  },
  {
    "path": ".electron-vue/build.js",
    "content": "'use strict'\n\nprocess.env.NODE_ENV = 'production'\n\nconst { say } = require('cfonts')\nconst chalk = require('chalk')\nconst del = require('del')\nconst { spawn } = require('child_process')\nconst webpack = require('webpack')\nconst Multispinner = require('multispinner')\n\n\nconst mainConfig = require('./webpack.main.config')\nconst rendererConfig = require('./webpack.renderer.config')\nconst webConfig = require('./webpack.web.config')\n\nconst doneLog = chalk.bgGreen.white(' DONE ') + ' '\nconst errorLog = chalk.bgRed.white(' ERROR ') + ' '\nconst okayLog = chalk.bgBlue.white(' OKAY ') + ' '\nconst isCI = process.env.CI || false\n\nif (process.env.BUILD_TARGET === 'clean') clean()\nelse if (process.env.BUILD_TARGET === 'web') web()\nelse build()\n\nfunction clean () {\n  del.sync(['build/*', '!build/icons', '!build/icons/icon.*'])\n  console.log(`\\n${doneLog}\\n`)\n  process.exit()\n}\n\nfunction build () {\n  greeting()\n\n  del.sync(['dist/electron/*', '!.gitkeep'])\n\n  const tasks = ['main', 'renderer']\n  const m = new Multispinner(tasks, {\n    preText: 'building',\n    postText: 'process'\n  })\n\n  let results = ''\n\n  m.on('success', () => {\n    process.stdout.write('\\x1B[2J\\x1B[0f')\n    console.log(`\\n\\n${results}`)\n    console.log(`${okayLog}take it away ${chalk.yellow('`electron-builder`')}\\n`)\n    process.exit()\n  })\n\n  pack(mainConfig).then(result => {\n    results += result + '\\n\\n'\n    m.success('main')\n  }).catch(err => {\n    m.error('main')\n    console.log(`\\n  ${errorLog}failed to build main process`)\n    console.error(`\\n${err}\\n`)\n    process.exit(1)\n  })\n\n  pack(rendererConfig).then(result => {\n    results += result + '\\n\\n'\n    m.success('renderer')\n  }).catch(err => {\n    m.error('renderer')\n    console.log(`\\n  ${errorLog}failed to build renderer process`)\n    console.error(`\\n${err}\\n`)\n    process.exit(1)\n  })\n}\n\nfunction pack (config) {\n  return new Promise((resolve, reject) => {\n    webpack(config, (err, stats) => {\n      if (err) reject(err.stack || err)\n      else if (stats.hasErrors()) {\n        let err = ''\n\n        stats.toString({\n          chunks: false,\n          colors: true\n        })\n        .split(/\\r?\\n/)\n        .forEach(line => {\n          err += `    ${line}\\n`\n        })\n\n        reject(err)\n      } else {\n        resolve(stats.toString({\n          chunks: false,\n          colors: true\n        }))\n      }\n    })\n  })\n}\n\nfunction web () {\n  del.sync(['dist/web/*', '!.gitkeep'])\n  webpack(webConfig, (err, stats) => {\n    if (err || stats.hasErrors()) console.log(err)\n\n    console.log(stats.toString({\n      chunks: false,\n      colors: true\n    }))\n\n    process.exit()\n  })\n}\n\nfunction greeting () {\n  const cols = process.stdout.columns\n  let text = ''\n\n  if (cols > 85) text = 'lets-build'\n  else if (cols > 60) text = 'lets-|build'\n  else text = false\n\n  if (text && !isCI) {\n    say(text, {\n      colors: ['yellow'],\n      font: 'simple3d',\n      space: false\n    })\n  } else console.log(chalk.yellow.bold('\\n  lets-build'))\n  console.log()\n}\n"
  },
  {
    "path": ".electron-vue/dev-client.js",
    "content": "const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')\n\nhotClient.subscribe(event => {\n  /**\n   * Reload browser when HTMLWebpackPlugin emits a new index.html\n   */\n  if (event.action === 'reload') {\n    window.location.reload()\n  }\n\n  /**\n   * Notify `mainWindow` when `main` process is compiling,\n   * giving notice for an expected reload of the `electron` process\n   */\n  if (event.action === 'compiling') {\n    document.body.innerHTML += `\n      <style>\n        #dev-client {\n          background: #4fc08d;\n          border-radius: 4px;\n          bottom: 20px;\n          box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3);\n          color: #fff;\n          font-family: 'Source Sans Pro', sans-serif;\n          left: 20px;\n          padding: 8px 12px;\n          position: absolute;\n        }\n      </style>\n\n      <div id=\"dev-client\">\n        Compiling Main Process...\n      </div>\n    `\n  }\n})\n"
  },
  {
    "path": ".electron-vue/dev-runner.js",
    "content": "'use strict'\n\nconst chalk = require('chalk')\nconst electron = require('electron')\nconst path = require('path')\nconst { say } = require('cfonts')\nconst { spawn } = require('child_process')\nconst webpack = require('webpack')\nconst WebpackDevServer = require('webpack-dev-server')\nconst webpackHotMiddleware = require('webpack-hot-middleware')\n\nconst mainConfig = require('./webpack.main.config')\nconst rendererConfig = require('./webpack.renderer.config')\n\nlet electronProcess = null\nlet manualRestart = false\nlet hotMiddleware\n\nfunction logStats (proc, data) {\n  let log = ''\n\n  log += chalk.yellow.bold(`┏ ${proc} Process ${new Array((19 - proc.length) + 1).join('-')}`)\n  log += '\\n\\n'\n\n  if (typeof data === 'object') {\n    data.toString({\n      colors: true,\n      chunks: false\n    }).split(/\\r?\\n/).forEach(line => {\n      log += '  ' + line + '\\n'\n    })\n  } else {\n    log += `  ${data}\\n`\n  }\n\n  log += '\\n' + chalk.yellow.bold(`┗ ${new Array(28 + 1).join('-')}`) + '\\n'\n\n  console.log(log)\n}\n\nfunction startRenderer () {\n  return new Promise((resolve, reject) => {\n    rendererConfig.entry.renderer = [path.join(__dirname, 'dev-client')].concat(rendererConfig.entry.renderer)\n\n    const compiler = webpack(rendererConfig)\n    hotMiddleware = webpackHotMiddleware(compiler, { \n      log: false, \n      heartbeat: 2500 \n    })\n\n    compiler.plugin('compilation', compilation => {\n      compilation.plugin('html-webpack-plugin-after-emit', (data, cb) => {\n        hotMiddleware.publish({ action: 'reload' })\n        cb()\n      })\n    })\n\n    compiler.plugin('done', stats => {\n      logStats('Renderer', stats)\n    })\n\n    const server = new WebpackDevServer(\n      compiler,\n      {\n        contentBase: path.join(__dirname, '../'),\n        quiet: true,\n        setup (app, ctx) {\n          app.use(hotMiddleware)\n          ctx.middleware.waitUntilValid(() => {\n            resolve()\n          })\n        }\n      }\n    )\n\n    server.listen(9080)\n  })\n}\n\nfunction startMain () {\n  return new Promise((resolve, reject) => {\n    mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main)\n\n    const compiler = webpack(mainConfig)\n\n    compiler.plugin('watch-run', (compilation, done) => {\n      logStats('Main', chalk.white.bold('compiling...'))\n      hotMiddleware.publish({ action: 'compiling' })\n      done()\n    })\n\n    compiler.watch({}, (err, stats) => {\n      if (err) {\n        console.log(err)\n        return\n      }\n\n      logStats('Main', stats)\n\n      if (electronProcess && electronProcess.kill) {\n        manualRestart = true\n        process.kill(electronProcess.pid)\n        electronProcess = null\n        startElectron()\n\n        setTimeout(() => {\n          manualRestart = false\n        }, 5000)\n      }\n\n      resolve()\n    })\n  })\n}\n\nfunction startElectron () {\n  electronProcess = spawn(electron, ['--inspect=5858', path.join(__dirname, '../dist/electron/main.js')])\n\n  electronProcess.stdout.on('data', data => {\n    electronLog(data, 'blue')\n  })\n  electronProcess.stderr.on('data', data => {\n    electronLog(data, 'red')\n  })\n\n  electronProcess.on('close', () => {\n    if (!manualRestart) process.exit()\n  })\n}\n\nfunction electronLog (data, color) {\n  let log = ''\n  data = data.toString().split(/\\r?\\n/)\n  data.forEach(line => {\n    log += `  ${line}\\n`\n  })\n  if (/[0-9A-z]+/.test(log)) {\n    console.log(\n      chalk[color].bold('┏ Electron -------------------') +\n      '\\n\\n' +\n      log +\n      chalk[color].bold('┗ ----------------------------') +\n      '\\n'\n    )\n  }\n}\n\nfunction greeting () {\n  const cols = process.stdout.columns\n  let text = ''\n\n  if (cols > 104) text = 'electron-vue'\n  else if (cols > 76) text = 'electron-|vue'\n  else text = false\n\n  if (text) {\n    say(text, {\n      colors: ['yellow'],\n      font: 'simple3d',\n      space: false\n    })\n  } else console.log(chalk.yellow.bold('\\n  electron-vue'))\n  console.log(chalk.blue('  getting ready...') + '\\n')\n}\n\nfunction init () {\n  greeting()\n\n  Promise.all([startRenderer(), startMain()])\n    .then(() => {\n      startElectron()\n    })\n    .catch(err => {\n      console.error(err)\n    })\n}\n\ninit()\n"
  },
  {
    "path": ".electron-vue/webpack.main.config.js",
    "content": "'use strict'\n\nprocess.env.BABEL_ENV = 'main'\n\nconst path = require('path')\nconst { dependencies } = require('../package.json')\nconst webpack = require('webpack')\n\nconst BabiliWebpackPlugin = require('babili-webpack-plugin')\n\nlet mainConfig = {\n  entry: {\n    main: path.join(__dirname, '../src/main/index.js')\n  },\n  externals: [\n    ...Object.keys(dependencies || {})\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.(js)$/,\n        enforce: 'pre',\n        exclude: /node_modules/,\n        use: {\n          loader: 'eslint-loader',\n          options: {\n            formatter: require('eslint-friendly-formatter')\n          }\n        }\n      },\n      {\n        test: /\\.js$/,\n        use: 'babel-loader',\n        exclude: /node_modules/\n      },\n      {\n        test: /\\.node$/,\n        use: 'node-loader'\n      }\n    ]\n  },\n  node: {\n    __dirname: process.env.NODE_ENV !== 'production',\n    __filename: process.env.NODE_ENV !== 'production'\n  },\n  output: {\n    filename: '[name].js',\n    libraryTarget: 'commonjs2',\n    path: path.join(__dirname, '../dist/electron')\n  },\n  plugins: [\n    new webpack.NoEmitOnErrorsPlugin()\n  ],\n  resolve: {\n    extensions: ['.js', '.json', '.node']\n  },\n  target: 'electron-main'\n}\n\n/**\n * Adjust mainConfig for development settings\n */\nif (process.env.NODE_ENV !== 'production') {\n  mainConfig.plugins.push(\n    new webpack.DefinePlugin({\n      '__static': `\"${path.join(__dirname, '../static').replace(/\\\\/g, '\\\\\\\\')}\"`\n    })\n  )\n}\n\n/**\n * Adjust mainConfig for production settings\n */\nif (process.env.NODE_ENV === 'production') {\n  mainConfig.plugins.push(\n    new BabiliWebpackPlugin({\n      removeConsole: true,\n      removeDebugger: true\n    }),\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"production\"'\n    })\n  )\n}\n\nmodule.exports = mainConfig\n"
  },
  {
    "path": ".electron-vue/webpack.renderer.config.js",
    "content": "'use strict'\n\nprocess.env.BABEL_ENV = 'renderer'\n\nconst path = require('path')\nconst { dependencies } = require('../package.json')\nconst webpack = require('webpack')\n\nconst BabiliWebpackPlugin = require('babili-webpack-plugin')\nconst CopyWebpackPlugin = require('copy-webpack-plugin')\nconst ExtractTextPlugin = require('extract-text-webpack-plugin')\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\n\n/**\n * List of node_modules to include in webpack bundle\n *\n * Required for specific packages like Vue UI libraries\n * that provide pure *.vue files that need compiling\n * https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals\n */\nlet whiteListedModules = ['vue']\n\nlet rendererConfig = {\n  devtool: '#cheap-module-eval-source-map',\n  entry: {\n    renderer: path.join(__dirname, '../src/renderer/main.js')\n  },\n  externals: [\n    ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d))\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.(js|vue)$/,\n        enforce: 'pre',\n        exclude: /node_modules/,\n        use: {\n          loader: 'eslint-loader',\n          options: {\n            formatter: require('eslint-friendly-formatter')\n          }\n        }\n      },\n      {\n        test: /\\.css$/,\n        use: ExtractTextPlugin.extract({\n          fallback: 'style-loader',\n          use: 'css-loader'\n        })\n      },\n      {\n        test: /\\.html$/,\n        use: 'vue-html-loader'\n      },\n      {\n        test: /\\.js$/,\n        use: 'babel-loader',\n        exclude: /node_modules/\n      },\n      {\n        test: /\\.node$/,\n        use: 'node-loader'\n      },\n      {\n        test: /\\.vue$/,\n        use: {\n          loader: 'vue-loader',\n          options: {\n            extractCSS: process.env.NODE_ENV === 'production',\n            loaders: {\n              sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',\n              scss: 'vue-style-loader!css-loader!sass-loader'\n            }\n          }\n        }\n      },\n      {\n        test: /\\.(png|jpe?g|gif|svg)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'imgs/[name].[ext]'\n          }\n        }\n      },\n      {\n        test: /\\.(woff2?|eot|ttf|otf)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'fonts/[name].[ext]'\n          }\n        }\n      }\n    ]\n  },\n  node: {\n    __dirname: process.env.NODE_ENV !== 'production',\n    __filename: process.env.NODE_ENV !== 'production'\n  },\n  plugins: [\n    new ExtractTextPlugin('styles.css'),\n    new HtmlWebpackPlugin({\n      filename: 'index.html',\n      template: path.resolve(__dirname, '../src/index.ejs'),\n      minify: {\n        collapseWhitespace: true,\n        removeAttributeQuotes: true,\n        removeComments: true\n      },\n      nodeModules: process.env.NODE_ENV !== 'production'\n        ? path.resolve(__dirname, '../node_modules')\n        : false\n    }),\n    new webpack.HotModuleReplacementPlugin(),\n    new webpack.NoEmitOnErrorsPlugin()\n  ],\n  output: {\n    filename: '[name].js',\n    libraryTarget: 'commonjs2',\n    path: path.join(__dirname, '../dist/electron')\n  },\n  resolve: {\n    alias: {\n      '@': path.join(__dirname, '../src/renderer'),\n      'vue$': 'vue/dist/vue.esm.js'\n    },\n    extensions: ['.js', '.vue', '.json', '.css', '.node']\n  },\n  target: 'electron-renderer'\n}\n\n/**\n * Adjust rendererConfig for development settings\n */\nif (process.env.NODE_ENV !== 'production') {\n  rendererConfig.plugins.push(\n    new webpack.DefinePlugin({\n      '__static': `\"${path.join(__dirname, '../static').replace(/\\\\/g, '\\\\\\\\')}\"`\n    })\n  )\n}\n\n/**\n * Adjust rendererConfig for production settings\n */\nif (process.env.NODE_ENV === 'production') {\n  rendererConfig.devtool = ''\n\n  rendererConfig.plugins.push(\n    new BabiliWebpackPlugin({\n      removeConsole: true,\n      removeDebugger: true\n    }),\n    new CopyWebpackPlugin([\n      {\n        from: path.join(__dirname, '../static'),\n        to: path.join(__dirname, '../dist/electron/static'),\n        ignore: ['.*']\n      }\n    ]),\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"production\"'\n    }),\n    new webpack.LoaderOptionsPlugin({\n      minimize: true\n    })\n  )\n}\n\nmodule.exports = rendererConfig\n"
  },
  {
    "path": ".electron-vue/webpack.web.config.js",
    "content": "'use strict'\n\nprocess.env.BABEL_ENV = 'web'\n\nconst path = require('path')\nconst webpack = require('webpack')\n\nconst BabiliWebpackPlugin = require('babili-webpack-plugin')\nconst CopyWebpackPlugin = require('copy-webpack-plugin')\nconst ExtractTextPlugin = require('extract-text-webpack-plugin')\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\n\nlet webConfig = {\n  devtool: '#cheap-module-eval-source-map',\n  entry: {\n    web: path.join(__dirname, '../src/renderer/main.js')\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.(js|vue)$/,\n        enforce: 'pre',\n        exclude: /node_modules/,\n        use: {\n          loader: 'eslint-loader',\n          options: {\n            formatter: require('eslint-friendly-formatter')\n          }\n        }\n      },\n      {\n        test: /\\.css$/,\n        use: ExtractTextPlugin.extract({\n          fallback: 'style-loader',\n          use: 'css-loader'\n        })\n      },\n      {\n        test: /\\.html$/,\n        use: 'vue-html-loader'\n      },\n      {\n        test: /\\.js$/,\n        use: 'babel-loader',\n        include: [ path.resolve(__dirname, '../src/renderer') ],\n        exclude: /node_modules/\n      },\n      {\n        test: /\\.vue$/,\n        use: {\n          loader: 'vue-loader',\n          options: {\n            extractCSS: true,\n            loaders: {\n              sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',\n              scss: 'vue-style-loader!css-loader!sass-loader'\n            }\n          }\n        }\n      },\n      {\n        test: /\\.(png|jpe?g|gif|svg)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'imgs/[name].[ext]'\n          }\n        }\n      },\n      {\n        test: /\\.(woff2?|eot|ttf|otf)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'fonts/[name].[ext]'\n          }\n        }\n      }\n    ]\n  },\n  plugins: [\n    new ExtractTextPlugin('styles.css'),\n    new HtmlWebpackPlugin({\n      filename: 'index.html',\n      template: path.resolve(__dirname, '../src/index.ejs'),\n      minify: {\n        collapseWhitespace: true,\n        removeAttributeQuotes: true,\n        removeComments: true\n      },\n      nodeModules: false\n    }),\n    new webpack.DefinePlugin({\n      'process.env.IS_WEB': 'true'\n    }),\n    new webpack.HotModuleReplacementPlugin(),\n    new webpack.NoEmitOnErrorsPlugin()\n  ],\n  output: {\n    filename: '[name].js',\n    path: path.join(__dirname, '../dist/web')\n  },\n  resolve: {\n    alias: {\n      '@': path.join(__dirname, '../src/renderer'),\n      'vue$': 'vue/dist/vue.esm.js'\n    },\n    extensions: ['.js', '.vue', '.json', '.css']\n  },\n  target: 'web'\n}\n\n/**\n * Adjust webConfig for production settings\n */\nif (process.env.NODE_ENV === 'production') {\n  webConfig.devtool = ''\n\n  webConfig.plugins.push(\n    new BabiliWebpackPlugin({\n      removeConsole: true,\n      removeDebugger: true\n    }),\n    new CopyWebpackPlugin([\n      {\n        from: path.join(__dirname, '../static'),\n        to: path.join(__dirname, '../dist/web/static'),\n        ignore: ['.*']\n      }\n    ]),\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"production\"'\n    }),\n    new webpack.LoaderOptionsPlugin({\n      minimize: true\n    })\n  )\n}\n\nmodule.exports = webConfig\n"
  },
  {
    "path": ".eslintignore",
    "content": "test/unit/coverage/**\ntest/unit/*.js\ntest/e2e/*.js\n"
  },
  {
    "path": ".eslintrc.js",
    "content": "module.exports = {\n  root: true,\n  parser: 'babel-eslint',\n  parserOptions: {\n    sourceType: 'module'\n  },\n  env: {\n    browser: true,\n    node: true\n  },\n  extends: 'airbnb-base',\n  globals: {\n    __static: true\n  },\n  plugins: [\n    'html'\n  ],\n  'rules': {\n    'global-require': 0,\n    'import/no-unresolved': 0,\n    'no-param-reassign': 0,\n    'no-shadow': 0,\n    'import/extensions': 0,\n    'import/newline-after-import': 0,\n    'no-multi-assign': 0,\n    // allow debugger during development\n    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,\n    'import/no-extraneous-dependencies': [\"error\", { devDependencies: true, }]\n  }\n}\n"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\ndist/electron/\ndist/web/\nbuild/\n!build/icons\ncoverage\nnode_modules/\nnpm-debug.log\nnpm-debug.log.*\nthumbs.db\n!.gitkeep\npackage-lock.json\n*.plist\n*.sh\n"
  },
  {
    "path": ".travis.yml",
    "content": "# Commented sections below can be used to run tests on the CI server\n# https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing\nosx_image: xcode8.3\nsudo: required\ndist: trusty\nlanguage: c\nmatrix:\n  include:\n  - os: osx\n  - os: linux\n    env: CC=clang CXX=clang++ npm_config_clang=1\n    compiler: clang\ncache:\n  directories:\n  - node_modules\n  - \"$HOME/.electron\"\n  - \"$HOME/.cache\"\naddons:\n  apt:\n    packages:\n    - libgnome-keyring-dev\n    - icnsutils\n    #- xvfb\nbefore_install:\n- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([\n  \"$TRAVIS_OS_NAME\" == \"linux\" ] && echo \"linux\" || echo \"darwin\")-amd64-1.2.1.tar.gz\n  | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull\n- if [[ \"$TRAVIS_OS_NAME\" == \"linux\" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi\ninstall:\n#- export DISPLAY=':99.0'\n#- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &\n- nvm install 7\n- curl -o- -L https://yarnpkg.com/install.sh | bash\n- source ~/.bashrc\n- npm install -g xvfb-maybe\n- yarn\nscript:\n#- xvfb-maybe node_modules/.bin/karma start test/unit/karma.conf.js\n- yarn run build\nbranches:\n  only:\n  - master\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<http://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "README.md",
    "content": "\n# ![Qbox logo](http://orhcxc3kd.bkt.clouddn.com/logo-blue.png)\n\n[![Build status](https://ci.appveyor.com/api/projects/status/soh7mapv45levrxy?svg=true)](https://ci.appveyor.com/project/LanceGin/qbox) [![Github All Releases](https://img.shields.io/github/downloads/lancegin/qbox/total.svg)]() [![Itunes App Store](https://img.shields.io/itunes/v/1267204866.svg)]() \n\n\n> QBox is a convenient manage tool for your [Qiniu](https://www.qiniu.com/) buckets. It is an open-source software and can be used on `OS X`, `Linux` and `Windows`, and it was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue)\n\n## Screenshots\n\n#### Bucket Panel\n\n![bucket panel](http://otwcctfiu.bkt.clouddn.com/bucket-panel.png)\n\n#### Manage Panel\n\n![bucket panel](http://otwcctfiu.bkt.clouddn.com/manage-panel.png)\n\n#### Upload Panel\n\n![bucket panel](http://otwcctfiu.bkt.clouddn.com/upload-panel.png)\n\n## Feature\n\n#### Bucket Panel\n\n- [x] Login by setting `accessKey` and `secretKey`.\n- [x] Logout by clearing localStorage (include `accessKey` and `secretKey`).\n- [x] List all buckets (include private).\n- [x] Manage files in a bucket, that will open a new `Manage Panel`.\n\n#### Manage Panel\n\n- [x] List all files in a specified bucket.\n- [x] List all files with pagination.\n- [x] Sort by `file name`, `file type`, `file size` or `modified time`.\n- [x] Preview `image` and `media` file.\n- [x] Delete a existing file.\n- [x] Delete a batch of files were checked.\n- [x] Copy the outer link of a file.\n- [x] Refresh the files in the bucket.\n- [x] Download a existing file.(this feature will be put in `preview` modal)\n- [x] Upload a single file. \n- [x] Search filter.\n\n## TODO\n\n#### MenuBar\n\n- [x] Set default bucket.\n- [x] Drag to MenuBar icon to upload.\n\n#### Bucket Panel\n\n- [x] Delete a existing bucket.\n- [x] Create a new bucket.\n\n#### Manage Panel\n\n- [x] Add enter event to search box.\n- [ ] Upload mutiple files.\n- [x] Download a batch of files were checked.\n- [x] Rename resouces.\n\n## License\n\n[![license](https://img.shields.io/github/license/lancegin/qbox.svg)]()\n\n## Contribute\n\n``` bash\n# install dependencies\nnpm install\n\n# serve with hot reload at localhost:9080\nnpm run dev\n\n# build electron application for production\nnpm run build\n\n# run unit tests (no tests now)\nnpm test\n\n# lint all JS/Vue component files in `src/`\nnpm run lint\n```\n\n## [中文文档](https://github.com/LanceGin/QBox/blob/master/README_zh.md)\n"
  },
  {
    "path": "README_zh.md",
    "content": "\n# ![Qbox logo](http://orhcxc3kd.bkt.clouddn.com/logo-blue.png)\n\n[![Build status](https://ci.appveyor.com/api/projects/status/soh7mapv45levrxy?svg=true)](https://ci.appveyor.com/project/LanceGin/qbox) [![Github All Releases](https://img.shields.io/github/downloads/lancegin/qbox/total.svg)]() [![Itunes App Store](https://img.shields.io/itunes/v/1267204866.svg)]()\n\n\n> QBox是一款方便的[七牛](https://www.qiniu.com/)仓库以及文件管理工具，是一款可以跨平台运行在`OS X`，`Linux` 以及 `Windows` 系统的开源软件。QBox基于 [electron-vue](https://github.com/SimulatedGREG/electron-vue) 开发。\n\n## 软件截图\n\n#### 仓库面板\n\n![bucket panel](http://otwcctfiu.bkt.clouddn.com/bucket-panel.png)\n\n#### 文件管理面板\n\n![bucket panel](http://otwcctfiu.bkt.clouddn.com/manage-panel.png)\n\n#### 上传文件面板\n\n![bucket panel](http://otwcctfiu.bkt.clouddn.com/upload-panel.png)\n\n## 功能\n\n#### 仓库面板\n\n- [x] 通过本地设置 `accessKey` 和 `secretKey`获取管理权限。\n- [x] 可清除本地token（包括 `accessKey` 和 `secretKey`）从而退出。\n- [x] 获取所有的仓库（包含私有仓库）。\n- [x] 新建一个专门的 `管理面板` 进行文件管理。\n\n#### 管理面板\n\n- [x] 列出仓库中的所有文件。\n- [x] 分页显示仓库中的文件，每次加载100条。\n- [x] 可通过 `文件名`，`文件类型`，`文件大小` 或者 `修改时间` 进行排序。\n- [x] `图片` 以及 `多媒体文件` 预览功能。\n- [x] 删除单个文件。\n- [x] 批量删除文件。\n- [x] 复制文件外链。\n- [x] 刷新文件列表。\n- [x] 下载单个文件。\n- [x] 上传文件（支持拖拽）。\n- [x] 文件名前缀搜索。\n\n## 计划\n\n#### 导航栏\n\n- [x] 设置默认仓库。\n- [x] 拖动至导航栏图标进行上传。\n\n#### 仓库面板\n\n- [x] 删除仓库。\n- [x] 创建仓库。\n\n#### 管理面板\n\n- [x] 搜索框提供回车响应。\n- [ ] 批量上传文件。\n- [x] 批量下载文件。\n- [x] 重命名文件。\n\n## 协议\n\n[![license](https://img.shields.io/github/license/lancegin/qbox.svg)]()\n\n## 代码贡献\n\n``` bash\n# 安装依赖\nnpm install\n\n# 本地开放版本测试\nnpm run dev\n\n# 编译线上版本\nnpm run build\n\n# 单元测试（目前暂无）\nnpm test\n\n# 检查代码规范\nnpm run lint\n```\n\n## [Document](https://github.com/LanceGin/QBox/blob/master/README.md)\n"
  },
  {
    "path": "appveyor.yml",
    "content": "# Commented sections below can be used to run tests on the CI server\n# https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing\nversion: 0.1.{build}\n\nbranches:\n  only:\n    - master\n\nimage: Visual Studio 2017\nplatform:\n  - x64\n\ncache:\n  - node_modules\n  - '%APPDATA%\\npm-cache'\n  - '%USERPROFILE%\\.electron'\n  - '%USERPROFILE%\\AppData\\Local\\Yarn\\cache'\n\ninit:\n  - git config --global core.autocrlf input\n\ninstall:\n  - ps: Install-Product node 8 x64\n  - choco install yarn --ignore-dependencies\n  - git reset --hard HEAD\n  - yarn\n  - node --version\n\nbuild_script:\n  #- yarn test\n  - yarn build\n\ntest: off\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"qbox\",\n  \"version\": \"1.6.0\",\n  \"author\": \"lancegin\",\n  \"description\": \"assistant\",\n  \"license\": \"AGPL\",\n  \"main\": \"./dist/electron/main.js\",\n  \"scripts\": {\n    \"build\": \"node .electron-vue/build.js && electron-builder\",\n    \"build:dir\": \"node .electron-vue/build.js && electron-builder --dir\",\n    \"build:clean\": \"cross-env BUILD_TARGET=clean node .electron-vue/build.js\",\n    \"build:web\": \"cross-env BUILD_TARGET=web node .electron-vue/build.js\",\n    \"dev\": \"node .electron-vue/dev-runner.js\",\n    \"lint\": \"eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src test\",\n    \"lint:fix\": \"eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src test\",\n    \"pack\": \"npm run pack:main && npm run pack:renderer\",\n    \"pack:main\": \"cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js\",\n    \"pack:renderer\": \"cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js\",\n    \"test\": \"npm run unit\",\n    \"unit\": \"karma start test/unit/karma.conf.js\",\n    \"postinstall\": \"npm run lint:fix\"\n  },\n  \"build\": {\n    \"productName\": \"QBox\",\n    \"appId\": \"com.artisanland.qbox\",\n    \"directories\": {\n      \"output\": \"build\"\n    },\n    \"files\": [\n      \"dist/electron\",\n      \"node_modules/\",\n      \"package.json\"\n    ],\n    \"dmg\": {\n      \"contents\": [\n        {\n          \"x\": 410,\n          \"y\": 150,\n          \"type\": \"link\",\n          \"path\": \"/Applications\"\n        },\n        {\n          \"x\": 130,\n          \"y\": 150,\n          \"type\": \"file\"\n        }\n      ]\n    },\n    \"mac\": {\n      \"icon\": \"build/icons/icon.icns\",\n      \"target\": [\n        \"mas\",\n        \"dmg\",\n        \"pkg\"\n      ],\n      \"bundleVersion\": \"1.6.0\"\n    },\n    \"win\": {\n      \"icon\": \"build/icons/icon.ico\"\n    },\n    \"linux\": {\n      \"icon\": \"build/icons\"\n    }\n  },\n  \"dependencies\": {\n    \"axios\": \"^0.16.1\",\n    \"element-ui\": \"^1.4.0\",\n    \"jszip\": \"^3.1.5\",\n    \"moment\": \"^2.18.1\",\n    \"request\": \"^2.81.0\",\n    \"request-promise\": \"^4.2.1\",\n    \"vue\": \"^2.3.3\",\n    \"vue-electron\": \"^1.0.6\",\n    \"vue-router\": \"^2.5.3\",\n    \"vuex\": \"^2.3.1\"\n  },\n  \"devDependencies\": {\n    \"babel-core\": \"^6.22.1\",\n    \"babel-loader\": \"^7.0.0\",\n    \"babel-plugin-transform-runtime\": \"^6.22.0\",\n    \"babel-preset-env\": \"^1.3.3\",\n    \"babel-preset-stage-0\": \"^6.5.0\",\n    \"babel-register\": \"^6.2.0\",\n    \"babili-webpack-plugin\": \"^0.1.1\",\n    \"cfonts\": \"^1.1.3\",\n    \"chalk\": \"^1.1.3\",\n    \"copy-webpack-plugin\": \"^4.0.1\",\n    \"cross-env\": \"^5.0.0\",\n    \"css-loader\": \"^0.28.4\",\n    \"del\": \"^2.2.1\",\n    \"devtron\": \"^1.1.0\",\n    \"electron\": \"^1.7.2\",\n    \"electron-debug\": \"^1.1.0\",\n    \"electron-devtools-installer\": \"^2.0.1\",\n    \"electron-builder\": \"^19.10.0\",\n    \"babel-eslint\": \"^7.0.0\",\n    \"eslint\": \"^3.13.1\",\n    \"eslint-friendly-formatter\": \"^3.0.0\",\n    \"eslint-loader\": \"^1.3.0\",\n    \"eslint-plugin-html\": \"^2.0.0\",\n    \"eslint-config-airbnb-base\": \"^11.2.0\",\n    \"eslint-import-resolver-webpack\": \"^0.8.1\",\n    \"eslint-plugin-import\": \"^2.2.0\",\n    \"extract-text-webpack-plugin\": \"^2.0.0-beta.4\",\n    \"file-loader\": \"^0.11.1\",\n    \"html-webpack-plugin\": \"^2.16.1\",\n    \"json-loader\": \"^0.5.4\",\n    \"inject-loader\": \"^3.0.0\",\n    \"karma\": \"^1.3.0\",\n    \"karma-chai\": \"^0.1.0\",\n    \"karma-coverage\": \"^1.1.1\",\n    \"karma-electron\": \"^5.1.1\",\n    \"karma-mocha\": \"^1.2.0\",\n    \"karma-sourcemap-loader\": \"^0.3.7\",\n    \"karma-spec-reporter\": \"^0.0.31\",\n    \"karma-webpack\": \"^2.0.1\",\n    \"webpack-merge\": \"^4.1.0\",\n    \"babel-plugin-istanbul\": \"^4.1.1\",\n    \"chai\": \"^4.0.0\",\n    \"mocha\": \"^3.0.2\",\n    \"multispinner\": \"^0.2.1\",\n    \"style-loader\": \"^0.18.1\",\n    \"url-loader\": \"^0.5.7\",\n    \"vue-html-loader\": \"^1.2.2\",\n    \"vue-loader\": \"^12.2.1\",\n    \"vue-style-loader\": \"^3.0.1\",\n    \"vue-template-compiler\": \"^2.3.3\",\n    \"webpack\": \"^2.2.1\",\n    \"webpack-dev-server\": \"^2.3.0\",\n    \"webpack-hot-middleware\": \"^2.18.0\"\n  }\n}\n"
  },
  {
    "path": "src/index.ejs",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <title>QBox</title>\n    <% if (htmlWebpackPlugin.options.nodeModules) { %>\n      <!-- Add `node_modules/` to global paths so `require` works properly in development -->\n      <script>\n        require('module').globalPaths.push('<%= htmlWebpackPlugin.options.nodeModules.replace(/\\\\/g, '\\\\\\\\') %>')\n      </script>\n    <% } %>\n    \n  </head>\n  <body>\n    <div id=\"app\"></div>\n    <!-- Set `__static` path to static files in production -->\n    <script>\n      if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname, '/static').replace(/\\\\/g, '\\\\\\\\')\n    </script>\n\n    <!-- webpack builds are automatically injected -->\n  </body>\n</html>\n"
  },
  {
    "path": "src/main/index.dev.js",
    "content": "/**\n * This file is used specifically and only for development. It installs\n * `electron-debug` & `vue-devtools`. There shouldn't be any need to\n *  modify this file, but it can be used to extend your development\n *  environment.\n */\n\n/* eslint-disable */\n\n// Set environment for development\nprocess.env.NODE_ENV = 'development'\n\n// Install `electron-debug` with `devtron`\nrequire('electron-debug')({ showDevTools: false })\n\n// Install `vue-devtools`\nrequire('electron').app.on('ready', () => {\n  let installExtension = require('electron-devtools-installer')\n  installExtension.default(installExtension.VUEJS_DEVTOOLS)\n    .then(() => {})\n    .catch(err => {\n      console.log('Unable to install `vue-devtools`: \\n', err)\n    })\n})\n\n// Require `main` process to boot app\nrequire('./index')\n"
  },
  {
    "path": "src/main/index.js",
    "content": "import { app, BrowserWindow, Menu, Tray, ipcMain } from 'electron' // eslint-disable-line\nimport Qiniu from '../renderer/utils/qiniu';\n\n/**\n * Set `__static` path to static files in production\n * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html\n */\nif (process.env.NODE_ENV !== 'development') {\n  global.__static = require('path').join(__dirname, '/static').replace(/\\\\/g, '\\\\\\\\') // eslint-disable-line\n}\n\nlet mainWindow;\nlet mainMenu;\nlet appIcon = null;\n\nconst winURL = process.env.NODE_ENV === 'development'\n  ? 'http://localhost:9080'\n  : `file://${__dirname}/index.html`;\n\nfunction createWindow() {\n  /**\n   * Initial menu options\n   */\n  const template = [\n    {\n      role: 'editMenu',\n    },\n    {\n      label: 'Window',\n      submenu: [\n        {\n          role: 'minimize',\n        },\n        {\n          role: 'close',\n        },\n        {\n          type: 'separator',\n        },\n        {\n          label: 'QBox',\n          accelerator: 'CmdOrCtrl+O',\n          click: () => {\n            app.emit('activate');\n          },\n        },\n      ],\n    },\n    {\n      role: 'help',\n      submenu: [\n        {\n          label: 'Document',\n          click() { require('electron').shell.openExternal('https://github.com/LanceGin/QBox/blob/master/README.md'); },\n        },\n        {\n          label: '中文文档',\n          click() { require('electron').shell.openExternal('https://github.com/LanceGin/QBox/blob/master/README_zh.md'); },\n        },\n        {\n          type: 'separator',\n        },\n        {\n          label: 'Open Source',\n          click() { require('electron').shell.openExternal('https://github.com/LanceGin/QBox'); },\n        },\n        {\n          label: 'License',\n          click() { require('electron').shell.openExternal('https://github.com/LanceGin/QBox/blob/master/LICENSE'); },\n        },\n        {\n          type: 'separator',\n        },\n        {\n          label: 'About Author(LanceGin)',\n          click() { require('electron').shell.openExternal('http://www.lancegin.cc'); },\n        },\n      ],\n    },\n  ];\n\n  if (process.platform === 'darwin') {\n    template.unshift({\n      label: app.getName(),\n      submenu: [\n        { role: 'about' },\n        { type: 'separator' },\n        { role: 'services', submenu: [] },\n        { type: 'separator' },\n        { role: 'hide' },\n        { role: 'hideothers' },\n        { role: 'unhide' },\n        { type: 'separator' },\n        { role: 'quit' },\n      ],\n    });\n  }\n\n  mainMenu = Menu.buildFromTemplate(template);\n  Menu.setApplicationMenu(mainMenu);\n\n  /**\n   * Initial window options\n   */\n  mainWindow = new BrowserWindow({\n    height: 640,\n    useContentSize: true,\n    width: 400,\n    titleBarStyle: 'hidden-inset',\n    resizable: false,\n    show: false,\n  });\n\n  mainWindow.loadURL(winURL);\n\n  // disable white loading page by 'ready-to-show' event\n  mainWindow.once('ready-to-show', () => {\n    mainWindow.show();\n  });\n\n  mainWindow.on('closed', () => {\n    mainWindow = null;\n  });\n\n  // disable open a outer resource from a dragover event\n  mainWindow.webContents.on('will-navigate', (e) => {\n    e.preventDefault();\n  });\n\n  // icon in menu bar\n  let accessKey = '';\n  let secretKey = '';\n  let defaultBucket = '';\n  if (appIcon === null) {\n    appIcon = new Tray(`${__static}/img/qboxTemplate.png`);\n    // appIcon.setToolTip('Drag file here and upload to the default bucket.');\n\n    // get qiniu bucket list\n    ipcMain.on('setKey', (event, key) => {\n      accessKey = key.ak;\n      secretKey = key.sk;\n      defaultBucket = key.db;\n      appIcon.setToolTip('set default bucket and drag a file here to upload');\n\n      // appIcon.setToolTip(accessKey);\n      Qiniu.buckets(accessKey, secretKey)\n        .then((data) => {\n          const submenuTmp = [];\n          data.map((bucketTmp) => {\n            // set the default bucket\n            let objTmp;\n            if (key.db !== undefined && bucketTmp === key.db) {\n              objTmp = {\n                label: bucketTmp,\n                type: 'radio',\n                checked: true,\n                click() {\n                  event.sender.send('setDefaultBucket', bucketTmp);\n                  defaultBucket = bucketTmp;\n                },\n              };\n            } else {\n              objTmp = {\n                label: bucketTmp,\n                type: 'radio',\n                click() {\n                  event.sender.send('setDefaultBucket', bucketTmp);\n                  defaultBucket = bucketTmp;\n                },\n              };\n            }\n\n            return submenuTmp.push(objTmp);\n          });\n          const contextMenu = Menu.buildFromTemplate([\n            {\n              label: 'Default Bucket',\n              submenu: submenuTmp,\n            },\n          ]);\n          appIcon.setContextMenu(contextMenu);\n          // this.bucketList = data;\n        });\n    });\n\n    // app tray click event\n    appIcon.on('click', () => {\n      if (mainWindow === null) {\n        createWindow();\n      }\n    });\n\n    // app tray drag-enter event\n    appIcon.on('drag-enter', () => {\n      // window.open(this.$router);\n      const uploadWin = new BrowserWindow({\n        height: 640,\n        useContentSize: true,\n        width: 1000,\n        titleBarStyle: 'hidden-inset',\n        resizable: false,\n      });\n      const winURL = process.env.NODE_ENV === 'development'\n        ? 'http://localhost:9080'\n        : `file://${__dirname}/index.html`;\n      uploadWin.loadURL(`${winURL}#/upload?bucket=${defaultBucket}`);\n    });\n  }\n}\n\napp.on('ready', createWindow);\n\napp.on('window-all-closed', () => {\n  if (process.platform !== 'darwin') {\n    app.quit();\n  }\n});\n\napp.on('activate', () => {\n  if (mainWindow === null) {\n    createWindow();\n  }\n});\n\n/**\n * Auto Updater\n *\n * Uncomment the following code below and install `electron-updater` to\n * support auto updating. Code Signing with a valid certificate is required.\n * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-electron-builder.html#auto-updating\n */\n\n/*\nimport { autoUpdater } from 'electron-updater'\n\nautoUpdater.on('update-downloaded', () => {\n  autoUpdater.quitAndInstall()\n})\n\napp.on('ready', () => {\n  if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates()\n})\n */\n"
  },
  {
    "path": "src/renderer/App.vue",
    "content": "<template>\n  <div id=\"app\">\n    <router-view></router-view>\n  </div>\n</template>\n\n<script>\n  export default {\n    name: 'qbox',\n  };\n</script>\n\n<style>\n  /* CSS */\n</style>\n"
  },
  {
    "path": "src/renderer/assets/.gitkeep",
    "content": ""
  },
  {
    "path": "src/renderer/components/About.vue",
    "content": "<template>\n  <div id=\"about-page\">\n    <p>this is the about page.</p>\n    <i class=\"iconfont icon-flip\"></i>\n  </div>\n</template>\n\n<script>\n  export default {\n    name: 'about',\n  };\n</script>\n\n<style scope>\n  body {\n    background: #eee;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/components/BucketHeader.vue",
    "content": "<template>\n  <header style=\"-webkit-app-region: drag\">\n  </header>\n</template>\n\n<script>\n  export default {\n    name: 'bucket-header',\n  };\n</script>\n\n<style scope>\n  header {\n    position: fixed;\n    width: 100vw;\n    height: 50px;\n    -webkit-app-region: drag;\n    background: url('../../../static/img/logo.png') no-repeat #2e84c7;\n    background-size: 80.6px 30px;\n    background-position: center;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/components/BucketList.vue",
    "content": "<template>\n  <div id=\"bucket-list-page\">\n    <div class=\"logout\">\n      <el-button type=\"text\" class=\"logout-btn\" icon=\"upload2\" @click=\"logout()\" v-loading.fullscreen.lock=\"fullscreenLoading\"></el-button>\n    </div>\n    <div v-for=\"bucket in bucketList\" :key=\"bucket\" class=\"bucket-item\">\n      <div class=\"item-icon\"></div>\n      <div class=\"item-name\">\n        <p>{{ bucket }}</p>\n      </div>\n      <div class=\"item-handler\">\n        <i class=\"el-icon-edit\" @click=\"manage(bucket)\"></i>\n        <i class=\"el-icon-delete\" @click=\"drop(bucket)\"></i>\n      </div>\n    </div>\n    <div class=\"mkbucket\">\n      <el-button class=\"mkbucket-btn\" @click=\"dialogFormVisible = true\">创建新仓库</el-button>\n      <el-dialog\n        title=\"创建新仓库\"\n        size=\"large\"\n        top=\"25%\"\n        :visible.sync=\"dialogFormVisible\">\n        <el-form :model=\"newBucket\">\n          <el-form-item label=\"Name\" :label-width=\"formLabelWidth\">\n            <el-input v-model=\"newBucket.name\" auto-complete=\"off\"></el-input>\n          </el-form-item>\n          <el-form-item label=\"Region\" :label-width=\"formLabelWidth\">\n            <el-select v-model=\"newBucket.region\" placeholder=\"请选择\">\n              <el-option\n                v-for=\"item in regions\"\n                :key=\"item.value\"\n                :label=\"item.label\"\n                :value=\"item.value\">\n              </el-option>\n            </el-select>\n          </el-form-item>\n        </el-form>\n        <div slot=\"footer\" class=\"dialog-footer\">\n          <el-button @click=\"dialogFormVisible = false\">取 消</el-button>\n          <el-button @click=\"mkbucket()\" v-loading.fullscreen.lock=\"fullscreenLoading\">确 定</el-button>\n        </div>\n      </el-dialog>\n    </div>\n  </div>\n</template>\n\n<script>\n  // import Qiniu class\n  import Qiniu from '../utils/qiniu';\n\n  const BrowserWindow = require('electron').remote.BrowserWindow;\n  const { ipcRenderer } = require('electron');\n\n  // transfer data to main process\n  const key = {\n    ak: localStorage.accessKey,\n    sk: localStorage.secretKey,\n    db: localStorage.db,\n  };\n\n  // register an event to set default bucket\n  ipcRenderer.on('setDefaultBucket', (event, arg) => {\n    // console.log(`${arg} args from main process`);\n    localStorage.db = arg;\n  });\n\n  let buckets;\n  export default {\n    name: 'bucket-list',\n    data() {\n      return {\n        fullscreenLoading: false,\n        bucketList: buckets,\n        dialogFormVisible: false,\n        formLabelWidth: '80px',\n        regions: [\n          {\n            value: 'z0',\n            label: '华东',\n          },\n          {\n            value: 'z1',\n            label: '华北',\n          },\n          {\n            value: 'z2',\n            label: '华南',\n          },\n          {\n            value: 'na0',\n            label: '北美',\n          },\n        ],\n        newBucket: {\n          name: '',\n          region: '',\n        },\n      };\n    },\n    mounted() {\n      const accessKey = localStorage.accessKey;\n      const secretKey = localStorage.secretKey;\n\n      Qiniu.buckets(accessKey, secretKey)\n        .then((data) => {\n          this.bucketList = data;\n        })\n        .catch((err) => {\n          // 当token无效时触发\n          this.$message(`${err.error.error}...💔`);\n          localStorage.clear();\n          this.$router.push({ path: '/login' });\n        });\n\n      // send signal and transfer localstorage to the main process\n      ipcRenderer.send('setKey', key);\n      // console.log(localStorage.db);\n    },\n    methods: {\n      // create new bucket\n      mkbucket() {\n        this.fullscreenLoading = true;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n\n        Qiniu.mkbucket(accessKey, secretKey, this.newBucket.name, this.newBucket.region)\n          .then(() => {\n            Qiniu.buckets(accessKey, secretKey)\n              .then((data) => {\n                this.dialogFormVisible = false;\n                this.fullscreenLoading = false;\n                this.bucketList = data;\n                this.$message(`仓库 ${this.newBucket.name} 创建成功..💗`);\n              });\n          })\n          .catch((err) => {\n            this.fullscreenLoading = false;\n            this.$message(`${err.error.error}...💔`);\n          });\n      },\n      // drop an exist bucket\n      drop(bucket) {\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        this.$confirm(`确定删除 ${bucket} ?`, '提示', {\n          confirmButtonText: '确定',\n          cancelButtonText: '取消',\n          type: 'warning',\n          customClass: 'confirm-box',\n        }).then(() => {\n          this.fullscreenLoading = true;\n          Qiniu.drop(accessKey, secretKey, bucket)\n            .then(() => {\n              Qiniu.buckets(accessKey, secretKey)\n                .then((data) => {\n                  this.bucketList = data;\n                  this.fullscreenLoading = false;\n                  this.$message(`成功删除 ${bucket}...💗`);\n                });\n            })\n            .catch((err) => {\n              this.$message(`${err.error.error}...💔`);\n            });\n        }).catch(() => {\n          this.$message('差点手误...💔');\n        });\n      },\n      // logout function.\n      // keys will be clear.\n      logout() {\n        const router = this.$router;\n        this.$confirm('确认退出并清空公私钥？', '提示', {\n          confirmButtonText: '确定',\n          cancelButtonText: '取消',\n          type: 'warning',\n          customClass: 'confirm-box',\n        }).then(() => {\n          localStorage.clear();\n          this.fullscreenLoading = true;\n          setTimeout(() => {\n            router.push({ path: '/login' });\n            this.fullscreenLoading = false;\n          }, 1000);\n        }).catch(() => {\n        });\n      },\n\n      // manage function.\n      // open a new window to manage files.\n      manage(bucket) {\n        // window.open(this.$router);\n        const win = new BrowserWindow({\n          height: 640,\n          useContentSize: true,\n          width: 1000,\n          titleBarStyle: 'hidden-inset',\n          resizable: false,\n        });\n        const winURL = process.env.NODE_ENV === 'development'\n          ? 'http://localhost:9080'\n          : `file://${__dirname}/index.html`;\n        win.loadURL(`${winURL}#/manage?bucket=${bucket}`);\n      },\n    },\n  };\n</script>\n\n<style scope>\n  .logout-btn {\n    position: fixed;\n    right: 30px;\n    top: 6px;\n    color: #fff;\n  }\n  .logout-btn:hover {\n    color: #fff;\n  }\n  .el-icon-upload2 {\n    cursor: pointer;\n  }\n  .confirm-box {\n    width: 80vw;\n  }\n  .bucket-item {\n    height: 60px;\n    border-bottom: 1px #eee solid;\n    padding: 0 20px;\n  }\n  .bucket-item:hover {\n    background: #eee;\n  }\n  .item-icon {\n    float: left;\n    margin-top: 5px;\n    height: 48px;\n    width: 48px;\n    background: url(\"../../../static/img/bucket.png\") no-repeat;\n    background-size: contain;\n    background-position: 0 2px;\n  }\n  .item-name {\n    float: left;\n    margin-top: 20px;\n    margin-left: 10px;\n    color: #888;\n  }\n  .item-name p {\n    -webkit-margin-before: 0;\n  }\n  .item-handler {\n    float: right;\n    margin-top: 20px;\n  }\n  .item-handler i {\n    border: 0;\n    margin-right: 10px;\n    background: transparent;\n    color: #888;\n    cursor: pointer;\n  }\n  .item-handler i:hover {\n    color: #2e84c7;\n  }\n  .mkbucket {\n    text-align: center;\n    margin-top: 20px;\n  }\n  .mkbucket-btn {\n    background: #2e84c7;\n    border: 0;\n    color: #fff;\n    font-size: 12px;\n  }\n  .mkbucket-btn:hover,\n  .mkbucket-btn:focus {\n    color: #fff;\n  }\n  .el-input__icon+.el-input__inner {\n    width: 240px;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/components/FileList.vue",
    "content": "<template>\n  <div id=\"file-list-page\">\n\n    <!-- rename resource -->\n    <el-dialog\n      title=\"重命名资源\"\n      :visible.sync=\"renameDialogVisible\"\n      width=\"30%\">\n      <el-input v-model=\"currentName\" :placeholder=\"currentName\"></el-input>\n      <span slot=\"footer\" class=\"dialog-footer\">\n        <el-button @click=\"renameCancel\">取 消</el-button>\n        <el-button type=\"primary\" @click=\"renameConfirm\">确 定</el-button>\n      </span>\n    </el-dialog>\n  \n    <!-- preview -->\n    <el-dialog\n      :title=\"preview_name\"\n      :visible.sync=\"dialogVisible\"\n      size=\"large\">\n      <div class=\"preview\">\n        <img :src=\"preview_url\" class=\"preview-img\">\n      </div>\n      <span slot=\"footer\" class=\"dialog-footer\">\n        <el-button @click=\"previewCopy()\">复 制</el-button>\n        <el-button type=\"primary\" @click=\"download()\">下 载</el-button>\n      </span>\n    </el-dialog>\n\n    <!-- file list table -->\n    <el-table\n      ref=\"multipleTable\"\n      :data=\"fileList\"\n      tooltip-effect=\"dark\"\n      style=\"width: 100%\"\n      stripe\n      @selection-change=\"handleSelectionChange\">\n      <el-table-column\n        type=\"selection\"\n        width=\"35\">\n      </el-table-column>\n      <el-table-column\n        prop=\"key\"\n        label=\"文件名\"\n        sortable\n        width=\"320\">\n      </el-table-column>\n      <el-table-column\n        prop=\"mimeType\"\n        label=\"文件类型\"\n        sortable\n        width=\"140\">\n      </el-table-column>\n      <el-table-column\n        prop=\"fsize\"\n        label=\"文件大小\"\n        sortable\n        width=\"120\"\n        :formatter=\"fsizeFormat\">\n      </el-table-column>\n      <el-table-column\n        prop=\"putTime\"\n        label=\"修改时间\"\n        sortable\n        width=\"200\"\n        :formatter=\"dateFormat\">\n      </el-table-column>\n      <el-table-column\n        label=\"操作\"\n        width=\"185\">\n        <template scope=\"scope\">\n          <el-button type=\"text\" size=\"small\" icon=\"view\" @click=\"preview(scope.row)\"></el-button>\n          <el-button type=\"text\" size=\"small\" @click=\"removeFile(scope.row)\">删除</el-button>\n          <el-button type=\"text\" size=\"small\" @click=\"copyLink(scope.row)\">复制</el-button>\n          <el-button type=\"text\" size=\"small\" @click=\"rename(scope.row)\">重命名</el-button>\n        </template>\n      </el-table-column>\n      <template slot=\"append\">\n        <div class=\"loadmore\">\n          <el-button\n            align=\"center\"\n            type=\"text\"\n            v-if=\"marker != ''\"\n            size=\"small\"\n            @click=\"loadMore()\">加载更多</el-button>\n        </div>\n      </template>\n    </el-table>\n  </div>\n</template>\n\n<script>\n  // import Qiniu class\n  import Qiniu from '../utils/qiniu';\n  import Util from '../utils/util';\n  import Bus from '../utils/bus';\n  const moment = require('moment');\n  const clipboard = require('electron').clipboard;\n  const webContents = require('electron').remote.getCurrentWebContents();\n\n  export default {\n    name: 'file-list',\n    data() {\n      return {\n        renameDialogVisible: false,\n        dialogVisible: false,\n        fileList: [],\n        multipleSelection: [],\n        preview_url: '',\n        preview_name: '',\n        marker: '',\n        filter: '',\n        oldName: '',\n        currentName: '',\n      };\n    },\n    created() {\n      // refresh files\n      Bus.$on('refresh', () => {\n        this.fileList = [];\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        Qiniu.list(accessKey, secretKey, bucket)\n          .then((data) => {\n            this.marker = data.marker == null ? '' : data.marker;\n            this.fileList = data.items;\n          })\n          .catch();\n      });\n\n      // batch delete\n      Bus.$on('batchDelete', () => {\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        // confirm to delete\n        this.$confirm('此操作将永久删除文件, 是否继续?', '提示', {\n          confirmButtonText: '确定',\n          cancelButtonText: '取消',\n          type: 'warning',\n        }).then(() => {\n          Qiniu.batchDelete(accessKey, secretKey, bucket, this.multipleSelection)\n            .then(() => {\n              this.$message('文件删除成功..💗');\n              Qiniu.list(accessKey, secretKey, bucket)\n                .then((data) => {\n                  this.marker = data.marker == null ? '' : data.marker;\n                  this.fileList = data.items;\n                })\n                .catch();\n            })\n            .catch();\n        }).catch(() => {\n          this.$message('取消删除');\n        });\n      });\n\n      // batch download\n      Bus.$on('batchDownload', () => {\n        // import jszip and fileSaver\n        const JSZip = require('jszip');\n        const saveAs = require('jszip/vendor/FileSaver');\n\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        const zip = new JSZip();\n        const items = this.multipleSelection;\n\n        Qiniu.domain(accessKey, secretKey, bucket)\n          .then((data) => {\n            const domain = data[data.length - 1];\n\n            items.forEach((item) => {\n              const link = `http://${domain}/${item.key}`;\n\n              // add file to the zip file through promise\n              const promise = Util.urlToBlob(link).then(res => res.blob());\n              zip.file(item.key, promise);\n            });\n\n            // compress and download\n            zip.generateAsync({\n              type: 'blob',\n              mimeType: 'application/zip',\n            })\n              .then((content) => {\n                saveAs(content, 'qbox-batchDownload.zip.zip');\n              });\n          })\n          .catch();\n      });\n\n      // search filter\n      Bus.$on('search', (filter) => {\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        Qiniu.list(accessKey, secretKey, bucket, '', filter)\n          .then((data) => {\n            // console.log(data);\n            this.filter = filter;\n            this.marker = data.marker == null ? '' : data.marker;\n            this.fileList = data.items;\n          })\n          .catch();\n      });\n    },\n    destroyed() {\n      Bus.$off('refresh');\n      Bus.$off('batchDelete');\n      Bus.$off('batchDownload');\n    },\n    mounted() {\n      const bucket = this.$route.query.bucket;\n      const accessKey = localStorage.accessKey;\n      const secretKey = localStorage.secretKey;\n      Qiniu.list(accessKey, secretKey, bucket)\n        .then((data) => {\n          // console.log(data);\n          this.marker = data.marker == null ? '' : data.marker;\n          this.fileList = data.items;\n        })\n        .catch();\n    },\n    methods: {\n      handleSelectionChange(val) {\n        this.multipleSelection = val;\n        Bus.$emit('batchShowStatus', this.multipleSelection);\n      },\n      // format the time stamp\n      dateFormat(row) {\n        let date = row.putTime;\n        if (date === undefined) {\n          return '';\n        }\n        date = date.toString();\n        date = date.substring(0, date.length - 7);\n        return moment.unix(date).format('YYYY-MM-DD HH:mm:ss');\n      },\n      // format file size\n      fsizeFormat(row) {\n        return Util.fsizeFormat(row.fsize);\n      },\n      // copy the link\n      copyLink(row) {\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        Qiniu.domain(accessKey, secretKey, bucket)\n          .then((data) => {\n            // get the latest domain\n            const domain = data[data.length - 1];\n            const link = `http://${domain}/${row.key}`;\n            clipboard.writeText(link);\n            this.$message('链接复制成功..💗');\n          })\n          .catch();\n      },\n      // remove a file\n      removeFile(row) {\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        // confirm to delete\n        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {\n          confirmButtonText: '确定',\n          cancelButtonText: '取消',\n          type: 'warning',\n        }).then(() => {\n          Qiniu.delete(accessKey, secretKey, bucket, row.key)\n            .then(() => {\n              this.$message('文件删除成功..💗');\n              // TODO\n              // just remove items from local datas, do not\n              // need to refresh.\n              Qiniu.list(accessKey, secretKey, bucket)\n                .then((data) => {\n                  this.marker = data.marker == null ? '' : data.marker;\n                  this.fileList = data.items;\n                })\n                .catch();\n            })\n            .catch();\n        }).catch(() => {\n          this.$message('取消删除');\n        });\n      },\n      // rename file\n      rename(row) {\n        this.oldName = row.key;\n        this.currentName = row.key;\n        this.renameDialogVisible = true;\n      },\n      renameCancel() {\n        this.renameDialogVisible = false;\n      },\n      renameConfirm() {\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        // console.log(bucket, this.oldName, this.currentName);\n        Qiniu.rename(accessKey, secretKey, bucket, this.oldName, this.currentName)\n          .then(() => {\n            this.renameDialogVisible = false;\n            this.$message('重命名成功..💗');\n            Qiniu.list(accessKey, secretKey, bucket)\n              .then((data) => {\n                this.marker = data.marker == null ? '' : data.marker;\n                this.fileList = data.items;\n              })\n              .catch();\n          })\n          .catch();\n      },\n      // preview file\n      preview(row) {\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        Qiniu.domain(accessKey, secretKey, bucket)\n          .then((data) => {\n            // get the latest domain\n            const domain = data[data.length - 1];\n            const link = `http://${domain}/${row.key}`;\n            this.preview_name = row.key;\n            this.dialogVisible = true;\n            if (row.mimeType.indexOf('image') >= 0) {\n              this.preview_url = link;\n            } else {\n              this.preview_url = 'https://qiniu.staticfile.org/static/images/no-prev.6ae40070.png';\n            }\n          })\n          .catch();\n      },\n      // copy link in the preview modal\n      previewCopy() {\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        Qiniu.domain(accessKey, secretKey, bucket)\n          .then((data) => {\n            // get the latest domain\n            const domain = data[data.length - 1];\n            const link = `http://${domain}/${this.preview_name}`;\n            clipboard.writeText(link);\n            this.$message('链接复制成功..💗');\n          })\n          .catch();\n      },\n      // download file\n      download() {\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        Qiniu.domain(accessKey, secretKey, bucket)\n          .then((data) => {\n            // get the latest domain\n            const domain = data[data.length - 1];\n            const link = `http://${domain}/${this.preview_name}?attname=${this.preview_name}.${this.preview_name.split('.')[1]}`;\n            webContents.loadURL(link);\n          })\n          .catch();\n      },\n      // loadMore feature\n      loadMore() {\n        // console.log(this.filter);\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        Qiniu.list(accessKey, secretKey, bucket, this.marker, this.filter)\n          .then((data) => {\n            this.marker = data.marker == null ? '' : data.marker;\n            this.fileList.push(...data.items);\n          })\n          .catch();\n      },\n    },\n  };\n</script>\n\n<style scope>\n  /* set table style */\n  .el-table {\n    color: #888;\n    max-height: 540px;\n  }\n  .el-table__header-wrapper thead div {\n    background: #fff;\n    color: #888;\n    font-size: 14px;\n    font-weight: lighter;\n  }\n  .el-table__header-wrapper th {\n    height: 30px;\n  }\n  .el-checkbox__inner {\n    width: 14px;\n    height: 14px;\n  }\n  .el-checkbox__inner::after {\n    width: 2px;\n    height: 6px;\n  }\n  .el-table th {\n    background: #fff;\n  }\n  .el-table .el-button--text {\n    color: #2e84c7;\n  }\n  .el-table .el-button--text:hover {\n    color: #2e84c7;\n  }\n  .el-table::after,\n  .el-table::before {\n    background: transparent;\n    z-index: 1;\n  }\n  .el-table__body-wrapper {\n    max-height: 520px !important;\n  }\n  .loadmore {\n    width: 100vw;\n    text-align: center;\n    margin-top: 5px;\n  }\n  .preview {\n    text-align: center;\n    max-height: 300px;\n  }\n  .preview-img {\n    max-height: 300px;\n    max-width: 100%;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/components/LandingPage/SystemInformation.vue",
    "content": "<template>\n  <div>\n    <div class=\"title\">Information</div>\n    <div class=\"items\">\n      <div class=\"item\">\n        <div class=\"name\">Path:</div>\n        <div class=\"value\">{{ path }}</div>\n      </div>\n      <div class=\"item\">\n        <div class=\"name\">Route Name:</div>\n        <div class=\"value\">{{ name }}</div>\n      </div>\n      <div class=\"item\">\n        <div class=\"name\">Vue.js:</div>\n        <div class=\"value\">{{ vue }}</div>\n      </div>\n      <div class=\"item\">\n        <div class=\"name\">Electron:</div>\n        <div class=\"value\">{{ electron }}</div>\n      </div>\n      <div class=\"item\">\n        <div class=\"name\">Node:</div>\n        <div class=\"value\">{{ node }}</div>\n      </div>\n      <div class=\"item\">\n        <div class=\"name\">Platform:</div>\n        <div class=\"value\">{{ platform }}</div>\n      </div>\n    </div>\n  </div>\n</template>\n\n<script>\n  export default {\n    data() {\n      return {\n        electron: process.versions['atom-shell'],\n        name: 'landing-page',\n        node: process.versions.node,\n        path: '/',\n        platform: require('os').platform(),\n        vue: require('vue/package.json').version,\n      };\n    },\n  };\n</script>\n\n<style scoped>\n  .title {\n    color: #888;\n    font-size: 18px;\n    font-weight: initial;\n    letter-spacing: .25px;\n    margin-top: 10px;\n  }\n\n  .items { margin-top: 8px; }\n\n  .item {\n    display: flex;\n    margin-bottom: 6px;\n  }\n\n  .item .name {\n    color: #6a6a6a;\n    margin-right: 6px;\n  }\n\n  .item .value {\n    color: #35495e;\n    font-weight: bold;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/components/LandingPage.vue",
    "content": "<template>\n  <div id=\"wrapper\">\n    <img id=\"logo\" src=\"~@/assets/logo.png\" alt=\"electron-vue\">\n    <main>\n      <div class=\"left-side\">\n        <span class=\"title\">\n          Welcome to your new project!\n        </span>\n        <system-information></system-information>\n        <about></about>\n      </div>\n\n      <div class=\"right-side\">\n        <div class=\"doc\">\n          <div class=\"title\">Getting Started</div>\n          <p>\n            electron-vue comes packed with detailed documentation that covers everything from\n            internal configurations, using the project structure, building your application,\n            and so much more.\n          </p>\n          <button @click=\"open('https://simulatedgreg.gitbooks.io/electron-vue/content/')\">Read the Docs</button><br><br>\n        </div>\n        <div class=\"doc\">\n          <div class=\"title alt\">Other Documentation</div>\n          <button class=\"alt\" @click=\"open('https://electron.atom.io/docs/')\">Electron</button>\n          <button class=\"alt\" @click=\"open('https://vuejs.org/v2/guide/')\">Vue.js</button>\n        </div>\n      </div>\n    </main>\n  </div>\n</template>\n\n<script>\n  import SystemInformation from './LandingPage/SystemInformation';\n  import About from './About';\n\n  export default {\n    name: 'landing-page',\n    components: { SystemInformation, About },\n    methods: {\n      open(link) {\n        this.$electron.shell.openExternal(link);\n      },\n    },\n  };\n</script>\n\n<style>\n  @import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro');\n\n  * {\n    box-sizing: border-box;\n    margin: 0;\n    padding: 0;\n  }\n\n  body { font-family: 'Source Sans Pro', sans-serif; }\n\n  #wrapper {\n    background:\n      radial-gradient(\n        ellipse at top left,\n        rgba(255, 255, 255, 1) 40%,\n        rgba(229, 229, 229, .9) 100%\n      );\n    height: 100vh;\n    padding: 60px 80px;\n    width: 100vw;\n  }\n\n  #logo {\n    height: auto;\n    margin-bottom: 20px;\n    width: 420px;\n  }\n\n  main {\n    display: flex;\n    justify-content: space-between;\n  }\n\n  main > div { flex-basis: 50%; }\n\n  .left-side {\n    display: flex;\n    flex-direction: column;\n  }\n\n  .welcome {\n    color: #555;\n    font-size: 23px;\n    margin-bottom: 10px;\n  }\n\n  .title {\n    color: #2c3e50;\n    font-size: 20px;\n    font-weight: bold;\n    margin-bottom: 6px;\n  }\n\n  .title.alt {\n    font-size: 18px;\n    margin-bottom: 10px;\n  }\n\n  .doc p {\n    color: black;\n    margin-bottom: 10px;\n  }\n\n  .doc button {\n    font-size: .8em;\n    cursor: pointer;\n    outline: none;\n    padding: 0.75em 2em;\n    border-radius: 2em;\n    display: inline-block;\n    color: #fff;\n    background-color: #4fc08d;\n    transition: all 0.15s ease;\n    box-sizing: border-box;\n    border: 1px solid #4fc08d;\n  }\n\n  .doc button.alt {\n    color: #42b983;\n    background-color: transparent;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/components/ManageTool.vue",
    "content": "<template>\n  <div class=\"manage-tool\">\n    <div class=\"bucket-info\">\n      <el-tag class=\"bucket-name\">{{ bucket }}</el-tag>\n    </div>\n    <div class=\"manage-btn\">\n      <el-button class=\"w-btn\" type=\"text\" icon=\"upload\" @click=\"upload()\"> 上传</el-button>\n      <el-button class=\"w-btn\" type=\"text\" icon=\"time\" @click=\"refresh()\"> 刷新</el-button>\n      <el-button class=\"w-btn\" type=\"text\" icon=\"delete\" :disabled=\"batchShow\" @click=\"batchDelete()\">删除</el-button>\n      <el-button class=\"w-btn\" type=\"text\" :disabled=\"batchShow\" icon=\"document\" @click=\"batchDownload()\"> 下载</el-button>\n    </div>\n    <div class=\"search-input\">\n      <el-input\n        placeholder=\"搜索\"\n        icon=\"search\"\n        v-model=\"filter\"\n        :on-icon-click=\"search\"\n        @keyup.enter.native=\"search\">\n      </el-input>\n    </div>\n  </div>\n</template>\n\n<script>\n  import Bus from '../utils/bus';\n\n  export default {\n    name: 'manage-tool',\n    data() {\n      return {\n        bucket: this.$route.query.bucket,\n        filter: '',\n        batchShow: true,\n      };\n    },\n    created() {\n      Bus.$on('batchShowStatus', (multipleSelection) => {\n        if (multipleSelection.length > 0) {\n          this.batchShow = false;\n        } else {\n          this.batchShow = true;\n        }\n      });\n    },\n    destroyed() {\n      Bus.$off('batchShowStatus');\n    },\n    methods: {\n      search() {\n        // file list filter\n        Bus.$emit('search', this.filter);\n      },\n      refresh() {\n        Bus.$emit('refresh');\n      },\n      upload() {\n        this.$router.push({ path: `/upload?bucket=${this.bucket}` });\n      },\n      batchDelete() {\n        Bus.$emit('batchDelete');\n      },\n      batchDownload() {\n        Bus.$emit('batchDownload');\n      },\n    },\n  };\n</script>\n\n<style scope>\n  .manage-tool {\n    position: fixed;\n    margin-top: 50px;\n    width: 100vw;\n    height: 50px;\n    -webkit-app-region: drag;\n    background: #2e84c7;\n  }\n  .manage-btn {\n    float: left;\n    margin-left: 4vw;\n  }\n  .bucket-info {\n    float: left;\n    margin-left: 10vw;\n    padding-top: 4px;\n  }\n  .bucket-name {\n    background: #fff;\n    color: #2e84c7;\n  }\n  .w-btn,\n  .w-btn:hover,\n  .w-btn:focus {\n    color: #fff;\n  }\n  .search-input {\n    float: right;\n    margin-right: 10vw;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/components/NoBucket.vue",
    "content": "<template>\n  <div id=\"no-bucket-page\">\n    <div class=\"nothing-img\"></div>\n    <el-button class=\"show-modal-btn\" @click=\"dialogFormVisible = true\">设置Key</el-button>\n\n    <el-dialog\n      title=\"设置公/私钥\"\n      size=\"large\"\n      top=\"25%\"\n      :visible.sync=\"dialogFormVisible\">\n      <el-form :model=\"form\">\n        <el-form-item label=\"AccessKey\" :label-width=\"formLabelWidth\">\n          <el-input v-model=\"form.ak\" auto-complete=\"off\"></el-input>\n        </el-form-item>\n        <el-form-item label=\"SecretKey\" :label-width=\"formLabelWidth\">\n          <el-input type=\"password\" v-model=\"form.sk\" auto-complete=\"off\"></el-input>\n        </el-form-item>\n      </el-form>\n      <div class=\"notice\">\n        <p>不知道key? <el-button type=\"text\" @click=\"openPortal()\">去七牛查看</el-button></p>\n      </div>\n      <div slot=\"footer\" class=\"dialog-footer\">\n        <el-button @click=\"dialogFormVisible = false\">取 消</el-button>\n        <el-button @click=\"setKey()\" v-loading.fullscreen.lock=\"fullscreenLoading\">确 定</el-button>\n      </div>\n    </el-dialog>\n  </div>\n</template>\n\n<script>\n  export default {\n    name: 'no-bucket',\n    data() {\n      return {\n        fullscreenLoading: false,\n        dialogVisible: false,\n        dialogFormVisible: false,\n        formLabelWidth: '80px',\n        form: {\n          ak: '',\n          sk: '',\n        },\n      };\n    },\n    methods: {\n      setKey() {\n        const router = this.$router;\n        localStorage.accessKey = this.form.ak;\n        localStorage.secretKey = this.form.sk;\n        this.dialogFormVisible = false;\n        this.fullscreenLoading = true;\n        setTimeout(() => {\n          router.push({ path: 'bucket' });\n          this.fullscreenLoading = false;\n        }, 3000);\n      },\n      // go to qiniu portal to find key\n      openPortal() {\n        require('electron').shell.openExternal('https://portal.qiniu.com/user/key');\n      },\n    },\n  };\n</script>\n\n<style scope>\n  body {\n    background: #fff;\n  }\n  .nothing-img {\n    text-align: center;\n    height: 260px;\n    background: url(../../../static/img/nothing.png) no-repeat;\n    background-size: 320px 198.35px;\n    background-position: 40px 80px;\n    margin-bottom: 80px;\n  }\n  .nothing-img img {\n    width: 80vw;\n  }\n  .show-modal-btn {\n    background: #2e84c7;\n    color: #ffffff;\n    border: 0;\n    width: 40vw;\n    margin-left: 30vw;\n    margin-top: 20px;\n    height: 50px;\n  }\n  .show-modal-btn:hover {\n    color: #ffffff;\n  }\n  .el-dialog__body {\n    padding-bottom: 0;\n  }\n  .notice {\n    margin-left: 170px;\n    color: #888;\n    font-size: 14px;\n    margin-top: -20px;\n  }\n  .dialog-footer {\n    margin-top: -10px;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/main.js",
    "content": "import Vue from 'vue';\nimport axios from 'axios';\nimport ElementUI from 'element-ui';\nimport 'element-ui/lib/theme-default/index.css';\n\nimport App from './App';\nimport router from './router';\nimport store from './store';\n\nif (!process.env.IS_WEB) Vue.use(require('vue-electron'));\nVue.http = Vue.prototype.$http = axios;\nVue.config.productionTip = false;\nVue.use(ElementUI);\n\n/* eslint-disable no-new */\nnew Vue({\n  components: { App },\n  router,\n  store,\n  template: '<App/>',\n  created() {\n    this.checkLogin();\n  },\n  methods: {\n    checkLogin() {\n      const accessKey = localStorage.getItem('accessKey');\n      const secretKey = localStorage.getItem('secretKey');\n\n      // check the exist of AK and SK\n      let hasKey = true;\n      if (accessKey == null || secretKey == null) {\n        hasKey = false;\n      }\n\n      if (hasKey === false) {\n        this.$router.push('/login');\n      }\n    },\n  },\n}).$mount('#app');\n"
  },
  {
    "path": "src/renderer/pages/Bucket.vue",
    "content": "<template>\n  <div class=\"bucket-page\">\n    <bucket-header></bucket-header>\n    <div class=\"bucket-list\">\n      <bucket-list></bucket-list>\n    </div>\n  </div>\n</template>\n\n<script>\n  import BucketHeader from '../components/BucketHeader';\n  import BucketList from '../components/BucketList';\n\n  export default {\n    name: 'bucket',\n    components: { BucketHeader, BucketList },\n  };\n</script>\n\n<style>\n  webkit,\n  ::-webkit-scrollbar {\n    width: 0;\n  }\n  body {\n    margin: 0;\n    font-family: \"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif;\n  }\n  .bucket-list {\n    padding-top: 50px;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/pages/Login.vue",
    "content": "<template>\n  <div class=\"login-page\">\n    <bucket-header></bucket-header>\n    <no-bucket></no-bucket>\n  </div>\n</template>\n\n<script>\n  import BucketHeader from '../components/BucketHeader';\n  import NoBucket from '../components/NoBucket';\n\n  export default {\n    name: 'login',\n    components: { BucketHeader, NoBucket },\n  };\n</script>\n\n<style>\n  webkit,\n  ::-webkit-scrollbar {\n    width: 0;\n  }\n  body {\n    margin: 0;\n    font-family: \"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/pages/Manage.vue",
    "content": "<template>\n  <div class=\"manage-page\">\n    <bucket-header></bucket-header>\n    <manage-tool></manage-tool>\n    <div class=\"file-list\">\n      <file-list></file-list>\n    </div>\n  </div>\n</template>\n\n<script>\n  import BucketHeader from '../components/BucketHeader';\n  import ManageTool from '../components/ManageTool';\n  import FileList from '../components/FileList';\n\n  export default {\n    name: 'manage',\n    components: { BucketHeader, ManageTool, FileList },\n  };\n</script>\n\n<style>\n  webkit,\n  ::-webkit-scrollbar {\n    width: 0;\n  }\n  body {\n    margin: 0;\n    font-family: \"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif;\n  }\n  .file-list {\n    padding-top: 100px;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/pages/Upload.vue",
    "content": "<template>\n  <div class=\"upload-page\">\n    <bucket-header></bucket-header>\n    <!-- manage tool -->\n    <div class=\"manage-tool\">\n      <div class=\"bucket-info\">\n        <el-tag class=\"bucket-name\">{{ bucket }}</el-tag>\n      </div>\n      <div class=\"manage-btn\">\n        <el-button class=\"w-btn\" type=\"text\" icon=\"arrow-left\" @click=\"goback()\">返回</el-button>\n      </div>\n    </div>\n\n    <div class=\"upload-panel\">\n      <el-upload\n        class=\"upload-demo\"\n        :action=\"uploadUrl\"\n        drag\n        :on-remove=\"handleRemove\"\n        :before-upload=\"beforeUpload\"\n        :on-success=\"handleSuccess\"\n        :on-error=\"handleError\"\n        :on-progress=\"handleProgress\"\n        :data=\"form\">\n        <i class=\"el-icon-upload\"></i>\n        <div class=\"el-upload__text\">将文件拖到此处，或<em>点击上传</em></div>\n      </el-upload>\n    </div>\n  </div>\n</template>\n\n<script>\n  import BucketHeader from '../components/BucketHeader';\n  import PutPolicy from '../utils/put_policy';\n  import Qiniu from '../utils/qiniu';\n\n  export default {\n    name: 'upload',\n    components: { BucketHeader },\n    data() {\n      return {\n        uploadUrl: '',\n        bucket: this.$route.query.bucket,\n        form: {},\n        headers: {},\n      };\n    },\n    created() {\n      Qiniu.autoZone(localStorage.accessKey, this.bucket)\n        .then((zone) => {\n          this.uploadUrl = `http://${zone.up.src.main[0]}`;\n        })\n        .catch();\n    },\n    methods: {\n      goback() {\n        this.$router.push({ path: `/manage?bucket=${this.bucket}` });\n      },\n      handleSuccess() {\n      },\n      handleError() {\n      },\n      handleProgress() {\n      },\n      handleRemove(item) {\n        const bucket = this.$route.query.bucket;\n        const accessKey = localStorage.accessKey;\n        const secretKey = localStorage.secretKey;\n        Qiniu.delete(accessKey, secretKey, bucket, item.response.key)\n          .then(() => {\n            this.$message('删除成功...💗');\n          })\n          .catch();\n      },\n      async beforeUpload(file) {\n        // generate uploadToken\n        const options = {\n          scope: `${this.bucket}:${file.name}`,\n        };\n        const mac = {\n          accessKey: localStorage.accessKey,\n          secretKey: localStorage.secretKey,\n        };\n        const putPolicy = new PutPolicy(options);\n        const uploadToken = putPolicy.uploadToken(mac);\n        // form data\n        this.form = {\n          key: file.name,\n          token: uploadToken,\n        };\n      },\n    },\n  };\n</script>\n\n<style>\n  webkit,\n  ::-webkit-scrollbar {\n    width: 0;\n  }\n  body {\n    margin: 0;\n    font-family: \"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif;\n  }\n  .upload-panel {\n    padding-top: 100px;\n  }\n  .manage-tool {\n    position: fixed;\n    margin-top: 50px;\n    width: 100vw;\n    height: 50px;\n    -webkit-app-region: drag;\n    background: #2e84c7;\n  }\n  .bucket-info {\n    float: left;\n    margin-left: 10vw;\n    padding-top: 4px;\n  }\n  .bucket-name {\n    background: #fff;\n    color: #2e84c7;\n  }\n  .manage-btn {\n    float: left;\n    margin-left: 4vw;\n  }\n  .w-btn,\n  .w-btn:hover,\n  .w-btn:focus {\n    color: #fff;\n  }\n  /* dtrag upload style */\n  .el-upload {\n    float: right;\n  }\n  .el-upload-dragger {\n    width: 61vw;\n    height: 536px;\n    border: 0;\n    border-left: 1px solid #eee;\n    border-radius: 0;\n    background: transparent;\n  }\n  .el-upload-dragger:hover {\n    border: 1px dashed #2e84c7;\n  }\n  .el-upload-dragger .el-icon-upload {\n    margin-top: 30vh;\n  }\n  .el-upload-list {\n    position: absolute;\n    width: 35vw;\n    top: 100px;\n    left: 2vw;\n    height: 540px;\n    overflow: scroll;\n  }\n</style>\n"
  },
  {
    "path": "src/renderer/router/index.js",
    "content": "import Vue from 'vue';\nimport Router from 'vue-router';\n\nVue.use(Router);\n\nexport default new Router({\n  routes: [\n    {\n      path: '/landing',\n      name: 'landing-page',\n      component: require('@/components/LandingPage'),\n    },\n    {\n      path: '/',\n      name: 'bucket',\n      component: require('@/pages/bucket'),\n    },\n    {\n      path: '/login',\n      name: 'login',\n      component: require('@/pages/login'),\n    },\n    {\n      path: '/manage',\n      name: 'manage',\n      component: require('@/pages/manage'),\n    },\n    {\n      path: '/upload',\n      name: 'upload',\n      component: require('@/pages/upload'),\n    },\n    {\n      path: '*',\n      redirect: '/',\n    },\n  ],\n});\n"
  },
  {
    "path": "src/renderer/store/index.js",
    "content": "import Vue from 'vue';\nimport Vuex from 'vuex';\n\nimport modules from './modules';\n\nVue.use(Vuex);\n\nexport default new Vuex.Store({\n  modules,\n  strict: process.env.NODE_ENV !== 'production',\n});\n"
  },
  {
    "path": "src/renderer/store/modules/Counter.js",
    "content": "const state = {\n  main: 0,\n};\n\nconst mutations = {\n  DECREMENT_MAIN_COUNTER(state) {\n    state.main -= 1;\n  },\n  INCREMENT_MAIN_COUNTER(state) {\n    state.main += 1;\n  },\n};\n\nconst actions = {\n  someAsyncTask({ commit }) {\n    // do something async\n    commit('INCREMENT_MAIN_COUNTER');\n  },\n};\n\nexport default {\n  state,\n  mutations,\n  actions,\n};\n"
  },
  {
    "path": "src/renderer/store/modules/index.js",
    "content": "/**\n * The file enables `@/store/index.js` to import all vuex modules\n * in a one-shot manner. There should not be any reason to edit this file.\n */\n\nconst files = require.context('.', false, /\\.js$/);\nconst modules = {};\n\nfiles.keys().forEach((key) => {\n  if (key === './index.js') return;\n  modules[key.replace(/(\\.\\/|\\.js)/g, '')] = files(key).default;\n});\n\nexport default modules;\n"
  },
  {
    "path": "src/renderer/utils/bus.js",
    "content": "// bus component\nimport Vue from 'vue';\n\nexport default new Vue();\n"
  },
  {
    "path": "src/renderer/utils/put_policy.js",
    "content": "/**\n *  @module   : Module to generate put policy and upload token\n *  @author   : Gin (gin.lance.inside@hotmail.com)\n */\nimport Util from './util';\n\nexport default class PutPolicy {\n  /**\n   * Generate put policy class.\n   *\n   * @param scope       must have this attr.\n   *                    the other option could find in\n   *                    https://developer.qiniu.com/kodo/manual/1206/put-policy\n   *\n   * @return PutPolicy\n   */\n  constructor(options) {\n    if (typeof options !== 'object') {\n      throw new Error('invalid putpolicy options');\n    }\n\n    this.scope = options.scope || null;\n    this.isPrefixalScope = options.isPrefixalScope || null;\n    this.expires = options.expires || 3600;\n    this.insertOnly = options.insertOnly || null;\n\n    this.saveKey = options.saveKey || null;\n    this.endUser = options.endUser || null;\n\n    this.returnUrl = options.returnUrl || null;\n    this.returnBody = options.returnBody || null;\n\n    this.callbackUrl = options.callbackUrl || null;\n    this.callbackHost = options.callbackHost || null;\n    this.callbackBody = options.callbackBody || null;\n    this.callbackBodyType = options.callbackBodyType || null;\n    this.callbackFetchKey = options.callbackFetchKey || null;\n\n    this.persistentOps = options.persistentOps || null;\n    this.persistentNotifyUrl = options.persistentNotifyUrl || null;\n    this.persistentPipeline = options.persistentPipeline || null;\n\n    this.fsizeLimit = options.fsizeLimit || null;\n    this.fsizeMin = options.fsizeMin || null;\n    this.mimeLimit = options.mimeLimit || null;\n\n    this.detectMime = options.detectMime || null;\n    this.deleteAfterDays = options.deleteAfterDays || null;\n    this.fileType = options.fileType || null;\n  }\n\n  /**\n   * make the PutPolicy to json string\n   *\n   * @return string\n   */\n  getFlags() {\n    const flags = {};\n    const attrs = ['scope', 'isPrefixalScope', 'insertOnly', 'saveKey', 'endUser',\n      'returnUrl', 'returnBody', 'callbackUrl', 'callbackHost',\n      'callbackBody', 'callbackBodyType', 'callbackFetchKey', 'persistentOps',\n      'persistentNotifyUrl', 'persistentPipeline', 'fsizeLimit', 'fsizeMin',\n      'detectMime', 'mimeLimit', 'deleteAfterDays', 'fileType',\n    ];\n\n    for (let i = attrs.length - 1; i >= 0; i -= 1) {\n      if (this[attrs[i]] !== null) {\n        flags[attrs[i]] = this[attrs[i]];\n      }\n    }\n\n    flags.deadline = this.expires + Math.floor(Date.now() / 1000);\n\n    return flags;\n  }\n\n  /**\n   * generate upload token\n   *\n   * @param mac      an object contain sk and ak\n   *\n   * @return string\n   */\n  uploadToken(mac) {\n    const flags = this.getFlags();\n    const encodedFlags = Util.urlsafeBase64Encode(JSON.stringify(flags));\n    const encoded = Util.hmacSha1(encodedFlags, mac.secretKey);\n    const encodedSign = Util.base64ToUrlSafe(encoded);\n    const uploadToken = `${mac.accessKey}:${encodedSign}:${encodedFlags}`;\n    return uploadToken;\n  }\n}\n"
  },
  {
    "path": "src/renderer/utils/qiniu.js",
    "content": "// load Util class\nimport Util from './util';\n\n// commonJs load modules\nconst rp = require('request-promise');\n\n/**\n * Qiniu module to implement all apis.\n */\nexport default class Qiniu {\n  /**\n   * auto get the bucket zone\n   * @param ak       accessKey\n   * @param bucket   bucket name\n   */\n  static async autoZone(ak, bucket) {\n    const requestURI = `https://uc.qbox.me/v2/query?ak=${ak}&bucket=${bucket}`;\n    const options = {\n      uri: requestURI,\n      json: true,\n    };\n\n    return rp(options);\n  }\n\n  /**\n   * list all buckets\n   * @param ak   accessKey\n   * @param sk   secretKey\n   */\n  static async buckets(ak, sk) {\n    const mac = {\n      accessKey: ak,\n      secretKey: sk,\n    };\n    const requestURI = 'http://rs.qbox.me/buckets';\n    const reqBody = '';\n    const accessToken = Util.generateAccessToken(mac, requestURI, reqBody);\n\n    const options = {\n      uri: requestURI,\n      headers: {\n        Authorization: accessToken,\n      },\n      json: true,\n    };\n\n    return rp(options);\n  }\n\n  /**\n   * drop an exist bucket\n   * @param ak      accessKey\n   * @param sk      secretKey\n   * @param name    bucket name\n   */\n  static async drop(ak, sk, name) {\n    const mac = {\n      accessKey: ak,\n      secretKey: sk,\n    };\n    const requestURI = `http://rs.qiniu.com/drop/${name}`;\n    const reqBody = '';\n    const accessToken = Util.generateAccessToken(mac, requestURI, reqBody);\n\n    const options = {\n      uri: requestURI,\n      headers: {\n        Authorization: accessToken,\n      },\n      json: true,\n    };\n\n    return rp(options);\n  }\n\n  /**\n   * create new bucket\n   * @param ak      accessKey\n   * @param sk      secretKey\n   * @param name    bucket name\n   * @param region  bucket region\n   */\n  static async mkbucket(ak, sk, name, region) {\n    const encodedBucketName = Util.urlsafeBase64Encode(name);\n    const mac = {\n      accessKey: ak,\n      secretKey: sk,\n    };\n    const requestURI = `http://rs.qiniu.com/mkbucketv2/${encodedBucketName}/region/${region}`;\n    const reqBody = '';\n    const accessToken = Util.generateAccessToken(mac, requestURI, reqBody);\n\n    const options = {\n      uri: requestURI,\n      headers: {\n        Authorization: accessToken,\n      },\n      json: true,\n    };\n\n    return rp(options);\n  }\n\n  /**\n   * list all files in a bucket\n   * @param ak     accessKey\n   * @param sk     secretKey\n   * @param bucket bucket name\n   */\n  static async list(ak, sk, bucket, marker = '', prefix = '') {\n    const mac = {\n      accessKey: ak,\n      secretKey: sk,\n    };\n    const requestURI = `http://rsf.qbox.me/list?bucket=${bucket}&limit=100&marker=${marker}&prefix=${prefix}`;\n    const reqBody = '';\n    const accessToken = Util.generateAccessToken(mac, requestURI, reqBody);\n\n    const options = {\n      uri: requestURI,\n      headers: {\n        Authorization: accessToken,\n      },\n      json: true,\n    };\n\n    return rp(options);\n  }\n\n  /**\n   * list the domain of a bucket\n   * @param ak     accessKey\n   * @param sk     secretKey\n   * @param bucket bucket name\n   */\n  static async domain(ak, sk, bucket) {\n    const mac = {\n      accessKey: ak,\n      secretKey: sk,\n    };\n    const requestURI = `http://api.qiniu.com/v6/domain/list?tbl=${bucket}`;\n    const reqBody = '';\n    const accessToken = Util.generateAccessToken(mac, requestURI, reqBody);\n\n    const options = {\n      uri: requestURI,\n      headers: {\n        Authorization: accessToken,\n      },\n      json: true,\n    };\n\n    return rp(options);\n  }\n\n  /**\n   * delete a file from a bucket\n   * @param ak     accessKey\n   * @param sk     secretKey\n   * @param bucket bucket name\n   * @patam key    item key\n   */\n  static async delete(ak, sk, bucket, key) {\n    const entry = `${bucket}:${key}`;\n    const encodedEntryURI = Util.urlsafeBase64Encode(entry);\n    const mac = {\n      accessKey: ak,\n      secretKey: sk,\n    };\n    const requestURI = `http://rs.qiniu.com/delete/${encodedEntryURI}`;\n    const reqBody = '';\n    const accessToken = Util.generateAccessToken(mac, requestURI, reqBody);\n\n    const options = {\n      uri: requestURI,\n      headers: {\n        Authorization: accessToken,\n      },\n      json: true,\n    };\n\n    return rp(options);\n  }\n\n  /**\n   *  batch management, delete, download etc.\n   *\n   */\n  static async batchDelete(ak, sk, bucket, items) {\n    const mac = {\n      accessKey: ak,\n      secretKey: sk,\n    };\n\n    let query = '';\n    items.forEach((item) => {\n      const entry = `${bucket}:${item.key}`;\n      const encodedEntryURI = Util.urlsafeBase64Encode(entry);\n      query += `op=/delete/${encodedEntryURI}&`;\n    });\n    query = query.substring(0, query.length - 1);\n\n    const requestURI = `http://rs.qiniu.com/batch?${query}`;\n    const reqBody = '';\n    const accessToken = Util.generateAccessToken(mac, requestURI, reqBody);\n\n    const options = {\n      uri: requestURI,\n      headers: {\n        Authorization: accessToken,\n      },\n      json: true,\n    };\n\n    return rp(options);\n  }\n\n  /**\n   * rename the resource\n   * @param ak      accessKey\n   * @param sk      secretKey\n   * @param bucket  bucket name\n   * @param oldName the old name of the resource\n   * @param newName the new name of the resource\n   */\n  static async rename(ak, sk, bucket, oldName, newName) {\n    const mac = {\n      accessKey: ak,\n      secretKey: sk,\n    };\n    // generate encodedEntryURISrc\n    const entrySrc = `${bucket}:${oldName}`;\n    const encodedEntryURISrc = Util.urlsafeBase64Encode(entrySrc);\n\n    // generate encodedEntryURIDest\n    const entryDest = `${bucket}:${newName}`;\n    const encodedEntryURIDest = Util.urlsafeBase64Encode(entryDest);\n\n    const requestURI = `http://rs.qiniu.com/move/${encodedEntryURISrc}/${encodedEntryURIDest}`;\n    const reqBody = '';\n    const accessToken = Util.generateAccessToken(mac, requestURI, reqBody);\n\n    const options = {\n      uri: requestURI,\n      headers: {\n        Authorization: accessToken,\n      },\n      json: true,\n    };\n\n    return rp(options);\n  }\n}\n"
  },
  {
    "path": "src/renderer/utils/util.js",
    "content": "const url = require('url');\nconst crypto = require('crypto');\n\n/**\n * Util module to implement the safe strategy.\n */\nexport default class Util {\n  /**\n   * Hmac-sha1 Crypt and return value already encoded with base64.\n   * @param encodedFlags    flag used to encode the key.\n   * @param secretKey       Qiniu secret key, you can get it in\n   *                        \"https://portal.qiniu.com/user/key\"\n   */\n  static hmacSha1(encodedFlags, secretKey) {\n    const hmac = crypto.createHmac('sha1', secretKey);\n    hmac.update(encodedFlags);\n    return hmac.digest('base64');\n  }\n\n  /**\n   * base64 to url safe with Qiniu standard.\n   * @param v    base64 string\n   */\n  static base64ToUrlSafe(v) {\n    return v.replace(/\\//g, '_').replace(/\\+/g, '-');\n  }\n\n  /**\n   * format the file size\n   * @param fsize  file size\n   */\n  static fsizeFormat(fsize, prec = 2) {\n    let rank = 0;\n    let unit = 'B';\n\n    while (fsize > 1024) {\n      fsize /= 1024;\n      rank += 1;\n    }\n\n    fsize = fsize.toFixed(prec);\n    switch (rank) {\n      case 1:\n        unit = 'KB';\n        break;\n      case 2:\n        unit = 'MB';\n        break;\n      case 3:\n        unit = 'GB';\n        break;\n      case 4:\n        unit = 'TB';\n        break;\n      default:\n        break;\n    }\n    return `${fsize} ${unit}`;\n  }\n\n\n  /**\n   * UrlSafe Base64 Decode.\n   * @param jsonFlag\n   */\n  static urlsafeBase64Encode(jsonFlags) {\n    const encoded = new Buffer(jsonFlags).toString('base64');\n    return this.base64ToUrlSafe(encoded);\n  }\n\n  /**\n   * generate AccessToken to manage the QBox.\n   * @param mac         AK&SK object\n   * @param requestURI  callback requestURI\n   * @param reqBody     requst body, needed while ContentType be\n   *                    application/x-www-form-urlencoded\n   */\n  static generateAccessToken(mac, requestURI, reqBody) {\n    const u = url.parse(requestURI);\n    const path = u.path;\n    let access = `${path}\\n`;\n\n    if (reqBody) {\n      access += reqBody;\n    }\n\n    const digest = this.hmacSha1(access, mac.secretKey);\n    const safeDigest = this.base64ToUrlSafe(digest);\n    return `QBox ${mac.accessKey}:${safeDigest}`;\n  }\n\n  /**\n   * transfer url string to Blob object\n   * @param url    url string\n   */\n  static urlToBlob(url) {\n    return fetch(url);\n  }\n}\n"
  },
  {
    "path": "static/.gitkeep",
    "content": ""
  },
  {
    "path": "static/style/iconfont.css",
    "content": "\n@font-face {font-family: \"iconfont\";\n  src: url('iconfont.eot?t=1501386021427'); /* IE9*/\n  src: url('iconfont.eot?t=1501386021427#iefix') format('embedded-opentype'), /* IE6-IE8 */\n  url('iconfont.woff?t=1501386021427') format('woff'), /* chrome, firefox */\n  url('iconfont.ttf?t=1501386021427') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/\n  url('iconfont.svg?t=1501386021427#iconfont') format('svg'); /* iOS 4.1- */\n}\n\n.iconfont {\n  font-family:\"iconfont\" !important;\n  font-size:16px;\n  font-style:normal;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\n.icon-download:before { content: \"\\e6e9\"; }\n\n.icon-202023:before { content: \"\\e65b\"; }\n\n.icon-upload:before { content: \"\\e60a\"; }\n\n.icon-previewline:before { content: \"\\e755\"; }\n\n.icon-logout:before { content: \"\\e62f\"; }\n\n.icon-manage:before { content: \"\\e502\"; }\n\n"
  },
  {
    "path": "test/.eslintrc",
    "content": "{\n  \"env\": {\n    \"mocha\": true\n  },\n  \"globals\": {\n    \"assert\": true,\n    \"expect\": true,\n    \"should\": true,\n    \"__static\": true\n  },\n  \"rules\": {\n    \"func-names\": 0,\n    \"prefer-arrow-callback\": 0\n  }\n}\n"
  },
  {
    "path": "test/unit/index.js",
    "content": "import Vue from 'vue'\nVue.config.devtools = false\nVue.config.productionTip = false\n\n// require all test files (files that ends with .spec.js)\nconst testsContext = require.context('./specs', true, /\\.spec$/)\ntestsContext.keys().forEach(testsContext)\n\n// require all src files except main.js for coverage.\n// you can also change this to match only the subset of files that\n// you want coverage for.\nconst srcContext = require.context('../../src/renderer', true, /^\\.\\/(?!main(\\.js)?$)/)\nsrcContext.keys().forEach(srcContext)\n"
  },
  {
    "path": "test/unit/karma.conf.js",
    "content": "'use strict'\n\nconst path = require('path')\nconst merge = require('webpack-merge')\nconst webpack = require('webpack')\n\nconst baseConfig = require('../../.electron-vue/webpack.renderer.config')\nconst projectRoot = path.resolve(__dirname, '../../src/renderer')\n\n// Set BABEL_ENV to use proper preset config\nprocess.env.BABEL_ENV = 'test'\n\nlet webpackConfig = merge(baseConfig, {\n  devtool: '#inline-source-map',\n  plugins: [\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"testing\"'\n    })\n  ]\n})\n\n// don't treat dependencies as externals\ndelete webpackConfig.entry\ndelete webpackConfig.externals\ndelete webpackConfig.output.libraryTarget\n\n// apply vue option to apply isparta-loader on js\nwebpackConfig.module.rules\n  .find(rule => rule.use.loader === 'vue-loader').use.options.loaders.js = 'babel-loader'\n\nmodule.exports = config => {\n  config.set({\n    browsers: ['visibleElectron'],\n    client: {\n      useIframe: false\n    },\n    coverageReporter: {\n      dir: './coverage',\n      reporters: [\n        { type: 'lcov', subdir: '.' },\n        { type: 'text-summary' }\n      ]\n    },\n    customLaunchers: {\n      'visibleElectron': {\n        base: 'Electron',\n        flags: ['--show']\n      }\n    },\n    frameworks: ['mocha', 'chai'],\n    files: ['./index.js'],\n    preprocessors: {\n      './index.js': ['webpack', 'sourcemap']\n    },\n    reporters: ['spec', 'coverage'],\n    singleRun: true,\n    webpack: webpackConfig,\n    webpackMiddleware: {\n      noInfo: true\n    }\n  })\n}\n"
  },
  {
    "path": "test/unit/specs/LandingPage.spec.js",
    "content": "import Vue from 'vue';\nimport LandingPage from '@/components/LandingPage';\n\ndescribe('LandingPage.vue', () => {\n  it('should render correct contents', () => {\n    const vm = new Vue({\n      el: document.createElement('div'),\n      render: h => h(LandingPage),\n    }).$mount();\n\n    expect(vm.$el.querySelector('.title').textContent).to.contain('Welcome to your new project!');\n  });\n});\n"
  }
]