Skip to content

Commit fd18859

Browse files
committed
Added code editor support, in creating modals
1 parent 4fdac12 commit fd18859

File tree

15 files changed

+927
-1029
lines changed

15 files changed

+927
-1029
lines changed

.prettierrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
singleQuote: true,
3+
trailingComma: 'all',
4+
};

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/Arattian/DynamoDb-GUI-Client/blob/master/LICENSE)
66

7-
### [Release v3.2.6](https://github.com/Arattian/DynamoDb-GUI-Client/releases/tag/3.2.6)
7+
### [Release v3.3.0](https://github.com/Arattian/DynamoDb-GUI-Client/releases/tag/3.3.0)
88

9-
#### [Download for MacOS (.dmg)](https://github.com/Arattian/DynamoDb-GUI-Client/releases/download/3.2.6/DynamoDbGUI-mac-3.2.6.dmg)
9+
#### [Download for MacOS (.dmg)](https://github.com/Arattian/DynamoDb-GUI-Client/releases/download/3.3.0/DynamoDbGUI-mac-3.3.0.dmg)
1010

11-
#### [Download for MacOS (.zip)](https://github.com/Arattian/DynamoDb-GUI-Client/releases/download/3.2.6/DynamoDbGUI-mac-3.2.6.zip)
11+
#### [Download for MacOS (.zip)](https://github.com/Arattian/DynamoDb-GUI-Client/releases/download/3.3.0/DynamoDbGUI-mac-3.3.0.zip)
1212

1313
### [Release v2.1.1 || Old UI](https://github.com/Arattian/DynamoDb-GUI-Client/releases/tag/v2.1.1)
1414

package-lock.json

