mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-28 17:50:56 +01:00
优化可配置爬虫前端界面
This commit is contained in:
@@ -18,6 +18,7 @@ import 'codemirror/mode/go/go.js'
|
||||
import 'codemirror/mode/shell/shell.js'
|
||||
import 'codemirror/mode/markdown/markdown.js'
|
||||
import 'codemirror/mode/php/php.js'
|
||||
import 'codemirror/mode/yaml/yaml.js'
|
||||
|
||||
export default {
|
||||
name: 'FileDetail',
|
||||
@@ -38,7 +39,7 @@ export default {
|
||||
},
|
||||
options () {
|
||||
return {
|
||||
mode: this.lanaguage,
|
||||
mode: this.language,
|
||||
theme: 'darcula',
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
@@ -46,8 +47,9 @@ export default {
|
||||
matchBrackets: true
|
||||
}
|
||||
},
|
||||
lanaguage () {
|
||||
language () {
|
||||
const fileName = this.$store.state.file.currentPath
|
||||
if (!fileName) return ''
|
||||
if (fileName.match(/\.js$/)) {
|
||||
return 'text/javascript'
|
||||
} else if (fileName.match(/\.py$/)) {
|
||||
@@ -60,6 +62,8 @@ export default {
|
||||
return 'text/x-php'
|
||||
} else if (fileName.match(/\.md$/)) {
|
||||
return 'text/x-markdown'
|
||||
} else if (fileName === 'Spiderfile') {
|
||||
return 'text/x-yaml'
|
||||
} else {
|
||||
return 'text'
|
||||
}
|
||||
@@ -74,7 +78,7 @@ export default {
|
||||
<style scoped>
|
||||
.file-content {
|
||||
border: 1px solid #eaecef;
|
||||
height: 480px;
|
||||
height: calc(100vh - 256px);
|
||||
}
|
||||
|
||||
.file-content >>> .CodeMirror {
|
||||
|
||||
@@ -120,6 +120,8 @@ export default {
|
||||
this.showFile = false
|
||||
this.onBack()
|
||||
}
|
||||
},
|
||||
created () {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user