Browse Source

Merge pull request #7653 from nocodb/nc-feat/license-key

Nc fix - DATABASE_URL bug
pull/7670/head
Mert E 9 months ago committed by GitHub
parent
commit
5368600373
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      packages/nc-gui/assets/nc-icons/phone-call.svg
  2. 3
      packages/nc-gui/components/dashboard/Sidebar.vue
  3. 3
      packages/nc-gui/components/dashboard/Sidebar/BeforeUserInfo.vue
  4. 2
      packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue
  5. 5
      packages/nc-gui/composables/useGlobal/actions.ts
  6. 3
      packages/nc-gui/utils/iconUtils.ts
  7. 2
      packages/nocodb/src/modules/global/global.module.ts
  8. 4
      packages/nocodb/src/modules/global/init-meta-service.provider.ts
  9. 10
      packages/nocodb/src/utils/nc-config/helpers.ts

3
packages/nc-gui/assets/nc-icons/phone-call.svg

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.0334 3.83268C10.6845 3.95973 11.283 4.27819 11.7521 4.74731C12.2212 5.21642 12.5397 5.81486 12.6667 6.46602M10.0334 1.16602C11.3862 1.31631 12.6478 1.92213 13.6109 2.88402C14.574 3.84591 15.1814 5.10669 15.3334 6.45935M14.6667 11.7793V13.7793C14.6675 13.965 14.6294 14.1488 14.555 14.3189C14.4807 14.489 14.3716 14.6417 14.2348 14.7673C14.0979 14.8928 13.9364 14.9883 13.7605 15.0478C13.5847 15.1073 13.3983 15.1294 13.2134 15.1127C11.1619 14.8898 9.19137 14.1888 7.46004 13.066C5.84926 12.0425 4.48359 10.6768 3.46004 9.06602C2.33336 7.32682 1.6322 5.34668 1.41337 3.28602C1.39671 3.10166 1.41862 2.91586 1.4777 2.74043C1.53679 2.56501 1.63175 2.40381 1.75655 2.2671C1.88134 2.13038 2.03324 2.02116 2.20256 1.94636C2.37189 1.87157 2.55493 1.83286 2.74004 1.83268H4.74004C5.06357 1.8295 5.37723 1.94407 5.62254 2.15504C5.86786 2.36601 6.02809 2.65898 6.07337 2.97935C6.15779 3.61939 6.31434 4.24783 6.54004 4.85268C6.62973 5.0913 6.64915 5.35063 6.59597 5.59994C6.5428 5.84925 6.41928 6.07809 6.24004 6.25935L5.39337 7.10602C6.34241 8.77505 7.72434 10.157 9.39337 11.106L10.24 10.2593C10.4213 10.0801 10.6501 9.95658 10.8994 9.90341C11.1488 9.85024 11.4081 9.86965 11.6467 9.95935C12.2516 10.185 12.88 10.3416 13.52 10.426C13.8439 10.4717 14.1396 10.6348 14.3511 10.8843C14.5625 11.1339 14.6748 11.4524 14.6667 11.7793Z" stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

3
packages/nc-gui/components/dashboard/Sidebar.vue

