feat: add static previews to the room pane
The preview tool could only name a port, so a static build needed a server the terminal had to keep alive. `preview` now accepts a path: the app reads the file or folder over the room's ssh sandbox and serves it from a signed host, with `..` and dotfiles refused and a 16 MiB cap. The target is stored with the room and replayed as a durable event. The pane shows a static path with a reload control and keeps the port field as a local fallback.
This commit is contained in:
1 parent
5be17cf4ef
commit
36de0aace7
20 files changed
+1046
-145
No files matched your search
@@ -1,10 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { Eye, FolderTree, PanelRightClose, Terminal } from 'lucide-vue-next'
|
||||
import type { PreviewTarget } from '~/types'
|
||||
|
||||
type Tab = 'terminal' | 'preview' | 'files'
|
||||
|
||||
defineProps<{ roomId: string; roomName: string }>()
|
||||
defineProps<{ roomId: string; roomName: string; preview: PreviewTarget | null }>()
|
||||
const emit = defineEmits<{ close: [] }>()
|
||||
|
||||
const tab = ref<Tab>('files')
|
||||
@@ -49,7 +50,7 @@ const tabs: Array<{ id: Tab; label: string; icon: typeof Terminal }> = [
|
||||
<div id="pane-panel" class="pane-body" role="tabpanel" :aria-labelledby="`pane-tab-${tab}`">
|
||||
<FilesPane v-if="tab === 'files'" :room-id="roomId" :room-name="roomName" />
|
||||
<TerminalPane v-else-if="tab === 'terminal'" :room-id="roomId" />
|
||||
<PreviewPane v-else :room-id="roomId" />
|
||||
<PreviewPane v-else :room-id="roomId" :target="preview" />
|
||||
</div>
|
||||
</aside>
|
||||
</template>
|
||||
Reference in new issue
Block a user