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 */
const signOut: Actions['signOut'] = async () => {
state.token.value = null
state.user.value = null
try {
const nuxtApp = useNuxtApp()
await nuxtApp.$api.auth.signout()
} catch {}
} catch {
} finally {
state.token.value = null
state.user.value = null
}
}
/** Sign in by setting the token in localStorage */

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

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

Loading…
Cancel
Save