@l1yp/file-viewer 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +134 -0
- package/dist/FileViewer.js +7 -0
- package/dist/FileViewer.vue.d.ts +37 -0
- package/dist/FileViewer.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/components/AppxViewer.js +7 -0
- package/dist/components/AppxViewer.vue.d.ts +18 -0
- package/dist/components/AppxViewer.vue_vue_type_script_setup_true_lang.js +174 -0
- package/dist/components/ArchiveBrowser.js +7 -0
- package/dist/components/ArchiveBrowser.vue.d.ts +18 -0
- package/dist/components/ArchiveBrowser.vue_vue_type_script_setup_true_lang.js +279 -0
- package/dist/components/AudioViewer.js +7 -0
- package/dist/components/AudioViewer.vue.d.ts +21 -0
- package/dist/components/AudioViewer.vue_vue_type_script_setup_true_lang.js +201 -0
- package/dist/components/BinObjBrowser.js +7 -0
- package/dist/components/BinObjBrowser.vue.d.ts +19 -0
- package/dist/components/BinObjBrowser.vue_vue_type_script_setup_true_lang.js +141 -0
- package/dist/components/CertViewer.js +7 -0
- package/dist/components/CertViewer.vue.d.ts +17 -0
- package/dist/components/CertViewer.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/components/ClassViewer.js +7 -0
- package/dist/components/ClassViewer.vue.d.ts +15 -0
- package/dist/components/ClassViewer.vue_vue_type_script_setup_true_lang.js +164 -0
- package/dist/components/CodeBlock.js +7 -0
- package/dist/components/CodeBlock.vue.d.ts +17 -0
- package/dist/components/CodeBlock.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/CodeView.js +7 -0
- package/dist/components/CodeView.vue.d.ts +21 -0
- package/dist/components/CodeView.vue_vue_type_script_setup_true_lang.js +180 -0
- package/dist/components/CsvViewer.js +7 -0
- package/dist/components/CsvViewer.vue.d.ts +26 -0
- package/dist/components/CsvViewer.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/DicomViewer.js +7 -0
- package/dist/components/DicomViewer.vue.d.ts +30 -0
- package/dist/components/DicomViewer.vue_vue_type_script_setup_true_lang.js +362 -0
- package/dist/components/DocxViewer.js +7 -0
- package/dist/components/DocxViewer.vue.d.ts +19 -0
- package/dist/components/DocxViewer.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/DrawioViewer.js +7 -0
- package/dist/components/DrawioViewer.vue.d.ts +16 -0
- package/dist/components/DrawioViewer.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/components/DxfViewer.js +7 -0
- package/dist/components/DxfViewer.vue.d.ts +14 -0
- package/dist/components/DxfViewer.vue_vue_type_script_setup_true_lang.js +239 -0
- package/dist/components/EbookViewer.js +7 -0
- package/dist/components/EbookViewer.vue.d.ts +22 -0
- package/dist/components/EbookViewer.vue_vue_type_script_setup_true_lang.js +170 -0
- package/dist/components/EmlViewer.js +7 -0
- package/dist/components/EmlViewer.vue.d.ts +21 -0
- package/dist/components/EmlViewer.vue_vue_type_script_setup_true_lang.js +193 -0
- package/dist/components/EplViewer.js +7 -0
- package/dist/components/EplViewer.vue.d.ts +19 -0
- package/dist/components/EplViewer.vue_vue_type_script_setup_true_lang.js +201 -0
- package/dist/components/FileViewerBody.js +7 -0
- package/dist/components/FileViewerBody.vue.d.ts +47 -0
- package/dist/components/FileViewerBody.vue_vue_type_script_setup_true_lang.js +599 -0
- package/dist/components/FileViewerPanel.js +7 -0
- package/dist/components/FileViewerPanel.vue.d.ts +3 -0
- package/dist/components/FileViewerPanel.vue_vue_type_script_setup_true_lang.js +207 -0
- package/dist/components/FontViewer.js +7 -0
- package/dist/components/FontViewer.vue.d.ts +17 -0
- package/dist/components/FontViewer.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/components/FrontmatterCard.js +7 -0
- package/dist/components/FrontmatterCard.vue.d.ts +11 -0
- package/dist/components/FrontmatterCard.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/GeoViewer.js +7 -0
- package/dist/components/GeoViewer.vue.d.ts +17 -0
- package/dist/components/GeoViewer.vue_vue_type_script_setup_true_lang.js +255 -0
- package/dist/components/HarViewer.js +7 -0
- package/dist/components/HarViewer.vue.d.ts +20 -0
- package/dist/components/HarViewer.vue_vue_type_script_setup_true_lang.js +322 -0
- package/dist/components/HexViewer.js +7 -0
- package/dist/components/HexViewer.vue.d.ts +22 -0
- package/dist/components/HexViewer.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/components/HprofViewer.js +7 -0
- package/dist/components/HprofViewer.vue.d.ts +27 -0
- package/dist/components/HprofViewer.vue_vue_type_script_setup_true_lang.js +561 -0
- package/dist/components/ImageLightbox.js +7 -0
- package/dist/components/ImageLightbox.vue.d.ts +3 -0
- package/dist/components/ImageLightbox.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/components/InlineText.d.ts +29 -0
- package/dist/components/InlineText.js +21 -0
- package/dist/components/JksViewer.js +7 -0
- package/dist/components/JksViewer.vue.d.ts +22 -0
- package/dist/components/JksViewer.vue_vue_type_script_setup_true_lang.js +353 -0
- package/dist/components/JsonlViewer.js +7 -0
- package/dist/components/JsonlViewer.vue.d.ts +15 -0
- package/dist/components/JsonlViewer.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/LogViewer.js +7 -0
- package/dist/components/LogViewer.vue.d.ts +29 -0
- package/dist/components/LogViewer.vue_vue_type_script_setup_true_lang.js +670 -0
- package/dist/components/LrcViewer.js +7 -0
- package/dist/components/LrcViewer.vue.d.ts +17 -0
- package/dist/components/LrcViewer.vue_vue_type_script_setup_true_lang.js +106 -0
- package/dist/components/MarkdownTable.js +7 -0
- package/dist/components/MarkdownTable.vue.d.ts +19 -0
- package/dist/components/MarkdownTable.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/components/MarkdownText.d.ts +30 -0
- package/dist/components/MarkdownText.js +21 -0
- package/dist/components/MhtViewer.js +7 -0
- package/dist/components/MhtViewer.vue.d.ts +22 -0
- package/dist/components/MhtViewer.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/components/MindMapView.js +7 -0
- package/dist/components/MindMapView.vue.d.ts +23 -0
- package/dist/components/MindMapView.vue_vue_type_script_setup_true_lang.js +337 -0
- package/dist/components/MissingDependency.js +7 -0
- package/dist/components/MissingDependency.vue.d.ts +17 -0
- package/dist/components/MissingDependency.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/ModelViewer.js +7 -0
- package/dist/components/ModelViewer.vue.d.ts +18 -0
- package/dist/components/ModelViewer.vue_vue_type_script_setup_true_lang.js +157 -0
- package/dist/components/MsiViewer.js +7 -0
- package/dist/components/MsiViewer.vue.d.ts +19 -0
- package/dist/components/MsiViewer.vue_vue_type_script_setup_true_lang.js +136 -0
- package/dist/components/NotebookViewer.js +7 -0
- package/dist/components/NotebookViewer.vue.d.ts +20 -0
- package/dist/components/NotebookViewer.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/components/PdfViewer.js +7 -0
- package/dist/components/PdfViewer.vue.d.ts +19 -0
- package/dist/components/PdfViewer.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/PptxViewer.js +7 -0
- package/dist/components/PptxViewer.vue.d.ts +20 -0
- package/dist/components/PptxViewer.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/components/PsdViewer.js +7 -0
- package/dist/components/PsdViewer.vue.d.ts +15 -0
- package/dist/components/PsdViewer.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/components/QmcAudioViewer.js +7 -0
- package/dist/components/QmcAudioViewer.vue.d.ts +18 -0
- package/dist/components/QmcAudioViewer.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/components/RasterViewer.js +7 -0
- package/dist/components/RasterViewer.vue.d.ts +21 -0
- package/dist/components/RasterViewer.vue_vue_type_script_setup_true_lang.js +161 -0
- package/dist/components/RtfViewer.js +7 -0
- package/dist/components/RtfViewer.vue.d.ts +21 -0
- package/dist/components/RtfViewer.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/components/SevenZipBrowser.js +7 -0
- package/dist/components/SevenZipBrowser.vue.d.ts +13 -0
- package/dist/components/SevenZipBrowser.vue_vue_type_script_setup_true_lang.js +366 -0
- package/dist/components/SqliteViewer.js +7 -0
- package/dist/components/SqliteViewer.vue.d.ts +18 -0
- package/dist/components/SqliteViewer.vue_vue_type_script_setup_true_lang.js +186 -0
- package/dist/components/SubtitleViewer.js +7 -0
- package/dist/components/SubtitleViewer.vue.d.ts +15 -0
- package/dist/components/SubtitleViewer.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/XlsxChart.js +7 -0
- package/dist/components/XlsxChart.vue.d.ts +14 -0
- package/dist/components/XlsxChart.vue_vue_type_script_setup_true_lang.js +240 -0
- package/dist/components/XlsxViewer.js +7 -0
- package/dist/components/XlsxViewer.vue.d.ts +22 -0
- package/dist/components/XlsxViewer.vue_vue_type_script_setup_true_lang.js +814 -0
- package/dist/components/XmindViewer.js +7 -0
- package/dist/components/XmindViewer.vue.d.ts +13 -0
- package/dist/components/XmindViewer.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/ZipBrowser.js +7 -0
- package/dist/components/ZipBrowser.vue.d.ts +14 -0
- package/dist/components/ZipBrowser.vue_vue_type_script_setup_true_lang.js +326 -0
- package/dist/components/ZoomImage.js +7 -0
- package/dist/components/ZoomImage.vue.d.ts +29 -0
- package/dist/components/ZoomImage.vue_vue_type_script_setup_true_lang.js +147 -0
- package/dist/components/epl/EplCodeBlock.js +7 -0
- package/dist/components/epl/EplCodeBlock.vue.d.ts +15 -0
- package/dist/components/epl/EplCodeBlock.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/components/epl/EplDoc.js +7 -0
- package/dist/components/epl/EplDoc.vue.d.ts +19 -0
- package/dist/components/epl/EplDoc.vue_vue_type_script_setup_true_lang.js +327 -0
- package/dist/components/epl/EplMethod.js +7 -0
- package/dist/components/epl/EplMethod.vue.d.ts +14 -0
- package/dist/components/epl/EplMethod.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/epl/EplResource.js +7 -0
- package/dist/components/epl/EplResource.vue.d.ts +15 -0
- package/dist/components/epl/EplResource.vue_vue_type_script_setup_true_lang.js +204 -0
- package/dist/components/epl/EplTree.js +7 -0
- package/dist/components/epl/EplTree.vue.d.ts +27 -0
- package/dist/components/epl/EplTree.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/components/epl/EplVarTable.js +7 -0
- package/dist/components/epl/EplVarTable.vue.d.ts +21 -0
- package/dist/components/epl/EplVarTable.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/epl/docTypes.d.ts +12 -0
- package/dist/components/epl/numbering.d.ts +21 -0
- package/dist/components/epl/numbering.js +14 -0
- package/dist/components/icons/Icon.js +7 -0
- package/dist/components/icons/Icon.vue.d.ts +14 -0
- package/dist/components/icons/Icon.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/icons/iconPaths.d.ts +60 -0
- package/dist/components/icons/iconPaths.js +54 -0
- package/dist/components/optionalViewer.d.ts +14 -0
- package/dist/components/optionalViewer.js +37 -0
- package/dist/components/ui/ClampBlock.d.ts +82 -0
- package/dist/components/ui/ClampBlock.js +63 -0
- package/dist/composables/useFileViewer.d.ts +428 -0
- package/dist/composables/useFileViewer.js +27 -0
- package/dist/composables/useLightbox.d.ts +33 -0
- package/dist/composables/useLightbox.js +17 -0
- package/dist/composables/useLogRules.d.ts +47 -0
- package/dist/composables/useLogRules.js +74 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +30 -0
- package/dist/lib/aes.d.ts +25 -0
- package/dist/lib/aes.js +99 -0
- package/dist/lib/appx.d.ts +66 -0
- package/dist/lib/appx.js +112 -0
- package/dist/lib/archive.d.ts +29 -0
- package/dist/lib/asn1.d.ts +47 -0
- package/dist/lib/asn1.js +122 -0
- package/dist/lib/binobj.d.ts +69 -0
- package/dist/lib/binobj.js +430 -0
- package/dist/lib/brotli.d.ts +14 -0
- package/dist/lib/brotli.js +16 -0
- package/dist/lib/bzip2.d.ts +14 -0
- package/dist/lib/bzip2.js +161 -0
- package/dist/lib/classfile.d.ts +72 -0
- package/dist/lib/classfile.js +210 -0
- package/dist/lib/codePreview.d.ts +22 -0
- package/dist/lib/codePreview.js +27 -0
- package/dist/lib/codefold.d.ts +14 -0
- package/dist/lib/codefold.js +30 -0
- package/dist/lib/codeformat.d.ts +21 -0
- package/dist/lib/codeformat.js +130 -0
- package/dist/lib/csv.d.ts +19 -0
- package/dist/lib/csv.js +74 -0
- package/dist/lib/des.d.ts +17 -0
- package/dist/lib/des.js +928 -0
- package/dist/lib/diagram.d.ts +5 -0
- package/dist/lib/diagram.js +479 -0
- package/dist/lib/dicom.d.ts +69 -0
- package/dist/lib/dicom.js +442 -0
- package/dist/lib/dicomCodecs.d.ts +28 -0
- package/dist/lib/dicomCodecs.js +156 -0
- package/dist/lib/dicomRender.d.ts +46 -0
- package/dist/lib/dicomRender.js +114 -0
- package/dist/lib/dxf.d.ts +86 -0
- package/dist/lib/dxf.js +399 -0
- package/dist/lib/eml.d.ts +40 -0
- package/dist/lib/eml.js +46 -0
- package/dist/lib/encoding.d.ts +28 -0
- package/dist/lib/encoding.js +44 -0
- package/dist/lib/epl/code/ast.d.ts +150 -0
- package/dist/lib/epl/code/codeDataParser.d.ts +3 -0
- package/dist/lib/epl/code/codeDataParser.js +330 -0
- package/dist/lib/epl/code/codeLines.d.ts +20 -0
- package/dist/lib/epl/code/codeLines.js +191 -0
- package/dist/lib/epl/code/structures.d.ts +86 -0
- package/dist/lib/epl/code/textCode.d.ts +29 -0
- package/dist/lib/epl/code/textCode.js +150 -0
- package/dist/lib/epl/code/variable.d.ts +25 -0
- package/dist/lib/epl/eplDocument.d.ts +21 -0
- package/dist/lib/epl/eplDocument.js +36 -0
- package/dist/lib/epl/imageList.d.ts +28 -0
- package/dist/lib/epl/imageList.js +66 -0
- package/dist/lib/epl/index.d.ts +53 -0
- package/dist/lib/epl/index.js +45 -0
- package/dist/lib/epl/io/binaryReader.d.ts +56 -0
- package/dist/lib/epl/io/binaryReader.js +119 -0
- package/dist/lib/epl/io/encoding.d.ts +16 -0
- package/dist/lib/epl/io/encoding.js +27 -0
- package/dist/lib/epl/model/eplSystemId.d.ts +64 -0
- package/dist/lib/epl/model/eplSystemId.js +16 -0
- package/dist/lib/epl/model/section.d.ts +46 -0
- package/dist/lib/epl/names/eplLibData.js +39 -0
- package/dist/lib/epl/names/idToNameMap.d.ts +33 -0
- package/dist/lib/epl/names/idToNameMap.js +130 -0
- package/dist/lib/epl/names/libNameProvider.d.ts +15 -0
- package/dist/lib/epl/names/libNameProvider.js +18 -0
- package/dist/lib/epl/program.d.ts +120 -0
- package/dist/lib/epl/program.js +134 -0
- package/dist/lib/epl/projectFileReader.d.ts +23 -0
- package/dist/lib/epl/projectFileReader.js +65 -0
- package/dist/lib/epl/sections/code.d.ts +20 -0
- package/dist/lib/epl/sections/esystemInfo.d.ts +14 -0
- package/dist/lib/epl/sections/losable.d.ts +11 -0
- package/dist/lib/epl/sections/projectConfig.d.ts +23 -0
- package/dist/lib/epl/sections/resource.d.ts +57 -0
- package/dist/lib/fb2.d.ts +14 -0
- package/dist/lib/fb2.js +62 -0
- package/dist/lib/fileType.d.ts +315 -0
- package/dist/lib/fileType.js +800 -0
- package/dist/lib/fonts.d.ts +8 -0
- package/dist/lib/fonts.js +4 -0
- package/dist/lib/format.d.ts +16 -0
- package/dist/lib/format.js +38 -0
- package/dist/lib/frontmatter.d.ts +13 -0
- package/dist/lib/frontmatter.js +23 -0
- package/dist/lib/geo.d.ts +30 -0
- package/dist/lib/geo.js +235 -0
- package/dist/lib/har.d.ts +171 -0
- package/dist/lib/har.js +397 -0
- package/dist/lib/highlight.d.ts +18 -0
- package/dist/lib/highlight.js +34 -0
- package/dist/lib/highlightLangs.d.ts +15 -0
- package/dist/lib/highlightLangs.js +93 -0
- package/dist/lib/hprof.d.ts +211 -0
- package/dist/lib/hprof.js +709 -0
- package/dist/lib/ipynb.d.ts +48 -0
- package/dist/lib/ipynb.js +130 -0
- package/dist/lib/jks.d.ts +86 -0
- package/dist/lib/jks.js +167 -0
- package/dist/lib/jsonl.d.ts +29 -0
- package/dist/lib/jsonl.js +24 -0
- package/dist/lib/lrc.d.ts +32 -0
- package/dist/lib/lrc.js +84 -0
- package/dist/lib/lzma.d.ts +70 -0
- package/dist/lib/lzma.js +204 -0
- package/dist/lib/markdown/blocks.d.ts +9 -0
- package/dist/lib/markdown/blocks.js +221 -0
- package/dist/lib/markdown/index.d.ts +3 -0
- package/dist/lib/markdown/inline.d.ts +33 -0
- package/dist/lib/markdown/inline.js +84 -0
- package/dist/lib/markdown/math.d.ts +5 -0
- package/dist/lib/markdown/math.js +25 -0
- package/dist/lib/markdown/segmentize.d.ts +11 -0
- package/dist/lib/markdown/segmentize.js +28 -0
- package/dist/lib/markdown/styles.d.ts +26 -0
- package/dist/lib/markdown/styles.js +135 -0
- package/dist/lib/mht.d.ts +51 -0
- package/dist/lib/mht.js +122 -0
- package/dist/lib/midi.d.ts +28 -0
- package/dist/lib/midi.js +84 -0
- package/dist/lib/mime.d.ts +82 -0
- package/dist/lib/mime.js +151 -0
- package/dist/lib/mindmap.d.ts +51 -0
- package/dist/lib/mindmap.js +113 -0
- package/dist/lib/mobi.d.ts +15 -0
- package/dist/lib/mobi.js +68 -0
- package/dist/lib/msi.d.ts +50 -0
- package/dist/lib/msi.js +332 -0
- package/dist/lib/optionalDep.d.ts +26 -0
- package/dist/lib/optionalDep.js +20 -0
- package/dist/lib/pkcs12.d.ts +56 -0
- package/dist/lib/pkcs12.js +356 -0
- package/dist/lib/qmc.d.ts +50 -0
- package/dist/lib/qmc.js +213 -0
- package/dist/lib/rar.d.ts +16 -0
- package/dist/lib/rar.js +40 -0
- package/dist/lib/rawPreview.d.ts +12 -0
- package/dist/lib/rawPreview.js +54 -0
- package/dist/lib/rc2.d.ts +12 -0
- package/dist/lib/rc2.js +298 -0
- package/dist/lib/resolveInput.d.ts +22 -0
- package/dist/lib/resolveInput.js +55 -0
- package/dist/lib/rtf.d.ts +53 -0
- package/dist/lib/rtf.js +413 -0
- package/dist/lib/sevenZip.d.ts +82 -0
- package/dist/lib/sevenZip.js +395 -0
- package/dist/lib/sha1.d.ts +24 -0
- package/dist/lib/sha1.js +53 -0
- package/dist/lib/sha256.d.ts +21 -0
- package/dist/lib/sha256.js +119 -0
- package/dist/lib/speechAudio.d.ts +36 -0
- package/dist/lib/speechAudio.js +85 -0
- package/dist/lib/sqlite.d.ts +38 -0
- package/dist/lib/sqlite.js +104 -0
- package/dist/lib/subtitle.d.ts +26 -0
- package/dist/lib/subtitle.js +99 -0
- package/dist/lib/tarball.d.ts +20 -0
- package/dist/lib/tarball.js +248 -0
- package/dist/lib/viewerFormats.d.ts +35 -0
- package/dist/lib/viewerFormats.js +83 -0
- package/dist/lib/viewerKind.d.ts +36 -0
- package/dist/lib/viewerKind.js +233 -0
- package/dist/lib/x509.d.ts +68 -0
- package/dist/lib/x509.js +267 -0
- package/dist/lib/xlsx.d.ts +55 -0
- package/dist/lib/xlsx.js +321 -0
- package/dist/lib/xlsxCharts.d.ts +34 -0
- package/dist/lib/xlsxCharts.js +152 -0
- package/dist/lib/xmind.d.ts +6 -0
- package/dist/lib/xmind.js +124 -0
- package/dist/lib/zip.d.ts +56 -0
- package/dist/lib/zip.js +169 -0
- package/dist/style.css +2 -0
- package/dist/types.d.ts +42 -0
- package/package.json +128 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { fileExt as e } from "../lib/fileType.js";
|
|
2
|
+
import t from "./MissingDependency.js";
|
|
3
|
+
import { isMissingModule as n } from "../lib/optionalDep.js";
|
|
4
|
+
import { parseGeo as r } from "../lib/geo.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, defineComponent as u, onBeforeUnmount as d, onMounted as f, openBlock as p, ref as m, renderList as h, shallowRef as g, toDisplayString as _, watch as v } from "vue";
|
|
6
|
+
//#region src/components/GeoViewer.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var y = { class: "geo" }, b = { class: "geo__head" }, x = { class: "geo__badge" }, S = { class: "geo__count" }, C = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "geo__chip"
|
|
10
|
+
}, w = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "geo__chip"
|
|
13
|
+
}, T = {
|
|
14
|
+
key: 2,
|
|
15
|
+
class: "geo__chip"
|
|
16
|
+
}, E = { class: "geo__map" }, D = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "geo__empty"
|
|
19
|
+
}, O = {
|
|
20
|
+
key: 2,
|
|
21
|
+
class: "geo__err"
|
|
22
|
+
}, k = {
|
|
23
|
+
key: 3,
|
|
24
|
+
class: "geo__offline"
|
|
25
|
+
}, A = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "geo__list"
|
|
28
|
+
}, ee = ["onClick"], j = { class: "geo__feat-name" }, M = { class: "geo__feat-kind" }, N = "https://tiles.openfreemap.org/styles/liberty", P = /*@__PURE__*/ u({
|
|
29
|
+
__name: "GeoViewer",
|
|
30
|
+
props: {
|
|
31
|
+
text: {},
|
|
32
|
+
name: {}
|
|
33
|
+
},
|
|
34
|
+
setup(u) {
|
|
35
|
+
let P = u, F = {
|
|
36
|
+
version: 8,
|
|
37
|
+
sources: {},
|
|
38
|
+
layers: [{
|
|
39
|
+
id: "bg",
|
|
40
|
+
type: "background",
|
|
41
|
+
paint: { "background-color": "#e6ebf0" }
|
|
42
|
+
}]
|
|
43
|
+
}, I = a(() => r(P.text, e(P.name))), L = {
|
|
44
|
+
geojson: "GeoJSON",
|
|
45
|
+
kml: "KML",
|
|
46
|
+
gpx: "GPX"
|
|
47
|
+
}, R = {
|
|
48
|
+
point: "点",
|
|
49
|
+
line: "线",
|
|
50
|
+
polygon: "面"
|
|
51
|
+
}, z = a(() => {
|
|
52
|
+
let e = [];
|
|
53
|
+
return I.value.features.forEach((t, n) => {
|
|
54
|
+
for (let r of t.geoms) {
|
|
55
|
+
let i = {
|
|
56
|
+
fi: n,
|
|
57
|
+
name: t.name,
|
|
58
|
+
kind: r.kind
|
|
59
|
+
};
|
|
60
|
+
if (r.kind === "point") e.push({
|
|
61
|
+
type: "Feature",
|
|
62
|
+
properties: i,
|
|
63
|
+
geometry: {
|
|
64
|
+
type: "Point",
|
|
65
|
+
coordinates: r.coords[0]
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
else if (r.kind === "line") e.push({
|
|
69
|
+
type: "Feature",
|
|
70
|
+
properties: i,
|
|
71
|
+
geometry: {
|
|
72
|
+
type: "LineString",
|
|
73
|
+
coordinates: r.coords
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
else {
|
|
77
|
+
let t = r.coords.slice(), n = t[0], a = t[t.length - 1];
|
|
78
|
+
n && a && (n[0] !== a[0] || n[1] !== a[1]) && t.push(n), e.push({
|
|
79
|
+
type: "Feature",
|
|
80
|
+
properties: i,
|
|
81
|
+
geometry: {
|
|
82
|
+
type: "Polygon",
|
|
83
|
+
coordinates: [t]
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}), {
|
|
89
|
+
type: "FeatureCollection",
|
|
90
|
+
features: e
|
|
91
|
+
};
|
|
92
|
+
}), B = a(() => z.value.features.length > 0), V = a(() => I.value.features.map((e) => {
|
|
93
|
+
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
94
|
+
for (let a of e.geoms) for (let [e, o] of a.coords) e < t && (t = e), e > r && (r = e), o < n && (n = o), o > i && (i = o);
|
|
95
|
+
return Number.isFinite(t) ? [[t, n], [r, i]] : null;
|
|
96
|
+
})), H = a(() => {
|
|
97
|
+
let e = Infinity, t = Infinity, n = -Infinity, r = -Infinity;
|
|
98
|
+
for (let i of V.value) i && (i[0][0] < e && (e = i[0][0]), i[0][1] < t && (t = i[0][1]), i[1][0] > n && (n = i[1][0]), i[1][1] > r && (r = i[1][1]));
|
|
99
|
+
return Number.isFinite(e) ? [[e, t], [n, r]] : null;
|
|
100
|
+
}), U = a(() => {
|
|
101
|
+
let e = 0, t = 0, n = 0;
|
|
102
|
+
for (let r of z.value.features) r.properties.kind === "point" ? e++ : r.properties.kind === "line" ? t++ : n++;
|
|
103
|
+
return {
|
|
104
|
+
features: I.value.features.length,
|
|
105
|
+
point: e,
|
|
106
|
+
line: t,
|
|
107
|
+
polygon: n
|
|
108
|
+
};
|
|
109
|
+
}), W = a(() => I.value.features.map((e) => {
|
|
110
|
+
let t = new Set(e.geoms.map((e) => R[e.kind]));
|
|
111
|
+
return Array.from(t).join("/");
|
|
112
|
+
})), G = m(null), K = g(null), q = m(""), J = m(null), Y = m(!1), X = null, Z;
|
|
113
|
+
function Q(e, t) {
|
|
114
|
+
!K.value || !e || K.value.fitBounds(e, {
|
|
115
|
+
padding: 44,
|
|
116
|
+
maxZoom: 15,
|
|
117
|
+
animate: t,
|
|
118
|
+
duration: 500
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function $() {
|
|
122
|
+
let e = K.value;
|
|
123
|
+
if (!(!e || !e.isStyleLoaded() || e.getSource("geo"))) {
|
|
124
|
+
clearTimeout(Z), e.addSource("geo", {
|
|
125
|
+
type: "geojson",
|
|
126
|
+
data: z.value
|
|
127
|
+
}), e.addLayer({
|
|
128
|
+
id: "geo-fill",
|
|
129
|
+
type: "fill",
|
|
130
|
+
source: "geo",
|
|
131
|
+
filter: [
|
|
132
|
+
"==",
|
|
133
|
+
["get", "kind"],
|
|
134
|
+
"polygon"
|
|
135
|
+
],
|
|
136
|
+
paint: {
|
|
137
|
+
"fill-color": "#3b82f6",
|
|
138
|
+
"fill-opacity": .25,
|
|
139
|
+
"fill-outline-color": "#2563eb"
|
|
140
|
+
}
|
|
141
|
+
}), e.addLayer({
|
|
142
|
+
id: "geo-line",
|
|
143
|
+
type: "line",
|
|
144
|
+
source: "geo",
|
|
145
|
+
filter: [
|
|
146
|
+
"==",
|
|
147
|
+
["get", "kind"],
|
|
148
|
+
"line"
|
|
149
|
+
],
|
|
150
|
+
paint: {
|
|
151
|
+
"line-color": "#e8590c",
|
|
152
|
+
"line-width": 3,
|
|
153
|
+
"line-opacity": .9
|
|
154
|
+
},
|
|
155
|
+
layout: {
|
|
156
|
+
"line-join": "round",
|
|
157
|
+
"line-cap": "round"
|
|
158
|
+
}
|
|
159
|
+
}), e.addLayer({
|
|
160
|
+
id: "geo-point",
|
|
161
|
+
type: "circle",
|
|
162
|
+
source: "geo",
|
|
163
|
+
filter: [
|
|
164
|
+
"==",
|
|
165
|
+
["get", "kind"],
|
|
166
|
+
"point"
|
|
167
|
+
],
|
|
168
|
+
paint: {
|
|
169
|
+
"circle-radius": 6,
|
|
170
|
+
"circle-color": "#d6336c",
|
|
171
|
+
"circle-stroke-color": "#ffffff",
|
|
172
|
+
"circle-stroke-width": 2
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
for (let t of [
|
|
176
|
+
"geo-fill",
|
|
177
|
+
"geo-line",
|
|
178
|
+
"geo-point"
|
|
179
|
+
]) e.on("click", t, (t) => {
|
|
180
|
+
let n = (t.features?.[0])?.properties?.name || "";
|
|
181
|
+
n && X && new X.Popup({ closeButton: !1 }).setLngLat(t.lngLat).setText(n).addTo(e);
|
|
182
|
+
}), e.on("mouseenter", t, () => e.getCanvas().style.cursor = "pointer"), e.on("mouseleave", t, () => e.getCanvas().style.cursor = "");
|
|
183
|
+
Q(H.value, !1);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
f(async () => {
|
|
187
|
+
if (!G.value) return;
|
|
188
|
+
try {
|
|
189
|
+
X = await import("maplibre-gl"), await import("maplibre-gl/dist/maplibre-gl.css");
|
|
190
|
+
} catch (e) {
|
|
191
|
+
n(e) ? J.value = ["maplibre-gl"] : q.value = "地图库加载失败";
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
let e = H.value, t = new X.Map({
|
|
195
|
+
container: G.value,
|
|
196
|
+
style: N,
|
|
197
|
+
center: e ? [(e[0][0] + e[1][0]) / 2, (e[0][1] + e[1][1]) / 2] : [0, 20],
|
|
198
|
+
zoom: e ? 4 : 1,
|
|
199
|
+
attributionControl: { compact: !0 }
|
|
200
|
+
});
|
|
201
|
+
K.value = t, t.addControl(new X.NavigationControl({ showCompass: !1 }), "top-right"), t.on("load", $), t.on("styledata", $), t.on("error", () => {
|
|
202
|
+
t.getSource("geo") || (Y.value = !0);
|
|
203
|
+
}), Z = setTimeout(() => {
|
|
204
|
+
!K.value || K.value.getSource("geo") || (Y.value = !0, K.value.setStyle(F));
|
|
205
|
+
}, 6e3);
|
|
206
|
+
}), v(z, (e) => {
|
|
207
|
+
let t = K.value;
|
|
208
|
+
if (!t) return;
|
|
209
|
+
let n = t.getSource("geo");
|
|
210
|
+
n && "setData" in n && (n.setData(e), Q(H.value, !1));
|
|
211
|
+
}), d(() => {
|
|
212
|
+
clearTimeout(Z), K.value?.remove(), K.value = null;
|
|
213
|
+
});
|
|
214
|
+
function te(e) {
|
|
215
|
+
let t = V.value[e], n = K.value;
|
|
216
|
+
!t || !n || (t[0][0] === t[1][0] && t[0][1] === t[1][1] ? n.flyTo({
|
|
217
|
+
center: t[0],
|
|
218
|
+
zoom: 14,
|
|
219
|
+
duration: 500
|
|
220
|
+
}) : Q(t, !0));
|
|
221
|
+
}
|
|
222
|
+
return (e, n) => (p(), c("div", y, [
|
|
223
|
+
l("div", b, [
|
|
224
|
+
l("span", x, _(L[I.value.format] ?? I.value.format), 1),
|
|
225
|
+
l("span", S, _(U.value.features) + " 个要素", 1),
|
|
226
|
+
U.value.point ? (p(), c("span", C, "点 " + _(U.value.point), 1)) : s("", !0),
|
|
227
|
+
U.value.line ? (p(), c("span", w, "线 " + _(U.value.line), 1)) : s("", !0),
|
|
228
|
+
U.value.polygon ? (p(), c("span", T, "面 " + _(U.value.polygon), 1)) : s("", !0),
|
|
229
|
+
B.value ? (p(), c("button", {
|
|
230
|
+
key: 3,
|
|
231
|
+
type: "button",
|
|
232
|
+
class: "geo__reset",
|
|
233
|
+
onClick: n[0] ||= (e) => Q(H.value, !0)
|
|
234
|
+
}, " 重置视图 ")) : s("", !0)
|
|
235
|
+
]),
|
|
236
|
+
l("div", E, [J.value ? (p(), o(t, {
|
|
237
|
+
key: 0,
|
|
238
|
+
pkg: J.value,
|
|
239
|
+
label: "地图"
|
|
240
|
+
}, null, 8, ["pkg"])) : (p(), c(i, { key: 1 }, [B.value ? (p(), c("div", {
|
|
241
|
+
key: 0,
|
|
242
|
+
ref_key: "mapEl",
|
|
243
|
+
ref: G,
|
|
244
|
+
class: "geo__canvas"
|
|
245
|
+
}, null, 512)) : (p(), c("p", D, "未解析到几何要素(可切换到「源码」查看原始内容)。")), q.value ? (p(), c("div", O, _(q.value), 1)) : Y.value ? (p(), c("div", k, " 底图瓦片不可达(离线?),仅显示数据 ")) : s("", !0)], 64))]),
|
|
246
|
+
B.value ? (p(), c("ul", A, [(p(!0), c(i, null, h(I.value.features, (e, t) => (p(), c("li", { key: t }, [l("button", {
|
|
247
|
+
type: "button",
|
|
248
|
+
class: "geo__feat",
|
|
249
|
+
onClick: (e) => te(t)
|
|
250
|
+
}, [l("span", j, _(e.name || `要素 #${t + 1}`), 1), l("span", M, _(W.value[t]), 1)], 8, ee)]))), 128))])) : s("", !0)
|
|
251
|
+
]));
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
//#endregion
|
|
255
|
+
export { P as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./HarViewer.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/HarViewer.vue
|
|
5
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-4b79eb8b"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Side-viewer HAR (`.har`) renderer. Fetches the archive text and parses the HTTP Archive entirely in-browser
|
|
3
|
+
* (hand-rolled, see lib/har.ts) — no third-party. Lays out a master-detail vertical split tuned for the narrow
|
|
4
|
+
* side pane: a filterable request list on top, and the selected request's detail (general / headers / query /
|
|
5
|
+
* cookies / request + response body) below. Bodies are decoded (standard base64 + the «base64 but undeclared»
|
|
6
|
+
* case some tools emit); images preview from a data URI, binaries show a hex dump.
|
|
7
|
+
*
|
|
8
|
+
* Safety: a HAR body is untrusted upstream content. We never execute it — text bodies render as escaped,
|
|
9
|
+
* optionally syntax-highlighted source; image bodies render through a data-URI `<img>` (an `<img>` never runs
|
|
10
|
+
* scripts, so even an SVG body is inert). No body is fetched as a live resource.
|
|
11
|
+
*/
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
/** Download URL of the .har bytes. */
|
|
14
|
+
url?: string;
|
|
15
|
+
name: string;
|
|
16
|
+
size?: number;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { formatBytes as e } from "../lib/format.js";
|
|
2
|
+
import { highlightCode as t } from "../lib/highlight.js";
|
|
3
|
+
import { decodeContent as n, decodePostData as r, fmtMs as i, fmtSize as a, parseHar as ee, parseQuery as te, prettyBody as ne, statusClass as re, toCurl as ie } from "../lib/har.js";
|
|
4
|
+
import { Fragment as o, computed as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, defineComponent as f, normalizeClass as p, onBeforeUnmount as m, openBlock as h, ref as g, renderList as _, toDisplayString as v, unref as y, vModelText as ae, watch as oe, withDirectives as se } from "vue";
|
|
5
|
+
//#region src/components/HarViewer.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var ce = { class: "har" }, le = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "har__msg"
|
|
9
|
+
}, ue = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "har__msg har__gate"
|
|
12
|
+
}, de = {
|
|
13
|
+
key: 2,
|
|
14
|
+
class: "har__msg har__msg--error"
|
|
15
|
+
}, fe = { class: "har__bar" }, pe = { class: "har__cats" }, me = ["onClick"], he = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "har__empty"
|
|
18
|
+
}, ge = ["title", "onClick"], _e = { class: "har__name" }, ve = { class: "har__name-main" }, ye = { class: "har__name-sub" }, be = { class: "har__type" }, xe = { class: "har__size" }, b = { class: "har__time" }, x = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "har__detail"
|
|
21
|
+
}, S = { class: "har__tabs" }, C = { class: "har__tab-n" }, w = { class: "har__tab-n" }, T = { class: "har__tab-n" }, E = { class: "har__pane" }, D = { class: "har__kv" }, O = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "har__kv har__kv--mono"
|
|
24
|
+
}, k = {
|
|
25
|
+
key: 2,
|
|
26
|
+
class: "har__kv har__kv--mono"
|
|
27
|
+
}, A = {
|
|
28
|
+
key: 3,
|
|
29
|
+
class: "har__kv har__kv--mono"
|
|
30
|
+
}, j = { class: "har__kv har__kv--mono" }, M = { class: "har__kv har__kv--mono" }, Se = {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: "har__kv har__kv--mono"
|
|
33
|
+
}, Ce = { class: "har__bodybar" }, we = { class: "har__bodymime" }, Te = { class: "har__body" }, Ee = ["innerHTML"], De = { class: "har__bodybar" }, Oe = { class: "har__bodymime" }, ke = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "har__b64"
|
|
36
|
+
}, Ae = {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: "har__img"
|
|
39
|
+
}, je = ["src", "alt"], Me = {
|
|
40
|
+
key: 1,
|
|
41
|
+
class: "har__body"
|
|
42
|
+
}, Ne = ["innerHTML"], Pe = 25 * 1024 * 1024, N = /*@__PURE__*/ f({
|
|
43
|
+
__name: "HarViewer",
|
|
44
|
+
props: {
|
|
45
|
+
url: {},
|
|
46
|
+
name: {},
|
|
47
|
+
size: {}
|
|
48
|
+
},
|
|
49
|
+
setup(f) {
|
|
50
|
+
let N = f, P = g("loading"), F = g(""), I = g(null), L = g(null), R = g(""), z = g("general"), B = {
|
|
51
|
+
doc: "文档",
|
|
52
|
+
xhr: "XHR",
|
|
53
|
+
js: "JS",
|
|
54
|
+
css: "CSS",
|
|
55
|
+
img: "图片",
|
|
56
|
+
font: "字体",
|
|
57
|
+
media: "媒体",
|
|
58
|
+
ws: "WS",
|
|
59
|
+
other: "其它"
|
|
60
|
+
}, V = g("all"), Fe = s(() => {
|
|
61
|
+
let e = /* @__PURE__ */ new Set();
|
|
62
|
+
for (let t of I.value?.entries ?? []) e.add(t.category);
|
|
63
|
+
return Object.keys(B).filter((t) => e.has(t));
|
|
64
|
+
}), H = s(() => {
|
|
65
|
+
let e = I.value?.entries ?? [], t = R.value.trim().toLowerCase(), n = V.value;
|
|
66
|
+
return e.filter((e) => n !== "all" && e.category !== n ? !1 : t ? e.url.toLowerCase().includes(t) || e.method.toLowerCase().includes(t) || String(e.status).includes(t) || e.type.toLowerCase().includes(t) : !0);
|
|
67
|
+
});
|
|
68
|
+
function Ie(e) {
|
|
69
|
+
return e.pathname.split("/").filter(Boolean).pop() || e.host || e.pathname || e.url;
|
|
70
|
+
}
|
|
71
|
+
function Le(e) {
|
|
72
|
+
L.value = e, z.value = "general";
|
|
73
|
+
}
|
|
74
|
+
async function U() {
|
|
75
|
+
if (N.url) {
|
|
76
|
+
P.value = "loading", F.value = "", L.value = null;
|
|
77
|
+
try {
|
|
78
|
+
let e = await fetch(N.url);
|
|
79
|
+
if (!e.ok) throw Error(`HTTP ${e.status}`);
|
|
80
|
+
let t = ee(await e.text());
|
|
81
|
+
I.value = {
|
|
82
|
+
entries: t.entries,
|
|
83
|
+
creator: t.creator,
|
|
84
|
+
version: t.version
|
|
85
|
+
}, P.value = "ready";
|
|
86
|
+
} catch (e) {
|
|
87
|
+
F.value = e instanceof Error ? e.message : String(e), P.value = "error";
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function Re() {
|
|
92
|
+
if (N.size && N.size > Pe) {
|
|
93
|
+
P.value = "gate";
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
U();
|
|
97
|
+
}
|
|
98
|
+
oe(() => N.url, Re, { immediate: !0 });
|
|
99
|
+
let W = s(() => L.value?.raw.request.headers ?? []), G = s(() => L.value?.raw.response.headers ?? []), K = s(() => {
|
|
100
|
+
let e = L.value;
|
|
101
|
+
if (!e) return [];
|
|
102
|
+
let t = e.raw.request.queryString;
|
|
103
|
+
if (t.length) return t;
|
|
104
|
+
let n = e.url.indexOf("?");
|
|
105
|
+
return n >= 0 ? te(e.url.slice(n)) : [];
|
|
106
|
+
}), q = s(() => {
|
|
107
|
+
let e = L.value;
|
|
108
|
+
return e ? {
|
|
109
|
+
req: e.raw.request.cookies,
|
|
110
|
+
res: e.raw.response.cookies
|
|
111
|
+
} : {
|
|
112
|
+
req: [],
|
|
113
|
+
res: []
|
|
114
|
+
};
|
|
115
|
+
}), ze = s(() => q.value.req.length + q.value.res.length > 0), J = s(() => {
|
|
116
|
+
let e = L.value;
|
|
117
|
+
if (!e) return null;
|
|
118
|
+
let t = r(e.raw.request.postData, "auto");
|
|
119
|
+
return t.kind === "empty" ? null : t;
|
|
120
|
+
}), Y = s(() => {
|
|
121
|
+
let e = L.value;
|
|
122
|
+
if (!e) return null;
|
|
123
|
+
let t = n(e.raw.response.content, "auto");
|
|
124
|
+
return t.kind === "empty" ? null : t;
|
|
125
|
+
}), Be = s(() => {
|
|
126
|
+
let e = L.value;
|
|
127
|
+
if (!e) return [];
|
|
128
|
+
let t = e.raw, n = [
|
|
129
|
+
{
|
|
130
|
+
name: "请求 URL",
|
|
131
|
+
value: e.url
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "方法",
|
|
135
|
+
value: e.method
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "状态",
|
|
139
|
+
value: e.status ? `${e.status} ${e.statusText}`.trim() : "(无响应)"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "协议",
|
|
143
|
+
value: t.response.httpVersion || t.request.httpVersion || ""
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "远端 IP",
|
|
147
|
+
value: e.serverIP
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "响应类型",
|
|
151
|
+
value: e.mime || ""
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "响应大小",
|
|
155
|
+
value: a(e.size)
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "请求体大小",
|
|
159
|
+
value: e.reqSize ? a(e.reqSize) : ""
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "耗时",
|
|
163
|
+
value: i(e.time)
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "开始时间",
|
|
167
|
+
value: e.startedISO
|
|
168
|
+
}
|
|
169
|
+
];
|
|
170
|
+
return t.response.redirectURL && n.push({
|
|
171
|
+
name: "重定向",
|
|
172
|
+
value: t.response.redirectURL
|
|
173
|
+
}), n.filter((e) => e.value);
|
|
174
|
+
});
|
|
175
|
+
function X(e) {
|
|
176
|
+
let { text: n, pretty: r } = ne(e.text, e.mime), i = r ? "json" : Ve(e.mime);
|
|
177
|
+
return i ? t(n, i) : He(n);
|
|
178
|
+
}
|
|
179
|
+
function Ve(e) {
|
|
180
|
+
let t = e.toLowerCase();
|
|
181
|
+
return t.includes("javascript") || t.includes("ecmascript") ? "javascript" : t === "text/css" ? "css" : t === "text/html" || t.includes("xhtml") ? "xml" : t.includes("json") ? "json" : t.includes("svg") || t.includes("xml") ? "xml" : "";
|
|
182
|
+
}
|
|
183
|
+
function He(e) {
|
|
184
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
185
|
+
}
|
|
186
|
+
let Z = g(""), Q;
|
|
187
|
+
async function $(e, t) {
|
|
188
|
+
try {
|
|
189
|
+
await navigator.clipboard?.writeText(e);
|
|
190
|
+
} catch {}
|
|
191
|
+
Z.value = t, clearTimeout(Q), Q = setTimeout(() => Z.value = "", 1400);
|
|
192
|
+
}
|
|
193
|
+
function Ue() {
|
|
194
|
+
L.value && $(ie(L.value), "curl");
|
|
195
|
+
}
|
|
196
|
+
return m(() => clearTimeout(Q)), (t, n) => (h(), l("div", ce, [P.value === "loading" ? (h(), l("p", le, "正在解析 HAR…")) : P.value === "gate" ? (h(), l("div", ue, [u("p", null, "该 HAR 较大(" + v(y(e)(N.size)) + "),将在浏览器内解析。是否继续?", 1), u("button", {
|
|
197
|
+
type: "button",
|
|
198
|
+
class: "har__btn",
|
|
199
|
+
onClick: U
|
|
200
|
+
}, "解析并预览")])) : P.value === "error" ? (h(), l("div", de, [u("p", null, "解析失败:" + v(F.value), 1), u("button", {
|
|
201
|
+
type: "button",
|
|
202
|
+
class: "har__btn",
|
|
203
|
+
onClick: U
|
|
204
|
+
}, "重试")])) : P.value === "ready" && I.value ? (h(), l(o, { key: 3 }, [
|
|
205
|
+
u("div", fe, [se(u("input", {
|
|
206
|
+
"onUpdate:modelValue": n[0] ||= (e) => R.value = e,
|
|
207
|
+
class: "har__filter",
|
|
208
|
+
type: "text",
|
|
209
|
+
placeholder: "筛选 URL / 方法 / 状态…"
|
|
210
|
+
}, null, 512), [[ae, R.value]]), u("div", pe, [u("button", {
|
|
211
|
+
type: "button",
|
|
212
|
+
class: p(["har__cat", { "har__cat--on": V.value === "all" }]),
|
|
213
|
+
onClick: n[1] ||= (e) => V.value = "all"
|
|
214
|
+
}, " 全部 " + v(I.value.entries.length), 3), (h(!0), l(o, null, _(Fe.value, (e) => (h(), l("button", {
|
|
215
|
+
key: e,
|
|
216
|
+
type: "button",
|
|
217
|
+
class: p(["har__cat", [`har__cat--${e}`, { "har__cat--on": V.value === e }]]),
|
|
218
|
+
onClick: (t) => V.value = e
|
|
219
|
+
}, v(B[e]), 11, me))), 128))])]),
|
|
220
|
+
u("div", { class: p(["har__list", { "har__list--split": L.value }]) }, [H.value.length ? c("", !0) : (h(), l("p", he, "没有匹配的请求。")), (h(!0), l(o, null, _(H.value, (e) => (h(), l("button", {
|
|
221
|
+
key: e.index,
|
|
222
|
+
type: "button",
|
|
223
|
+
class: p(["har__row", { "har__row--on": L.value?.index === e.index }]),
|
|
224
|
+
title: e.url,
|
|
225
|
+
onClick: (t) => Le(e)
|
|
226
|
+
}, [
|
|
227
|
+
u("span", { class: p(["har__method", `m-${e.method.toLowerCase()}`]) }, v(e.method), 3),
|
|
228
|
+
u("span", { class: p(["har__status", y(re)(e.status)]) }, v(e.status || "—"), 3),
|
|
229
|
+
u("span", _e, [u("span", ve, v(Ie(e)), 1), u("span", ye, v(e.host), 1)]),
|
|
230
|
+
u("span", be, v(e.type), 1),
|
|
231
|
+
u("span", xe, v(y(a)(e.size)), 1),
|
|
232
|
+
u("span", b, v(y(i)(e.time)), 1)
|
|
233
|
+
], 10, ge))), 128))], 2),
|
|
234
|
+
L.value ? (h(), l("section", x, [u("div", S, [
|
|
235
|
+
u("button", {
|
|
236
|
+
type: "button",
|
|
237
|
+
class: p(["har__tab", { "har__tab--on": z.value === "general" }]),
|
|
238
|
+
onClick: n[2] ||= (e) => z.value = "general"
|
|
239
|
+
}, " 概览 ", 2),
|
|
240
|
+
u("button", {
|
|
241
|
+
type: "button",
|
|
242
|
+
class: p(["har__tab", { "har__tab--on": z.value === "reqHeaders" }]),
|
|
243
|
+
onClick: n[3] ||= (e) => z.value = "reqHeaders"
|
|
244
|
+
}, [n[11] ||= d(" 请求头 ", -1), u("span", C, v(W.value.length), 1)], 2),
|
|
245
|
+
u("button", {
|
|
246
|
+
type: "button",
|
|
247
|
+
class: p(["har__tab", { "har__tab--on": z.value === "resHeaders" }]),
|
|
248
|
+
onClick: n[4] ||= (e) => z.value = "resHeaders"
|
|
249
|
+
}, [n[12] ||= d(" 响应头 ", -1), u("span", w, v(G.value.length), 1)], 2),
|
|
250
|
+
K.value.length ? (h(), l("button", {
|
|
251
|
+
key: 0,
|
|
252
|
+
type: "button",
|
|
253
|
+
class: p(["har__tab", { "har__tab--on": z.value === "query" }]),
|
|
254
|
+
onClick: n[5] ||= (e) => z.value = "query"
|
|
255
|
+
}, [n[13] ||= d(" 查询 ", -1), u("span", T, v(K.value.length), 1)], 2)) : c("", !0),
|
|
256
|
+
ze.value ? (h(), l("button", {
|
|
257
|
+
key: 1,
|
|
258
|
+
type: "button",
|
|
259
|
+
class: p(["har__tab", { "har__tab--on": z.value === "cookies" }]),
|
|
260
|
+
onClick: n[6] ||= (e) => z.value = "cookies"
|
|
261
|
+
}, " Cookie ", 2)) : c("", !0),
|
|
262
|
+
J.value ? (h(), l("button", {
|
|
263
|
+
key: 2,
|
|
264
|
+
type: "button",
|
|
265
|
+
class: p(["har__tab", { "har__tab--on": z.value === "reqBody" }]),
|
|
266
|
+
onClick: n[7] ||= (e) => z.value = "reqBody"
|
|
267
|
+
}, " 请求体 ", 2)) : c("", !0),
|
|
268
|
+
Y.value ? (h(), l("button", {
|
|
269
|
+
key: 3,
|
|
270
|
+
type: "button",
|
|
271
|
+
class: p(["har__tab", { "har__tab--on": z.value === "resBody" }]),
|
|
272
|
+
onClick: n[8] ||= (e) => z.value = "resBody"
|
|
273
|
+
}, " 响应体 ", 2)) : c("", !0)
|
|
274
|
+
]), u("div", E, [z.value === "general" ? (h(), l(o, { key: 0 }, [u("dl", D, [(h(!0), l(o, null, _(Be.value, (e) => (h(), l("div", {
|
|
275
|
+
key: e.name,
|
|
276
|
+
class: "har__kv-row"
|
|
277
|
+
}, [u("dt", null, v(e.name), 1), u("dd", null, v(e.value), 1)]))), 128))]), u("button", {
|
|
278
|
+
type: "button",
|
|
279
|
+
class: "har__btn har__btn--sm",
|
|
280
|
+
onClick: Ue
|
|
281
|
+
}, v(Z.value === "curl" ? "已复制" : "复制为 cURL"), 1)], 64)) : z.value === "reqHeaders" ? (h(), l("dl", O, [(h(!0), l(o, null, _(W.value, (e, t) => (h(), l("div", {
|
|
282
|
+
key: t,
|
|
283
|
+
class: "har__kv-row"
|
|
284
|
+
}, [u("dt", null, v(e.name), 1), u("dd", null, v(e.value), 1)]))), 128))])) : z.value === "resHeaders" ? (h(), l("dl", k, [(h(!0), l(o, null, _(G.value, (e, t) => (h(), l("div", {
|
|
285
|
+
key: t,
|
|
286
|
+
class: "har__kv-row"
|
|
287
|
+
}, [u("dt", null, v(e.name), 1), u("dd", null, v(e.value), 1)]))), 128))])) : z.value === "query" ? (h(), l("dl", A, [(h(!0), l(o, null, _(K.value, (e, t) => (h(), l("div", {
|
|
288
|
+
key: t,
|
|
289
|
+
class: "har__kv-row"
|
|
290
|
+
}, [u("dt", null, v(e.name), 1), u("dd", null, v(e.value), 1)]))), 128))])) : z.value === "cookies" ? (h(), l(o, { key: 4 }, [q.value.req.length ? (h(), l(o, { key: 0 }, [n[14] ||= u("h4", { class: "har__sub" }, "请求 Cookie", -1), u("dl", j, [(h(!0), l(o, null, _(q.value.req, (e, t) => (h(), l("div", {
|
|
291
|
+
key: t,
|
|
292
|
+
class: "har__kv-row"
|
|
293
|
+
}, [u("dt", null, v(e.name), 1), u("dd", null, v(e.value), 1)]))), 128))])], 64)) : c("", !0), q.value.res.length ? (h(), l(o, { key: 1 }, [n[15] ||= u("h4", { class: "har__sub" }, "响应 Set-Cookie", -1), u("dl", M, [(h(!0), l(o, null, _(q.value.res, (e, t) => (h(), l("div", {
|
|
294
|
+
key: t,
|
|
295
|
+
class: "har__kv-row"
|
|
296
|
+
}, [u("dt", null, v(e.name), 1), u("dd", null, v(e.value), 1)]))), 128))])], 64)) : c("", !0)], 64)) : z.value === "reqBody" && J.value ? (h(), l(o, { key: 5 }, [J.value.kind === "form" && J.value.form ? (h(), l("dl", Se, [(h(!0), l(o, null, _(J.value.form, (e, t) => (h(), l("div", {
|
|
297
|
+
key: t,
|
|
298
|
+
class: "har__kv-row"
|
|
299
|
+
}, [u("dt", null, v(e.name), 1), u("dd", null, v(e.value), 1)]))), 128))])) : (h(), l(o, { key: 1 }, [u("div", Ce, [u("span", we, v(J.value.mime || "文本") + " · " + v(y(a)(J.value.size)), 1), u("button", {
|
|
300
|
+
type: "button",
|
|
301
|
+
class: "har__btn har__btn--sm",
|
|
302
|
+
onClick: n[9] ||= (e) => $(J.value.text, "reqBody")
|
|
303
|
+
}, v(Z.value === "reqBody" ? "已复制" : "复制"), 1)]), u("pre", Te, [u("code", {
|
|
304
|
+
class: "hljs",
|
|
305
|
+
innerHTML: X(J.value)
|
|
306
|
+
}, null, 8, Ee)])], 64))], 64)) : z.value === "resBody" && Y.value ? (h(), l(o, { key: 6 }, [u("div", De, [u("span", Oe, [d(v(Y.value.mime || "文本") + " · " + v(y(a)(Y.value.size)) + " ", 1), Y.value.wasBase64 ? (h(), l("span", ke, "base64 已解码")) : c("", !0)]), Y.value.isImage ? c("", !0) : (h(), l("button", {
|
|
307
|
+
key: 0,
|
|
308
|
+
type: "button",
|
|
309
|
+
class: "har__btn har__btn--sm",
|
|
310
|
+
onClick: n[10] ||= (e) => $(Y.value.text, "resBody")
|
|
311
|
+
}, v(Z.value === "resBody" ? "已复制" : "复制"), 1))]), Y.value.isImage ? (h(), l("div", Ae, [u("img", {
|
|
312
|
+
src: Y.value.dataUri,
|
|
313
|
+
alt: L.value.url
|
|
314
|
+
}, null, 8, je)])) : (h(), l("pre", Me, [u("code", {
|
|
315
|
+
class: "hljs",
|
|
316
|
+
innerHTML: X(Y.value)
|
|
317
|
+
}, null, 8, Ne)]))], 64)) : c("", !0)])])) : c("", !0)
|
|
318
|
+
], 64)) : c("", !0)]));
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
//#endregion
|
|
322
|
+
export { N as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./HexViewer.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/HexViewer.vue
|
|
5
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-6866d481"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Side-viewer hex dump: fetch a file's raw bytes and render them as the classic three columns — an offset
|
|
3
|
+
* gutter, 16 bytes per row in hex (split into two 8-byte groups), and an ASCII gutter (printable bytes shown
|
|
4
|
+
* verbatim, everything else as `.`). Like {@link LogViewer} the rows are VIRTUALIZED — only the visible window
|
|
5
|
+
* is in the DOM — so even a multi-MB file scrolls smoothly (a naive dump would mount hundreds of thousands of
|
|
6
|
+
* rows). The bytes never leave the browser; they come from the same download endpoint as any other file.
|
|
7
|
+
*
|
|
8
|
+
* This is the universal fall-back: ANY file can be inspected byte-for-byte here, so it's offered (alongside
|
|
9
|
+
* the other formatters) on the unpreviewable-binary card — never auto-detected. Parsing needs the whole file
|
|
10
|
+
* in memory, so a large file is gated behind a confirm (mirrors BinObjBrowser).
|
|
11
|
+
*/
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
url?: string;
|
|
14
|
+
name: string;
|
|
15
|
+
size?: number;
|
|
16
|
+
};
|
|
17
|
+
declare function doLoad(): Promise<void>;
|
|
18
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
19
|
+
reload: typeof doLoad;
|
|
20
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|