Skip to content

Commit

Permalink
feat(databases): display JDBC connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
trenutoo committed Oct 19, 2023
1 parent 6e6f75e commit 144180d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/locales/en/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
"description": "Description",
"owner": "Owner",
"connection": "Connection",
"jdbc_string": "JDBC Connection String",
"username": "Username",
"password": "Password",
"2fa": "2FA",
Expand Down
12 changes: 12 additions & 0 deletions src/views/server/databases/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
<code v-clipboard>{{ result.host.connection() }}</code>
</template>

<template #field-jdbc_string="{ result }">
<div v-if="result.showJdbc">
<code v-clipboard>
jdbc:mysql://{{result.username}}:{{encodeURIComponent(result.password)}}@{{result.host.connection()}}/{{result.name}}
</code>
</div>
<v-button v-else @click="result.showJdbc = true">
<code class="skeleton">{{ ''.repeat(12) }}</code>
</v-button>
</template>

<template #fields-after="{ result }">
<td class="p-6 text-right">
<div class="flex justify-end space-x-4">
Expand Down Expand Up @@ -77,6 +88,7 @@ export default defineComponent({
{ key: 'username', features: ['clipboard', 'code'], skeleton: 12 },
{ key: 'password', features: ['clipboard', 'code', 'secret'], skeleton: 12 },
{ key: 'connection', skeleton: 12 },
{ key: 'jdbc_string', skeleton: 12 },
],
};
},
Expand Down

0 comments on commit 144180d

Please sign in to comment.