Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ log = "0.4"
futures = "0.3"
rand = "0.8"
# data-studio-agent: pinned to latest release tag.
data-studio-agent = { git = "https://github.com/geek-fun/data-studio-agent.git", tag = "v0.1.8" }
data-studio-agent = { git = "https://github.com/geek-fun/data-studio-agent.git", tag = "v0.1.9" }

# Archive extraction (JRE downloads)
flate2 = "1.0"
Expand Down
18 changes: 17 additions & 1 deletion src/components/connections/ServerCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import {
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
import { ProBadge } from '@/components/upgrade'
import { useDatabaseIcon } from '@/composables/useDatabaseIcon'
import { ConnectionStatus, DatabaseType, formatServerVersion, getConnectionStrategy } from '@/store'
import { ConnectionStatus, DatabaseType, formatServerVersion, getConnectionStrategy, useEntitlementStore } from '@/store'

const props = defineProps<{
connection: ServerConnection
Expand All @@ -31,6 +32,7 @@ const emit = defineEmits<{
}>()

const { t } = useI18n()
const entitlementStore = useEntitlementStore()
const { getDatabaseIcon, getDatabaseColor } = useDatabaseIcon()

const statusColor = computed(() => {
Expand Down Expand Up @@ -225,6 +227,20 @@ const connectTooltip = computed(() =>
<Badge v-if="connection.ssl" variant="outline" class="text-xs">
SSL
</Badge>
<TooltipProvider v-if="connection.sshTunnel?.enabled">
<Tooltip>
<TooltipTrigger as-child>
<Badge variant="outline" class="text-xs">
<span class="i-carbon-locked mr-0.5 h-3 w-3" />
SSH
<ProBadge v-if="!entitlementStore.isLocalUltimate" size="xs" class="ml-1" />
</Badge>
</TooltipTrigger>
<TooltipContent>
<p>SSH tunnel</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>

<!-- Actions -->
Expand Down
6 changes: 4 additions & 2 deletions src/components/connections/ServerFormDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import type { OracleConnectionOptions, ServerConnection } from '@/store'
import type { DatabaseFileAssessment } from '@/utils/databaseFiles'
import { invoke } from '@tauri-apps/api/core'
import { open as openDialog } from '@tauri-apps/plugin-dialog'
import { openUrl } from '@tauri-apps/plugin-opener'
import { computed, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { UPGRADE_URL } from '@/common'
import { Button } from '@/components/ui/button'
import { SearchableSelect } from '@/components/ui/combobox'
import { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/components/ui/dialog'
Expand All @@ -19,7 +21,6 @@ import {
SelectValue,
} from '@/components/ui/select'
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { openUpgradeDialog } from '@/components/upgrade'
import { useDatabaseIcon } from '@/composables/useDatabaseIcon'
import { useDownloadEvents } from '@/composables/useDownloadEvents'
import { toast } from '@/composables/useNotifications'
Expand Down Expand Up @@ -191,7 +192,8 @@ async function runStep(step: StepDef): Promise<boolean> {

function toggleSsh(checked: boolean) {
if (checked && !entitlementStore.isLocalUltimate) {
openUpgradeDialog('ssh_tunnel')
// usage-side feature — send to the pricing site (matches dockit)
openUrl(UPGRADE_URL)
return
}
if (!formData.value.sshTunnel) {
Expand Down
29 changes: 28 additions & 1 deletion src/pages/ConnectionsPage.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script setup lang="ts">
import type { ServerConnection } from '@/store'
import { openUrl } from '@tauri-apps/plugin-opener'
import { computed, onMounted, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
import { UPGRADE_URL } from '@/common'
import { ServerCard, ServerFormDialog } from '@/components/connections'
import ConnectingModal from '@/components/connections/ConnectingModal.vue'
import AppLayout from '@/components/layout/AppLayout.vue'
Expand All @@ -11,13 +13,14 @@ import { Card } from '@/components/ui/card'
import { DestructiveConfirmDialog } from '@/components/ui/destructive-confirm-dialog'
import { Input } from '@/components/ui/input'
import { toast } from '@/composables/useNotifications'
import { ConnectionStatus, useConnectionStore } from '@/store'
import { ConnectionStatus, useConnectionStore, useEntitlementStore } from '@/store'

const MIN_LOADING_TIME = 1500

const { t } = useI18n()
const router = useRouter()
const connectionStore = useConnectionStore()
const entitlementStore = useEntitlementStore()

const searchQuery = ref('')
const viewMode = ref<'grid' | 'list'>('grid')
Expand Down Expand Up @@ -57,6 +60,9 @@ function handleAddConnection() {
}

function handleEditConnection(connection: ServerConnection) {
if (!guardSshConnection(connection)) {
return
}
editingConnection.value = connection
isFormDialogOpen.value = true
}
Expand Down Expand Up @@ -124,8 +130,20 @@ async function establishConnection(connection: ServerConnection, navigateOnSucce
}
}

// an SSH-bound saved connection is only operable with Ultimate — instead of
// attempting a connect that dies with a raw 403, route to the pricing site
function guardSshConnection(connection: ServerConnection): boolean {
if (entitlementStore.isLocalUltimate || !connection.sshTunnel?.enabled)
return true
openUrl(UPGRADE_URL)
return false
}

async function handleConnect(connection: ServerConnection) {
connectError.value = null
if (!guardSshConnection(connection)) {
return
}
if (!connection.id) {
return
}
Expand All @@ -146,6 +164,9 @@ async function handleConnect(connection: ServerConnection) {

async function handleDoubleClick(connection: ServerConnection) {
connectError.value = null
if (!guardSshConnection(connection)) {
return
}
if (!connection.id) {
return
}
Expand All @@ -164,6 +185,9 @@ async function handleDoubleClick(connection: ServerConnection) {
}

function handleDeleteConnection(connection: ServerConnection) {
if (!guardSshConnection(connection)) {
return
}
connectionToDelete.value = connection
deleteDialogOpen.value = true
}
Expand All @@ -177,6 +201,9 @@ async function confirmDelete() {
}

function handleDuplicateConnection(connection: ServerConnection) {
if (!guardSshConnection(connection)) {
return
}
editingConnection.value = {
...connection,
id: undefined,
Expand Down
Loading