Skip to content

Commit

Permalink
Add components and new routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Breno Douglas committed Dec 29, 2017
1 parent c70b73c commit 45e4fdd
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 12 deletions.
6 changes: 3 additions & 3 deletions frontend/components/Footer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<footer>
Visit our website for more documentation : <a href="https://nuxtjs.org" target="_blank">nuxtjs.org</a>
</footer>
<div>
<slot></slot>
</div>
</template>
8 changes: 2 additions & 6 deletions frontend/pages/about.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@
</nuxt-link>
</section>
</template>
<script>
import axios from 'axios'

<script>
export default {
data ({ req }) {
return axios.get(`http://localhost:3000/proxy/api/v1/category`)
.then((res) => {
return { name: req ? 'server' : 'client', data: res.data }
})
return { name: req ? 'server' : 'client' }
},
head () {
return {
Expand Down
57 changes: 57 additions & 0 deletions frontend/pages/breno.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<template>
<section class="container">
<img src="../assets/img/logo.png" alt="Nuxt.js Logo" class="logo" />
<h1 class="title">
This page is loaded from the {{ name }}
</h1>
<h2 class="info" v-if="name === 'client'">
Please refresh the page
</h2>

<ul>
<li v-for="category in data">
{{category.id}} - {{category.name}}
</li>
</ul>

<nuxt-link class="button" to="/">
Home page
</nuxt-link>
</section>
</template>

<script>
export default {
data ({ req }) {
return { name: req ? 'server' : 'client' }
},
methods() {
return {
}
}
head () {
return {
title: `About Page (${this.name}-side)`
}
}
}
</script>

<style scoped>
.title
{
margin-top: 50px;
}
.info
{
font-weight: 300;
color: #9aabb1;
margin: 0;
margin-top: 10px;
}
.button
{
margin-top: 50px;
}
</style>
15 changes: 15 additions & 0 deletions frontend/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<h1 class="title">
Universal Vue.js Application Framework
</h1>

<rodape>
<footer>XX</footer>
</rodape>

<nuxt-link class="button" to="/about">
About page
</nuxt-link>
Expand All @@ -16,3 +21,13 @@
margin: 50px 0;
}
</style>

<script>
import rodape from '~/components/Footer'
export default {
components: {
rodape
}
}
</script>
6 changes: 3 additions & 3 deletions frontend/server.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const Nuxt = require('nuxt')
const app = require('express')()
const proxy = require('express-http-proxy');
const cors = require('cors');
const proxy = require('express-http-proxy')
const cors = require('cors')

const port = process.env.PORT || 3000

// We instantiate Nuxt.js with the options
let config = require('./nuxt.config.js')
const nuxt = new Nuxt(config)

app.use(cors());
app.use(cors())
app.use('/proxy', proxy('apache:8080'))

app.use(nuxt.render)
Expand Down
56 changes: 56 additions & 0 deletions october/plugins/site/admin/updates/create_v1_tables.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php namespace Site\Admin\Updates;

use Schema;
use October\Rain\Database\Updates\Migration;

/**
* create v1 tables
*/
class CreateV1Tables extends Migration
{

public function up()
{
Schema::create('site_admin_user', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('name');
$table->string('tel');
$table->string('password');
$table->string('email');
$table->integer('role');
// $table->integer('user_id')->unsigned()->nullable()->index();
$table->timestamps();
});

Schema::create('site_admin_condo', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('name');
$table->string('whatsapp');
$table->string('telegram');
$table->string('facebook');
$table->integer('user_id')->unsigned()->nullable()->index();
$table->timestamps();
});

Schema::create('site_admin_event', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('name');
$table->string('whatsapp');
$table->string('telegram');
$table->string('facebook');
$table->integer('user_id')->unsigned()->nullable()->index();
$table->timestamps();
});
}

public function down()
{

}
}

0 comments on commit 45e4fdd

Please sign in to comment.