Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
13 changes: 13 additions & 0 deletions Front/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
22 changes: 15 additions & 7 deletions Front/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: ["plugin:vue/essential", "@vue/typescript", "prettier"],
rules: {
"vue/no-unused-vars": "error",
browser: true,
node: true
},
parserOptions: {
parser: "@typescript-eslint/parser",
parser: 'babel-eslint'
},
};
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {}
}
213 changes: 213 additions & 0 deletions Front/.nuxt/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
import Vue from 'vue'

import { getMatchedComponentsInstances, getChildrenComponentInstancesUsingFetch, promisify, globalHandleError, urlJoin, sanitizeComponent } from './utils'
import NuxtError from './components/nuxt-error.vue'
import NuxtLoading from '~/components/common/Loading.vue'
import NuxtBuildIndicator from './components/nuxt-build-indicator'

import '../assets/css/main.css'

import '../node_modules/vuetify/dist/vuetify.css'

import _4bcb6116 from '../layouts/common-layout.vue'
import _6f6c098b from '../layouts/default.vue'
import _7ef65b6f from '../layouts/simple-layout.vue'

const layouts = { "_common-layout": sanitizeComponent(_4bcb6116),"_default": sanitizeComponent(_6f6c098b),"_simple-layout": sanitizeComponent(_7ef65b6f) }

export default {
render (h, props) {
const loadingEl = h('NuxtLoading', { ref: 'loading' })

const layoutEl = h(this.layout || 'nuxt')
const templateEl = h('div', {
domProps: {
id: '__layout'
},
key: this.layoutName
}, [layoutEl])

const transitionEl = h('transition', {
props: {
name: 'layout',
mode: 'out-in'
},
on: {
beforeEnter (el) {
// Ensure to trigger scroll event after calling scrollBehavior
window.$nuxt.$nextTick(() => {
window.$nuxt.$emit('triggerScroll')
})
}
}
}, [templateEl])

return h('div', {
domProps: {
id: '__nuxt'
}
}, [
loadingEl,
h(NuxtBuildIndicator),
transitionEl
])
},

data: () => ({
isOnline: true,

layout: null,
layoutName: '',

nbFetching: 0
}),

beforeCreate () {
Vue.util.defineReactive(this, 'nuxt', this.$options.nuxt)
},
created () {
// Add this.$nuxt in child instances
this.$root.$options.$nuxt = this

if (process.client) {
// add to window so we can listen when ready
window.$nuxt = this

this.refreshOnlineStatus()
// Setup the listeners
window.addEventListener('online', this.refreshOnlineStatus)
window.addEventListener('offline', this.refreshOnlineStatus)
}
// Add $nuxt.error()
this.error = this.nuxt.error
// Add $nuxt.context
this.context = this.$options.context
},

async mounted () {
this.$loading = this.$refs.loading
},

watch: {
'nuxt.err': 'errorChanged'
},

computed: {
isOffline () {
return !this.isOnline
},

isFetching () {
return this.nbFetching > 0
},

isPreview () {
return Boolean(this.$options.previewData)
},
},

methods: {
refreshOnlineStatus () {
if (process.client) {
if (typeof window.navigator.onLine === 'undefined') {
// If the browser doesn't support connection status reports
// assume that we are online because most apps' only react
// when they now that the connection has been interrupted
this.isOnline = true
} else {
this.isOnline = window.navigator.onLine
}
}
},

async refresh () {
const pages = getMatchedComponentsInstances(this.$route)

if (!pages.length) {
return
}
this.$loading.start()

const promises = pages.map((page) => {
const p = []

// Old fetch
if (page.$options.fetch && page.$options.fetch.length) {
p.push(promisify(page.$options.fetch, this.context))
}
if (page.$fetch) {
p.push(page.$fetch())
} else {
// Get all component instance to call $fetch
for (const component of getChildrenComponentInstancesUsingFetch(page.$vnode.componentInstance)) {
p.push(component.$fetch())
}
}

if (page.$options.asyncData) {
p.push(
promisify(page.$options.asyncData, this.context)
.then((newData) => {
for (const key in newData) {
Vue.set(page.$data, key, newData[key])
}
})
)
}

return Promise.all(p)
})
try {
await Promise.all(promises)
} catch (error) {
this.$loading.fail(error)
globalHandleError(error)
this.error(error)
}
this.$loading.finish()
},
errorChanged () {
if (this.nuxt.err) {
if (this.$loading) {
if (this.$loading.fail) {
this.$loading.fail(this.nuxt.err)
}
if (this.$loading.finish) {
this.$loading.finish()
}
}

let errorLayout = (NuxtError.options || NuxtError).layout;

if (typeof errorLayout === 'function') {
errorLayout = errorLayout(this.context)
}

this.setLayout(errorLayout)
}
},

setLayout (layout) {
if(layout && typeof layout !== 'string') {
throw new Error('[nuxt] Avoid using non-string value as layout property.')
}

if (!layout || !layouts['_' + layout]) {
layout = 'default'
}
this.layoutName = layout
this.layout = layouts['_' + layout]
return this.layout
},
loadLayout (layout) {
if (!layout || !layouts['_' + layout]) {
layout = 'default'
}
return Promise.resolve(layouts['_' + layout])
},
},

components: {
NuxtLoading
}
}
Loading