From c332d0284b7fdf0d47d7d1a7d62f3582fd3201c0 Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Mon, 13 Mar 2023 17:00:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=20code-editor=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/global/mimetype.ts | 59 +++++++++++++++++++ frontend/src/lang/modules/en.ts | 2 + frontend/src/lang/modules/zh.ts | 2 + .../file-management/code-editor/index.vue | 53 ++++++++++++++--- .../src/views/host/file-management/index.vue | 29 ++++++--- 5 files changed, 129 insertions(+), 16 deletions(-) diff --git a/frontend/src/global/mimetype.ts b/frontend/src/global/mimetype.ts index 38b3d46b5..327846a60 100644 --- a/frontend/src/global/mimetype.ts +++ b/frontend/src/global/mimetype.ts @@ -15,3 +15,62 @@ export const Mimetypes = new Map([ ['gzip/document', CompressType.TarGz], ['application/x-xz', CompressType.Xz], ]); + +export const Languages = [ + { + label: 'go', + value: 'go', + }, + { + label: 'html', + value: 'html', + }, + { + label: 'javascript', + value: 'javascript', + }, + { + label: 'java', + value: 'java', + }, + { + label: 'kotlin', + value: 'kotlin', + }, + { + label: 'markdown', + value: 'markdown', + }, + { + label: 'mysql', + value: 'mysql', + }, + { + label: 'php', + value: 'php', + }, + { + label: 'redis', + value: 'redis', + }, + { + label: 'shell', + value: 'shell', + }, + { + label: 'sql', + value: 'sql', + }, + { + label: 'yaml', + value: 'yaml', + }, + { + label: 'json', + value: 'json', + }, + { + label: 'css', + value: 'css', + }, +]; diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 0b6b7d395..39c62cab2 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -748,6 +748,8 @@ export default { list: 'File List', sub: 'Include subdirectory', downlodSuccess: 'Download Success', + theme: 'Theme', + language: 'Language', }, setting: { all: 'All', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 710639f34..4568d0ad5 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -755,6 +755,8 @@ export default { list: '文件列表', sub: '包含子目录', downlodSuccess: '下载完成', + theme: '主题', + language: '语言', }, setting: { all: '全部', diff --git a/frontend/src/views/host/file-management/code-editor/index.vue b/frontend/src/views/host/file-management/code-editor/index.vue index db19d8fa7..5cc3c5565 100644 --- a/frontend/src/views/host/file-management/code-editor/index.vue +++ b/frontend/src/views/host/file-management/code-editor/index.vue @@ -6,9 +6,20 @@ destroy-on-close width="70%" @opened="onOpen" - class="coder-dialog" > -
+ + + + + + + + + + + + +