Commit 4fdd29b5 authored by unknown's avatar unknown

final changes

parent 5e6badb0
Pipeline #3278 passed with stage
in 28 seconds
# RepView
Repview is web tool for interactive report and source code viewing. It aims to provide quick code
Repview is web tool for interactive report and source code review. It aims to provide quick code
revision based on appropriate report.
## Requirements
......
......@@ -14,6 +14,11 @@
*/
export default {
name: 'App'
name: 'App',
created () {
const flame = String.fromCodePoint(0x1F525)
console.log('%cRepView console.', 'color: #4287f5 ; font-size: 2vh; ')
console.log('%cPlease do ' + '%cNOT' + ' %charm me. ' + flame, 'color: #4287f5; font-size: 2vh', 'color: #ad39bd; font-size: 2vh', 'color: #4287f5; font-size: 2vh')
}
}
</script>
<template>
<div id="code">
<div class="q-gutter-y-md" style="max-width: 600px">
<q-tabs
active-color="primary"
align="justify"
class="text-grey"
dense
indicator-color="primary"
narrow-indicator
v-model="tab"
>
<q-tab label="Mails" name="mails"/>
<q-tab label="Alarms" name="alarms"/>
<q-tab label="Movies" name="movies"/>
</q-tabs>
<q-separator/>
<q-tab-panels
animated
transition-next="fade"
transition-prev="fade"
v-model="tab">
<q-tab-panel name="main.c">
<div class="text-h6">Mails</div>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
</q-tab-panel>
<q-tab-panel name="main.h">
<div class="text-h6">Alarms</div>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
</q-tab-panel>
<q-tab-panel name="test.c">
<div class="text-h6">Movies</div>
<codemirror
:options="cmOptions"
id="cm2"
ref="editor2"
v-model=source
/>
</q-tab-panel>
</q-tab-panels>
</div>
</div>
</template>
<script>
import '../required/imports.js'
export default {
name: 'Code',
props: {
source: String,
unified_report: Object,
unified_report_new: Object
},
data () {
return {
files: this.unified_report.file,
cmOptions: {
// codemirror options
lineNumbers: true,
line: true,
mode: this.selectMode(),
theme: 'monokai',
tabSize: 4,
readOnly: true,
lineWrapping: true,
foldGutter: true,
autoCloseTags: true,
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
autoRefresh: true
},
test: 'int main();',
tab: ''
}
},
methods: {
selectMode () {
return 'text/x-csrc'
},
highlightLine (editor) {
editor.markText({ line: 8, ch: 0 }, { line: 8, ch: 22 }, {
css: 'background: rgba(255, 19, 24, 0.35)',
inclusiveRight: true
})
editor.markText({ line: 13, ch: 0 }, { line: 13, ch: 50 }, {
css: 'background: rgba(255, 19, 24, 0.35)',
inclusiveRight: true
})
},
getLinesToHighlight () {
return {
from: {
line: 6,
ch: 0
},
to: {
line: 7,
ch: 20
}
}
}
},
computed: {
editor () {
return this.$refs.editor.codemirror
}
},
mounted () {
this.editor.focus()
this.editor.setSize(null, '600px')
this.highlightLine(this.editor.doc)
}
}
</script>
<style scoped>
#code {
height: 500px;
}
.CodeMirror {
border: 1px solid #eee;
height: auto;
}
.CodeMirror-focused {
outline: 2px solid red;
font-size: 10px;
}
</style>
......@@ -352,7 +352,7 @@ export default {
)
.then(() => {
this.$emit('to-delete')
this.showNotiff('Successfully deleted', 10000, 'positive', 'positive')
this.showNotiff('Successfully deleted', 3000, 'positive', 'positive')
})
// this.lsw.set(this.filesList, local_storage_target, 24);)
},
......@@ -373,7 +373,7 @@ export default {
)
.then(() => {
this.$emit('to-delete')
this.showNotiff('Deleted', 10000, 'positive', 'positive')
this.showNotiff('Deleted', 3000, 'positive', 'positive')
})
.catch((err) => {
this.showNotiff(err.message, 3000, 'negative', 'warning')
......@@ -528,7 +528,7 @@ export default {
.then(() => {
this.modal = !this.modal // close modal window
this.validateOk = false
this.showNotiff('Rename success', 10000, 'positive', 'positive')
this.showNotiff('Rename success', 3000, 'positive', 'positive')
this.filesList.forEach((item) => {
if (item.bundle.dir === this.originalFolder) {
item.bundle.dir = this.editData
......
......@@ -219,7 +219,6 @@ export default {
this.setReportDetailToggle(editor)
},
reportDetailHandler (instance, e) {
console.log(e)
if (e.target.classList.contains('error-background-dark') || e.target.classList.contains('error-background-white')) {
const target = e.target.parentNode.parentElement.nextSibling.childNodes[0] // toggle-content element
......@@ -301,6 +300,19 @@ export default {
button.style.border = this.$q.dark.isActive ? '1px white solid' : '1px black solid'
button.style.opacity = this.$q.dark.isActive ? '80%' : '60%'
})
widgets = document.getElementsByClassName('context-name')
Array.from(widgets).forEach((widget) => {
const darkIsActive = this.$q.dark.isActive
widget.style.border = darkIsActive ? '1px white solid' : '1px black solid'
const elementContainsDark = widget.classList.contains('context-name-dark')
if (darkIsActive && !elementContainsDark) {
widget.classList.add('context-name-dark')
}
if (!darkIsActive && elementContainsDark) {
widget.classList.remove('context-name-dark')
}
})
},
copyToClipBoard (e) {
let text = e.path[4].innerText
......@@ -313,7 +325,7 @@ export default {
type: 'positive',
position: 'bottom',
textColor: 'white',
timeout: 10000
timeout: 2000
})
}, () => {
this.$q.notify({
......@@ -321,7 +333,7 @@ export default {
message: 'Error!',
type: 'warning',
position: 'bottom',
timeout: 1000,
timeout: 2000,
textColor: 'white'
})
})
......@@ -461,7 +473,7 @@ export default {
message: 'Next traceback part does not belong under this project',
type: 'info',
position: 'bottom',
timeout: 5000,
timeout: 3000,
textColor: 'black'
})
}
......@@ -507,9 +519,9 @@ export default {
name.innerText = 'jump to ' + prop + ' trace'
name.classList.add('context-name')
if (!this.$q.dark.isActive) {
name.classList.add('context-name-dark')
}
// if (!this.$q.dark.isActive) {
// name.classList.add('context-name-dark')
// }
name.addEventListener('mousedown', () => {
this.jumpToLine(report[prop].line, report[prop].file)
})
......@@ -584,7 +596,6 @@ export default {
},
setMode (editor) {
const ext = editor.name.split('.').pop()
console.log('ext', ext)
if (ext === 'c' || ext === 'h') {
editor.editor.setOption('mode', 'text/x-csrc')
} else if (ext === 'py') {
......
......@@ -200,7 +200,7 @@ export default {
})
.catch((err) => {
if (err.response.status === parseInt(503)) {
this.showNotiff(err.response.data.message, 5000, 'negative', 'warning')
this.showNotiff(err.response.data.message, 3000, 'negative', 'warning')
return
}
this.showNotiff('Error while uploading your files: ' + err, 3000, 'negative', 'warning')
......@@ -221,7 +221,6 @@ export default {
}
)
.then((response) => {
console.log('response', response)
this.response = response.data
this.setUrlParam(window.location.pathname, id)
this.$emit('response-data', UploadedFilesParser.set(this.response))
......
......@@ -36,21 +36,22 @@
.context-name:hover {
.context-name-dark:hover {
cursor: pointer;
background: #437539;
background: #437539 !important;
}
.context-name-dark:hover {
background: #ffffff !important;
.context-name:hover {
cursor: pointer;
background: #ffffff ;
}
.context-name-dark {
border: 1px solid black!important;
/*border: 1px solid black!important;*/
}
.context-name {
border: 1px solid white;
/*border: 1px solid white;*/
margin-bottom: 2px;
margin-top: 2px;
max-width: 200px;
......
<template>
<div class="text-center q-pa-md flex flex-center" >
<div :class="dark" class="fullscreen ">
<div style="font-size: 30vh">
<div class="text-center q-pa-md">
<div class="fullscreen bg-blue-8">
<div style="font-size: 15vh; margin-top: 20vh">
404
</div>
<div class="text-h2" style="opacity:.4">
Oops. Nothing here...
<div class="text">
Page does not exists. Please correct your URL address
</div>
<div class="text">
or
</div>
<q-btn
class="q-mt-xl"
color="white"
class="q-mt-md main-page-button"
color="black"
text-color="blue"
unelevated
to="/"
label="Go Home"
label="Go to Main page"
no-caps
size="2vh"
/>
</div>
</div>
......@@ -32,15 +33,17 @@
*/
export default {
name: 'Error404',
computed: {
dark () {
const d = this.$q.dark.isActive
const bg = d ? 'bg-black' : 'bg-blue'
const text = d ? 'text-white' : 'text:white'
return [bg, text]
}
}
name: 'Error404'
}
</script>
<style lang="css">
.main-page-button:hover {
color: #cec9c9 !important;
}
.text {
opacity:.4;
font-size: 5vh
}
</style>
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