From 87ae660c644810f28796d351bd0586e983791b11 Mon Sep 17 00:00:00 2001 From: wingkwong Date: Fri, 4 Jun 2021 21:38:37 +0800 Subject: [PATCH 01/11] chore: sync version with package.json --- packages/nc-cli/package-lock.json | 2 +- packages/nocodb/package-lock.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nc-cli/package-lock.json b/packages/nc-cli/package-lock.json index 186bf3b0eb..c7fe5e3ff2 100644 --- a/packages/nc-cli/package-lock.json +++ b/packages/nc-cli/package-lock.json @@ -1,6 +1,6 @@ { "name": "create-nocodb-app", - "version": "0.1.17", + "version": "0.1.21", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/nocodb/package-lock.json b/packages/nocodb/package-lock.json index 8204e13d6a..4ab0b4988c 100644 --- a/packages/nocodb/package-lock.json +++ b/packages/nocodb/package-lock.json @@ -1,6 +1,6 @@ { "name": "nocodb", - "version": "0.9.22", + "version": "0.9.23", "lockfileVersion": 1, "requires": true, "dependencies": { From ae5e04da089d8856d77114df0f3fd6f2c642faa0 Mon Sep 17 00:00:00 2001 From: oof1lab Date: Sun, 6 Jun 2021 01:24:30 +0530 Subject: [PATCH 02/11] Docs : Adding how to run locally & contributing sections. --- README.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3396c12b48..1eec0a0830 100644 --- a/README.md +++ b/README.md @@ -143,9 +143,6 @@ docker run -p 8080:8080 -e NC_DB="pg://host:port?u=user&p=password&d=database" n docker run -p 8080:8080 -e NC_DB="mssql://host:port?u=user&p=password&d=database" nocodb/nocodb ``` - - - ## Environment variables | Variable | Mandatory | Comments | If absent | |-------------------------|-----------|----------------------------------------------------------------------------------|--------------------------------------------| @@ -157,6 +154,32 @@ docker run -p 8080:8080 -e NC_DB="mssql://host:port?u=user&p=password&d=database | NC_CONNECT_TO_EXTERNAL_DB_DISABLED | No | Disable Project creation with external database | | | NC_DISABLE_TELE | No | Disable telemetry | | +# Running locally +``` +git clone https://github.com/nocodb/nocodb +cd nocodb + +# run backend +cd packages/nocodb +npm install +npm run watch:run + +# open localhost:8080/dashboard in browser + +# run frontend +cd packages/nc-gui +npm install +npm run dev + +# open localhost:3000/dashboard in browser +``` + +Changes made to code automatically restart. + +# Contributing +- Please take a look at ./contribute/HowToApplyLicense.md +- Ignore adding headers for .json or .md or .yml + # 🎯 Why are we building this ? Most internet businesses equip themselves with either spreadsheet or a database to solve their business needs. Spreadsheets are used by a Billion+ humans collaboratively every single day. However, we are way off working at similar speeds on databases which are way more powerful tools when it comes to computing. Attempts to solve this with SaaS offerings has meant horrible access controls, vendor lockin, data lockin, abrupt price changes & most importantly a glass ceiling on what's possible in future. @@ -184,6 +207,11 @@ Our mission is to provide the most powerful no-code interface for databases whic + + + + - - - - - - - + From 440bf97d210944957ed001145b19de36a0f47c7d Mon Sep 17 00:00:00 2001 From: Naveen MR Date: Sun, 6 Jun 2021 12:15:19 +0530 Subject: [PATCH 03/11] Docs : Updating contributors Signed-off-by: Naveen MR --- README.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 1eec0a0830..b07ed78183 100644 --- a/README.md +++ b/README.md @@ -190,27 +190,27 @@ Our mission is to provide the most powerful no-code interface for databases whic [//]: contributor-faces - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - From 8ca8ba5910fbdd36292884ccc32462b37cdd7710 Mon Sep 17 00:00:00 2001 From: Naveen MR Date: Sun, 6 Jun 2021 13:48:24 +0530 Subject: [PATCH 04/11] Docs : Start docker in detached mode Signed-off-by: Naveen MR --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b07ed78183..ac58db8432 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Turns any MySQL, PostgreSQL, SQL Server, SQLite & MariaDB into a smart-spreadshe ### Using Docker ```bash -docker run --name nocodb -p 8080:8080 nocodb/nocodb +docker run -d --name nocodb -p 8080:8080 nocodb/nocodb ``` ### Using Npm @@ -130,17 +130,17 @@ And connection params for this database can be specified in `NC_DB` environment #### Example MySQL ``` -docker run -p 8080:8080 -e NC_DB="mysql2://host:port?u=user&p=password&d=database" nocodb/nocodb +docker run -d -p 8080:8080 -e NC_DB="mysql2://host:port?u=user&p=password&d=database" nocodb/nocodb ``` #### Example Postgres ``` -docker run -p 8080:8080 -e NC_DB="pg://host:port?u=user&p=password&d=database" nocodb/nocodb +docker run -d -p 8080:8080 -e NC_DB="pg://host:port?u=user&p=password&d=database" nocodb/nocodb ``` #### Example SQL Server ``` -docker run -p 8080:8080 -e NC_DB="mssql://host:port?u=user&p=password&d=database" nocodb/nocodb +docker run -d -p 8080:8080 -e NC_DB="mssql://host:port?u=user&p=password&d=database" nocodb/nocodb ``` ## Environment variables From 1ae36ff6fb540a1bab70e95eef6f40e1452ea9c1 Mon Sep 17 00:00:00 2001 From: Naveen MR Date: Sun, 6 Jun 2021 18:00:04 +0530 Subject: [PATCH 05/11] Docs : Added NC_AUTH_JWT_SECRET in examples. Signed-off-by: Naveen MR --- README.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ac58db8432..f01baeaec6 100644 --- a/README.md +++ b/README.md @@ -130,19 +130,36 @@ And connection params for this database can be specified in `NC_DB` environment #### Example MySQL ``` -docker run -d -p 8080:8080 -e NC_DB="mysql2://host:port?u=user&p=password&d=database" nocodb/nocodb +docker run -d -p 8080:8080 \ + -e NC_DB="mysql2://host.docker.internal:3306?u=root&p=password&d=d1" \ + -e NC_AUTH_JWT_SECRET="569a1821-0a93-45e8-87ab-eb857f20a010" \ + nocodb/nocodb ``` #### Example Postgres ``` -docker run -d -p 8080:8080 -e NC_DB="pg://host:port?u=user&p=password&d=database" nocodb/nocodb +docker run -d -p 8080:8080 \ + -e NC_DB="pg://host:port?u=user&p=password&d=database" \ + -e NC_AUTH_JWT_SECRET="569a1821-0a93-45e8-87ab-eb857f20a010" \ + nocodb/nocodb ``` #### Example SQL Server ``` -docker run -d -p 8080:8080 -e NC_DB="mssql://host:port?u=user&p=password&d=database" nocodb/nocodb +docker run -d -p 8080:8080 \ + -e NC_DB="mssql://host:port?u=user&p=password&d=database" \ + -e NC_AUTH_JWT_SECRET="569a1821-0a93-45e8-87ab-eb857f20a010" \ + nocodb/nocodb ``` +## Docker Compose +``` +cd docker-compose +cd mysql or pg or mssql +docker-compose up +``` + + ## Environment variables | Variable | Mandatory | Comments | If absent | |-------------------------|-----------|----------------------------------------------------------------------------------|--------------------------------------------| From deea056a1b359b45b7a216ed0b9e82b80d33841e Mon Sep 17 00:00:00 2001 From: Bhanu P Chaudhary Date: Mon, 7 Jun 2021 15:38:40 +0530 Subject: [PATCH 06/11] added scaleway plugin Signed-off-by: Bhanu P Chaudhary --- packages/nc-gui/static/plugins/scaleway.png | Bin 0 -> 2969 bytes .../src/lib/noco/plugins/NcPluginMgr.ts | 27 +++- .../plugins/scaleway/ScalewayObjectStorage.ts | 118 ++++++++++++++++++ .../scaleway/ScalewayObjectStoragePlugin.ts | 43 +++++++ packages/nocodb/src/plugins/scaleway/index.ts | 80 ++++++++++++ 5 files changed, 267 insertions(+), 1 deletion(-) create mode 100644 packages/nc-gui/static/plugins/scaleway.png create mode 100644 packages/nocodb/src/plugins/scaleway/ScalewayObjectStorage.ts create mode 100644 packages/nocodb/src/plugins/scaleway/ScalewayObjectStoragePlugin.ts create mode 100644 packages/nocodb/src/plugins/scaleway/index.ts diff --git a/packages/nc-gui/static/plugins/scaleway.png b/packages/nc-gui/static/plugins/scaleway.png new file mode 100644 index 0000000000000000000000000000000000000000..342a50f6867f28325e7d4a19ae60af232566130e GIT binary patch literal 2969 zcmV;K3ug3*P)vZ`Rtuz4 z37%35n@K>+Q3an-1)Wg_n@#@`~3d>{{8;`{`=+UUv2;Z3I<6;K~#9!?VVe9;y4n3>l~G7ZpMUeV77^w z*`5uMU2c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XLMujJ_iPhXH` P00000NkvXXu0mjfTnC!@ literal 0 HcmV?d00001 diff --git a/packages/nocodb/src/lib/noco/plugins/NcPluginMgr.ts b/packages/nocodb/src/lib/noco/plugins/NcPluginMgr.ts index 84b6e122e9..54c2ee9eef 100644 --- a/packages/nocodb/src/lib/noco/plugins/NcPluginMgr.ts +++ b/packages/nocodb/src/lib/noco/plugins/NcPluginMgr.ts @@ -24,6 +24,7 @@ import MattermostPluginConfig from "../../../plugins/mattermost"; import DiscordPluginConfig from "../../../plugins/discord"; import TwilioWhatsappPluginConfig from "../../../plugins/twilioWhatsapp"; import TwilioPluginConfig from "../../../plugins/twilio"; +import ScalewayPluginConfig from "../../../plugins/scaleway"; import Noco from "../Noco"; import Local from "./adapters/storage/Local"; @@ -45,6 +46,7 @@ const defaultPlugins = [ LinodePluginConfig, UpcloudPluginConfig, SMTPPluginConfig, + ScalewayPluginConfig, ] class NcPluginMgr { @@ -129,4 +131,27 @@ class NcPluginMgr { } -export default NcPluginMgr; \ No newline at end of file +export default NcPluginMgr; + +/** + * @copyright Copyright (c) 2021, Xgene Cloud Ltd + * + * @author Pranav C Balan + * @author Bhanu P Chaudhary + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ \ No newline at end of file diff --git a/packages/nocodb/src/plugins/scaleway/ScalewayObjectStorage.ts b/packages/nocodb/src/plugins/scaleway/ScalewayObjectStorage.ts new file mode 100644 index 0000000000..99b1dca9e0 --- /dev/null +++ b/packages/nocodb/src/plugins/scaleway/ScalewayObjectStorage.ts @@ -0,0 +1,118 @@ +import AWS from "aws-sdk"; +import fs from "fs"; +import path from "path"; +import {IStorageAdapter, XcFile} from "nc-plugin"; + +export default class ScalewayObjectStorage implements IStorageAdapter { + + private s3Client: AWS.S3; + private input: any; + + constructor(input: any) { + this.input = input; + } + + + async fileCreate(key: string, file: XcFile): Promise { + + const uploadParams: any = { + ACL: 'public-read' + }; + return new Promise((resolve, reject) => { + // Configure the file stream and obtain the upload parameters + const fileStream = fs.createReadStream(file.path); + fileStream.on('error', (err) => { + console.log('File Error', err); + reject(err); + }); + + uploadParams.Body = fileStream; + uploadParams.Key = key; + + // call S3 to retrieve upload file to specified bucket + this.s3Client.upload(uploadParams, (err, data) => { + if (err) { + console.log("Error", err); + reject(err); + } + if (data) { + resolve(data.Location); + } + }); + }); + } + + public async fileDelete(_path: string): Promise { + return Promise.resolve(undefined); + } + + public async fileRead(key: string): Promise { + return new Promise((resolve, reject) => { + this.s3Client.getObject({Key: key} as any, (err, data) => { + if (err) { + return reject(err); + } + if (!data?.Body) { + return reject(data); + } + return resolve(data.Body); + }); + }); + } + + public async init(): Promise { + const s3Options: any = { + params: {Bucket: this.input.bucket}, + region: this.input.region + }; + + s3Options.accessKeyId = this.input.access_key + s3Options.secretAccessKey = this.input.access_secret; + + s3Options.endpoint = new AWS.Endpoint(`s3.${this.input.region}.scw.cloud`); + + this.s3Client = new AWS.S3(s3Options); + } + + public async test(): Promise { + try { + const tempFile = path.join(process.cwd(), 'temp.txt'); + const createStream = fs.createWriteStream(tempFile); + createStream.end(); + await this.fileCreate('/test.txt', { + path: tempFile, + mimetype: '', + originalname: 'temp.txt', + size: '' + }); + fs.unlinkSync(tempFile); + return true; + } catch (e) { + throw e; + } + } + +} + + +/** + * @copyright Copyright (c) 2021, Bhanu P Chaudhary + * + * @author Bhanu P Chaudhary + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ \ No newline at end of file diff --git a/packages/nocodb/src/plugins/scaleway/ScalewayObjectStoragePlugin.ts b/packages/nocodb/src/plugins/scaleway/ScalewayObjectStoragePlugin.ts new file mode 100644 index 0000000000..446f63a58d --- /dev/null +++ b/packages/nocodb/src/plugins/scaleway/ScalewayObjectStoragePlugin.ts @@ -0,0 +1,43 @@ +import {IStorageAdapter, XcStoragePlugin} from "nc-plugin"; +import ScalewayObjectStorage from "./ScalewayObjectStorage"; + + +class ScalewayObjectStoragePlugin extends XcStoragePlugin { + + private static storageAdapter: ScalewayObjectStorage; + + public getAdapter(): IStorageAdapter { + return ScalewayObjectStoragePlugin.storageAdapter; + } + + public async init(config: any): Promise { + ScalewayObjectStoragePlugin.storageAdapter = new ScalewayObjectStorage(config); + await ScalewayObjectStoragePlugin.storageAdapter.init(); + } + +} + +export default ScalewayObjectStoragePlugin; + + +/** + * @copyright Copyright (c) 2021, Bhanu P Chaudhary + * + * @author Bhanu P Chaudhary + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ \ No newline at end of file diff --git a/packages/nocodb/src/plugins/scaleway/index.ts b/packages/nocodb/src/plugins/scaleway/index.ts new file mode 100644 index 0000000000..f99689e9b8 --- /dev/null +++ b/packages/nocodb/src/plugins/scaleway/index.ts @@ -0,0 +1,80 @@ +import {XcPluginConfig} from "nc-plugin"; +import ScalewayObjectStoragePlugin from "./ScalewayObjectStoragePlugin"; +import {XcActionType, XcType} from "nc-common"; + +const config: XcPluginConfig = { + builder: ScalewayObjectStoragePlugin, + title: 'Scaleway Object Storage', + version: '0.0.1', + logo: 'plugins/scaleway.png', + tags: 'Storage', + description: 'S3-compatible Scaleway Object Storage makes it easy and more affordable to store and access data on Scaleway Cloud Platform infrastructure. The service also gives a 75GB free storage and external outgoing transfer on Object Storage every month', + inputs: { + title: 'Configure Scaleway Object Storage', + items: [{ + key: 'bucket', + label: 'Bucket Name', + placeholder: 'Bucket Name', + type: XcType.SingleLineText, + required: true + }, { + key: 'region', + label: 'Region', + placeholder: 'Region', + type: XcType.SingleLineText, + required: true + }, { + key: 'access_key', + label: 'Access Key', + placeholder: 'Access Key', + type: XcType.SingleLineText, + required: true + }, { + key: 'access_secret', + label: 'Access Secret', + placeholder: 'Access Secret', + type: XcType.Password, + required: true + },], + actions: [{ + label: 'Test', + placeholder: 'Test', + key: 'test', + actionType: XcActionType.TEST, + type: XcType.Button + }, { + label: 'Save', + placeholder: 'Save', + key: 'save', + actionType: XcActionType.SUBMIT, + type: XcType.Button + },], + msgOnInstall: 'Successfully installed and attachment will be stored in Scaleway Object Storage', + msgOnUninstall: '', + }, + category: 'Storage', +} + +export default config; + +/** + * @copyright Copyright (c) 2021, Bhanu P Chaudhary + * + * @author Bhanu P Chaudhary + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ \ No newline at end of file From 370137aefee6f27824afad49acdc0b329fede2ac Mon Sep 17 00:00:00 2001 From: Bhanu P Chaudhary Date: Mon, 7 Jun 2021 15:49:45 +0530 Subject: [PATCH 07/11] added fix for date column in postgres Signed-off-by: Bhanu P Chaudhary --- packages/nc-gui/components/project/spreadsheet/mixins/cell.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nc-gui/components/project/spreadsheet/mixins/cell.js b/packages/nc-gui/components/project/spreadsheet/mixins/cell.js index 1d710c2c20..7bd2bd83c2 100644 --- a/packages/nc-gui/components/project/spreadsheet/mixins/cell.js +++ b/packages/nc-gui/components/project/spreadsheet/mixins/cell.js @@ -32,7 +32,7 @@ export default { }, isFloat() { return this.abstractType === 'float'; }, isDate() { - return this.abstractType === 'date'; + return this.abstractType === 'date' || this.column.uidt === 'Date'; }, isTime() { return this.abstractType === 'time'; }, isDateTime() { From 23bb5dfe4b834be1ea8afaeeb4334af16522daba Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 7 Jun 2021 20:57:11 +0800 Subject: [PATCH 08/11] feat: add dco check Signed-off-by: Wing-Kam Wong --- .github/workflows/dco-check.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/dco-check.yml diff --git a/.github/workflows/dco-check.yml b/.github/workflows/dco-check.yml new file mode 100644 index 0000000000..abd006c044 --- /dev/null +++ b/.github/workflows/dco-check.yml @@ -0,0 +1,17 @@ +name: DCO Check +on: [pull_request] + +jobs: + commits_check_job: + runs-on: ubuntu-latest + name: Commits Check + steps: + - name: Get PR Commits + id: 'get-pr-commits' + uses: tim-actions/get-pr-commits@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: DCO Check + uses: tim-actions/dco@master + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} From ed5781ae9a9d75a14dc23e7b125c1e8028ed06ff Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 7 Jun 2021 22:06:55 +0800 Subject: [PATCH 09/11] feat: i18n on project page - ref to #236 Signed-off-by: Wing-Kam Wong --- packages/nc-gui/pages/projects/index.vue | 79 +++++++++++++----------- packages/nc-gui/static/lang/en.json | 26 +++++++- packages/nc-gui/static/lang/ja.json | 26 +++++++- packages/nc-gui/static/lang/zh.json | 29 ++++++++- 4 files changed, 120 insertions(+), 40 deletions(-) diff --git a/packages/nc-gui/pages/projects/index.vue b/packages/nc-gui/pages/projects/index.vue index 510bd47082..cc8b0bb2d5 100644 --- a/packages/nc-gui/pages/projects/index.vue +++ b/packages/nc-gui/pages/projects/index.vue @@ -12,7 +12,7 @@ - My Projects + {{ $t('home.my_projects') }} @@ -22,7 +22,7 @@ small color="primary grey" @click="projectsLoad" - tooltip="Refresh projects"> + v-bind:tooltip="$t('home.reload_projects_tooltip')"> mdi-refresh   @@ -34,20 +34,20 @@ ref="search1" v-model="search" class="caption pt-0 mt-0" - placeholder="Search Project" + v-bind:placeholder="$t('home.search_project')" single-line hide-details v-ge="['home','project-search']" style="max-width:200px" - > + > - + @@ -74,7 +74,7 @@ v-ge="['home','project-new']" @click="onCreateProject()"> mdi-plus - {{ $t('create-new-project') }} + {{ $t('home.create_new_project_button.text') }} --> @@ -91,7 +91,7 @@ v-ge="['home','project-new']" v-on="on" > - {{ $t('create-new-project') }} + {{ $t('home.create_new_project_button.text') }} mdi-menu-down @@ -103,14 +103,14 @@ mdi-plus - Create + {{ $t('home.create_new_project_button.subtext_1') }} - Create a new project + {{ $t('home.create_new_project_button.subtext_1_tooltip') }} @@ -119,7 +119,7 @@ mdi-power-plug-outline Create By Connecting
To An External Database
+ class="caption font-weight-regular" v-html="$t('home.create_new_project_button.subtext_2')">
@@ -127,7 +127,7 @@ - Supports MySQL, PostgreSQL, SQL Server & SQLite + {{ $t('home.create_new_project_button.subtext_2_tooltip') }} @@ -141,7 +141,7 @@ color="primary" v-ge="['home','project-new']" > - {{ $t('create-new-project') }} + {{ $t('home.create_new_project_button.text') }} @@ -170,9 +170,9 @@ :color="props.item.status === 'started' ? 'green' : (props.item.status === 'stopped' ? 'orange' : 'orange') "> mdi-moon-full - + @@ -186,32 +186,32 @@
+ mdi-stop-circle-outline + mdi-play-circle-outline - - mdi-loading mdi-spin - + mdi-restart - + mdi-delete-circle-outline @@ -225,21 +225,21 @@ mdi-import - Import Metadata + {{ $t('home.project_verticial_option_1') }} mdi-export - Export Metadata + {{ $t('home.project_verticial_option_2') }} mdi-delete-variant - Clear Metadata + {{ $t('home.project_verticial_option_3') }} @@ -255,7 +255,7 @@ :value="true" color="error" icon="warning" - >Your search for "{{ search }}" found no results. + >{{ $t('home.search.no_result', { search }) }} @@ -264,7 +264,8 @@ - Get started by creating a new project. + + {{ $t('home.project_empty_message') }} @@ -281,8 +282,8 @@

- - Create new project
by connecting to your
existing or new database
+ +

mdi-lightbulb-on   - New Project + + {{ $t('home.create_new_project_button.text') }} @@ -330,9 +332,11 @@ mdi-github - Star + + {{ $t('home.show_community_message_1_1') }} mdi-star-outline - us on Github + + {{ $t('home.show_community_message_1_2') }} @@ -340,21 +344,24 @@ mdi-calendar-month - Book a Free DEMO + + {{ $t('home.show_community_message_2') }} mdi-discord - Get your questions answered + + {{ $t('home.show_community_message_3') }} mdi-twitter - Follow NocoDB + + {{ $t('home.show_community_message_4') }} diff --git a/packages/nc-gui/static/lang/en.json b/packages/nc-gui/static/lang/en.json index cc6031b4e2..593d98e118 100644 --- a/packages/nc-gui/static/lang/en.json +++ b/packages/nc-gui/static/lang/en.json @@ -1,3 +1,27 @@ { - "create-new-project": "New Project" + "home.my_projects": "My Projects", + "home.reload_projects_tooltip": "Refresh projects", + "home.create_new_project_button.text": "New Project", + "home.create_new_project_button.subtext_1": "Create", + "home.create_new_project_button.subtext_1_tooltip": "Create a new project", + "home.create_new_project_button.subtext_2": "Create By Connecting
To An External Database", + "home.create_new_project_button.subtext_2_tooltip": "Supports MySQL, PostgreSQL, SQL Server & SQLite", + "home.search_project": "Search Project", + "home.project_verticial_option_1": "Import Metadata", + "home.project_verticial_option_2": "Export Metadata", + "home.project_verticial_option_3": "Clear Metadata", + "home.project_horizontal_option_1": "Stop Project", + "home.project_horizontal_option_2": "Start Project", + "home.project_horizontal_option_3": "Restart Project", + "home.project_horizontal_option_4": "Delete Project", + "home.project_api_type_tooltip_graphql": "Accessible via GraphQL APIs", + "home.project_api_type_tooltip_rest": "Accessible via REST APIs", + "home.project_empty_message": "Get started by creating a new project", + "home.import_button.text": "Import NocoDB Project by uploading metadata zip file", + "home.show_community_message_1_1": "Star", + "home.show_community_message_1_2": "us on Github", + "home.show_community_message_2": "Book a Free DEMO", + "home.show_community_message_3": "Get your questions answered", + "home.show_community_message_4": "Follow NocoDB", + "home.search.no_result": "Your search for {search} found no results" } diff --git a/packages/nc-gui/static/lang/ja.json b/packages/nc-gui/static/lang/ja.json index 4a50ec6db5..1be007c814 100644 --- a/packages/nc-gui/static/lang/ja.json +++ b/packages/nc-gui/static/lang/ja.json @@ -1,3 +1,27 @@ { - "create-new-project": "新しいプロジェクトを作成する" + "home.my_projects": "My Projects", + "home.reload_projects_tooltip": "Refresh projects", + "home.create_new_project_button.text": "新しいプロジェクトを作成する", + "home.create_new_project_button.subtext_1": "Create", + "home.create_new_project_button.subtext_1_tooltip": "Create a new project", + "home.create_new_project_button.subtext_2": "Create By Connecting
To An External Database", + "home.create_new_project_button.subtext_2_tooltip": "Supports MySQL, PostgreSQL, SQL Server & SQLite", + "home.search_project": "Search Project", + "home.project_verticial_option_1": "Import Metadata", + "home.project_verticial_option_2": "Export Metadata", + "home.project_verticial_option_3": "Clear Metadata", + "home.project_horizontal_option_1": "Stop Project", + "home.project_horizontal_option_2": "Start Project", + "home.project_horizontal_option_3": "Restart Project", + "home.project_horizontal_option_4": "Delete Project", + "home.project_api_type_tooltip_graphql": "Accessible via GraphQL APIs", + "home.project_api_type_tooltip_rest": "Accessible via REST APIs", + "home.project_empty_message": "Get started by creating a new project", + "home.import_button.text": "Import NocoDB Project by uploading metadata zip file", + "home.show_community_message_1_1": "Star", + "home.show_community_message_1_2": "us on Github", + "home.show_community_message_2": "Book a Free DEMO", + "home.show_community_message_3": "Get your questions answered", + "home.show_community_message_4": "Follow NocoDB", + "home.search.no_result": "Your search for {search} found no results" } diff --git a/packages/nc-gui/static/lang/zh.json b/packages/nc-gui/static/lang/zh.json index ff028a2dd9..2261901460 100644 --- a/packages/nc-gui/static/lang/zh.json +++ b/packages/nc-gui/static/lang/zh.json @@ -1,3 +1,28 @@ { - "create-new-project": "创建新项目" -} + "home.my_projects": "My Projects", + "home.reload_projects_tooltip": "Refresh projects", + "home.create_new_project_button.text": "创建新项目", + "home.create_new_project_button.subtext_1": "Create", + "home.create_new_project_button.subtext_1_tooltip": "Create a new project", + "home.create_new_project_button.subtext_2": "Create By Connecting
To An External Database", + "home.create_new_project_button.subtext_2_tooltip": "Supports MySQL, PostgreSQL, SQL Server & SQLite", + "home.search_project": "Search Project", + "home.project_verticial_option_1": "Import Metadata", + "home.project_verticial_option_2": "Export Metadata", + "home.project_verticial_option_3": "Clear Metadata", + "home.project_horizontal_option_1": "Stop Project", + "home.project_horizontal_option_2": "Start Project", + "home.project_horizontal_option_3": "Restart Project", + "home.project_horizontal_option_4": "Delete Project", + "home.project_api_type_tooltip_graphql": "Accessible via GraphQL APIs", + "home.project_api_type_tooltip_rest": "Accessible via REST APIs", + "home.project_empty_message": "Get started by creating a new project", + "home.import_button.text": "Import NocoDB Project by uploading metadata zip file", + "home.show_community_message_1_1": "Star", + "home.show_community_message_1_2": "us on Github", + "home.show_community_message_2": "Book a Free DEMO", + "home.show_community_message_3": "Get your questions answered", + "home.show_community_message_4": "Follow NocoDB", + "home.search.no_result": "Your search for {search} found no results" + } + \ No newline at end of file From 197b5a9516eb05e28719bf2b1305dad40d059dd4 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 7 Jun 2021 22:09:35 +0800 Subject: [PATCH 10/11] chore: remove unused local files Signed-off-by: Wing-Kam Wong --- packages/nc-gui/assets/img/lang/en.json | 3 --- packages/nc-gui/assets/img/lang/ja.json | 3 --- packages/nc-gui/assets/img/lang/zh.json | 3 --- 3 files changed, 9 deletions(-) delete mode 100644 packages/nc-gui/assets/img/lang/en.json delete mode 100644 packages/nc-gui/assets/img/lang/ja.json delete mode 100644 packages/nc-gui/assets/img/lang/zh.json diff --git a/packages/nc-gui/assets/img/lang/en.json b/packages/nc-gui/assets/img/lang/en.json deleted file mode 100644 index 8437b0c360..0000000000 --- a/packages/nc-gui/assets/img/lang/en.json +++ /dev/null @@ -1,3 +0,0 @@ - { - "create-new-project": "Create New Project" -} diff --git a/packages/nc-gui/assets/img/lang/ja.json b/packages/nc-gui/assets/img/lang/ja.json deleted file mode 100644 index 4a50ec6db5..0000000000 --- a/packages/nc-gui/assets/img/lang/ja.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "create-new-project": "新しいプロジェクトを作成する" -} diff --git a/packages/nc-gui/assets/img/lang/zh.json b/packages/nc-gui/assets/img/lang/zh.json deleted file mode 100644 index ff028a2dd9..0000000000 --- a/packages/nc-gui/assets/img/lang/zh.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "create-new-project": "创建新项目" -} From ddb321d7adc8736cba257faa8e4b63723735bd8f Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 7 Jun 2021 22:28:03 +0800 Subject: [PATCH 11/11] chore: format index.vue Signed-off-by: Wing-Kam Wong --- packages/nc-gui/pages/projects/index.vue | 1237 +++++++++++++--------- 1 file changed, 728 insertions(+), 509 deletions(-) diff --git a/packages/nc-gui/pages/projects/index.vue b/packages/nc-gui/pages/projects/index.vue index cc8b0bb2d5..a6018317a8 100644 --- a/packages/nc-gui/pages/projects/index.vue +++ b/packages/nc-gui/pages/projects/index.vue @@ -1,34 +1,48 @@