Browse Source

Merge branch 'develop' into feat/pnpm

pull/5903/head
Wing-Kam Wong 1 year ago
parent
commit
7b466a6325
  1. 8
      packages/nc-gui/composables/useGlobal/actions.ts
  2. 156
      packages/nc-gui/lang/th.json
  3. 8
      packages/nocodb/src/controllers/users/users.controller.ts
  4. 5
      packages/nocodb/src/services/users/users.service.ts

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

@ -8,12 +8,14 @@ export function useGlobalActions(state: State): Actions {
/** Sign out by deleting the token from localStorage */ /** Sign out by deleting the token from localStorage */
const signOut: Actions['signOut'] = async () => { const signOut: Actions['signOut'] = async () => {
state.token.value = null
state.user.value = null
try { try {
const nuxtApp = useNuxtApp() const nuxtApp = useNuxtApp()
await nuxtApp.$api.auth.signout() await nuxtApp.$api.auth.signout()
} catch {} } catch {
} finally {
state.token.value = null
state.user.value = null
}
} }
/** Sign in by setting the token in localStorage */ /** Sign in by setting the token in localStorage */

156
packages/nc-gui/lang/th.json

@ -16,11 +16,11 @@
"cancel": "ยกเลก", "cancel": "ยกเลก",
"submit": "สง", "submit": "สง",
"create": "สราง", "create": "สราง",
"duplicate": "Duplicate", "duplicate": "ดลอก",
"insert": "แทรก", "insert": "แทรก",
"delete": "ลบ", "delete": "ลบ",
"update": "อปเดต", "update": "อปเดต",
"rename": "การเปลยนชอ", "rename": "เปลยนชอ",
"reload": "โหลดใหม", "reload": "โหลดใหม",
"reset": "รเซต", "reset": "รเซต",
"install": "ตดตง", "install": "ตดตง",
@ -57,32 +57,32 @@
"notification": "การแจง", "notification": "การแจง",
"reference": "อางอง", "reference": "อางอง",
"function": "การทำงาน", "function": "การทำงาน",
"confirm": "Confirm", "confirm": "นย",
"generate": "Generate", "generate": "Generate",
"copy": "Copy", "copy": "ดลอก",
"misc": "Miscellaneous", "misc": "Miscellaneous",
"lock": "Lock", "lock": "อค",
"unlock": "Unlock", "unlock": "ปลดลอค",
"credentials": "Credentials", "credentials": "Credentials",
"help": "Help", "help": "ความชวยเหล",
"questions": "Questions", "questions": "คำถาม",
"reachOut": "Reach out here", "reachOut": "แจงได",
"betaNote": "This feature is currently in beta.", "betaNote": "เจอรอยในเวอรนเบต",
"moreInfo": "More information can be found here", "moreInfo": "หาขอมลเพมเตมได",
"logs": "Logs", "logs": "Logs",
"groupingField": "Grouping Field", "groupingField": "Grouping Field",
"insertAfter": "Insert After", "insertAfter": "แทรกหล",
"insertBefore": "Insert Before", "insertBefore": "แทรกกอน",
"hideField": "Hide Field", "hideField": "Hide Field",
"sortAsc": "Sort Ascending", "sortAsc": "เรยงจากนอยไปมาก",
"sortDesc": "Sort Descending", "sortDesc": "เรยงจากมากไปนอย",
"geoDataField": "GeoData Field" "geoDataField": "GeoData Field"
}, },
"objects": { "objects": {
"project": "โครงการ", "project": "โครงการ",
"projects": "โครงการ", "projects": "โครงการ",
"table": "ตาราง", "table": "ตาราง",
"tables": "โต", "tables": "ตาราง",
"field": "สนาม", "field": "สนาม",
"fields": "ฟลด", "fields": "ฟลด",
"column": "คอลมน", "column": "คอลมน",
@ -200,18 +200,18 @@
"resetPassword": "รเซตรหสผานของคณ", "resetPassword": "รเซตรหสผานของคณ",
"teamAndSettings": "Team & Settings", "teamAndSettings": "Team & Settings",
"apiDocs": "API Docs", "apiDocs": "API Docs",
"importFromAirtable": "Import From Airtable", "importFromAirtable": "นำเขาจาก Airtable",
"generateToken": "Generate Token", "generateToken": "Generate Token",
"APIsAndSupport": "APIs & Support", "APIsAndSupport": "APIs & Support",
"helpCenter": "Help center", "helpCenter": "นยวยเหล",
"swaggerDocumentation": "Swagger Documentation", "swaggerDocumentation": "Swagger Documentation",
"quickImportFrom": "Quick Import From", "quickImportFrom": "นำเขาดวนจาก",
"quickImport": "Quick Import", "quickImport": "นำเขาดวน",
"advancedSettings": "Advanced Settings", "advancedSettings": "การตงคาขนส",
"codeSnippet": "Code Snippet", "codeSnippet": "Code Snippet",
"keyboardShortcut": "Keyboard Shortcuts", "keyboardShortcut": "ดแปนพมพ",
"generateRandomName": "Generate Random Name", "generateRandomName": "มช",
"findRowByScanningCode": "Find row by scanning a QR or Barcode" "findRowByScanningCode": "หาแถวโดยสแกน QR โค"
}, },
"labels": { "labels": {
"createdBy": "Created By", "createdBy": "Created By",
@ -275,24 +275,24 @@
"columnName": "การผน - ชอคอลมน" "columnName": "การผน - ชอคอลมน"
}, },
"community": { "community": {
"starUs1": "ดาว", "starUs1": "ใหดาว",
"starUs2": "เราใน GitHub", "starUs2": "เราใน GitHub",
"bookDemo": "จองการสาธตฟร", "bookDemo": "จองการสาธตฟร",
"getAnswered": "บคำถามของคณตอบ", "getAnswered": "คำถาม มาหาคำตอบท",
"joinDiscord": "เขารวมบความไมลงรอยก", "joinDiscord": "เขารวม Discord",
"joinCommunity": "Join NocoDB Community", "joinCommunity": "เขารวมคอมมของ NocoDB",
"joinReddit": "เขารวม /r/NocoDB", "joinReddit": "เขารวม /r/NocoDB",
"followNocodb": "ตดตาม NocoDB" "followNocodb": "ตดตาม NocoDB"
}, },
"docReference": "เอกสารอางอง", "docReference": "เอกสารอางอง",
"selectUserRole": "เลอกบทบาทผใช", "selectUserRole": "เลอกบทบาทผใช",
"childTable": "โตะเดก", "childTable": "ตารางลก",
"childColumn": "คอลมนเดก", "childColumn": "คอลมนเดก",
"linkToAnotherRecord": "Link to another record", "linkToAnotherRecord": "เชอมไปยงตารางอ",
"onUpdate": "เมออปเดต", "onUpdate": "เมออปเดต",
"onDelete": "ในการลบ", "onDelete": "ในการลบ",
"account": "Account", "account": "Account",
"language": "Language", "language": "ภาษา",
"primaryColor": "Primary Color", "primaryColor": "Primary Color",
"accentColor": "Accent Color", "accentColor": "Accent Color",
"customTheme": "Custom Theme", "customTheme": "Custom Theme",
@ -309,8 +309,8 @@
"goToDashboard": "Go to Dashboard", "goToDashboard": "Go to Dashboard",
"importing": "Importing", "importing": "Importing",
"flattenNested": "Flatten Nested", "flattenNested": "Flatten Nested",
"downloadAllowed": "Download allowed", "downloadAllowed": "อนญาตใหดาวนโหลด",
"weAreHiring": "We are Hiring!", "weAreHiring": "เรากำลงรบสมคร!",
"primaryKey": "Primary key", "primaryKey": "Primary key",
"hasMany": "has many", "hasMany": "has many",
"belongsTo": "belongs to", "belongsTo": "belongs to",
@ -319,13 +319,13 @@
"commentsOnly": "Comments only", "commentsOnly": "Comments only",
"documentation": "Documentation", "documentation": "Documentation",
"subscribeNewsletter": "Subscribe to our weekly newsletter", "subscribeNewsletter": "Subscribe to our weekly newsletter",
"signUpWithGoogle": "Sign up with Google", "signUpWithGoogle": "สมครใชงานดวย Google",
"signInWithGoogle": "Sign in with Google", "signInWithGoogle": "ลงชอเขาใชวย Google",
"agreeToTos": "By signing up, you agree to the Terms of Service", "agreeToTos": "เมอคณสมครใชงานแลว ถอวายอมรบขอตกลงการใชงาน",
"welcomeToNc": "Welcome to NocoDB!", "welcomeToNc": "นดอนรบส NocoDB!",
"inviteOnlySignup": "Allow signup only using invite url", "inviteOnlySignup": "อนญาตใหสมครไดานลงกเชญชวนเทาน",
"nextRow": "Next Row", "nextRow": "แถวตอไป",
"prevRow": "Previous Row" "prevRow": "แถวทแล"
}, },
"activity": { "activity": {
"createProject": "สรางโครงการ", "createProject": "สรางโครงการ",
@ -370,14 +370,14 @@
"invite": "เชญชวน", "invite": "เชญชวน",
"inviteMore": "เชญมากขน", "inviteMore": "เชญมากขน",
"inviteTeam": "เชญทม", "inviteTeam": "เชญทม",
"inviteUser": "Invite User", "inviteUser": "เชญผใช",
"inviteToken": "เชญโทเคน", "inviteToken": "เชญโทเคน",
"newUser": "ผใชใหม", "newUser": "ผใชใหม",
"editUser": "แกไขผใช", "editUser": "แกไขผใช",
"deleteUser": "ลบผใชจากโครงการ", "deleteUser": "ลบผใชจากโครงการ",
"resendInvite": "สงอเมลเชญสงอเมลอกครง", "resendInvite": "สงอเมลเชญสงอเมลอกครง",
"copyInviteURL": "Copy Invite URL", "copyInviteURL": "Copy Invite URL",
"copyPasswordResetURL": "Copy password reset URL", "copyPasswordResetURL": "ดลอก URL รเซตรหสผาน",
"newRole": "บทบาทใหม", "newRole": "บทบาทใหม",
"reloadRoles": "โหลดบทบาทใหม", "reloadRoles": "โหลดบทบาทใหม",
"nextPage": "หนาตอไป", "nextPage": "หนาตอไป",
@ -385,22 +385,22 @@
"nextRecord": "บนทกตอไป", "nextRecord": "บนทกตอไป",
"previousRecord": "บนทกกอนหนา", "previousRecord": "บนทกกอนหนา",
"copyApiURL": "คดลอก URL API", "copyApiURL": "คดลอก URL API",
"createTable": "Create New Table", "createTable": "สรางตารางใหม",
"refreshTable": "รเฟรชตาราง", "refreshTable": "รเฟรชตาราง",
"renameTable": "Rename Table", "renameTable": "เปลยนชอตาราง",
"deleteTable": "Delete Table", "deleteTable": "ลบตาราง",
"addField": "เพมฟลดใหมลงในตารางน", "addField": "เพมฟลดใหมลงในตารางน",
"setDisplay": "Set as Display value", "setDisplay": "งเปนคาแสดง",
"addRow": "เพมแถวใหม", "addRow": "เพมแถวใหม",
"saveRow": "บนทกแถว", "saveRow": "บนทกแถว",
"saveAndExit": "Save & Exit", "saveAndExit": "นทกและออก",
"saveAndStay": "Save & Stay", "saveAndStay": "นทกและอย",
"insertRow": "แทรกแถวใหม", "insertRow": "แทรกแถวใหม",
"duplicateRow": "Duplicate Row", "duplicateRow": "ดลอกแถว",
"deleteRow": "ลบแถว", "deleteRow": "ลบแถว",
"deleteSelectedRow": "ลบแถวทเลอก", "deleteSelectedRow": "ลบแถวทเลอก",
"importExcel": "นำเขา Excel", "importExcel": "นำเขา Excel",
"importCSV": "Import CSV", "importCSV": "นำเข CSV",
"downloadCSV": "ดาวนโหลดเปน CSV", "downloadCSV": "ดาวนโหลดเปน CSV",
"downloadExcel": "ดาวนโหลดเปน XLSX", "downloadExcel": "ดาวนโหลดเปน XLSX",
"uploadCSV": "อปโหลด CSV", "uploadCSV": "อปโหลด CSV",
@ -417,7 +417,7 @@
"listSharedView": "รายการมมมองทใชวมกน", "listSharedView": "รายการมมมองทใชวมกน",
"ListView": "รายการมมมอง", "ListView": "รายการมมมอง",
"copyView": "คดลอกมมมอง", "copyView": "คดลอกมมมอง",
"renameView": "เปลยนช", "renameView": "เปลยนชมมอง",
"deleteView": "ลบมมมอง", "deleteView": "ลบมมมอง",
"createGrid": "สรางมมมองกรด", "createGrid": "สรางมมมองกรด",
"createGallery": "สรางมมมองแกลเลอร", "createGallery": "สรางมมมองแกลเลอร",
@ -429,10 +429,10 @@
"openTab": "เปดแทบใหม", "openTab": "เปดแทบใหม",
"iFrame": "คดลอกรหส HTML ทงได", "iFrame": "คดลอกรหส HTML ทงได",
"addWebhook": "เพม webhook ใหม", "addWebhook": "เพม webhook ใหม",
"enableWebhook": "Enable Webhook", "enableWebhook": "เปดการใชงาน Webhook",
"testWebhook": "Test Webhook", "testWebhook": "ทดสอบ Webhook",
"copyWebhook": "Copy Webhook", "copyWebhook": "ดลอก Webhook",
"deleteWebhook": "Delete Webhook", "deleteWebhook": "ลบ Webhook",
"newToken": "เพมโทเคนใหม", "newToken": "เพมโทเคนใหม",
"exportZip": "สงออกซป", "exportZip": "สงออกซป",
"importZip": "zip นำเขา", "importZip": "zip นำเขา",
@ -445,22 +445,22 @@
"editConnJson": "แกไขการเชอมตอ JSON", "editConnJson": "แกไขการเชอมตอ JSON",
"sponsorUs": "สปอนเซอรสหรฐฯ", "sponsorUs": "สปอนเซอรสหรฐฯ",
"sendEmail": "สงอเมล", "sendEmail": "สงอเมล",
"addUserToProject": "Add user to project", "addUserToProject": "เพมผใชในโครงการ",
"getApiSnippet": "Get API Snippet", "getApiSnippet": "Get API Snippet",
"clearCell": "Clear cell", "clearCell": "Clear cell",
"addFilterGroup": "Add Filter Group", "addFilterGroup": "Add Filter Group",
"linkRecord": "Link record", "linkRecord": "เชอมตาราง",
"addNewRecord": "Add new record", "addNewRecord": "เพมตารางใหม",
"useConnectionUrl": "Use Connection URL", "useConnectionUrl": "Use Connection URL",
"toggleCommentsDraw": "Toggle comments draw", "toggleCommentsDraw": "Toggle comments draw",
"expandRecord": "Expand Record", "expandRecord": "ขยายตาราง",
"deleteRecord": "Delete Record", "deleteRecord": "ลบตาราง",
"erd": { "erd": {
"showColumns": "Show Columns", "showColumns": "Show Columns",
"showPkAndFk": "Show Primary and Foreign Keys", "showPkAndFk": "Show Primary and Foreign Keys",
"showSqlViews": "Show SQL Views", "showSqlViews": "Show SQL Views",
"showMMTables": "Show Many to Many tables", "showMMTables": "แสดงตารางทมพนธแบบกลมตอกล",
"showJunctionTableNames": "Show Junction Table Names" "showJunctionTableNames": "แสดงตารางทเชอมกน 2 ตารางขนไป"
}, },
"kanban": { "kanban": {
"collapseStack": "Collapse Stack", "collapseStack": "Collapse Stack",
@ -646,35 +646,35 @@
"credentials": "Where to find this?" "credentials": "Where to find this?"
}, },
"import": { "import": {
"clickOrDrag": "Click or drag file to this area to upload" "clickOrDrag": "คลกหรอลากไฟลมาทเพออปโหลด"
}, },
"metaDataRecreated": "Table metadata recreated successfully", "metaDataRecreated": "Table metadata recreated successfully",
"invalidCredentials": "Invalid credentials", "invalidCredentials": "Invalid credentials",
"downloadingMoreFiles": "Downloading more files", "downloadingMoreFiles": "Downloading more files",
"copiedToClipboard": "Copied to clipboard", "copiedToClipboard": "ดลอกไปยงคลปบอรดแล",
"requriedFieldsCantBeMoved": "Required field can't be moved", "requriedFieldsCantBeMoved": "Required field can't be moved",
"updateNotAllowedWithoutPK": "Update not allowed for table which doesn't have primary key", "updateNotAllowedWithoutPK": "Update not allowed for table which doesn't have primary key",
"autoIncFieldNotEditable": "Auto increment field is not editable", "autoIncFieldNotEditable": "องตารางทเพมลำดบไดเองแกไขไมได",
"editingPKnotSupported": "Editing primary key not supported", "editingPKnotSupported": "Editing primary key not supported",
"deletedCache": "Deleted cache successfully", "deletedCache": "ลบแคชเรยบรอยแล",
"cacheEmpty": "Cache is empty", "cacheEmpty": "ไมพบแคช",
"exportedCache": "Exported Cache Successfully", "exportedCache": "งออกแคชเรยบรอยแล",
"valueAlreadyInList": "This value is already in the list", "valueAlreadyInList": "This value is already in the list",
"noColumnsToUpdate": "No columns to update", "noColumnsToUpdate": "No columns to update",
"tableDeleted": "Deleted table successfully", "tableDeleted": "ลบตารางสำเร",
"generatePublicShareableReadonlyBase": "Generate publicly shareable readonly base", "generatePublicShareableReadonlyBase": "Generate publicly shareable readonly base",
"deleteViewConfirmation": "Are you sure you want to delete this view?", "deleteViewConfirmation": "Are you sure you want to delete this view?",
"deleteTableConfirmation": "Do you want to delete the table", "deleteTableConfirmation": "ณตองการลบตารางหรอไม",
"showM2mTables": "Show M2M Tables", "showM2mTables": "แสดงตารางทมพนธแบบกลมตอกล",
"showM2mTablesDesc": "Many-to-many relation is supported via a junction table & is hidden by default. Enable this option to list all such tables along with existing tables.", "showM2mTablesDesc": "Many-to-many relation is supported via a junction table & is hidden by default. Enable this option to list all such tables along with existing tables.",
"showNullInCells": "Show NULL in Cells", "showNullInCells": "แสดงคา NULL ในชอง",
"showNullInCellsDesc": "Display 'NULL' tag in cells holding NULL value. This helps differentiate against cells holding EMPTY string.", "showNullInCellsDesc": "แสดงแทก 'NULL' ทาเปน NULL ในชองตาราง ตวเลอกนวยแยกระหวางชองทเปน EMPTY ไดดเจนข",
"showNullAndEmptyInFilter": "Show NULL and EMPTY in Filter", "showNullAndEmptyInFilter": "แสดงคา NULL และ EMPTY ในตวกรอง",
"showNullAndEmptyInFilterDesc": "Enable 'additional' filters to differentiate fields containing NULL & Empty Strings. Default support for Blank treats both NULL & Empty strings alike.", "showNullAndEmptyInFilterDesc": "เปดใชงานฟลเตอร 'เพมเตม' เพอแยกขอมลทเปน NULL และคาตวอกษรวาง ระบบปกตนจดให NULL และ Empty มาเหมอนก",
"deleteKanbanStackConfirmation": "Deleting this stack will also remove the select option `{stackToBeDeleted}` from the `{groupingField}`. The records will move to the uncategorized stack.", "deleteKanbanStackConfirmation": "Deleting this stack will also remove the select option `{stackToBeDeleted}` from the `{groupingField}`. The records will move to the uncategorized stack.",
"computedFieldEditWarning": "Computed field: contents are read-only. Use column edit menu to reconfigure", "computedFieldEditWarning": "Computed field: contents are read-only. Use column edit menu to reconfigure",
"computedFieldDeleteWarning": "Computed field: contents are read-only. Unable to clear content.", "computedFieldDeleteWarning": "Computed field: contents are read-only. Unable to clear content.",
"noMoreRecords": "No more records" "noMoreRecords": "ไมตารางใดๆ"
}, },
"error": { "error": {
"searchProject": "การคนหาของคณสำหรบ {search} ไมพบผลลพธ", "searchProject": "การคนหาของคณสำหรบ {search} ไมพบผลลพธ",
@ -722,7 +722,7 @@
"deleteRowFailed": "Failed to delete row", "deleteRowFailed": "Failed to delete row",
"setFormDataFailed": "Failed to set form data", "setFormDataFailed": "Failed to set form data",
"formViewUpdateFailed": "Failed to update form view", "formViewUpdateFailed": "Failed to update form view",
"tableNameRequired": "Table name is required", "tableNameRequired": "จำเปนตองมอตาราง",
"nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _",
"followingCharactersAreNotAllowed": "Following characters are not allowed", "followingCharactersAreNotAllowed": "Following characters are not allowed",
"columnNameRequired": "Column name is required", "columnNameRequired": "Column name is required",
@ -764,7 +764,7 @@
"pluginUninstalled": "Plugin uninstalled successfully", "pluginUninstalled": "Plugin uninstalled successfully",
"pluginSettingsSaved": "Plugin settings saved successfully", "pluginSettingsSaved": "Plugin settings saved successfully",
"pluginTested": "Successfully tested plugin settings", "pluginTested": "Successfully tested plugin settings",
"tableRenamed": "Table renamed successfully", "tableRenamed": "เปลยนชอตารางสำเร",
"viewDeleted": "View deleted successfully", "viewDeleted": "View deleted successfully",
"primaryColumnUpdated": "Successfully updated as primary column", "primaryColumnUpdated": "Successfully updated as primary column",
"tableDataExported": "Successfully exported all table data", "tableDataExported": "Successfully exported all table data",

8
packages/nocodb/src/controllers/users/users.controller.ts

@ -73,11 +73,15 @@ export class UsersController {
res.json(this.usersService.login(req.user)); res.json(this.usersService.login(req.user));
} }
@UseGuards(GlobalGuard)
@Post('/api/v1/auth/user/signout') @Post('/api/v1/auth/user/signout')
@HttpCode(200) @HttpCode(200)
async signout(@Request() req, @Response() res): Promise<any> { async signOut(@Request() req, @Response() res): Promise<any> {
if (!(req as any).isAuthenticated()) {
NcError.forbidden('Not allowed');
}
res.json( res.json(
await this.usersService.signout({ await this.usersService.signOut({
req, req,
res, res,
}), }),

5
packages/nocodb/src/services/users/users.service.ts

@ -496,13 +496,14 @@ export class UsersService {
}; };
} }
async signout(param: { res: any; req: any }) { async signOut(param: { res: any; req: any }) {
try { try {
param.res.clearCookie('refresh_token'); param.res.clearCookie('refresh_token');
const user = (param.req as any).user; const user = (param.req as any).user;
if (user) { if (user?.id) {
await User.update(user.id, { await User.update(user.id, {
refresh_token: null, refresh_token: null,
token_version: null,
}); });
} }
return { msg: 'Signed out successfully' }; return { msg: 'Signed out successfully' };

Loading…
Cancel
Save