mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
Additions
This commit is contained in:
@@ -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";
|
Reference in New Issue
Block a user