Move ui from deprecated to src/

This commit is contained in:
jbnadal
2017-06-08 12:26:37 +02:00
parent 33298d0fad
commit d78ffaa025
40 changed files with 0 additions and 0 deletions

View File

@@ -1,5 +0,0 @@
{
"presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime"],
"comments": false
}

View File

@@ -1,9 +0,0 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

View File

@@ -1,16 +0,0 @@
module.exports = {
root: true,
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'standard',
// required to lint *.vue files
plugins: [
'html'
],
// add your custom rules here
'rules': {
// allow paren-less arrow functions
'arrow-parens': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
}
}

View File

@@ -1,7 +0,0 @@
.DS_Store
node_modules/
dist/
npm-debug.log
selenium-debug.log
test/unit/coverage
test/e2e/reports

View File

@@ -1,31 +0,0 @@
# Domo
> Home Automation Tool
# Update packages with the last available.
npm-check-updates -u
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# run unit tests
npm run unit
# run e2e tests
npm run e2e
# run all tests
npm test
```
For detailed explanation on how things work, checkout the [guide](https://github.com/vuejs-templates/webpack#vue-webpack-boilerplate) and [docs for vue-loader](http://vuejs.github.io/vue-loader).

View File

@@ -1,37 +0,0 @@
/* eslint-env shelljs */
// https://github.com/shelljs/shelljs
require('shelljs/global')
env.NODE_ENV = 'production'
var path = require('path')
var config = require('../config')
var ora = require('ora')
var webpack = require('webpack')
var webpackConfig = require('./webpack.prod.conf')
console.log(
' Tip:\n' +
' Built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
)
var spinner = ora('building for production...')
spinner.start()
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
rm('-rf', assetsPath)
mkdir('-p', assetsPath)
cp('-R', 'static/', assetsPath)
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n')
})

View File

@@ -1,36 +0,0 @@
var ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = function (options) {
options = options || {}
// generate loader string to be used with extract text plugin
function generateLoaders (loaders) {
var sourceLoader = loaders.map(function (loader) {
var extraParamChar
if (/\?/.test(loader)) {
loader = loader.replace(/\?/, '-loader?')
extraParamChar = '&'
} else {
loader = loader + '-loader'
extraParamChar = '?'
}
return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '')
}).join('!')
if (options.extract) {
return ExtractTextPlugin.extract('vue-style-loader', sourceLoader)
} else {
return ['vue-style-loader', sourceLoader].join('!')
}
}
// http://vuejs.github.io/vue-loader/configurations/extract-css.html
return {
css: generateLoaders(['css']),
postcss: generateLoaders(['css']),
less: generateLoaders(['css', 'less']),
sass: generateLoaders(['css', 'sass?indentedSyntax']),
scss: generateLoaders(['css', 'sass']),
stylus: generateLoaders(['css', 'stylus']),
styl: generateLoaders(['css', 'stylus'])
}
}

View File

@@ -1,8 +0,0 @@
require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
hotClient.subscribe(function (event) {
if (event.action === 'reload') {
window.location.reload()
}
})

View File

@@ -1,65 +0,0 @@
var path = require('path')
var express = require('express')
var webpack = require('webpack')
var config = require('../config')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = process.env.NODE_ENV === 'testing'
? require('./webpack.prod.conf')
: require('./webpack.dev.conf')
// default port where dev server listens for incoming traffic
var port = process.env.PORT || config.dev.port
// Define HTTP proxies to your custom API backend
// https://github.com/chimurai/http-proxy-middleware
var proxyTable = config.dev.proxyTable
var app = express()
var compiler = webpack(webpackConfig)
var devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: webpackConfig.output.publicPath,
stats: {
colors: true,
chunks: false
}
})
var hotMiddleware = require('webpack-hot-middleware')(compiler)
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})
})
// proxy api requests
Object.keys(proxyTable).forEach(function (context) {
var options = proxyTable[context]
if (typeof options === 'string') {
options = { target: options }
}
app.use(proxyMiddleware(context, options))
})
// handle fallback for HTML5 history API
app.use(require('connect-history-api-fallback')())
// serve webpack bundle output
app.use(devMiddleware)
// enable hot-reload and state-preserving
// compilation error display
app.use(hotMiddleware)
// serve pure static assets
var staticPath = path.posix.join(config.build.assetsPublicPath, config.build.assetsSubDirectory)
app.use(staticPath, express.static('./static'))
module.exports = app.listen(port, function (err) {
if (err) {
console.log(err)
return
}
console.log('Listening at http://localhost:' + port + '\n')
})

View File

@@ -1,77 +0,0 @@
var path = require('path')
var config = require('../config')
var cssLoaders = require('./css-loaders')
var projectRoot = path.resolve(__dirname, '../')
module.exports = {
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
publicPath: config.build.assetsPublicPath,
filename: '[name].js'
},
resolve: {
extensions: ['', '.js', '.vue'],
fallback: [path.join(__dirname, '../node_modules')],
alias: {
'src': path.resolve(__dirname, '../src'),
'assets': path.resolve(__dirname, '../src/assets'),
'components': path.resolve(__dirname, '../src/components')
}
},
resolveLoader: {
fallback: [path.join(__dirname, '../node_modules')]
},
module: {
preLoaders: [
{
test: /\.vue$/,
loader: 'eslint',
include: projectRoot,
exclude: /node_modules/
},
{
test: /\.js$/,
loader: 'eslint',
include: projectRoot,
exclude: /node_modules/
}
],
loaders: [
{
test: /\.vue$/,
loader: 'vue'
},
{
test: /\.js$/,
loader: 'babel',
include: projectRoot,
exclude: /node_modules/
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.html$/,
loader: 'vue-html'
},
{
test: /\.(png|jpe?g|gif|svg|woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url',
query: {
limit: 10000,
name: path.join(config.build.assetsSubDirectory, '[name].[hash:7].[ext]')
}
}
]
},
vue: {
loaders: cssLoaders()
},
eslint: {
formatter: require('eslint-friendly-formatter')
}
}

View File

@@ -1,26 +0,0 @@
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
// eval-source-map is faster for development
devtool: '#eval-source-map',
plugins: [
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
})
]
})

View File

@@ -1,56 +0,0 @@
var path = require('path')
var config = require('../config')
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var cssLoaders = require('./css-loaders')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = merge(baseWebpackConfig, {
devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
path: config.build.assetsRoot,
filename: path.join(config.build.assetsSubDirectory, '[name].[chunkhash].js'),
chunkFilename: path.join(config.build.assetsSubDirectory, '[id].[chunkhash].js')
},
vue: {
loaders: cssLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
plugins: [
// http://vuejs.github.io/vue-loader/workflow/production.html
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin(),
// extract css into its own file
new ExtractTextPlugin(path.join(config.build.assetsSubDirectory, '[name].[contenthash].css')),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing'
? 'index.html'
: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
}
})
]
})

View File

@@ -1,13 +0,0 @@
cmake_minimum_required(VERSION 2.8.11)
project(ui)
#add_custom_target(ui ALL)
add_custom_target(ui)
add_custom_command(TARGET ui PRE_BUILD
COMMAND mkdir -p ${CMAKE_SOURCE_DIR}/build/html
COMMAND cd ${CMAKE_SOURCE_DIR}/src/ui/Domo && npm install
COMMAND cd ${CMAKE_SOURCE_DIR}/src/ui/Domo && npm run build
COMMAND cp -a ${CMAKE_SOURCE_DIR}/src/ui/Domo/dist/* ${CMAKE_SOURCE_DIR}/build/html/
)

View File

@@ -1,16 +0,0 @@
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
build: {
index: path.resolve(__dirname, 'dist/index.html'),
assetsRoot: path.resolve(__dirname, 'dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true
},
dev: {
port: 8080,
proxyTable: {}
}
}

View File

@@ -1,54 +0,0 @@
curl -v http://192.168.1.6:8081/v1/capabilities/lights
* Hostname was NOT found in DNS cache
* Trying 192.168.1.6...
* Connected to 192.168.1.6 (192.168.1.6) port 8081 (#0)
> GET /v1/capabilities/lights HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 192.168.1.6:8081
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
< Access-Control-Allow-Origin: *
< Cache-Control: no-store, no-cache, must-revalidate, max-age=0
< Connection: close
< Content-Type: application/json; charset=utf-8
< Pragma: no-cache
<
{
"Lights" : [
{
"id" : 1,
"interruptor" : 0,
"name" : "Bureau JB",
"sender" : 12797322,
"speach_name" : "bureau",
"state" : true,
"zone" : ""
},
{
"id" : 2,
"interruptor" : 1,
"name" : "Salon",
"sender" : 12797322,
"speach_name" : "salon",
"state" : false,
"zone" : ""
},
{
"id" : 3,
"interruptor" : 2,
"name" : "Sapin",
"sender" : 12797322,
"speach_name" : "sapin",
"state" : false,
"zone" : ""
}
],
"id" : "/v1/capabilities/lights",
"response_code" : 200,
"status" : "OK"
}
* Closing connection 0

View File

@@ -1,31 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset='utf-8' />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="Domo Home Automation Controller" />
<meta name="author" content="NADAL Jean-Baptiste" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes" />
<link rel="icon" sizes="192x192" href="/static/android-desktop.png" />
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="Domo" />
<link rel="apple-touch-icon-precomposed" href="/static/ios-desktop.png" />
<link rel="shortcut icon" href="/static/favicon.png" />
<title>Domo</title>
</head>
<body>
<app></app>
<!-- built files will be auto injected -->
</body>
</html>

View File

@@ -1,78 +0,0 @@
{
"name": "Domo",
"version": "0.1.0",
"description": "Home Automation Tool",
"author": "NADAL Jean-Baptiste <jean.baptiste@nadal-fr.com>",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"build": "node build/build.js",
"unit": "karma start test/unit/karma.conf.js --single-run",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e"
},
"dependencies": {
"babel-runtime": "^6.0.0",
"fastclick": "^1.0.6",
"font-awesome": "^4.6.1",
"vue": "^1.0.26",
"vue-resource": "^0.9.1",
"vue-router": "^0.7.13",
"vux": "^0.1.1"
},
"devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-stage-2": "^6.0.0",
"chai": "^3.5.0",
"chromedriver": "^2.21.2",
"connect-history-api-fallback": "^1.1.0",
"cross-spawn": "^2.1.5",
"css-loader": "^0.23.0",
"eslint": "^2.0.0",
"eslint-config-standard": "^5.1.0",
"eslint-friendly-formatter": "^1.2.2",
"eslint-loader": "^1.3.0",
"eslint-plugin-html": "^1.3.0",
"eslint-plugin-promise": "^1.0.8",
"eslint-plugin-standard": "^1.3.2",
"eventsource-polyfill": "^0.9.6",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.4",
"function-bind": "^1.0.2",
"html-webpack-plugin": "^2.8.1",
"http-proxy-middleware": "^0.12.0",
"inject-loader": "^2.0.1",
"isparta-loader": "^2.0.0",
"json-loader": "^0.5.4",
"karma": "^0.13.15",
"karma-coverage": "^0.5.5",
"karma-mocha": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sinon-chai": "^1.2.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.24",
"karma-webpack": "^1.7.0",
"lolex": "^1.4.0",
"mocha": "^2.4.5",
"nightwatch": "^0.8.18",
"ora": "^0.2.0",
"phantomjs-prebuilt": "^2.1.3",
"selenium-server": "2.53.0",
"shelljs": "^0.6.0",
"sinon": "^1.17.3",
"sinon-chai": "^2.8.0",
"url-loader": "^0.5.7",
"vue-hot-reload-api": "^1.2.0",
"vue-html-loader": "^1.0.0",
"vue-loader": "^8.3.0",
"vue-style-loader": "^1.0.0",
"webpack": "^1.12.2",
"webpack-dev-middleware": "^1.4.0",
"webpack-hot-middleware": "^2.6.0",
"webpack-merge": "^0.8.3"
}
}

View File

@@ -1,72 +0,0 @@
<template>
<div id="app">
<router-view transition transition-mode="out-in">
</router-view>
<tabbar>
<tabbar-item is-link v-link="'/'">
<i slot="icon" class="fa fa-home" aria-hidden="true"></i>
<span slot="label">Home</span>
</tabbar-item>
<tabbar-item is-link v-link="'/lights'">
<i slot="icon" class="fa fa-lightbulb-o" aria-hidden="true"></i>
<span slot="label">Lights</span>
</tabbar-item>
<tabbar-item is-link v-link="'/sprinklers'">
<img slot="icon" src="assets/images/sprinklers.svg">
<span slot="label">Sprinklers</span>
</tabbar-item>
<tabbar-item is-link v-link="'/shutters'">
<img slot="icon" src="assets/images/shutters.svg">
<span slot="label">Rolling shutter</span>
</tabbar-item>
<tabbar-item is-link v-link="'/timers'">
<i slot="icon" class="fa fa-clock-o" color="black" aria-hidden="true"></i>
<span slot="label">Timers</span>
</tabbar-item>
<tabbar-item is-link v-link="'/settings'">
<i slot="icon" class="fa fa-bars" aria-hidden="true"></i>
<span slot="label">Settings</span>
</tabbar-item>
</tabbar>
</div>
</template>
<script>
import Tabbar from 'vux/dist/components/tabbar'
import TabbarItem from 'vux/dist/components/tabbar-item'
export default {
components: {
Tabbar,
TabbarItem
}
}
</script>
<style>
@import '~vux/dist/vux.css';
@import '~font-awesome/css/font-awesome.css';
body {
font-family: Helvetica, sans-serif;
background-color: #fbf9fe;
padding-bottom:50px;
}
.fa-home {
color: black;
}
.fa-lightbulb-o {
color: black;
}
.fa-clock-o {
color: black;
}
.fa-bars {
color: black;
}
</style>

View File

@@ -1,45 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="150.000000pt" height="161.000000pt" viewBox="0 0 150.000000 161.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata>
<g transform="translate(0.000000,161.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M210 1592 c0 -6 746 -256 925 -309 73 -22 105 -61 105 -130 0 -99
-73 -167 -152 -144 -96 29 -103 176 -10 212 26 10 69 -4 88 -29 40 -52 -13
-141 -70 -119 -39 15 -36 87 4 87 23 0 27 -25 5 -34 -26 -9 -16 -27 13 -24 22
2 28 9 30 34 7 70 -71 85 -102 19 -49 -102 89 -173 147 -76 9 16 17 49 17 74
0 39 -5 49 -35 76 -60 52 -137 35 -175 -39 -35 -69 -23 -136 34 -189 19 -18
41 -26 81 -29 54 -4 56 -4 99 39 84 85 84 217 -1 277 -16 10 -226 85 -468 166
-319 106 -453 146 -488 146 -26 0 -47 -3 -47 -8z"/>
<path d="M133 1568 c-13 -6 -23 -14 -23 -18 0 -4 199 -75 441 -159 420 -144
443 -151 465 -136 28 18 30 30 8 39 -109 42 -836 286 -850 285 -10 0 -29 -5
-41 -11z"/>
<path d="M51 1504 c-12 -15 -21 -30 -21 -33 0 -7 910 -345 914 -339 19 32 33
78 26 83 -15 9 -879 315 -889 315 -5 0 -19 -12 -30 -26z"/>
<path d="M1013 1469 c-18 -5 -33 -14 -33 -18 0 -5 28 -19 63 -30 60 -20 66
-21 102 -5 93 39 181 -10 212 -116 34 -118 15 -240 -52 -331 -30 -42 -39 -48
-82 -52 -59 -7 -183 -40 -183 -49 0 -4 30 -22 67 -40 64 -31 73 -33 173 -32
58 0 118 6 135 13 l30 13 -24 19 c-21 17 -23 23 -13 37 29 40 64 126 78 194
32 150 -13 254 -146 340 -90 58 -236 83 -327 57z"/>
<path d="M29 1393 c-8 -85 -59 -62 809 -372 l112 -40 0 59 0 59 -57 21 c-131
49 -851 310 -856 310 -3 0 -6 -17 -8 -37z"/>
<path d="M30 1221 c0 -38 4 -61 13 -64 6 -2 208 -80 447 -172 239 -92 441
-170 448 -172 10 -4 12 11 10 67 l-3 73 -200 74 c-374 136 -700 253 -707 253
-5 0 -8 -27 -8 -59z"/>
<path d="M30 1072 l0 -61 455 -180 c250 -100 457 -181 460 -181 3 0 5 30 3 66
l-3 67 -435 168 c-239 93 -445 172 -457 175 -22 6 -23 4 -23 -54z"/>
<path d="M32 929 l3 -61 455 -188 455 -189 3 56 c2 31 -1 59 -5 64 -6 6 -769
322 -891 370 -23 9 -23 8 -20 -52z"/>
<path d="M29 836 c-2 -2 -2 -27 -1 -54 l4 -51 446 -191 c246 -106 453 -194
460 -197 10 -4 12 9 10 58 l-3 64 -450 187 c-468 194 -459 191 -466 184z"/>
<path d="M32 639 l3 -50 452 -200 c249 -109 455 -199 458 -199 3 0 5 26 3 57
l-3 57 -454 193 c-250 106 -456 193 -458 193 -2 0 -3 -23 -1 -51z"/>
<path d="M32 495 l3 -57 453 -209 c250 -115 456 -209 458 -209 2 0 4 31 4 68
l0 68 -443 192 c-243 105 -450 194 -460 198 -16 6 -18 1 -15 -51z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -1,73 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="200.000000pt" height="200.000000pt" viewBox="0 0 200.000000 200.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata>
<g transform="translate(0.000000,200.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M301 1636 c-7 -8 -11 -27 -9 -43 2 -22 9 -29 31 -31 50 -6 75 38 41
72 -19 20 -48 20 -63 2z"/>
<path d="M916 1640 c-118 -21 -176 -78 -176 -172 l0 -48 80 0 81 0 -3 -77 c-3
-77 -3 -78 -30 -81 l-28 -3 0 -380 0 -379 -35 0 -35 0 0 -105 0 -105 250 0
250 0 0 105 0 105 -35 0 -35 0 0 380 0 380 -25 0 c-25 0 -25 1 -25 80 l0 80
76 0 76 0 -4 65 c-5 78 -26 105 -105 135 -63 23 -203 34 -277 20z"/>
<path d="M1676 1634 c-33 -32 -13 -74 36 -74 38 0 55 33 33 66 -18 28 -46 31
-69 8z"/>
<path d="M442 1538 c-15 -15 -15 -51 0 -66 28 -28 78 -7 78 33 0 27 -18 45
-45 45 -12 0 -26 -5 -33 -12z"/>
<path d="M1536 1534 c-23 -23 -20 -51 8 -69 34 -23 66 -5 66 35 0 44 -44 64
-74 34z"/>
<path d="M308 1459 c-22 -12 -24 -62 -3 -79 23 -19 64 -4 71 27 5 20 2 31 -16
45 -25 21 -29 21 -52 7z"/>
<path d="M570 1452 c-45 -36 -1 -99 50 -72 27 14 27 65 1 80 -25 13 -25 13
-51 -8z"/>
<path d="M1412 1438 c-7 -7 -12 -21 -12 -33 0 -12 5 -26 12 -33 7 -7 21 -12
33 -12 12 0 26 5 33 12 7 7 12 21 12 33 0 12 -5 26 -12 33 -7 7 -21 12 -33 12
-12 0 -26 -5 -33 -12z"/>
<path d="M1670 1431 c-14 -27 -13 -37 6 -55 23 -23 51 -20 69 8 13 19 14 29 5
45 -14 28 -65 29 -80 2z"/>
<path d="M452 1354 c-49 -34 -6 -103 47 -74 28 14 25 57 -4 76 -18 12 -24 11
-43 -2z"/>
<path d="M688 1358 c-25 -21 -28 -45 -9 -69 24 -30 68 -20 77 18 5 20 2 31
-16 45 -26 21 -31 22 -52 6z"/>
<path d="M1541 1344 c-30 -21 -27 -61 5 -76 36 -17 59 0 59 42 0 40 -31 57
-64 34z"/>
<path d="M1288 1325 c-9 -21 -8 -28 7 -45 10 -11 26 -20 35 -20 9 0 25 9 35
20 27 30 7 70 -35 70 -23 0 -33 -6 -42 -25z"/>
<path d="M308 1259 c-28 -16 -23 -67 7 -81 21 -9 28 -8 45 7 25 23 26 47 2 68
-21 19 -30 20 -54 6z"/>
<path d="M565 1250 c-36 -40 7 -96 55 -70 27 14 27 65 1 80 -27 14 -35 13 -56
-10z"/>
<path d="M1412 1238 c-7 -7 -12 -21 -12 -33 0 -12 5 -26 12 -33 7 -7 21 -12
33 -12 12 0 26 5 33 12 7 7 12 21 12 33 0 12 -5 26 -12 33 -7 7 -21 12 -33 12
-12 0 -26 -5 -33 -12z"/>
<path d="M1672 1238 c-27 -27 -1 -78 38 -78 29 0 54 43 40 69 -12 24 -58 29
-78 9z"/>
<path d="M442 1158 c-28 -28 -7 -78 33 -78 40 0 61 50 33 78 -7 7 -21 12 -33
12 -12 0 -26 -5 -33 -12z"/>
<path d="M1539 1151 c-29 -23 -20 -68 16 -77 34 -9 57 12 53 49 -4 39 -38 53
-69 28z"/>
<path d="M302 1058 c-30 -30 -3 -83 39 -76 32 5 45 31 31 62 -13 28 -49 35
-70 14z"/>
<path d="M1676 1054 c-30 -30 -10 -74 34 -74 40 0 58 32 35 66 -18 28 -46 31
-69 8z"/>
<path d="M1310 863 c25 -83 48 -256 56 -425 l7 -148 119 0 118 0 0 30 c0 88
69 340 122 443 19 38 19 38 -1 28 -42 -23 -124 -129 -164 -213 -23 -48 -44
-87 -47 -88 -3 0 -13 33 -22 73 -23 95 -75 198 -144 286 -30 39 -57 71 -59 71
-1 0 5 -26 15 -57z"/>
<path d="M514 773 c-52 -78 -101 -202 -115 -291 l-12 -74 -40 76 c-22 42 -57
95 -78 119 l-38 42 25 -73 c14 -40 33 -120 42 -178 l16 -104 128 0 127 0 6 38
c15 90 39 192 61 256 17 50 20 65 9 56 -25 -21 -84 -106 -116 -167 l-31 -58 6
85 c2 47 16 139 31 204 14 65 24 121 21 123 -2 2 -21 -22 -42 -54z"/>
<path d="M1831 563 c-50 -56 -124 -189 -137 -245 l-6 -28 69 0 70 0 6 83 c3
45 17 118 31 162 14 43 24 81 22 83 -2 1 -27 -23 -55 -55z"/>
<path d="M136 433 c13 -37 24 -85 24 -105 l0 -38 46 0 c42 0 45 1 39 23 -11
37 -68 126 -101 158 l-31 30 23 -68z"/>
<path d="M683 473 c-28 -31 -58 -86 -79 -145 l-13 -38 44 0 45 0 0 44 c0 24 9
72 19 105 10 34 17 61 14 61 -2 0 -15 -12 -30 -27z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -1,6 +0,0 @@
<template>
<h1>Home</h1>
</template>
<script>
</script>

View File

@@ -1,58 +0,0 @@
<template>
<h1>Lights</h1>
<group>
<cell-switch v-for="item in lights" :data="item" @on-change="setLight"></cell-switch>
</group>
</template>
<script>
import Group from 'vux/dist/components/group'
import Cell from 'vux/dist/components/cell'
import CellSwitch from './cell-switch'
export default {
// Data
data () {
// console.log('Data init.');
return {
lights: []
}
},
ready () {
console.log('Get Lights state')
this.getLights()
},
// Components used.
components: {
Group,
Cell,
CellSwitch
},
methods: {
/* Get Lights */
getLights () {
this.$http.get('http://192.168.1.6:8081/v1/capabilities/lights')
.then(function (response) {
this.$set('lights', response.data.Lights)
console.log('Success!:', response.data)
}, function (err) {
console.log(err)
})
},
/* Set Light */
setLight (data) {
var msg = ''
console.log(data)
msg = '{"id": ' + data.id + ', "state": ' + data.state + '}'
console.log(msg)
this.$http.post('http://192.168.1.6:8081/v1/capabilities/lights', msg)
.then(function (response) {
console.log('Success!:', response.data)
}, function (err) {
console.log(err)
})
}
}
}
</script>

View File

@@ -1,6 +0,0 @@
<template>
<h1>Settings</h1>
</template>
<script>
</script>

View File

@@ -1,6 +0,0 @@
<template>
<h1>Shutters</h1>
</template>
<script>
</script>

View File

@@ -1,59 +0,0 @@
<template>
<h1>Sprinklers</h1>
<group>
<cell-switch v-for="item in sprinklers" :data="item" @on-change="setSprinkler">
</cell-switch>
</group>
</template>
<script>
import Group from 'vux/dist/components/group'
import Cell from 'vux/dist/components/cell'
import CellSwitch from './cell-switch'
export default {
// Data
data () {
// console.log('Data init.');
return {
sprinklers: []
}
},
ready () {
console.log('Get Sprinklers state')
this.getSprinklers()
},
// Components used.
components: {
Group,
Cell,
CellSwitch
},
methods: {
/* Get Sprinklers */
getSprinklers () {
this.$http.get('http://192.168.1.6:8081/v1/capabilities/sprinklers')
.then(function (response) {
this.$set('sprinklers', response.data.Sprinklers)
console.log('Success!:', response.data)
}, function (err) {
console.log(err)
})
},
/* Set Sprinkler */
setSprinkler (data) {
var msg = ''
console.log(data)
msg = '{"id": ' + data.id + ', "state": ' + data.state + '}'
console.log(msg)
this.$http.post('http://192.168.1.6:8081/v1/capabilities/sprinklers', msg)
.then(function (response) {
console.log('Success!:', response.data)
}, function (err) {
console.log(err)
})
}
}
}
</script>

View File

@@ -1,6 +0,0 @@
<template>
<h1>Timers</h1>
</template>
<script>
</script>

View File

@@ -1,52 +0,0 @@
<template>
<div class="weui_cell weui_cell_switch">
<div class="weui_cell_hd weui_cell_primary">
<label class="weui_label" :style="labelStyle">{{{data.name}}}</label>
<inline-desc v-if="inlineDesc">{{inlineDesc}}</inline-desc>
</div>
<div class="weui_cell_ft">
<input class="weui_switch" type="checkbox" :disabled="disabled" v-model="data.state"/>
</div>
</div>
</template>
<script>
import InlineDesc from 'vux/dist/components/inline-desc'
export default {
components: {
InlineDesc
},
computed: {
labelStyle: function () {
let isHTML = /<\/?[^>]*>/.test(this.title)
let width = Math.min(isHTML ? 5 : (this.title.length + 1), 14) + 'em'
return {
width
}
}
},
props: {
data: {},
disabled: {
type: Boolean,
default: false
},
inlineDesc: {
type: String
}
},
ready: function () {},
watch: {
'data.state': function (newState) {
this.$dispatch('on-change', this.data)
}
}
}
</script>
<style>
.weui_cell_switch .weui_cell_ft {
font-size: 0;
}
</style>

View File

@@ -1,44 +0,0 @@
import Vue from 'vue'
import Router from 'vue-router'
import VueResource from 'vue-resource'
import App from './App'
import Home from './components/Home'
import Lights from './components/Lights'
import Shutters from './components/Shutters'
import Sprinklers from './components/Sprinklers'
import Timers from './components/Timers'
import Settings from './components/Settings'
const FastClick = require('fastclick')
FastClick.attach(document.body)
Vue.use(VueResource)
Vue.use(Router)
Vue.config.devtools = true
const router = new Router()
router.map({
'/': {
component: Home
},
'/lights': {
component: Lights
},
'/shutters': {
component: Shutters
},
'/sprinklers': {
component: Sprinklers
},
'/timers': {
component: Timers
},
'/settings': {
component: Settings
}
})
router.start(App, 'app')

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,26 +0,0 @@
// A custom Nightwatch assertion.
// the name of the method is the filename.
// can be used in tests like this:
//
// browser.assert.elementCount(selector, count)
//
// for how to write custom assertions see
// http://nightwatchjs.org/guide#writing-custom-assertions
exports.assertion = function (selector, count) {
this.message = 'Testing if element <' + selector + '> has count: ' + count
this.expected = count
this.pass = function (val) {
return val === this.expected
}
this.value = function (res) {
return res.value
}
this.command = function (cb) {
var self = this
return this.api.execute(function (selector) {
return document.querySelectorAll(selector).length
}, [selector], function (res) {
cb.call(self, res)
})
}
}

View File

@@ -1,40 +0,0 @@
// http://nightwatchjs.org/guide#settings-file
module.exports = {
"src_folders": ["test/e2e/specs"],
"output_folder": "test/e2e/reports",
"custom_assertions_path": ["test/e2e/custom-assertions"],
"selenium": {
"start_process": true,
"server_path": "node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.0.jar",
"host": "127.0.0.1",
"port": 4444,
"cli_args": {
"webdriver.chrome.driver": require('chromedriver').path
}
},
"test_settings": {
"default": {
"selenium_port": 4444,
"selenium_host": "localhost",
"silent": true
},
"chrome": {
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true
}
},
"firefox": {
"desiredCapabilities": {
"browserName": "firefox",
"javascriptEnabled": true,
"acceptSslCerts": true
}
}
}
}

View File

@@ -1,31 +0,0 @@
// 1. start the dev server using production config
process.env.NODE_ENV = 'testing'
var server = require('../../build/dev-server.js')
// 2. run the nightwatch test suite against it
// to run in additional browsers:
// 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings"
// 2. add it to the --env flag below
// For more information on Nightwatch's config file, see
// http://nightwatchjs.org/guide#settings-file
var spawn = require('cross-spawn')
var runner = spawn(
'./node_modules/.bin/nightwatch',
[
'--config', 'test/e2e/nightwatch.conf.js',
'--env', 'chrome,firefox'
],
{
stdio: 'inherit'
}
)
runner.on('exit', function (code) {
server.close()
process.exit(code)
})
runner.on('error', function (err) {
server.close()
throw err
})

View File

@@ -1,14 +0,0 @@
// For authoring Nightwatch tests, see
// http://nightwatchjs.org/guide#usage
module.exports = {
'default e2e tests': function (browser) {
browser
.url('http://localhost:8080')
.waitForElementVisible('#app', 5000)
.assert.elementPresent('.logo')
.assert.containsText('h1', 'Hello World!')
.assert.elementCount('p', 2)
.end()
}
}

View File

@@ -1,9 +0,0 @@
{
"env": {
"mocha": true
},
"globals": {
"expect": true,
"sinon": true
}
}

View File

@@ -1,9 +0,0 @@
// require all test files (files that ends with .spec.js)
var testsContext = require.context('./specs', true, /\.spec$/)
testsContext.keys().forEach(testsContext)
// require all src files except main.js for coverage.
// you can also change this to match only the subset of files that
// you want coverage for.
var srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/)
srcContext.keys().forEach(srcContext)

View File

@@ -1,66 +0,0 @@
// This is a karma config file. For more details see
// http://karma-runner.github.io/0.13/config/configuration-file.html
// we are also using it with karma-webpack
// https://github.com/webpack/karma-webpack
var path = require('path')
var merge = require('webpack-merge')
var baseConfig = require('../../build/webpack.base.conf')
var projectRoot = path.resolve(__dirname, '../../')
var webpackConfig = merge(baseConfig, {
// use inline sourcemap for karma-sourcemap-loader
devtool: '#inline-source-map',
vue: {
loaders: {
js: 'isparta'
}
}
})
// no need for app entry during tests
delete webpackConfig.entry
// make sure isparta loader is applied before eslint
webpackConfig.module.preLoaders = webpackConfig.module.preLoaders || []
webpackConfig.module.preLoaders.unshift({
test: /\.js$/,
loader: 'isparta',
include: projectRoot,
exclude: /test\/unit|node_modules/
})
// only apply babel for test files when using isparta
webpackConfig.module.loaders.some(function (loader, i) {
if (loader.loader === 'babel') {
loader.include = /test\/unit/
return true
}
})
module.exports = function (config) {
config.set({
// to run in additional browsers:
// 1. install corresponding karma launcher
// http://karma-runner.github.io/0.13/config/browsers.html
// 2. add it to the `browsers` array below.
browsers: ['PhantomJS'],
frameworks: ['mocha', 'sinon-chai'],
reporters: ['spec', 'coverage'],
files: ['./index.js'],
preprocessors: {
'./index.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true
},
coverageReporter: {
dir: './coverage',
reporters: [
{ type: 'lcov', subdir: '.' },
{ type: 'text-summary' }
]
}
})
}

View File

@@ -1,12 +0,0 @@
import Vue from 'vue'
import Hello from 'src/components/Hello'
describe('Hello.vue', () => {
it('should render correct contents', () => {
const vm = new Vue({
template: '<div><hello></hello></div>',
components: { Hello }
}).$mount()
expect(vm.$el.querySelector('.hello h1').textContent).to.contain('Hello World!')
})
})