@ -56,7 +56,8 @@ onUnmounted(() => {
> >
<DashboardTreeView v-if="!isWorkspaceLoading" /> <DashboardTreeView v-if="!isWorkspaceLoading" />
</div> </div>
<div v-if="!isSharedBase"> <div v-if="!isSharedBase" class="border-t-1">
<DashboardSidebarBeforeUserInfo />
<DashboardSidebarUserInfo /> <DashboardSidebarUserInfo />
</div> </div>
</div> </div>

3
packages/nc-gui/components/dashboard/Sidebar/BeforeUserInfo.vue

@ -0,0 +1,3 @@
<template>
<span></span>
</template>

2
packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue

@ -78,7 +78,7 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="flex w-full flex-col p-1 border-t-1 border-gray-200 gap-y-1"> <div class="flex w-full flex-col p-1 border-gray-200 gap-y-1">
<NcDropdown v-model:visible="isMenuOpen" placement="topLeft" overlay-class-name="!min-w-64"> <NcDropdown v-model:visible="isMenuOpen" placement="topLeft" overlay-class-name="!min-w-64">
<div <div
class="flex flex-row py-2 px-3 gap-x-2 items-center hover:bg-gray-200 rounded-lg cursor-pointer h-10" class="flex flex-row py-2 px-3 gap-x-2 items-center hover:bg-gray-200 rounded-lg cursor-pointer h-10"

5
packages/nc-gui/composables/useGlobal/actions.ts

@ -142,6 +142,11 @@ export function useGlobalActions(state: State): Actions {
} }
const getBaseUrl = (workspaceId: string) => { const getBaseUrl = (workspaceId: string) => {
// if baseUrl is set in appInfo, use it
if (state.appInfo.value.baseUrl) {
return state.appInfo.value.baseUrl
}
if (state.appInfo.value.baseHostName && location.hostname !== `${workspaceId}.${state.appInfo.value.baseHostName}`) { if (state.appInfo.value.baseHostName && location.hostname !== `${workspaceId}.${state.appInfo.value.baseHostName}`) {
return `https://${workspaceId}.${state.appInfo.value.baseHostName}` return `https://${workspaceId}.${state.appInfo.value.baseHostName}`
} }

3
packages/nc-gui/utils/iconUtils.ts

@ -121,6 +121,7 @@ import NcArrowDown from '~icons/nc-icons/arrow-down'
import NcUpload from '~icons/nc-icons/upload' import NcUpload from '~icons/nc-icons/upload'
import NcDownload from '~icons/nc-icons/download' import NcDownload from '~icons/nc-icons/download'
import NcProjectGray from '~icons/nc-icons/project-gray' import NcProjectGray from '~icons/nc-icons/project-gray'
import NcPhoneCall from '~icons/nc-icons/phone-call'
// keep it for reference // keep it for reference
// todo: remove it after all icons are migrated // todo: remove it after all icons are migrated
@ -270,7 +271,6 @@ import NcProjectGray from '~icons/nc-icons/project-gray'
} as const */ } as const */
export const iconMap = { export const iconMap = {
projectGray: NcProjectGray,
sort: Sort, sort: Sort,
group: Group, group: Group,
filter: Filter, filter: Filter,
@ -480,6 +480,7 @@ export const iconMap = {
ncEdit: NcEdit, ncEdit: NcEdit,
ncArrowUp: NcArrowUp, ncArrowUp: NcArrowUp,
ncArrowDown: NcArrowDown, ncArrowDown: NcArrowDown,
phoneCall: NcPhoneCall,
} }
export const getMdiIcon = (type: string): any => { export const getMdiIcon = (type: string): any => {

2
packages/nocodb/src/modules/global/global.module.ts

@ -1,7 +1,7 @@
import { forwardRef, Global, Module } from '@nestjs/common'; import { forwardRef, Global, Module } from '@nestjs/common';
import { ExtractJwt } from 'passport-jwt'; import { ExtractJwt } from 'passport-jwt';
import { InitMetaServiceProvider } from './init-meta-service.provider';
import type { Provider } from '@nestjs/common'; import type { Provider } from '@nestjs/common';
import { InitMetaServiceProvider } from '~/modules/global/init-meta-service.provider';
import { EventEmitterModule } from '~/modules/event-emitter/event-emitter.module'; import { EventEmitterModule } from '~/modules/event-emitter/event-emitter.module';
import { SocketGateway } from '~/gateways/socket.gateway'; import { SocketGateway } from '~/gateways/socket.gateway';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';

4
packages/nocodb/src/modules/global/init-meta-service.provider.ts

@ -1,5 +1,5 @@
import { T } from 'nc-help'; import { T } from 'nc-help';
import type { Provider } from '@nestjs/common'; import type { FactoryProvider } from '@nestjs/common';
import type { IEventEmitter } from '~/modules/event-emitter/event-emitter.interface'; import type { IEventEmitter } from '~/modules/event-emitter/event-emitter.interface';
import { populatePluginsForCloud } from '~/utils/cloud/populateCloudPlugins'; import { populatePluginsForCloud } from '~/utils/cloud/populateCloudPlugins';
import { MetaService } from '~/meta/meta.service'; import { MetaService } from '~/meta/meta.service';
@ -12,7 +12,7 @@ import initAdminFromEnv from '~/helpers/initAdminFromEnv';
import { User } from '~/models'; import { User } from '~/models';
import { NcConfig, prepareEnv } from '~/utils/nc-config'; import { NcConfig, prepareEnv } from '~/utils/nc-config';
export const InitMetaServiceProvider: Provider = { export const InitMetaServiceProvider: FactoryProvider = {
// initialize app, // initialize app,
// 1. init cache // 1. init cache
// 2. init db connection and create if not exist // 2. init db connection and create if not exist

10
packages/nocodb/src/utils/nc-config/helpers.ts

@ -109,14 +109,16 @@ export function jdbcToXcUrl(url: string): string {
const extraParams = []; const extraParams = [];
for (const [key, value] of Object.entries(extra)) { for (const [key, value] of Object.entries(extra)) {
extraParams.push(`${key}=${value}`); extraParams.push(`${key}=${encodeURIComponent(value + '')}`);
} }
const res = `${driverClientMapping[driver] || driver}://${host}${ const res = `${driverClientMapping[driver] || driver}://${host}${
port ? `:${port}` : '' port ? `:${port}` : ''
}?${user ? `u=${user}&` : ''}${password ? `p=${password}&` : ''}${ }?${user ? `u=${encodeURIComponent(user)}&` : ''}${
database ? `d=${database}&` : '' password ? `p=${encodeURIComponent(password)}&` : ''
}${extraParams.join('&')}`; }${database ? `d=${encodeURIComponent(database)}&` : ''}${extraParams.join(
'&',
)}`;
return res; return res;
} }

Loading…
Cancel
Save