mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-11-14 16:27:25 +01:00
Sandbox executable MIME aliases, enforce strict Mermaid rendering, and add security regression coverage. Upgrade vulnerable dependencies with archive compatibility checks and Node 22/24 CI. Make repository restoration atomic and provide actionable viewer errors with retry controls.
42 lines
3.5 KiB
HTML
42 lines
3.5 KiB
HTML
<div v-code-editor="{ content: content, options: aceOption }" v-if="type == 'text'"></div>
|
|
<div class="file-content markdown-body" v-if="type == 'html'" v-html="highlightRedactions(sanitize(content))"></div>
|
|
<html-doc v-if="type == 'html-doc' && !showSource && content != null" :content="content" :base-url="(fileBaseUrl)" :allow-scripts="allowScripts"></html-doc>
|
|
<div v-code-editor="{ content: content, options: aceOption }" v-if="(type == 'code' || (type == 'html-doc' && showSource)) && content != null"></div>
|
|
<img class="image-content" v-if="type == 'image'" :src="safeUrl((url))">
|
|
<iframe class="h-100 overflow-auto w-100 b-0" v-if="type == 'media'" :src="safeUrl((url))"></iframe>
|
|
<pdfviewer v-if="type == 'pdf'" :src="safeUrl((url))"></pdfviewer>
|
|
<div v-if="type == 'audio'"><audio controls="controls"><source :src="safeUrl((url))"></audio></div>
|
|
<div v-if="type == 'IPython'"><notebook :file="url" :content="content"></notebook></div>
|
|
<div class="file-error container d-flex h-100" v-if="type == 'rate_limited'">
|
|
<div class="paper-ratelimit-card m-auto" style="max-width:520px;">
|
|
<div class="paper-ratelimit-head">
|
|
<svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-hourglass"></use></svg>
|
|
<div>
|
|
<div class="paper-error-eyebrow">Temporarily paused</div>
|
|
<div class="paper-error-title">GitHub API rate limit reached</div>
|
|
</div>
|
|
</div>
|
|
<p class="paper-error-msg">This repository will be available in <strong>{{ rateLimitCountdown }}</strong>. The page will reload automatically.</p>
|
|
</div>
|
|
</div>
|
|
<div class="file-error container d-flex h-100" v-if="type == 'error'">
|
|
<section class="viewer-error paper-error-card file-error-card m-auto" role="alert" aria-labelledby="viewer-error-title">
|
|
<h1 id="viewer-error-title" class="paper-empty-title">{{ fmt.translate(isSourceAccessError() ? 'VIEWER_ERRORS.access_title' : 'VIEWER_ERRORS.title') }}</h1>
|
|
<p>{{ fmt.translate('ERRORS.' + content) }}</p>
|
|
<template v-if="isSourceAccessError()">
|
|
<p>{{ fmt.translate('VIEWER_ERRORS.reader_help') }}</p>
|
|
<p>{{ fmt.translate('VIEWER_ERRORS.owner_help') }}</p>
|
|
</template>
|
|
<div class="paper-error-actions">
|
|
<a v-if="!isSourceAccessError()" href="/" class="btn btn-sm">Back to home</a>
|
|
<a v-if="!isSourceAccessError()" href="/faq" class="btn btn-sm">Read the FAQ</a>
|
|
<button type="button" class="btn btn-primary" @click="retryContent()">{{ fmt.translate('VIEWER_ERRORS.retry') }}</button>
|
|
<a v-if="isSourceAccessError()" class="btn btn-outline-ink" href="/dashboard">{{ fmt.translate('VIEWER_ERRORS.dashboard') }}</a>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<div class="file-error container d-flex h-100" v-if="type == 'loading' && !error"><h1 class="paper-empty-title m-auto">Loading…</h1></div>
|
|
<div class="file-error container d-flex h-100" v-if="type == 'empty'"><h1 class="paper-empty-title m-auto">Empty <em>repository</em>.</h1></div>
|
|
<div class="file-error container d-flex h-100" v-if="content == null && type != 'empty'"><h1 class="paper-empty-title m-auto">Empty <em>file</em>.</h1></div>
|
|
<div class="file-error container d-flex h-100" v-if="type == 'binary'"><h1 class="paper-empty-title m-auto">Unsupported <em>binary file</em>. You can <a target="_blank" :href="safeUrl((url) + "&download=true")">download it</a>.</h1></div>
|