diff --git a/frontend/src/global/mimetype.ts b/frontend/src/global/mimetype.ts
index 8ac3c7c4e..0f62671fb 100644
--- a/frontend/src/global/mimetype.ts
+++ b/frontend/src/global/mimetype.ts
@@ -19,62 +19,62 @@ export const Mimetypes = new Map([
export const Languages = [
{
label: 'plaintext',
- value: 'plaintext',
+ value: ['txt'],
},
{
label: 'json',
- value: 'json',
- },
- {
- label: 'go',
- value: 'go',
- },
- {
- label: 'html',
- value: 'html',
- },
- {
- label: 'javascript',
- value: 'javascript',
- },
- {
- label: 'java',
- value: 'java',
- },
- {
- label: 'kotlin',
- value: 'kotlin',
+ value: ['json'],
},
{
label: 'markdown',
- value: 'markdown',
- },
- {
- label: 'mysql',
- value: 'mysql',
- },
- {
- label: 'php',
- value: 'php',
- },
- {
- label: 'redis',
- value: 'redis',
- },
- {
- label: 'shell',
- value: 'shell',
- },
- {
- label: 'sql',
- value: 'sql',
+ value: ['md'],
},
{
label: 'yaml',
- value: 'yaml',
+ value: ['yml', 'yaml'],
+ },
+ {
+ label: 'php',
+ value: ['php'],
+ },
+ {
+ label: 'sql',
+ value: ['sql'],
+ },
+ {
+ label: 'go',
+ value: ['go'],
+ },
+ {
+ label: 'html',
+ value: ['html'],
+ },
+ {
+ label: 'javascript',
+ value: ['js'],
+ },
+ {
+ label: 'java',
+ value: ['java'],
+ },
+ {
+ label: 'kotlin',
+ value: ['kt'],
+ },
+ {
+ label: 'python',
+ value: ['py'],
+ },
+ {
+ label: 'redis',
+ value: ['redis'],
+ },
+ {
+ label: 'shell',
+ value: ['sh'],
},
{
label: 'css',
- value: 'css',
+ value: ['css'],
},
];
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 31a3ee18c..7e9767e52 100644
--- a/frontend/src/views/host/file-management/code-editor/index.vue
+++ b/frontend/src/views/host/file-management/code-editor/index.vue
@@ -15,7 +15,7 @@
-
+
diff --git a/frontend/src/views/host/file-management/index.vue b/frontend/src/views/host/file-management/index.vue
index 6519112d6..74bc7024a 100644
--- a/frontend/src/views/host/file-management/index.vue
+++ b/frontend/src/views/host/file-management/index.vue
@@ -454,8 +454,8 @@ const openCodeEditor = (row: File.File) => {
if (row.extension != '') {
Languages.forEach((language) => {
const ext = row.extension.substring(1);
- if (language.value == ext) {
- fileEdit.language = language.value;
+ if (language.value.indexOf(ext) > -1) {
+ fileEdit.language = language.label;
}
});
}