Commit 03c4ec30 authored by gick's avatar gick
Browse files

add all

parents
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# Nuxt generate
dist
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# IDE / Editor
.idea
.editorconfig
# Service worker
sw.*
# Mac OSX
.DS_Store
# Vim swap files
*.swp
# albiziapp-viewer
> A viewer for Albiziapp
## Build Setup
``` bash
# install dependencies
$ npm run install
# serve with hot reload at localhost:3000
$ npm run dev
# build for production and launch server
$ npm run build
$ npm run start
# generate static project
$ npm run generate
```
For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org).
let express=require('express')
let app=express()
app.get('/*',express.static('./dist'))
app.listen(5000)
\ No newline at end of file
# ASSETS
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).
$font-size-root: 20px;
<template>
<div class="VueToNuxtLogo">
<div class="Triangle Triangle--two" />
<div class="Triangle Triangle--one" />
<div class="Triangle Triangle--three" />
<div class="Triangle Triangle--four" />
</div>
</template>
<style>
.VueToNuxtLogo {
display: inline-block;
animation: turn 2s linear forwards 1s;
transform: rotateX(180deg);
position: relative;
overflow: hidden;
height: 180px;
width: 245px;
}
.Triangle {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
}
.Triangle--one {
border-left: 105px solid transparent;
border-right: 105px solid transparent;
border-bottom: 180px solid #41b883;
}
.Triangle--two {
top: 30px;
left: 35px;
animation: goright 0.5s linear forwards 3.5s;
border-left: 87.5px solid transparent;
border-right: 87.5px solid transparent;
border-bottom: 150px solid #3b8070;
}
.Triangle--three {
top: 60px;
left: 35px;
animation: goright 0.5s linear forwards 3.5s;
border-left: 70px solid transparent;
border-right: 70px solid transparent;
border-bottom: 120px solid #35495e;
}
.Triangle--four {
top: 120px;
left: 70px;
animation: godown 0.5s linear forwards 3s;
border-left: 35px solid transparent;
border-right: 35px solid transparent;
border-bottom: 60px solid #fff;
}
@keyframes turn {
100% {
transform: rotateX(0deg);
}
}
@keyframes godown {
100% {
top: 180px;
}
}
@keyframes goright {
100% {
left: 70px;
}
}
</style>
# COMPONENTS
**This directory is not required, you can delete it if you don't want to use it.**
The components directory contains your Vue.js Components.
_Nuxt.js doesn't supercharge these components._
<template>
<img
class="VuetifyLogo"
alt="Vuetify Logo"
src="/logo.png"
>
</template>
<style>
.VuetifyLogo {
width: 180px;
transform: rotateY(560deg);
animation: turn 3.5s ease-out forwards 1s;
}
@keyframes turn {
100% {
transform: rotateY(0deg);
}
}
</style>
# LAYOUTS
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your Application Layouts.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).
<template>
<v-app dark>
<v-navigation-drawer
permanent
app
>
<v-list>
<v-list-item
v-for="(item, i) in items"
:key="i"
:to="item.to"
router
exact
>
<v-list-item-action>
<v-icon>{{ item.icon }}</v-icon>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title v-text="item.title" />
</v-list-item-content>
</v-list-item>
</v-list>
</v-navigation-drawer>
<v-app-bar
:clipped-left="clipped"
fixed
app
>
Albiziapp viewer
</v-app-bar>
<v-content>
<v-container>
<nuxt />
</v-container>
</v-content>
</v-app>
</template>
<script>
export default {
data () {
return {
clipped: false,
drawer: false,
fixed: false,
items: [
{
icon: 'mdi-apps',
title: 'Welcome',
to: '/'
},
{
icon: 'mdi-leaf',
title: 'Observation Explorer',
to: '/images'
},
{
icon: 'mdi-map',
title: 'Observation Map',
to: '/mapping'
}
],
miniVariant: false,
right: true,
rightDrawer: false,
title: 'Vuetify.js'
}
}
}
</script>
<template>
<v-app dark>
<h1 v-if="error.statusCode === 404">
{{ pageNotFound }}
</h1>
<h1 v-else>
{{ otherError }}
</h1>
<NuxtLink to="/">
Home page
</NuxtLink>
</v-app>
</template>
<script>
export default {
layout: 'empty',
props: {
error: {
type: Object,
default: null
}
},
head () {
const title =
this.error.statusCode === 404 ? this.pageNotFound : this.otherError
return {
title
}
},
data () {
return {
pageNotFound: '404 Not Found',
otherError: 'An error occurred'
}
}
}
</script>
<style scoped>
h1 {
font-size: 20px;
}
</style>
# MIDDLEWARE
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your application middleware.
Middleware let you define custom functions that can be run before rendering either a page or a group of pages.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware).
import colors from 'vuetify/es5/util/colors'
export default {
mode: 'spa',
/*
** Headers of the page
*/
vue: {
config: {
productionTip: true,
devtools: true,
devServer: {
proxy: 'http://localhost:8000'
}
},
},
head: {
titleTemplate: '%s - ' + process.env.npm_package_name,
title: process.env.npm_package_name || '',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: [
'leaflet.markercluster/dist/MarkerCluster.css',
'leaflet.markercluster/dist/MarkerCluster.Default.css'
],
/*
** Plugins to load before mounting the App
*/
plugins: [
],
/*
** Nuxt.js dev-modules
*/
devModules: [
'@nuxtjs/vuetify',
],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios',
'@nuxtjs/proxy',
'nuxt-leaflet'
],
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
axios: {
},
/*
** vuetify module configuration
** https://github.com/nuxt-community/vuetify-module
*/
vuetify: {
customVariables: ['~/assets/variables.scss'],
theme: {
dark: true,
themes: {
dark: {
primary: colors.blue.darken2,
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3
}
}
}
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend (config, ctx) {
}
}
}
This diff is collapsed.
{
"name": "albiziapp-viewer",
"version": "1.0.0",
"description": "A viewer for Albiziapp",
"author": "gick",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxtjs/axios": "^5.3.6",
"@nuxtjs/proxy": "^1.3.3",
"express": "^4.17.1",
"nuxt": "^2.0.0",
"nuxt-leaflet": "0.0.19",
"vue2-leaflet-markercluster": "^3.0.0"
},
"devDependencies": {
"@nuxtjs/vuetify": "^1.0.0"
}
}
# PAGES
This directory contains your Application Views and Routes.
The framework reads all the `*.vue` files inside this directory and creates the router of your application.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing).
<template>
<v-layout>
<v-flex class="text-center">
<v-card :elevation="10">
<v-card-text>
<p class="text-center ma-0">Click on a row with image to 'Yes' to display the image</p>
</v-card-text>
</v-card>
<v-select
dark
item-color="grey"
v-model="startHeader"
v-on:change="setHeader"
:items="headersList"
item-text="text"
:item-value="['text','value']"
:menu-props="{ maxWidth: '400' }"
label="Select column"
multiple
hint="Select colomns"
></v-select>
<v-card>
<v-img
v-if="image.length>0"
:src="'https://albiziapp.reveries-project.fr/api/image/'+image"
style="max-width:300px;margin:auto;"
></v-img>
<v-card-title>
Observations
<v-spacer></v-spacer>
<v-text-field v-model="search" label="Search" single-line hide-details></v-text-field>
</v-card-title>
</v-card>
<v-data-table
:headers="headers"
multi-sort
:items="data"
:dense="true"
:items-per-page="10"
@click:row="setImage"
item-key="_id"
v-model="selected"
:search="search"
class="elevation-1"
></v-data-table>
</v-flex>
</v-layout>
</template>
<script>
export default {
async asyncData({ $axios }) {
console.log(this);
let data = await $axios.$get("https://albiziapp.reveries-project.fr/api/observation");
return {
data: data.map(x => {
if (x.hasImage) {
x.hasImage = "Yes";
return x;
}
x.hasImage = "No";
return x;
})
};
},
data() {
return {
image: "",
search: "",
headersList: [
{
text: "Author",
align: "left",
value: "authorName"
},
{ text: "Species", align: "left", value: "specie" },
{ text: "Genus", align: "left", value: "genus" },
{ text: "Image", align: "left", value: "hasImage" },
{ text: "Common", align: "left", value: "common" },
{ text: "Confidence", align: "left", value: "confidence" },
{ text: "Date", align: "left", value: "date" }
],
startHeader: ["Author", "Species", "Genus", "Image"],
selected: [],
headers: [
{
text: "Author",
align: "left",
value: "authorName"
},
{ text: "Species", align: "left", value: "specie" },
{ text: "Genus", align: "left", value: "genus" },
{ text: "Image", align: "left", value: "hasImage" }
]
};
},
methods: {
setImage(e) {
if (e.hasImage == "Yes") {
this.image = e._id;
return;
}
this.image = "";
},
setHeader(e) {
let newHeaders = [];
for (let i of e) {
let header = this.headersList.filter(v => v.text == i)[0];
newHeaders.push(header);
}
this.headers = newHeaders;
}
}
};
</script>