Commit 5e6badb0 authored by unknown's avatar unknown

doc updated

parent fd4e39cc
Pipeline #3277 passed with stage
in 33 seconds
......@@ -5,6 +5,14 @@
</template>
<script>
/*
* --------------------------------------------------------
* Base component, that is injected to the DOM element in base HTML template
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
export default {
name: 'App'
}
......
import axios from 'axios'
/*
* --------------------------------------------------------
* Export axios library to later access on Vue instance
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
export default async ({ Vue }) => {
Vue.prototype.$axios = axios
}
import VueClipboard from 'vue-clipboard2'
/*
* --------------------------------------------------------
* Export vue-clipboard library to later access on Vue instance
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
export default async ({ Vue }) => {
Vue.use(VueClipboard)
}
/*
* --------------------------------------------------------
* Import all needed code mirror styles
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
import 'codemirror/theme/base16-light.css'
// import 'codemirror/theme/base16-dark.css'
import 'codemirror/theme/monokai.css'
......
......@@ -229,11 +229,16 @@
</template>
<script>
// import LocalStorageWrapper from "../helpers/LocalStorageWrapper";
/*
* --------------------------------------------------------
* History component
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
import UploadedFilesParser from 'src/helpers/UploadedFilesParser'
const CONFIG = require('../config/config')
const Environment = require('../config/environment')
// const local_storage_target = 'fileList';
......@@ -337,7 +342,7 @@ export default {
}
this.filesList = []
const id = window.location.pathname.substr(1)
this.$axios.delete(`${CONFIG.BACKEND_API_LOCAL_URL}/files/${id}`,
this.$axios.delete(`${Environment.BACKEND_API_LOCAL_URL}/files/${id}`,
{
headers: {
'Content-Type': 'multipart/form-data',
......@@ -358,7 +363,7 @@ export default {
this.fileIndex--
// this.lsw.set(this.filesList, local_storage_target, 24);
this.$axios.delete(
`${CONFIG.BACKEND_API_LOCAL_URL}/files/${id}/${deletedFolder}`,
`${Environment.BACKEND_API_LOCAL_URL}/files/${id}/${deletedFolder}`,
{
headers: {
'Content-Type': 'multipart/form-data',
......@@ -420,7 +425,7 @@ export default {
const id = window.location.pathname.substr(1)
this.$axios.get(
`${CONFIG.BACKEND_API_LOCAL_URL}/files/${id}`,
`${Environment.BACKEND_API_LOCAL_URL}/files/${id}`,
{
headers: {
'Content-Type': 'multipart/form-data',
......@@ -511,7 +516,7 @@ export default {
const formData = new FormData()
formData.append('folder', this.editData)
this.$axios.put(
`${CONFIG.BACKEND_API_LOCAL_URL}/files/${id}/${this.originalFolder}`,
`${Environment.BACKEND_API_LOCAL_URL}/files/${id}/${this.originalFolder}`,
formData,
{
headers: {
......
......@@ -78,8 +78,15 @@
</template>
<script>
/*
* --------------------------------------------------------
* Report component
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
const CONFIG = require('../config/config')
const Environment = require('../config/environment')
export default {
name: 'Report',
......@@ -222,7 +229,7 @@ export default {
formData.append('report', this.editData)
this.$axios.put(
`${CONFIG.BACKEND_API_LOCAL_URL}/report/${id}/${folder}`,
`${Environment.BACKEND_API_LOCAL_URL}/report/${id}/${folder}`,
formData,
{
headers: {
......
......@@ -78,13 +78,20 @@
</template>
<script>
/*
* --------------------------------------------------------
* Review component
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
import Upload from './Upload'
import Report from './Report'
import History from './History'
import SourceCodeWrapper from './SourceCodeWrapper'
export default {
name: 'Demo',
name: 'Review',
components: { Upload, SourceCodeWrapper, Report, History },
data: function () {
......
......@@ -55,7 +55,13 @@
</template>
<script>
/*
* --------------------------------------------------------
* SourceCodeWrapper component
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
import '../css/codeStyle.css'
import { codemirror } from 'vue-codemirror'
import R from 'src/helpers/ReportStructure'
......@@ -571,6 +577,7 @@ export default {
editor.editor.setSize(null, '70vh')
editor.editor.getWrapperElement().style['font-size'] = 14 + 'px'
editor.editor.getWrapperElement().style['font-family'] = 'Roboto", "-apple-system", "Helvetica Neue", Helvetica, Arial, sans-serif'
editor.editor.getWrapperElement().style['border-bottom'] = '1px solid white'
const theme = this.$q.dark.isActive ? 'monokai' : 'default'
editor.editor.setOption('theme', theme)
this.setMode(editor)
......
......@@ -126,8 +126,14 @@
</template>
<script>
const CONFIG = require('../config/config')
/*
* --------------------------------------------------------
* Upload component
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
const Environment = require('../config/environment')
import UploadedFilesParser from 'src/helpers/UploadedFilesParser'
import LocalStorageWrapper from 'src/helpers/LocalStorageWrapper'
......@@ -178,7 +184,7 @@ export default {
}
formData.append('url', window.location.pathname)
this.$axios.post(
`${CONFIG.BACKEND_API_LOCAL_URL}/files`,
`${Environment.BACKEND_API_LOCAL_URL}/files`,
formData,
{
headers: {
......@@ -206,7 +212,7 @@ export default {
},
getFiles (id, folder) {
this.$axios.get(
`${CONFIG.BACKEND_API_LOCAL_URL}/file/${id}/${folder}`,
`${Environment.BACKEND_API_LOCAL_URL}/file/${id}/${folder}`,
{
header: {
'Content-Type': 'application/x-www-form-urlencoded',
......@@ -263,7 +269,7 @@ export default {
},
synchronizeTools () {
this.$axios.get(
`${CONFIG.BACKEND_API_LOCAL_URL}/tools`,
`${Environment.BACKEND_API_LOCAL_URL}/tools`,
{
headers: {
'Content-Type': 'multipart/form-data',
......
const CONFIG = {
/*
* --------------------------------------------------------
* Load environment variables and export them as module
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
const Environment = {
BACKEND_API_LOCAL_URL: process.env.VUE_APP_BACKEND_API_URL.slice(1, -1)
// BACKEND_API_LOCAL_URL: 'http://localhost:3001/api'
}
module.exports = CONFIG
module.exports = Environment
/*
* --------------------------------------------------------
* Export class that simplify usage of Local Storage
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
export default class LocalStorageWrapper {
get (key) {
const data = localStorage.getItem(key)
......
/*
* --------------------------------------------------------
* Export class that add context to current report
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
export default class ReportStructure {
setUp (report, prev = null) {
if (typeof report === 'undefined') return
......
/*
* --------------------------------------------------------
* Export object that create report object
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
const UploadedFilesParser = {
raw_report: '',
source_files: {},
......
<template>
<div>
<demo :key="editorKey" @on-render="forceRender" bundle="bundle"/>
<review :key="editorKey" @on-render="forceRender" bundle="bundle"/>
</div>
</template>
<script>
/*
* --------------------------------------------------------
* Main page of whole application
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
export default {
name: 'EditorPage',
components: {
Demo: () => import('../components/Demo')
Review: () => import('../components/Review')
},
props: {
bundle: Object,
......
......@@ -23,6 +23,14 @@
</template>
<script >
/*
* --------------------------------------------------------
* Error page, that is displayed if user types wrong URL
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
export default {
name: 'Error404',
computed: {
......
/*
* --------------------------------------------------------
* All supported routes of application
*
* Author: Jakub Dolejsi
* --------------------------------------------------------
*/
const routes = [
{
path: '/',
component: () => import('pages/EditorPage.vue'),
children: [
{ path: '', component: () => import('components/Demo.vue') }
{ path: '', component: () => import('components/Review.vue') }
]
},
{
path: '/(.{20})', // must contain exactly 20 chars
component: () => import('pages/EditorPage.vue'),
children: [
{ path: '', component: () => import('components/Demo.vue') }
{ path: '', component: () => import('components/Review.vue') }
]
},
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment