s8 assignment following max

This commit is contained in:
Tyrel Souza 2018-04-17 22:49:16 -04:00
parent 6790319a8a
commit 797f26a3fa
No known key found for this signature in database
GPG Key ID: 5A9394D4C30AEAC0
14 changed files with 4502 additions and 0 deletions

5
s8follow/.babelrc Normal file
View File

@ -0,0 +1,5 @@
{
"presets": [
["es2015", { "modules": false }]
]
}

18
s8follow/README.md Normal file
View File

@ -0,0 +1,18 @@
# vue-cli
> A Vue.js project
## 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
```
For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).

13
s8follow/index.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Vue Components</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<div id="app">
</div>
<script src="/dist/build.js"></script>
</body>
</html>

25
s8follow/package.json Normal file
View File

@ -0,0 +1,25 @@
{
"name": "vue-cli",
"description": "A Vue.js project",
"author": "Maximilian Schwarzmüller <mblacky0@gmail.com>",
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --inline --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies": {
"bootstrap": "^3.3.7",
"vue": "^2.0.1"
},
"devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"cross-env": "^3.0.0",
"css-loader": "^0.25.0",
"file-loader": "^0.9.0",
"vue-loader": "^9.7.0",
"webpack": "2.1.0-beta.25",
"webpack-dev-server": "2.1.0-beta.0"
}
}

32
s8follow/src/App.vue Normal file
View File

@ -0,0 +1,32 @@
<template>
<div class="container">
<app-header></app-header>
<hr>
<div class="row">
<servers></servers>
<app-server-details></app-server-details>
</div>
<hr>
<app-footer></app-footer>
</div>
</template>
<script>
import Header from './components/Shared/Header.vue';
import Footer from './components/Shared/Footer.vue';
import Servers from './components/Server/Servers.vue';
import ServerDetails from './components/Server/ServerDetails.vue';
export default {
components: {
appHeader: Header,
Servers,
'app-server-details': ServerDetails,
'app-footer': Footer
}
}
</script>
<style>
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1,24 @@
<template>
<li class="list-group-item"
@click="serverSelected" style="cursor: pointer"
>
Server #{{ server.id }}
</li>
</template>
<script>
import {serverBus } from "../../main";
export default {
props: ['server'],
methods: {
serverSelected(){
serverBus.$emit('serverSelected', this.server);
}
},
}
</script>
<style>
</style>

View File

@ -0,0 +1,39 @@
<template>
<div class="col-xs-12 col-sm-6">
<p v-if="!server">Please select a server</p>
<p v-else> Server #{{server.id}} selected, status: {{server.status}}</p>
<hr>
<button @click="resetStatus">Normal</button>
</div>
</template>
<script>
import {serverBus } from "../../main";
export default {
props: ['server'],
data(){
return {
server: null
}
},
created(){
console.log('created');
serverBus.$on("serverSelected", (server) => {
this.server = server;
console.log(this.server)
})
},
methods:{
resetStatus(){
this.server.status = 'Normal'
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,34 @@
<template>
<div class="col-xs-12 col-sm-6">
<ul class="list-group">
<app-server
v-for="server in servers"
:server="server"
></app-server>
</ul>
</div>
</template>
<script>
import Server from './Server.vue'
export default {
components: {
appServer: Server,
},
data: function () {
return {
servers: [
{id: 1, status: "Normal"},
{id: 2, status: "Critical"},
{id: 3, status: "Unknown"},
{id: 4, status: "Normal"},
]
};
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,16 @@
<template>
<div class="row">
<div class="col-xs-12">
<footer>
<p>All Servers are managed here</p>
</footer>
</div>
</div>
</template>
<script>
</script>
<style>
</style>

View File

@ -0,0 +1,16 @@
<template>
<div class="row">
<div class="col-xs-12">
<header>
<h1>Server Status</h1>
</header>
</div>
</div>
</template>
<script>
</script>
<style>
</style>

10
s8follow/src/main.js Normal file
View File

@ -0,0 +1,10 @@
import Vue from 'vue'
import App from './App.vue'
export const serverBus = new Vue();
new Vue({
el: '#app',
render: h => h(App)
})

View File

@ -0,0 +1,64 @@
var path = require('path')
var webpack = require('webpack')
module.exports = {
entry: './src/main.js',
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: 'build.js'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue',
options: {
// vue-loader options go here
}
},
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue'
}
},
devServer: {
historyApiFallback: true,
noInfo: true
},
devtool: '#eval-source-map'
}
if (process.env.NODE_ENV === 'production') {
module.exports.devtool = '#source-map'
// http://vue-loader.vuejs.org/en/workflow/production.html
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
])
}

4206
s8follow/yarn.lock Normal file

File diff suppressed because it is too large Load Diff