Skip to content
Snippets Groups Projects
Commit 186828a9 authored by Pierre-Jean CHANCELLIER's avatar Pierre-Jean CHANCELLIER
Browse files

start

parents
No related branches found
No related tags found
No related merge requests found
Showing with 854 additions and 0 deletions
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
# 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
# Service worker
sw.*
# macOS
.DS_Store
# Vim swap files
*.swp
# wotwizard-ui
## Build Setup
```bash
# install dependencies
$ npm 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 the [documentation](https://nuxtjs.org).
## Special Directories
You can create the following extra directories, some of which have special behaviors. Only `pages` is required; you can delete them if you don't want to use their functionality.
### `assets`
The assets directory contains your uncompiled assets such as Stylus or Sass files, images, or fonts.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/assets).
### `components`
The components directory contains your Vue.js components. Components make up the different parts of your page and can be reused and imported into your pages, layouts and even other components.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/components).
### `layouts`
Layouts are a great help when you want to change the look and feel of your Nuxt app, whether you want to include a sidebar or have distinct layouts for mobile and desktop.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/layouts).
### `pages`
This directory contains your application views and routes. Nuxt will read all the `*.vue` files inside this directory and setup Vue Router automatically.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/get-started/routing).
### `plugins`
The plugins directory contains JavaScript plugins that you want to run before instantiating the root Vue.js Application. This is the place to add Vue plugins and to inject functions or constants. Every time you need to use `Vue.use()`, you should create a file in `plugins/` and add its path to plugins in `nuxt.config.js`.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/plugins).
### `static`
This directory contains your static files. Each file inside this directory is mapped to `/`.
Example: `/static/robots.txt` is mapped as `/robots.txt`.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/static).
### `store`
This directory contains your Vuex store files. Creating a file in this directory automatically activates Vuex.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/store).
@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss/mixins";
@import "~bootstrap/scss/root";
@import "~bootstrap/scss/reboot";
@import "~bootstrap/scss/type";
@import "~bootstrap/scss/images";
@import "~bootstrap/scss/code";
@import "~bootstrap/scss/grid";
@import "~bootstrap/scss/tables";
@import "~bootstrap/scss/forms";
@import "~bootstrap/scss/buttons";
@import "~bootstrap/scss/transitions";
// @import "~bootstrap/scss/dropdown";
// @import "~bootstrap/scss/button-group";
// @import "~bootstrap/scss/input-group";
// @import "~bootstrap/scss/custom-forms";
@import "~bootstrap/scss/nav";
@import "~bootstrap/scss/navbar";
@import "~bootstrap/scss/card";
@import "~bootstrap/scss/breadcrumb";
// @import "~bootstrap/scss/pagination";
// @import "~bootstrap/scss/badge";
// @import "~bootstrap/scss/jumbotron";
@import "~bootstrap/scss/alert";
// @import "~bootstrap/scss/progress";
@import "~bootstrap/scss/media";
@import "~bootstrap/scss/list-group";
@import "~bootstrap/scss/close";
// @import "~bootstrap/scss/toasts";
// @import "~bootstrap/scss/modal";
// @import "~bootstrap/scss/tooltip";
// @import "~bootstrap/scss/popover";
// @import "~bootstrap/scss/carousel";
@import "~bootstrap/scss/spinners";
@import "~bootstrap/scss/utilities";
@import "~bootstrap/scss/print";
\ No newline at end of file
$link-hover-decoration: none;
$text-muted: #a6a4b0;
@import 'bootstrap';
:root {
--menu-size: 300px;
}
.content {
@extend .container-fluid;
}
.table.striped tbody {
tr {
opacity: .9;
cursor: pointer;
&:nth-child(2n+1) {
opacity: .7;
}
&:hover {
opacity: 1;
}
}
}
\ No newline at end of file
assets/img/logo.png

18.9 KiB

<template>
<nav aria-label="breadcrumb">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item" :class="{ 'active': item.active }" :aria-current="item.active ? 'page' : null" v-for="item in breadcrumb" :key="item.text">
<NuxtLink :to="item.to" v-if="item.to">{{ item.text }}</NuxtLink>
<span v-else>{{ item.text }}</span>
</li>
</ol>
</nav>
</template>
<script>
export default {
props: {
breadcrumb: Array
}
}
</script>
\ No newline at end of file
<template>
<button type="submit" class="btn btn-primary">
<span v-if="isWaiting">
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Chargement...
</span>
<span v-else>Go !</span>
</button>
</template>
<script>
export default {
props: {
isWaiting: Boolean
}
}
</script>
\ No newline at end of file
<template>
<aside class="menu shadow">
<div class="nav_header border-bottom pb-3 mb-5">
<nuxt-link to="/" class="text-dark"><h1 class="h2 d-flex"><img src="@/assets/img/logo.png" alt="Accueil" class="logo">&nbsp;Wotwizard</h1></nuxt-link>
<button type="button" class="close position-absolute d-xl-none" aria-label="Close" @click="toggleMenu">
<span aria-hidden="true">&times;</span>
</button>
</div>
<nav class="navbar-light">
<ssMenu v-for="menu in menus" :key="menu.title" :menu="menu"/>
</nav>
</aside>
</template>
<script>
import ssMenu from './ssMenu.vue'
export default {
data() {
return {
menus : [
{title: 'Un menu',
items : [
{path: '/explore',title: 'Explorer la toile de confiance'},
{path: '/test',title: 'Test'},
{path: '/coucou',title: 'Coucou'}
]},
{title: 'Un autre menu',
items : [
{path: '/hoho',title: 'Hoho'},
{path: '/hihi',title: 'Hihi'},
{path: '/haha',title: 'Haha'}
]}
]
}
},
components: {
ssMenu
},
methods: {
toggleMenu() {
this.$emit('toggleMenu')
}
}
}
</script>
\ No newline at end of file
<template>
<header>
<div class="position-relative">
<button class="toggle btn border-secondary position-absolute p-1 m-3" @click="toggleMenu"><span></span></button>
<breadcrumb :breadcrumb="breadcrumb" class="ml-5 py-3 px-4" />
</div>
<Menu @toggleMenu="toggleMenu" />
<div class="bg_overlay" @click="toggleMenu"></div>
</header>
</template>
<script>
import breadcrumb from './breadcrumb.vue'
import menu from './menu.vue'
export default {
components: {
breadcrumb,
menu
},
methods: {
toggleMenu() {
document.querySelector('.app').classList.toggle('open')
}
},
props: {
breadcrumb: Array
}
}
</script>
<style lang="scss">
$bg-menu: #fff;
$btn-width: 50px;
$line-color: #000;
%hamburger-line {
display: block;
height: 4px;
width: .8 * $btn-width;
background: var(--color);
content: "";
position: absolute;
transition-property: transform;
border-radius: 4px;
}
.toggle {
--color: #{$line-color};
height: $btn-width;
width: $btn-width;
line-height: $btn-width;
span {
@extend %hamburger-line;
top: 50%;
transform: translateY(-50%);
transition-timing-function: cubic-bezier(.55,.055,.675,.19);
transition-duration: 75ms;
.open & {
transform: rotate(45deg);
display: block;
margin-top: -2px;
}
&::before {
transition: top 75ms ease .12s,opacity 75ms ease;
@extend %hamburger-line;
top: -10px;
.open & {
opacity: 0;
}
}
&::after {
transition: bottom 75ms ease .12s,transform 75ms cubic-bezier(.55,.055,.675,.19);
@extend %hamburger-line;
bottom: -10px;
.open & {
top: 0;
transform: rotate(-90deg);
}
}
}
}
.menu {
width: var(--menu-size);
background: $bg-menu;
position: fixed;
top: 0;
z-index: 1200;
height: 100vh;
padding: 1.1rem 0.5rem;
overflow-y: scroll;
scrollbar-color: #6969dd #e0e0e0;
scrollbar-width: thin;
transition: left .5s ease-in-out;
left: -400px;
.list-group-item {
&.nuxt-link-active {
z-index: 2;
color: #fff;
background-color: var(--primary);
border-color: var(--primary);
}
span {
transition: left .3s ease-in-out;
display: block;
position: relative;
left: 0;
padding: 0.75rem 1.25rem;
&::before {
content: "›";
position: relative;
left: -.5em;
}
&:hover {
left: .5em;
}
}
}
.open & {
left: 0;
}
.close {
--size: 50px;
width: var(--size);
height: var(--size);
top: .8rem;
right: .5rem;
font-size: 2rem;
}
h2 {
cursor: default;
}
}
.bg_overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 120vh;
z-index: 1100;
display: block;
visibility: hidden;
opacity: 0;
transition: all .5s ease;
background-color: rgba(34,41,47,.5);
.open & {
opacity: 1;
visibility: visible;
}
}
.logo {
max-width: 75px;
}
@media (min-width:1200px) {
.open {
&.app {
margin-left: var(--menu-size);
}
.menu {
left: 0;
}
.bg_overlay {
visibility: hidden;
opacity: 0;
}
}
}
</style>
<template>
<div class="mb-4">
<h2 class="h6 text-muted text-uppercase">{{ menu.title }}</h2>
<div class="nav navbar-nav list-group list-group-flush">
<NuxtLink class="list-group-item list-group-item-action p-0" :to="item.path" v-for="item in menu.items" :key="item.path"><span>{{ item.title }}</span></NuxtLink>
</div>
</div>
</template>
<script>
export default {
props: {
menu: Object
}
}
</script>
\ No newline at end of file
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./*"],
"@/*": ["./*"],
"~~/*": ["./*"],
"@@/*": ["./*"]
}
},
"exclude": ["node_modules", ".nuxt", "dist"]
}
<template>
<div class="app">
<Navigation :breadcrumb="breadcrumb" />
<Nuxt />
</div>
</template>
<script>
export default {
data() {
return {
breadcrumb: []
}
},
created() {
this.$nuxt.$on('changeRoute', (breadcrumb) => {
this.breadcrumb = breadcrumb
})
}
}
</script>
<style lang="scss">
.app {
transition: margin .5s ease-in-out;
}
</style>
\ No newline at end of file
<template>
<main class="content">
<h2 v-if="error.statusCode === 404" class="display-2 text-center mb-5">Page not found</h2>
<h2 v-else class="display-2 text-center mb-5">An error occurred - {{ error.statusCode }} </h2>
<NuxtLink to="/" class="d-block text-center">Retour à l'accueil</NuxtLink>
</main>
</template>
<script>
export default {
data() {
return {
breadcrumb: [
{
text: 'Erreur ',
active: true
}
]
}
},
mounted () {
$nuxt.$emit('changeRoute',this.breadcrumb)
},
props: ['error'],
layout: 'error'
}
</script>
<style lang="scss">
.app {
transition: margin .5s ease-in-out;
}
</style>
\ No newline at end of file
export default {
data() {
return {
WWZ_URL : "https://wwgql.coinduf.eu",
WWZ_REQUEST_VERSION : "{version}",
query: "",
retour : null,
isWaiting: false
}
},
methods: {
WWZ_REQUEST_IDS(hint) { return `{idSearch(with:{hint:\\"${hint}\\"}){ids{uid}}}` },
WWZ_REQUEST_DETAILS(hint) { return `{idSearch(with:{hint:\\"${hint}\\"}){ids{pubkey,uid,status}}}` },
},
async fetch() {
this.retour = await fetch(this.WWZ_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: '{"query":"' + this.query + '"}'
}).then((res) => {
// console.log(this.query)
return res.json()
})
},
watch: {
query : function() {
this.isWaiting = true
this.$fetch()
},
retour : function() {
this.isWaiting = false
}
}
}
\ No newline at end of file
export default {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
ssr: false,
// Target: https://go.nuxtjs.dev/config-target
target: 'static',
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'wotwizard-ui',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
'@/assets/css/style.scss'
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa',
],
// PWA module configuration: https://go.nuxtjs.dev/pwa
pwa: {
manifest: {
lang: 'en'
}
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
}
}
source diff could not be displayed: it is too large. Options to address this: view the blob.
{
"name": "wotwizard-ui",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxtjs/pwa": "^3.3.5",
"bootstrap": "^4.6.0",
"core-js": "^3.15.1",
"nuxt": "^2.15.7"
},
"devDependencies": {
"fibers": "^5.0.0",
"sass": "^1.45.0",
"sass-loader": "^10.2.0"
}
}
<template>
<main class="content">
<h2 class="display-2 text-center mb-5">Page d'accueil</h2>
<div class="row">
<div class="col-6 m-auto">
<form @submit.prevent="refresh" class="mb-5">
<div class="mb-3">
<label for="rech" class="form-label">Votre recherche</label>
<input type="text" class="form-control" id="rech" aria-describedby="rechHelp">
<small id="rechHelp" class="form-text text-muted">Saisissez le début d'un pseudo ou d'une clé publique</small>
</div>
<btnloading :isWaiting="isWaiting"/>
</form>
</div>
</div>
<div class="row" v-if="retour && !isWaiting">
<div class="col-8 m-auto">
<p v-if="retour.errors" class="alert alert-danger">{{ retour.errors }}</p>
<div class="table-responsive" v-else>
<table class="table striped">
<thead class="thead-light">
<tr>
<th scope="col">UID</th>
<th scope="col" class="d-none d-xl-table-cell">PUBKEY</th>
<th scope="col" class="d-none d-sm-table-cell">STATUS</th>
</tr>
</thead>
<tbody>
<tr v-for="member in retour.data.idSearch.ids" :key="member.uid"
:class="{
'table-danger' : member.status == 'REVOKED',
'table-success' : member.status == 'MEMBER',
'table-info' : member.status == 'NEWCOMER',
'table-warning' : member.status == 'MISSING',
}">
<th scope="row">{{ member.uid }}</th>
<td class="d-none d-xl-table-cell">{{ member.pubkey }}</td>
<td class="d-none d-sm-table-cell">{{ member.status }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</main>
</template>
<script>
import global from "~/mixins/wotwizard"
import btnloading from "~/components/btnloading.vue"
export default {
data() {
return {
breadcrumb: [
{
text: 'Accueil',
to: "/"
},
{
text: 'Explorer la wot',
active: true
}
]
}
},
methods: {
refresh() {
let rech = document.querySelector('#rech').value
rech = this.WWZ_REQUEST_DETAILS(rech)
this.query = rech
}
},
mounted () {
$nuxt.$emit('changeRoute',this.breadcrumb)
},
mixins: [global],
components: {
btnloading
}
}
</script>
<style lang="sass" scoped>
</style>
\ No newline at end of file
<template>
<main class="content">
<h2 class="display-2 text-center mb-5">Page d'accueil</h2>
<div class="row">
<div class="col-6 m-auto text-center">
<button class="btn btn-primary" @click="helloWorld($event)" data-response="I'm here !">Hello ?</button>
<p>{{ hello }}</p>
</div>
</div>
</main>
</template>
<script>
// Importer ce mixin pour lancer des requêtes graphQL
// Voir ./explore.vue pour plus de détails
// import global from "~/mixins/wotwizard"
export default {
data() {
return {
// Fil d'ariane
breadcrumb: [
{
text: 'Accueil',
active: true
}
],
// Variable locale
hello: ''
}
},
methods: {
// Fonctions locales
helloWorld(e) {
this.hello = e.target.dataset.response
}
},
mounted () {
// Mise à jour du fil d'ariane au chargement
$nuxt.$emit('changeRoute',this.breadcrumb)
}
}
</script>
<style lang="sass" scoped>
</style>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment