mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-07 02:28:54 +08:00
App diagnostic dialog #46
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sqliteviz",
|
||||
"version": "0.11.0",
|
||||
"version": "0.13.0",
|
||||
"license": "Apache-2.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
82
src/views/Main/AppDiagnosticInfo.vue
Normal file
82
src/views/Main/AppDiagnosticInfo.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div id="app-info-container">
|
||||
<img id="app-info-icon" :src="require('@/assets/images/info.svg')" @click="$modal.show('app-info')"/>
|
||||
<modal name="app-info" classes="dialog" height="auto" width="400px">
|
||||
<div class="dialog-header">
|
||||
App info
|
||||
<close-icon @click="$modal.hide('app-info')"/>
|
||||
</div>
|
||||
<div class="dialog-body">
|
||||
<div v-for="(item, index) in info" :key="index" class="info-item">
|
||||
{{item.name}}
|
||||
<div class="divider"/>
|
||||
<div v-for="(opt, index) in item.info" :key="index" class="options">
|
||||
{{opt}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CloseIcon from '@/components/svg/close'
|
||||
|
||||
export default {
|
||||
name: 'AppDiagnosticInfo',
|
||||
components: { CloseIcon },
|
||||
data () {
|
||||
return {
|
||||
info: [
|
||||
{
|
||||
name: 'sqliteviz version',
|
||||
info: [require('../../../package.json').version]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
async created () {
|
||||
const state = this.$store.state
|
||||
let result = await state.db.execute('select sqlite_version()')
|
||||
this.info.push({
|
||||
name: 'SQLite version',
|
||||
info: result.values[0]
|
||||
})
|
||||
|
||||
result = await state.db.execute('PRAGMA compile_options')
|
||||
this.info.push({
|
||||
name: 'SQLite compile options',
|
||||
info: result.values.map(row => row[0])
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#app-info-icon {
|
||||
cursor: pointer;
|
||||
}
|
||||
#app-info-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-left: 32px;
|
||||
}
|
||||
.divider {
|
||||
height: 1px;
|
||||
background-color: var(--color-border);
|
||||
margin: 4px 0;
|
||||
}
|
||||
.options {
|
||||
font-family: monospace;
|
||||
font-size: 13px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
.info-item {
|
||||
margin-bottom: 32px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.info-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -5,7 +5,7 @@
|
||||
<router-link to="/my-queries">My queries</router-link>
|
||||
<a href="https://github.com/lana-k/sqliteviz/wiki" target="_blank">Help</a>
|
||||
</div>
|
||||
<div>
|
||||
<div id="nav-buttons">
|
||||
<button
|
||||
id="run-btn"
|
||||
v-if="currentQuery && $route.path === '/editor'"
|
||||
@@ -31,6 +31,7 @@
|
||||
>
|
||||
Create
|
||||
</button>
|
||||
<app-diagnostic-info />
|
||||
</div>
|
||||
|
||||
<!--Save Query dialog -->
|
||||
@@ -64,12 +65,14 @@
|
||||
import TextField from '@/components/TextField'
|
||||
import CloseIcon from '@/components/svg/close'
|
||||
import storedQueries from '@/lib/storedQueries'
|
||||
import AppDiagnosticInfo from './AppDiagnosticInfo'
|
||||
|
||||
export default {
|
||||
name: 'MainMenu',
|
||||
components: {
|
||||
TextField,
|
||||
CloseIcon
|
||||
CloseIcon,
|
||||
AppDiagnosticInfo
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -213,7 +216,7 @@ nav {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
padding: 0 52px;
|
||||
padding: 0 16px 0 52px;
|
||||
z-index: 999;
|
||||
}
|
||||
a {
|
||||
@@ -238,4 +241,8 @@ button {
|
||||
#save-note img {
|
||||
margin: -3px 6px 0 0;
|
||||
}
|
||||
|
||||
#nav-buttons {
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user