Skip to content

Commit 1fd682b

Browse files
committed
file view app update
1 parent a7ed79f commit 1fd682b

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

app/vue/src/App.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { computed, provide, watch, onMounted } from 'vue'
33
import { useStore } from '@/store'
44
import { useAccount } from '@/store/pinia/account'
55
import { useCompany } from '@/store/pinia/company'
6+
import type { Company } from '@/store/types/settings.ts'
67
78
const accStore = useAccount()
89
const userInfo = computed(() => accStore.userInfo)
@@ -13,7 +14,7 @@ provide('superAuth', superAuth)
1314
provide('workManager', workManager)
1415
1516
const comStore = useCompany()
16-
const company = computed(() => comStore.company)
17+
const company = computed<Company | null>(() => comStore.company)
1718
provide('company', company)
1819
1920
const store = useStore()
@@ -29,7 +30,7 @@ onMounted(() => {
2930
isDark.value
3031
? document.body.classList.add('dark-theme')
3132
: document.body.classList.remove('dark-theme')
32-
if (accStore.isAuthorized) comStore.fetchCompany(company.value?.pk || comStore.initComId)
33+
if (accStore.isAuthorized) comStore.fetchCompany(company.value?.pk ?? comStore.initComId)
3334
})
3435
</script>
3536

app/vue/src/views/_Work/Manages/Projects/components/Repository/components/Tree/GitFileView.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import { inject, onMounted, type PropType, ref, watch } from 'vue'
33
import { bgLight, btnSecondary } from '@/utils/cssMixins.ts'
44
import type { FileInfo } from '@/store/types/work_github.ts'
5-
import { humanizeFileSize } from '@/utils/baseMixins.ts'
5+
import { cutString, humanizeFileSize } from '@/utils/baseMixins.ts'
6+
import sanitizeHtml from 'sanitize-html'
67
import hljs from 'highlight.js'
78
89
const props = defineProps({
@@ -65,7 +66,7 @@ watch(
6566
<CRow class="py-2">
6667
<CCol>
6768
<h5>
68-
<router-link to="">Git 저장소</router-link>
69+
<router-link to="" @click="emit('file-view-close')">Git 저장소</router-link>
6970
/ {{ fileData?.name }}
7071
</h5>
7172
</CCol>
@@ -84,14 +85,16 @@ watch(
8485
<div class="file-viewer">
8586
<table :class="bgLight" style="width: 100%">
8687
<tr>
87-
<td class="py-2 px-5 strong" style="width: 500px">{{ fileData.path }}</td>
88-
<td class="px-5" style="width: 150px">SHA: {{ fileData.sha }}</td>
88+
<td class="py-2 px-5 strong" style="width: 400px">{{ fileData.path }}</td>
89+
<td class="px-5" style="width: 150px">SHA: {{ cutString(fileData.sha, 7) }}</td>
8990
<td class="px-5">Size: {{ humanizeFileSize(fileData.size) }}</td>
9091
</tr>
9192
</table>
92-
<pre v-if="fileData.content" class="code-block">
93-
<code ref="codeBlock" class="language-python">{{ fileData.content }}</code>
94-
</pre>
93+
<pre
94+
v-if="fileData.content"
95+
class="code-block"
96+
><code ref="codeBlock" class="language-python"
97+
v-html="sanitizeHtml(fileData.content)" /></pre>
9598
<p v-else>Loading file...</p>
9699
</div>
97100
</CCol>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy