mirror of
https://github.com/Fabio286/antares.git
synced 2025-01-31 09:35:10 +01:00
Additions
This commit is contained in:
parent
d1b83fd148
commit
7b4c55dd62
@ -1,3 +1,4 @@
|
||||
/node_modules
|
||||
/assets/vendor
|
||||
/out
|
||||
/out
|
||||
/dist
|
@ -9,7 +9,8 @@
|
||||
"plugin:vue/recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2017,
|
||||
"parser": "babel-eslint",
|
||||
"ecmaVersion": 9,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
@ -40,9 +41,6 @@
|
||||
],
|
||||
"no-console": "off",
|
||||
"no-undef": "off",
|
||||
"plugins": [
|
||||
"vue"
|
||||
],
|
||||
"vue/no-side-effects-in-computed-properties": "off",
|
||||
"vue/require-default-prop": "off",
|
||||
"vue/no-v-html": "off",
|
||||
|
24
package-lock.json
generated
24
package-lock.json
generated
@ -1901,6 +1901,20 @@
|
||||
"integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==",
|
||||
"dev": true
|
||||
},
|
||||
"babel-eslint": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz",
|
||||
"integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@babel/parser": "^7.7.0",
|
||||
"@babel/traverse": "^7.7.0",
|
||||
"@babel/types": "^7.7.0",
|
||||
"eslint-visitor-keys": "^1.0.0",
|
||||
"resolve": "^1.12.0"
|
||||
}
|
||||
},
|
||||
"babel-loader": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.1.0.tgz",
|
||||
@ -2832,6 +2846,11 @@
|
||||
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
|
||||
"dev": true
|
||||
},
|
||||
"codemirror": {
|
||||
"version": "5.53.2",
|
||||
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.53.2.tgz",
|
||||
"integrity": "sha512-wvSQKS4E+P8Fxn/AQ+tQtJnF1qH5UOlxtugFLpubEZ5jcdH2iXTVinb+Xc/4QjshuOxRm4fUsU2QPF1JJKiyXA=="
|
||||
},
|
||||
"collection-visit": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
|
||||
@ -7777,6 +7796,11 @@
|
||||
"escape-string-regexp": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"material-design-icons": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/material-design-icons/-/material-design-icons-3.0.1.tgz",
|
||||
"integrity": "sha1-mnHEh0chjrylHlGmbaaCA4zct78="
|
||||
},
|
||||
"md5.js": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
|
||||
|
12
package.json
12
package.json
@ -17,10 +17,19 @@
|
||||
"static/*"
|
||||
]
|
||||
},
|
||||
"electronWebpack": {},
|
||||
"electronWebpack": {
|
||||
"whiteListedModules": [
|
||||
"codemirror"
|
||||
],
|
||||
"renderer": {
|
||||
"webpackConfig": "webpack.config.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"codemirror": "^5.53.2",
|
||||
"devicons": "^1.8.0",
|
||||
"knex": "^0.21.1",
|
||||
"material-design-icons": "^3.0.1",
|
||||
"source-map-support": "^0.5.16",
|
||||
"vue-i18n": "^8.17.4",
|
||||
"vue-router": "^3.1.6",
|
||||
@ -34,6 +43,7 @@
|
||||
"electron-webpack": "^2.8.2",
|
||||
"electron-webpack-vue": "^2.4.0",
|
||||
"eslint": "^6.8.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint-config-standard": "^14.1.1",
|
||||
"eslint-plugin-import": "^2.20.1",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
|
@ -15,6 +15,8 @@ function createMainWindow () {
|
||||
const window = new BrowserWindow({
|
||||
width: 1024,
|
||||
height: 800,
|
||||
title: 'Antares',
|
||||
autoHideMenuBar: true,
|
||||
icon: path.join(__static, 'logo-32.png'),
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
|
@ -1,32 +1,45 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<img alt="Vue logo" src="logo.png">
|
||||
<HelloWorld :msg="$store.state.application.appName" />
|
||||
<div id="wrapper">
|
||||
<!-- <TheHeader @toggleSidebar="toggleSidebar" /> -->
|
||||
<!-- <TheSidebar /> -->
|
||||
<div id="main-content">
|
||||
<!-- <BaseLoaderLayer
|
||||
id="main-loader"
|
||||
:is-loading="isLoading"
|
||||
/> -->
|
||||
<QueryEditor v-model="query" />
|
||||
</div>
|
||||
<!-- <TheFooter /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HelloWorld from './components/HelloWorld.vue';
|
||||
import QueryEditor from '@/components/QueryEditor';
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
HelloWorld
|
||||
QueryEditor
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
query: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isLoading () {
|
||||
return this.$store.state.application.isLoading;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body{
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
#app {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
margin-top: 60px;
|
||||
}
|
||||
html,
|
||||
body{
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,41 +0,0 @@
|
||||
<template>
|
||||
<div class="hello">
|
||||
<h1>{{ msg }}</h1>
|
||||
<div>
|
||||
<i class="devicons devicons-mysql"></i>
|
||||
<i class="devicons devicons-msql_server"></i>
|
||||
<i class="devicons devicons-postgresql"></i>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'HelloWorld',
|
||||
props: {
|
||||
msg: String
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped>
|
||||
h3 {
|
||||
margin: 40px 0 0;
|
||||
}
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
li {
|
||||
display: inline-block;
|
||||
margin: 0 10px;
|
||||
}
|
||||
a {
|
||||
color: #42b983;
|
||||
}
|
||||
|
||||
.devicons{
|
||||
font-size: 4rem;
|
||||
}
|
||||
</style>
|
72
src/renderer/components/QueryEditor.vue
Normal file
72
src/renderer/components/QueryEditor.vue
Normal file
@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<div class="editor-wrapper">
|
||||
<textarea
|
||||
ref="codemirror"
|
||||
:options="cmOptions"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CodeMirror from 'codemirror';
|
||||
|
||||
import 'codemirror/lib/codemirror.css';
|
||||
import 'codemirror/theme/material-darker.css';
|
||||
import 'codemirror/mode/sql/sql';
|
||||
import 'codemirror/addon/edit/closebrackets';
|
||||
import 'codemirror/addon/selection/active-line';
|
||||
import 'codemirror/addon/hint/show-hint';
|
||||
import 'codemirror/addon/hint/show-hint.css';
|
||||
import 'codemirror/addon/hint/sql-hint';
|
||||
|
||||
CodeMirror.defineOption('sql-hint');
|
||||
|
||||
export default {
|
||||
name: 'QueryEditor',
|
||||
props: {
|
||||
value: String
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
cminstance: null,
|
||||
content: '',
|
||||
cmOptions: {
|
||||
tabSize: 3,
|
||||
smartIndent: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
line: true,
|
||||
mode: 'text/x-sql',
|
||||
theme: 'material-darker',
|
||||
extraKeys: {
|
||||
'Ctrl-Space': 'autocomplete'
|
||||
},
|
||||
hintOptions: {
|
||||
tables: {
|
||||
users: ['name', 'score', 'birthDate'],
|
||||
countries: ['name', 'population', 'size']
|
||||
}
|
||||
},
|
||||
autoCloseBrackets: true
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted () {
|
||||
this.initialize();
|
||||
},
|
||||
methods: {
|
||||
initialize () {
|
||||
this.cminstance = CodeMirror.fromTextArea(this.$refs.codemirror, this.cmOptions);
|
||||
this.cminstance.setValue(this.value || this.content);
|
||||
|
||||
this.cminstance.on('change', cm => {
|
||||
this.content = cm.getValue();
|
||||
this.$emit('input', this.content);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
@ -1,14 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
import 'devicons/css/devicons.min.css';
|
||||
import 'material-design-icons/iconfont/material-icons.css';
|
||||
import '@/scss/main.scss';
|
||||
|
||||
import App from '@/App.vue';
|
||||
import store from '@/store';
|
||||
import router from '@/routes';
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
new Vue({
|
||||
render: h => h(App),
|
||||
store
|
||||
store,
|
||||
router
|
||||
}).$mount('#app');
|
||||
|
10
src/renderer/routes/index.js
Normal file
10
src/renderer/routes/index.js
Normal file
@ -0,0 +1,10 @@
|
||||
import Vue from 'vue';
|
||||
import Router from 'vue-router';
|
||||
|
||||
Vue.use(Router);
|
||||
|
||||
const router = new Router({
|
||||
routes: []
|
||||
});
|
||||
|
||||
export default router;
|
0
src/renderer/scss/_variables.scss
Normal file
0
src/renderer/scss/_variables.scss
Normal file
1
src/renderer/scss/main.scss
Normal file
1
src/renderer/scss/main.scss
Normal file
@ -0,0 +1 @@
|
||||
@import "variables";
|
4
webpack.config.js
Normal file
4
webpack.config.js
Normal file
@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
]
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user