Lines changed: 687 additions & 991 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dynamodb-gui-client",
3-
"version": "3.2.6",
3+
"version": "3.3.0",
44
"description": "DynamoDb-GUI-Client",
55
"author": {
66
"name": "Misak Poghosyan",
@@ -16,41 +16,38 @@
1616
"test:unit": "vue-cli-service test:unit --coverage"
1717
},
1818
"dependencies": {
19-
"aws-sdk": "^2.418.0",
20-
"awscred": "^1.4.2",
19+
"aws-sdk": "^2.432.0",
2120
"electron-default-menu": "^1.0.1",
22-
"element-ui": "^2.6.1",
23-
"lodash": "^4.17.11",
24-
"vue": "^2.6.8",
25-
"vue-awesome": "^3.4.0",
26-
"vue-class-component": "^6.3.2",
27-
"vue-json-editor": "^1.2.3",
28-
"vue-property-decorator": "^8.0.0",
21+
"element-ui": "^2.7.0",
22+
"vue": "^2.6.10",
23+
"vue-awesome": "^3.5.1",
24+
"vue-class-component": "^7.0.2",
25+
"vue-json-editor": "1.2.3",
26+
"vue-property-decorator": "^8.1.0",
2927
"vue-resize-split-pane": "^0.1.5",
30-
"vue-virtual-scroll-list": "^1.3.1",
28+
"vue-virtual-scroll-list": "^1.3.2",
3129
"vuex": "^3.1.0",
32-
"vuex-class": "^0.3.1"
30+
"vuex-class": "^0.3.2"
3331
},
3432
"devDependencies": {
3533
"@types/jest": "^24.0.11",
36-
"@types/lodash": "^4.14.122",
37-
"@vue/cli-plugin-babel": "3.5.0",
38-
"@vue/cli-plugin-typescript": "3.5.0",
39-
"@vue/cli-plugin-unit-jest": "3.5.0",
40-
"@vue/cli-service": "3.5.0",
34+
"@vue/cli-plugin-babel": "3.5.3",
35+
"@vue/cli-plugin-typescript": "3.5.3",
36+
"@vue/cli-plugin-unit-jest": "3.5.3",
37+
"@vue/cli-service": "3.5.3",
4138
"@vue/test-utils": "^1.0.0-beta.29",
4239
"babel-core": "^7.0.0-bridge.0",
43-
"electron": "^4.0.8",
40+
"electron": "^4.1.3",
4441
"element-theme-dark": "^1.0.3",
4542
"pug": "^2.0.3",
4643
"pug-plain-loader": "^1.0.0",
4744
"stylus": "^0.54.5",
4845
"stylus-loader": "^3.0.2",
49-
"ts-jest": "^24.0.0",
50-
"typescript": "^3.3.3333",
51-
"vue-cli-plugin-electron-builder": "1.1.2",
46+
"ts-jest": "^24.0.1",
47+
"typescript": "^3.4.1",
48+
"vue-cli-plugin-electron-builder": "1.2.0",
5249
"vue-cli-plugin-element": "^1.0.1",
53-
"vue-template-compiler": "^2.6.8"
50+
"vue-template-compiler": "^2.6.10"
5451
},
5552
"keywords": [
5653
"element-ui",

src/App.vue

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export default class App extends Vue {}
4141
*
4242
padding 0
4343
margin 0
44-
font-family 'Roboto', sans-serif
4544
box-sizing border-box
4645
4746
*::-webkit-scrollbar
@@ -67,6 +66,9 @@ html, body
6766
::placeholder
6867
opacity .5
6968
69+
[class^="el-"],.el-col,.el-row
70+
font-family 'Roboto', sans-serif
71+
7072
#app
7173
display flex
7274
width 100%
@@ -195,6 +197,46 @@ td
195197
.jsoneditor-previous
196198
display none !important
197199
200+
.jsoneditor-contextmenu .jsoneditor-menu
201+
background-color #222933 !important
202+
border 1px solid #191d25 !important
203+
box-shadow none !important
204+
205+
div.jsoneditor-contextmenu ul li button
206+
color #fff !important
207+
208+
div.jsoneditor-contextmenu ul li button:hover
209+
background-color #191d25 !important
210+
211+
.ace-jsoneditor .ace_scroller
212+
background-color #2c323a !important
213+
border 1px solid #191d25 !important
214+
215+
.jsoneditor-poweredBy
216+
display none !important
217+
218+
.ace_gutter
219+
background #2c323f !important
220+
border 1px solid #191d25 !important
221+
222+
.ace-jsoneditor .ace_marker-layer .ace_active-line
223+
background #2f3f3f !important
224+
225+
.ace-jsoneditor .ace_text-layer
226+
color #fff !important
227+
228+
.ace_variable
229+
color #FF007F !important
230+
231+
.ace_string
232+
color #52E3F6 !important
233+
234+
.ace-jsoneditor .ace_indent-guide
235+
background none !important
236+
237+
.ace-jsoneditor.ace_editor
238+
height 50vh !important
239+
198240
@media screen and (max-height: 600px)
199241
.table
200242
height 65vh !important

src/components/CreateModal.vue

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
<template lang="pug">
22
el-dialog(center :visible="isVisible" :show-close="false" width="800px")
33
el-row(class="hint-container")
4+
el-select(v-model="editor")
5+
el-option(value="Tree") Tree
6+
el-option(value="Code") Code
47
el-popover(
58
placement="left-end"
69
title="Hint"
710
width="500"
811
trigger="hover"
912
:content="hintText")
1013
i(class="el-icon-question hint" slot="reference")
11-
el-row(class="editor")
14+
el-row(class="tree-editor" v-show="editor === 'Tree'")
1215
vue-json-editor(:value="metaValue" @json-change="metaChange" :showBtns="false" ref="editorInstance")
16+
el-row(class="code-editor" v-show="editor === 'Code'")
17+
vue-json-editor(:value="metaValue" @json-change="metaChange" :showBtns="false" :mode="'code'")
1318
ActionButtons(
1419
:cancelHandler="cancelHandler"
1520
:confirmHandler="confirmHandler"
@@ -27,6 +32,7 @@ import ActionButtons from './ActionButtons.vue';
2732
},
2833
})
2934
export default class CreateModal extends Vue {
35+
private editor: string = 'Tree';
3036
@Prop(Function) private confirmHandler: any;
3137
@Prop(Function) private cancelHandler: any;
3238
@Prop(Function) private metaChange: any;
@@ -35,8 +41,10 @@ export default class CreateModal extends Vue {
3541
@Prop(String) private hintText!: string;
3642
private mounted() {
3743
setTimeout(() => {
38-
const { editor }: any = this.$refs.editorInstance;
39-
editor.expandAll();
44+
if (this.editor === 'tree') {
45+
const { editor }: any = this.$refs.editorInstance;
46+
editor.expandAll();
47+
}
4048
}, 200);
4149
}
4250
}
@@ -46,6 +54,7 @@ export default class CreateModal extends Vue {
4654
.hint-container
4755
display flex
4856
justify-content flex-end
57+
align-items center
4958
5059
.hint
5160
color #fdb416
@@ -55,6 +64,10 @@ export default class CreateModal extends Vue {
5564
.hint:hover
5665
color #ffd272
5766
67+
.el-select
68+
margin-right 10px
69+
width 116px
70+
5871
.editor
5972
height 50vh
6073
overflow-y auto
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<template lang="pug">
2+
el-dialog(:visible="true" :show-close="false" width="800px")
3+
el-form(:model="submitForm.configs")
4+
el-form-item(label="Database Name (Optional)")
5+
el-input(placeholder="Database display name" v-model="submitForm.name")
6+
template(slot="append")
7+
el-color-picker(v-model="submitForm.color" size="mini")
8+
.remote(v-if="submitForm.configs.region !== 'localhost'")
9+
el-form-item(label="AWS region" required)
10+
el-select(v-model="submitForm.configs.region" placeholder="AWS Region")
11+
el-option(v-for="(region, index) in regionList" :key="index" :label="region" :value="region")
12+
el-form-item(label="Access Key Id" required)
13+
el-input(v-model="submitForm.configs.accessKeyId" placeholder="AWS access key id")
14+
el-form-item(label="Secret Access Key" @keyup.enter.native="submitRemoteForm" required)
15+
el-input(v-model="submitForm.configs.secretAccessKey" :type="inputType" placeholder="AWS secret access key")
16+
template(slot="append")
17+
el-button(icon="el-icon-view" @click="showSecretKey")
18+
.local(v-if="submitForm.configs.region === 'localhost'")
19+
el-form-item(label="Local Database Endpoint" required)
20+
el-input(placeholder="Enter Endpoint" @keyup.enter.native="submitLocalForm" v-model="submitForm.configs.endpoint")
21+
ActionButtons(
22+
:cancelHandler="cancelHandler"
23+
:confirmHandler="submitForm.configs.region === 'localhost' ? submitLocalForm : submitRemoteForm"
24+
confirmType="success"
25+
confirmText="Save"
26+
)
27+
</template>
28+
29+
<script lang="ts">
30+
import { Vue, Component, Prop } from 'vue-property-decorator';
31+
import ActionButtons from './ActionButtons.vue';
32+
33+
@Component({
34+
components: {
35+
ActionButtons,
36+
},
37+
})
38+
export default class EditDatabaseModal extends Vue {
39+
private inputType: string = 'password';
40+
@Prop(String) private currentDb!: string;
41+
@Prop(Function) private cancelHandler!: any;
42+
@Prop(Function) private submitRemoteForm!: any;
43+
@Prop(Function) private submitLocalForm!: any;
44+
@Prop(Function) private fillEditForm!: any;
45+
@Prop(Array) private regionList!: string[];
46+
@Prop(Object) private submitForm!: any;
47+
private created() {
48+
this.fillEditForm(this.currentDb);
49+
}
50+
51+
private showSecretKey() {
52+
if (this.inputType === 'password') {
53+
this.inputType = 'text';
54+
} else {
55+
this.inputType = 'password';
56+
}
57+
}
58+
}
59+
</script>
60+
61+
<style lang="stylus" scoped>
62+
.header
63+
display flex
64+
flex-direction column
65+
align-items center
66+
67+
.el-icon-warning
68+
color #fdb416
69+
font-size 5em
70+
margin-bottom 20px
71+
</style>

src/components/SidebarTables.vue

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
.inner-fixed
44
el-button(type="primary" plain @click="initialState")
55
span Quick Connect
6-
el-row(class="change-title") Change Database
7-
el-select(:value="currentDb" @change="getCurrentDb" placeholder="Select Database" spellcheck="false" :title="currentDb" class="input-field")
8-
el-option(
9-
v-for="db in databaseList"
10-
:key="db.name"
11-
:value="db.name"
12-
)
6+
.input-field
7+
el-select(:value="currentDb" @change="getCurrentDb" placeholder="Select Database" spellcheck="false" :title="currentDb")
8+
el-option(
9+
v-for="db in databaseList"
10+
:key="db.name"
11+
:value="db.name"
12+
)
13+
el-row(class="change-title")
14+
el-col(:span="22") Edit Database
15+
el-col(:span="2" class="edit")
16+
i(class="el-icon-edit" @click="toggleEditModal")
1317
el-row(class="input-field")
1418
el-input(placeholder="Search Table" @input="filterTextChange" :value="filterText" suffix-icon="el-icon-search" spellcheck="false")
1519
el-row(class="table-actions")
@@ -38,6 +42,7 @@ export default class SidebarTables extends Vue {
3842
@Prop(Function) private initialState: any;
3943
@Prop(Function) private toggleCreateModal: any;
4044
@Prop(Function) private toggleDeleteModal: any;
45+
@Prop(Function) private toggleEditModal: any;
4146
@Prop(Array) private databaseList!: string[];
4247
@Prop(Array) private tableList!: string[];
4348
@Prop(String) private currentTable!: string;
@@ -93,6 +98,16 @@ export default class SidebarTables extends Vue {
9398
.el-select
9499
width 100%
95100
101+
.edit
102+
margin-left 10px
103+
display flex
104+
justify-content flex-end
105+
align-items center
106+
107+
.edit:hover
108+
color #00d986
109+
cursor pointer
110+
96111
.list-item
97112
background #121820
98113
margin 5px 10px

src/containers/DatabaseModals.vue

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<template lang="pug">
2+
EditDatabaseModal(
3+
:currentDb="currentDb"
4+
:cancelHandler="toggleEditModal"
5+
:fillEditForm="fillEditForm"
6+
:submitRemoteForm="submitRemoteForm"
7+
:submitLocalForm="submitLocalForm"
8+
:regionList="database.regionList"
9+
:submitForm="database.submitForm"
10+
)
11+
</template>
12+
13+
<script lang="ts">
14+
import { Vue, Component, Prop } from 'vue-property-decorator';
15+
import { Action, Mutation, Getter, State } from 'vuex-class';
16+
import { TableModuleState } from '../store/modules/table/types';
17+
import EditDatabaseModal from '../components/EditDatabaseModal.vue';
18+
19+
const namespace: string = 'database';
20+
@Component({
21+
components: {
22+
EditDatabaseModal,
23+
},
24+
})
25+
export default class DatabaseModals extends Vue {
26+
@Getter private currentDb!: string;
27+
@State(namespace) private database!: any;
28+
@Mutation('toggleEditModal', { namespace }) private toggleEditModal!: any;
29+
@Mutation('fillEditForm', { namespace }) private fillEditForm!: any;
30+
@Action('submitRemoteForm', { namespace }) private submitRemoteForm!: any;
31+
@Action('submitLocalForm', { namespace }) private submitLocalForm!: any;
32+
}
33+
</script>
34+
35+
<style lang="stylus" scoped>
36+
</style>

0 commit comments

Comments
 (0)