diff --git a/src/renderer/components/BaseConfirmModal.vue b/src/renderer/components/BaseConfirmModal.vue new file mode 100644 index 00000000..77ec3063 --- /dev/null +++ b/src/renderer/components/BaseConfirmModal.vue @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/renderer/components/BaseContextMenu.vue b/src/renderer/components/BaseContextMenu.vue index 1fdd08a4..b3e5fcbf 100644 --- a/src/renderer/components/BaseContextMenu.vue +++ b/src/renderer/components/BaseContextMenu.vue @@ -1,10 +1,5 @@ - Credentials - + @@ -39,10 +39,10 @@ diff --git a/src/renderer/components/ModalEditConnection.vue b/src/renderer/components/ModalEditConnection.vue new file mode 100644 index 00000000..9ae80736 --- /dev/null +++ b/src/renderer/components/ModalEditConnection.vue @@ -0,0 +1,235 @@ + + + + + + + Create a new connection + + + + + + + + + + Client: + + + + + MySQL/MariaDB + + + Microsoft SQL + + + PostgreSQL + + + Oracle DB + + + + + + + Host name/IP: + + + + + + + + Port: + + + + + + + + User: + + + + + + + + Password: + + + + + + + + + + Ask for credentials + + + + + + + + + + + + + + + + diff --git a/src/renderer/components/ModalNewConnection.vue b/src/renderer/components/ModalNewConnection.vue index 710fff27..38a52378 100644 --- a/src/renderer/components/ModalNewConnection.vue +++ b/src/renderer/components/ModalNewConnection.vue @@ -216,7 +216,18 @@ export default { async continueTest (credentials) { // if "Ask for credentials" is true this.isAsking = false; const params = Object.assign({}, this.connection, credentials); - await Connection.makeTest(params); + try { + const res = await Connection.makeTest(params); + if (res.status === 'error') + this.toast = { status: 'error', message: res.response.message }; + else + this.toast = { status: 'success', message: 'Connection successifully made!' }; + } + catch (err) { + this.toast = { status: 'error', message: err.stack }; + } + + this.isTesting = false; }, saveNewConnection () { this.addConnection(this.connection); diff --git a/src/renderer/components/SettingBarContext.vue b/src/renderer/components/SettingBarContext.vue new file mode 100644 index 00000000..3a64bb6b --- /dev/null +++ b/src/renderer/components/SettingBarContext.vue @@ -0,0 +1,81 @@ + + + + edit Edit + + + delete Delete + + + + + Delete connection + + + + Do you confirm the cancellation of {{ contextConnection.user }}@{{ contextConnection.host }}:{{ contextConnection.port }}? + + + + + + + + + + + diff --git a/src/renderer/components/TheSettingBar.vue b/src/renderer/components/TheSettingBar.vue index 7852e654..70d4564e 100644 --- a/src/renderer/components/TheSettingBar.vue +++ b/src/renderer/components/TheSettingBar.vue @@ -1,18 +1,12 @@ - - - edit Edit - - - delete Delete - - + :context-connection="contextConnection" + @closeContext="isContext = false" + /> @@ -51,19 +45,20 @@