feat(image-hoster): enterprise redesign with obsidian liquid glass theme, server background vault, session governance with auto-expiration, live telemetry, and multi-format exports
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
/temp_sessions/
|
||||
/downloads/
|
||||
/uploads/
|
||||
/data/image-hoster/
|
||||
/data/facial-rotation-detector/
|
||||
/data/*/uploads/
|
||||
.DS_Store
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,221 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"archive/zip"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
dataDir = "data/image-hoster"
|
||||
sessionsDir = filepath.Join(dataDir, "sessions")
|
||||
metaPath = filepath.Join(dataDir, "sessions.json")
|
||||
govLock sync.Mutex
|
||||
)
|
||||
|
||||
func initGovernance() {
|
||||
if err := os.MkdirAll(sessionsDir, 0755); err != nil {
|
||||
slog.Error("failed to create sessions storage directory", "err", err)
|
||||
}
|
||||
|
||||
loadSessionsMetadata()
|
||||
go runGovernanceWatchdog()
|
||||
}
|
||||
|
||||
func loadSessionsMetadata() {
|
||||
govLock.Lock()
|
||||
defer govLock.Unlock()
|
||||
|
||||
b, err := os.ReadFile(metaPath)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var stored map[string]*SessionMeta
|
||||
if err := json.Unmarshal(b, &stored); err != nil {
|
||||
slog.Warn("could not decode sessions.json", "err", err)
|
||||
return
|
||||
}
|
||||
|
||||
globalState.mu.Lock()
|
||||
defer globalState.mu.Unlock()
|
||||
|
||||
now := time.Now()
|
||||
for id, s := range stored {
|
||||
// If expired while server was offline, mark or delete
|
||||
if !s.ExpiresAt.IsZero() && now.After(s.ExpiresAt) {
|
||||
slog.Info("session expired during downtime", "session_id", id)
|
||||
// Cleanup background session files if on server
|
||||
if s.Mode == ModeServerBg {
|
||||
os.RemoveAll(filepath.Join(sessionsDir, id))
|
||||
}
|
||||
continue
|
||||
}
|
||||
// If mode was relay, reset channels (browser will re-connect)
|
||||
if s.Mode == ModeRelay {
|
||||
globalState.relaySessions[id] = make(chan map[string]interface{}, 100)
|
||||
}
|
||||
globalState.sessions[id] = s
|
||||
}
|
||||
}
|
||||
|
||||
func saveSessionsMetadata() {
|
||||
govLock.Lock()
|
||||
defer govLock.Unlock()
|
||||
|
||||
globalState.mu.RLock()
|
||||
data, err := json.MarshalIndent(globalState.sessions, "", " ")
|
||||
globalState.mu.RUnlock()
|
||||
|
||||
if err != nil {
|
||||
slog.Error("failed to serialize sessions metadata", "err", err)
|
||||
return
|
||||
}
|
||||
|
||||
tmpPath := metaPath + ".tmp"
|
||||
if err := os.WriteFile(tmpPath, data, 0644); err == nil {
|
||||
os.Rename(tmpPath, metaPath)
|
||||
}
|
||||
}
|
||||
|
||||
// Background auto-expiration governance watchdog
|
||||
func runGovernanceWatchdog() {
|
||||
ticker := time.NewTicker(20 * time.Second)
|
||||
defer ticker.Stop()
|
||||
|
||||
for range ticker.C {
|
||||
now := time.Now()
|
||||
var expiredIDs []string
|
||||
|
||||
globalState.mu.RLock()
|
||||
for id, s := range globalState.sessions {
|
||||
if !s.ExpiresAt.IsZero() && now.After(s.ExpiresAt) {
|
||||
expiredIDs = append(expiredIDs, id)
|
||||
}
|
||||
}
|
||||
globalState.mu.RUnlock()
|
||||
|
||||
if len(expiredIDs) > 0 {
|
||||
for _, id := range expiredIDs {
|
||||
slog.Info("enterprise governance: auto-terminating expired session", "session_id", id)
|
||||
deleteSessionInternal(id)
|
||||
}
|
||||
saveSessionsMetadata()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func deleteSessionInternal(id string) {
|
||||
globalState.mu.Lock()
|
||||
s, exists := globalState.sessions[id]
|
||||
if !exists {
|
||||
globalState.mu.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
delete(globalState.sessions, id)
|
||||
if ch, ok := globalState.relaySessions[id]; ok {
|
||||
close(ch)
|
||||
delete(globalState.relaySessions, id)
|
||||
}
|
||||
delete(globalState.accessLogs, id)
|
||||
globalState.mu.Unlock()
|
||||
|
||||
// Clean up server-side files if hosted on server
|
||||
if s.Mode == ModeServerBg {
|
||||
targetDir := filepath.Join(sessionsDir, id)
|
||||
os.RemoveAll(targetDir)
|
||||
}
|
||||
}
|
||||
|
||||
func recordAccessEvent(sessionID, ip, method, path string, status int, bytes int64, userAgent string) {
|
||||
globalState.mu.Lock()
|
||||
defer globalState.mu.Unlock()
|
||||
|
||||
s, exists := globalState.sessions[sessionID]
|
||||
if exists {
|
||||
s.Requests++
|
||||
s.BytesServed += bytes
|
||||
s.LastActive = time.Now()
|
||||
}
|
||||
|
||||
ev := AccessEvent{
|
||||
Timestamp: time.Now(),
|
||||
IP: ip,
|
||||
Method: method,
|
||||
Path: path,
|
||||
Status: status,
|
||||
Bytes: bytes,
|
||||
UserAgent: userAgent,
|
||||
}
|
||||
|
||||
logs := globalState.accessLogs[sessionID]
|
||||
if len(logs) >= 60 {
|
||||
logs = logs[1:]
|
||||
}
|
||||
globalState.accessLogs[sessionID] = append(logs, ev)
|
||||
}
|
||||
|
||||
// Stream zip archive of all hosted files in a session
|
||||
func createSessionZip(sessionID string, w http.ResponseWriter) error {
|
||||
globalState.mu.RLock()
|
||||
s, exists := globalState.sessions[sessionID]
|
||||
globalState.mu.RUnlock()
|
||||
|
||||
if !exists {
|
||||
return os.ErrNotExist
|
||||
}
|
||||
|
||||
basePath := s.Path
|
||||
if s.Mode == ModeServerBg {
|
||||
basePath = filepath.Join(sessionsDir, sessionID)
|
||||
}
|
||||
|
||||
if basePath == "" {
|
||||
return os.ErrNotExist
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/zip")
|
||||
w.Header().Set("Content-Disposition", `attachment; filename="hosted_session_`+sessionID+`.zip"`)
|
||||
|
||||
zw := zip.NewWriter(w)
|
||||
defer zw.Close()
|
||||
|
||||
return filepath.Walk(basePath, func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil || info.IsDir() {
|
||||
return nil
|
||||
}
|
||||
rel, err := filepath.Rel(basePath, path)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
rel = filepath.ToSlash(rel)
|
||||
|
||||
hdr, err := zip.FileInfoHeader(info)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
hdr.Name = rel
|
||||
hdr.Method = zip.Deflate
|
||||
|
||||
writer, err := zw.CreateHeader(hdr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
f, err := os.Open(path)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
_, err = io.Copy(writer, f)
|
||||
return err
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,520 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="theme-color" content="#030305">
|
||||
<meta name="color-scheme" content="dark">
|
||||
<title>Host It Now · Enterprise Cloud Vault & Edge Relay</title>
|
||||
|
||||
<!-- Google Fonts: Inter & JetBrains Mono -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
|
||||
<!-- QRCode.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
|
||||
|
||||
<!-- Styles -->
|
||||
<link rel="stylesheet" href="/styles.css?v=3.0">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Ambient Obsidian Background Mesh -->
|
||||
<div class="ambient-mesh"></div>
|
||||
|
||||
<div class="app-root">
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
ENTERPRISE TOP APPLICATION HEADER
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
<header class="hin-header">
|
||||
<div class="header-left">
|
||||
<div class="brand-badge">
|
||||
<div class="brand-icon">
|
||||
<i class="fa-solid fa-cloud-arrow-up"></i>
|
||||
</div>
|
||||
<div class="brand-text">
|
||||
<h1>Host It Now</h1>
|
||||
<span>Enterprise Cloud Vault & Edge Relay</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header-center">
|
||||
<!-- Global Metrics Strip -->
|
||||
<div class="header-metrics">
|
||||
<div class="metric-pill" title="Total active hosting sessions">
|
||||
<i class="fa-solid fa-layer-group text-cyan"></i>
|
||||
<span class="metric-label">Sessions:</span>
|
||||
<span class="metric-val" id="metric-total-sessions">0</span>
|
||||
</div>
|
||||
<div class="metric-pill" title="Total hosted files across active session">
|
||||
<i class="fa-solid fa-images text-purple"></i>
|
||||
<span class="metric-label">Files:</span>
|
||||
<span class="metric-val" id="metric-total-files">0</span>
|
||||
</div>
|
||||
<div class="metric-pill" title="Total requests served">
|
||||
<i class="fa-solid fa-bolt text-amber"></i>
|
||||
<span class="metric-label">Requests:</span>
|
||||
<span class="metric-val" id="metric-total-reqs">0</span>
|
||||
</div>
|
||||
<div class="metric-pill" title="Total bandwidth transferred">
|
||||
<i class="fa-solid fa-arrow-right-arrow-left text-green"></i>
|
||||
<span class="metric-label">Bandwidth:</span>
|
||||
<span class="metric-val" id="metric-total-bytes">0 MB</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header-right">
|
||||
<button class="btn btn-secondary btn-sm" onclick="openTelemetryModal()" title="View live server traffic and access telemetry">
|
||||
<i class="fa-solid fa-chart-line text-cyan"></i> Telemetry
|
||||
</button>
|
||||
<a href="/radheradhe/" target="_blank" class="btn btn-secondary btn-sm" title="Open administrator dashboard">
|
||||
<i class="fa-solid fa-shield-halved text-purple"></i> Admin
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
SESSION GOVERNANCE & SWITCHER RAIL
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
<section class="session-governance-strip">
|
||||
<div class="session-rail-left">
|
||||
<span class="rail-title"><i class="fa-solid fa-server"></i> Active Sessions</span>
|
||||
<div class="session-tabs-rail" id="sessionTabsRail">
|
||||
<!-- Populated dynamically by app.js -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="session-rail-actions">
|
||||
<button class="btn btn-cyan btn-sm" onclick="openNewSessionModal()" title="Create a new hosting session">
|
||||
<i class="fa-solid fa-plus"></i> New Session
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-sm" onclick="openGovernanceModal()" title="Configure time limit and session governance">
|
||||
<i class="fa-solid fa-clock"></i> Governance
|
||||
</button>
|
||||
<button class="btn btn-danger btn-sm" onclick="deleteCurrentSession()" title="Delete active session and free resources">
|
||||
<i class="fa-solid fa-trash-can"></i>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
PUBLIC LIVE LINK & TUNNEL HUD
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
<section class="live-tunnel-card" id="livePanel">
|
||||
<div class="tunnel-header">
|
||||
<div class="tunnel-info">
|
||||
<div class="tunnel-status-badge badge-offline" id="liveBadge">
|
||||
<span class="status-dot"></span>
|
||||
<span id="liveStatusText">Offline</span>
|
||||
</div>
|
||||
<div class="tunnel-governance-pill" id="tunnelGovernancePill" title="Session time limit countdown">
|
||||
<i class="fa-solid fa-hourglass-half"></i>
|
||||
<span id="sessionTtlText">Unlimited (Enterprise)</span>
|
||||
</div>
|
||||
<div class="tunnel-mode-pill" id="sessionModePill">
|
||||
<i class="fa-solid fa-cloud"></i>
|
||||
<span id="sessionModeText">Server Vault</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tunnel-controls">
|
||||
<div id="liveSpinner" class="tunnel-spinner hidden">
|
||||
<i class="fa-solid fa-circle-notch fa-spin"></i> Initializing Gateway…
|
||||
</div>
|
||||
<button id="btnGoLive" class="btn btn-green btn-sm" onclick="startTunnel()">
|
||||
<i class="fa-solid fa-satellite-dish"></i> Go Live (Public Tunnel)
|
||||
</button>
|
||||
<button id="btnStopLive" class="btn btn-danger btn-sm hidden" onclick="stopTunnel()">
|
||||
<i class="fa-solid fa-power-off"></i> Stop Tunnel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="liveUrlRow" class="tunnel-url-row hidden">
|
||||
<div class="url-input-box">
|
||||
<i class="fa-solid fa-link text-cyan"></i>
|
||||
<span class="url-text" id="liveUrlText"></span>
|
||||
</div>
|
||||
<div class="url-actions">
|
||||
<button class="btn btn-secondary btn-sm" onclick="copyLiveUrl()" title="Copy live URL to clipboard">
|
||||
<i class="fa-solid fa-copy"></i> Copy
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-sm" onclick="openQrModal('Public Session Link', document.getElementById('liveUrlText').textContent)" title="Display QR Code for mobile scanning">
|
||||
<i class="fa-solid fa-qrcode"></i> QR
|
||||
</button>
|
||||
<a id="liveOpenBtn" href="#" target="_blank" class="btn btn-secondary btn-sm" title="Open live URL in new tab">
|
||||
<i class="fa-solid fa-arrow-up-right-from-square"></i> Open
|
||||
</a>
|
||||
<button class="btn btn-secondary btn-sm" onclick="regenerateTunnel()" title="Regenerate tunnel URL">
|
||||
<i class="fa-solid fa-rotate"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
CONTENT INGESTION & HOSTING MODES
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
<section class="ingest-card">
|
||||
<!-- Mode Selector Tabs -->
|
||||
<div class="ingest-tabs">
|
||||
<button class="ingest-tab active" data-tab="vault" onclick="switchIngestMode('vault')">
|
||||
<i class="fa-solid fa-cloud-arrow-up"></i>
|
||||
<div class="tab-meta">
|
||||
<strong>Server Background Vault</strong>
|
||||
<span>Persistent 24/7 hosting · Survives browser close</span>
|
||||
</div>
|
||||
</button>
|
||||
<button class="ingest-tab" data-tab="path" onclick="switchIngestMode('path')">
|
||||
<i class="fa-solid fa-hard-drive"></i>
|
||||
<div class="tab-meta">
|
||||
<strong>Host Server Directory</strong>
|
||||
<span>Map any existing filesystem path on host</span>
|
||||
</div>
|
||||
</button>
|
||||
<button class="ingest-tab" data-tab="relay" onclick="switchIngestMode('relay')">
|
||||
<i class="fa-solid fa-tower-broadcast"></i>
|
||||
<div class="tab-meta">
|
||||
<strong>Browser Relay (P2P Memory)</strong>
|
||||
<span>Direct client stream · Zero disk footprint</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Ingest Body: Mode 1 - Server Background Vault -->
|
||||
<div class="ingest-content" id="mode-content-vault">
|
||||
<input type="file" id="vaultFolderInput" webkitdirectory directory multiple style="display:none" onchange="handleVaultUpload(event, 'folder')">
|
||||
<input type="file" id="vaultFileInput" multiple style="display:none" onchange="handleVaultUpload(event, 'file')">
|
||||
<input type="file" id="vaultZipInput" accept=".zip" style="display:none" onchange="handleZipUpload(event)">
|
||||
|
||||
<div class="vault-dropzone" id="vaultDropzone">
|
||||
<div class="dropzone-icon">
|
||||
<i class="fa-solid fa-cloud-arrow-up"></i>
|
||||
</div>
|
||||
<div class="dropzone-text">
|
||||
<h3>Drop Images, Folders, or ZIP Archives to Host in Background</h3>
|
||||
<p>Uploaded directly to the secure server vault so files remain online even if your browser is closed.</p>
|
||||
</div>
|
||||
<div class="dropzone-buttons">
|
||||
<button class="btn btn-cyan btn-sm" onclick="document.getElementById('vaultFileInput').click()">
|
||||
<i class="fa-solid fa-file-arrow-up"></i> Upload Files
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-sm" onclick="document.getElementById('vaultFolderInput').click()">
|
||||
<i class="fa-solid fa-folder-plus"></i> Upload Folder
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-sm" onclick="document.getElementById('vaultZipInput').click()" title="Automatically unpacks all contents into session">
|
||||
<i class="fa-solid fa-file-zipper"></i> Upload .ZIP Archive
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="upload-progress-container hidden" id="uploadProgressBox">
|
||||
<div class="progress-info">
|
||||
<span id="uploadStatusText">Uploading files to server vault...</span>
|
||||
<span id="uploadPercentText" class="font-mono">0%</span>
|
||||
</div>
|
||||
<div class="progress-bar-bg">
|
||||
<div class="progress-bar-fill" id="uploadProgressBar"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Ingest Body: Mode 2 - Host Server Directory -->
|
||||
<div class="ingest-content hidden" id="mode-content-path">
|
||||
<div class="path-input-group">
|
||||
<div class="input-wrapper">
|
||||
<i class="fa-solid fa-folder text-cyan"></i>
|
||||
<input type="text" class="text-input" id="pathInput" placeholder="Enter absolute server directory path — e.g. /home/user/images or /var/www/assets">
|
||||
</div>
|
||||
<button class="btn btn-cyan" onclick="setFolderPath()">
|
||||
<i class="fa-solid fa-map-pin"></i> Map Directory
|
||||
</button>
|
||||
<button class="btn btn-secondary" onclick="openServerDirModal()" title="Explore server filesystem visually">
|
||||
<i class="fa-solid fa-folder-tree"></i> Browse Server
|
||||
</button>
|
||||
</div>
|
||||
<p class="input-hint"><i class="fa-solid fa-shield-halved"></i> Directly mounts an existing directory from the server filesystem with zero upload delay.</p>
|
||||
</div>
|
||||
|
||||
<!-- Ingest Body: Mode 3 - Browser Relay (P2P) -->
|
||||
<div class="ingest-content hidden" id="mode-content-relay">
|
||||
<input type="file" id="relayFolderInput" webkitdirectory directory multiple style="display:none" onchange="handleRelaySelect(event, 'folder')">
|
||||
<input type="file" id="relayFileInput" multiple style="display:none" onchange="handleRelaySelect(event, 'file')">
|
||||
|
||||
<div class="relay-action-grid">
|
||||
<button class="relay-card-btn" onclick="document.getElementById('relayFolderInput').click()">
|
||||
<i class="fa-solid fa-folder-open text-purple"></i>
|
||||
<strong>Relay Folder from Device</strong>
|
||||
<span>Stream entire folder tree from browser memory</span>
|
||||
</button>
|
||||
<button class="relay-card-btn" onclick="document.getElementById('relayFileInput').click()">
|
||||
<i class="fa-solid fa-images text-cyan"></i>
|
||||
<strong>Relay Files from Device</strong>
|
||||
<span>Select individual images to stream directly</span>
|
||||
</button>
|
||||
</div>
|
||||
<p class="input-hint"><i class="fa-solid fa-circle-info"></i> Browser Relay streams files on-demand via SSE memory without writing to server disk. Note: browser tab must remain open.</p>
|
||||
</div>
|
||||
|
||||
<!-- Active Status Bar -->
|
||||
<div class="hin-status-bar" id="statusBar">
|
||||
<div class="status-left">
|
||||
<i class="fa-solid fa-circle-check text-green" id="statusIcon"></i>
|
||||
<span id="statusText">Session active</span>
|
||||
</div>
|
||||
<div class="status-right" id="statusDetails">
|
||||
<span id="statusFileCountPill" class="meta-pill">0 files</span>
|
||||
<span id="statusSizePill" class="meta-pill">0 MB</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
EXPLORER: SEARCH, FILTERS & BULK ACTIONS
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
<section class="explorer-card">
|
||||
<div class="explorer-toolbar">
|
||||
<div class="toolbar-search">
|
||||
<i class="fa-solid fa-magnifying-glass"></i>
|
||||
<input type="text" id="fileSearchInput" placeholder="Filter files by name, folder, or extension..." oninput="handleSearchFilter(this.value)">
|
||||
</div>
|
||||
|
||||
<div class="toolbar-filter-chips">
|
||||
<button class="filter-chip active" data-filter="all" onclick="setCategoryFilter('all')">All</button>
|
||||
<button class="filter-chip" data-filter="images" onclick="setCategoryFilter('images')">Images</button>
|
||||
<button class="filter-chip" data-filter="code" onclick="setCategoryFilter('code')">Code & JSON</button>
|
||||
<button class="filter-chip" data-filter="docs" onclick="setCategoryFilter('docs')">Docs & Other</button>
|
||||
</div>
|
||||
|
||||
<div class="toolbar-bulk-actions">
|
||||
<button class="btn btn-secondary btn-sm" onclick="openBatchExportModal()" title="Export all file URLs in multiple developer formats">
|
||||
<i class="fa-solid fa-share-nodes text-cyan"></i> Copy All URLs
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-sm" onclick="downloadSessionZip()" title="Download entire hosted session as a ZIP archive">
|
||||
<i class="fa-solid fa-file-zipper text-purple"></i> Download ZIP
|
||||
</button>
|
||||
<div class="view-toggle">
|
||||
<button class="view-btn active" id="btnViewGrid" onclick="setViewMode('grid')" title="Grid View"><i class="fa-solid fa-grip"></i></button>
|
||||
<button class="view-btn" id="btnViewList" onclick="setViewMode('list')" title="List View"><i class="fa-solid fa-list"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Dynamic File Container -->
|
||||
<div id="filesContainer" class="files-container grid-mode">
|
||||
<!-- Populated dynamically by app.js -->
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
MODALS & DIALOGS
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
|
||||
<!-- New Session & Governance Modal -->
|
||||
<div class="modal-backdrop" id="sessionGovModal" style="display: none;">
|
||||
<div class="modal-card">
|
||||
<div class="modal-header">
|
||||
<h3><i class="fa-solid fa-shield-halved text-cyan"></i> Session Governance & Time Limit</h3>
|
||||
<button class="modal-close-btn" onclick="closeGovernanceModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>Session Name</label>
|
||||
<input type="text" id="govSessionName" class="text-input" placeholder="e.g. Product Demo Assets">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Hosting Mode</label>
|
||||
<select id="govSessionMode" class="text-input">
|
||||
<option value="server_background">Server Background Vault (Persistent 24/7)</option>
|
||||
<option value="local_path">Local Server Directory Path</option>
|
||||
<option value="relay">Browser Relay (P2P Memory)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Governance Time Limit (Auto-Expiration)</label>
|
||||
<select id="govTimeLimitSel" class="text-input">
|
||||
<option value="0">Unlimited (Enterprise Permanent)</option>
|
||||
<option value="900">15 Minutes (Scratch Session)</option>
|
||||
<option value="3600">1 Hour (Quick QA Test)</option>
|
||||
<option value="14400">4 Hours (Standard Review)</option>
|
||||
<option value="86400">24 Hours (Full Day Demo)</option>
|
||||
<option value="604800">7 Days (Production Sprint)</option>
|
||||
</select>
|
||||
<span class="form-hint"><i class="fa-solid fa-hourglass-start"></i> When the time limit expires, the server automatically terminates the session and purges temporary files to free resources.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary btn-sm" onclick="closeGovernanceModal()">Cancel</button>
|
||||
<button class="btn btn-cyan btn-sm" onclick="saveSessionGovernance()">Apply Settings</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- QR Code Scan Modal -->
|
||||
<div class="modal-backdrop" id="qrModal" style="display: none;">
|
||||
<div class="modal-card" style="max-width: 420px; text-align: center;">
|
||||
<div class="modal-header">
|
||||
<h3 id="qrModalTitle"><i class="fa-solid fa-qrcode text-cyan"></i> Scan QR Code</h3>
|
||||
<button class="modal-close-btn" onclick="closeQrModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
<div class="modal-body" style="display: flex; flex-direction: column; align-items: center; gap: 14px;">
|
||||
<div class="qr-canvas-box" id="qrCodeContainer"></div>
|
||||
<div class="url-input-box" style="width: 100%;">
|
||||
<span class="url-text" id="qrUrlText" style="font-size: 11px;"></span>
|
||||
</div>
|
||||
<p style="font-size: 11.5px; color: var(--muted); margin: 0;">Scan with any smartphone or mobile camera to open this hosted asset directly.</p>
|
||||
</div>
|
||||
<div class="modal-footer" style="justify-content: center;">
|
||||
<button class="btn btn-cyan btn-sm" onclick="copyText(document.getElementById('qrUrlText').textContent)">
|
||||
<i class="fa-solid fa-copy"></i> Copy Link
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Media Fullscreen Lightbox Modal -->
|
||||
<div class="modal-backdrop" id="lightboxModal" style="display: none;" onclick="closeLightbox(event)">
|
||||
<div class="lightbox-card" onclick="event.stopPropagation()">
|
||||
<div class="lightbox-header">
|
||||
<span class="lightbox-title" id="lightboxTitle">Image Preview</span>
|
||||
<div class="lightbox-actions">
|
||||
<a id="lightboxDlBtn" href="#" download class="btn btn-secondary btn-sm"><i class="fa-solid fa-download"></i> Download</a>
|
||||
<button class="modal-close-btn" onclick="closeLightbox()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lightbox-body">
|
||||
<img id="lightboxImg" src="" alt="Fullscreen Preview">
|
||||
</div>
|
||||
<div class="lightbox-footer">
|
||||
<span id="lightboxDims" class="font-mono">Dimensions: --</span>
|
||||
<span id="lightboxSize" class="font-mono">Size: --</span>
|
||||
<span id="lightboxUrl" class="font-mono" style="max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Code & JSON Viewer Modal -->
|
||||
<div class="modal-backdrop" id="codeModal" style="display: none;">
|
||||
<div class="modal-card" style="max-width: 760px;">
|
||||
<div class="modal-header">
|
||||
<h3 id="codeModalTitle"><i class="fa-solid fa-code text-cyan"></i> Document Viewer</h3>
|
||||
<div style="display: flex; gap: 8px;">
|
||||
<button class="btn btn-secondary btn-sm" onclick="copyCodeContent()"><i class="fa-solid fa-copy"></i> Copy Code</button>
|
||||
<button class="modal-close-btn" onclick="closeCodeModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body" style="padding: 0;">
|
||||
<pre class="code-viewport" id="codeModalContent"></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Server Directory Explorer Modal -->
|
||||
<div class="modal-backdrop" id="serverDirModal" style="display: none;">
|
||||
<div class="modal-card" style="max-width: 640px;">
|
||||
<div class="modal-header">
|
||||
<h3><i class="fa-solid fa-folder-tree text-cyan"></i> Server Filesystem Explorer</h3>
|
||||
<button class="modal-close-btn" onclick="closeServerDirModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="server-dir-breadcrumb">
|
||||
<span id="serverDirCurrent">/</span>
|
||||
</div>
|
||||
<div class="server-dir-list" id="serverDirList">
|
||||
<!-- Populated dynamically by app.js -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary btn-sm" onclick="closeServerDirModal()">Cancel</button>
|
||||
<button class="btn btn-cyan btn-sm" onclick="selectCurrentServerDir()">Select Directory</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Real-Time Telemetry & Traffic Modal -->
|
||||
<div class="modal-backdrop" id="telemetryModal" style="display: none;">
|
||||
<div class="modal-card" style="max-width: 820px;">
|
||||
<div class="modal-header">
|
||||
<h3><i class="fa-solid fa-chart-line text-cyan"></i> Live Telemetry & Access Traffic</h3>
|
||||
<div style="display: flex; gap: 8px;">
|
||||
<button class="btn btn-secondary btn-sm" onclick="refreshTelemetry()"><i class="fa-solid fa-rotate"></i> Refresh</button>
|
||||
<button class="modal-close-btn" onclick="closeTelemetryModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="telemetry-stats-row">
|
||||
<div class="t-stat-card">
|
||||
<span class="t-stat-val" id="t-reqs">0</span>
|
||||
<span class="t-stat-label">Total HTTP Requests</span>
|
||||
</div>
|
||||
<div class="t-stat-card">
|
||||
<span class="t-stat-val" id="t-bytes">0 MB</span>
|
||||
<span class="t-stat-label">Bandwidth Transferred</span>
|
||||
</div>
|
||||
<div class="t-stat-card">
|
||||
<span class="t-stat-val" id="t-active-time">Active</span>
|
||||
<span class="t-stat-label">Last Ping</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ps-section-title" style="margin-top: 14px; font-size: 12px; color: var(--text-2); text-transform: uppercase;">Recent Access Logs (Last 50 Requests)</div>
|
||||
<div class="telemetry-log-table-wrap">
|
||||
<table class="telemetry-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Method</th>
|
||||
<th>Path</th>
|
||||
<th>Status</th>
|
||||
<th>Bytes</th>
|
||||
<th>Client IP</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="telemetryLogsBody">
|
||||
<tr><td colspan="6" style="text-align:center; color: var(--muted); padding: 18px;">No traffic events recorded yet.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Batch URLs Export Modal -->
|
||||
<div class="modal-backdrop" id="batchExportModal" style="display: none;">
|
||||
<div class="modal-card" style="max-width: 700px;">
|
||||
<div class="modal-header">
|
||||
<h3><i class="fa-solid fa-share-nodes text-cyan"></i> Export All Hosted URLs</h3>
|
||||
<button class="modal-close-btn" onclick="closeBatchExportModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="batch-export-formats">
|
||||
<button class="seg-pill active" onclick="switchExportFormat('raw')">Plain List</button>
|
||||
<button class="seg-pill" onclick="switchExportFormat('json')">JSON Array</button>
|
||||
<button class="seg-pill" onclick="switchExportFormat('markdown')">Markdown</button>
|
||||
<button class="seg-pill" onclick="switchExportFormat('html')">HTML Img</button>
|
||||
<button class="seg-pill" onclick="switchExportFormat('curl')">cURL Script</button>
|
||||
</div>
|
||||
<textarea id="batchExportTextarea" class="code-viewport" style="width: 100%; height: 240px; margin-top: 12px; font-size: 11.5px;" readonly></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary btn-sm" onclick="closeBatchExportModal()">Close</button>
|
||||
<button class="btn btn-cyan btn-sm" onclick="copyBatchExportContent()"><i class="fa-solid fa-copy"></i> Copy to Clipboard</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Toast Notification Container -->
|
||||
<div id="toast-container" class="toast-container"></div>
|
||||
|
||||
<!-- App Script -->
|
||||
<script src="/app.js?v=3.0" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
+762
-295
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,59 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
type SessionMode string
|
||||
|
||||
const (
|
||||
ModeServerBg SessionMode = "server_background" // Hosted persistently on server disk
|
||||
ModeLocalPath SessionMode = "local_path" // Mapped to local server filesystem path
|
||||
ModeRelay SessionMode = "relay" // P2P streaming from browser memory via SSE
|
||||
)
|
||||
|
||||
type SessionMeta struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Mode SessionMode `json:"mode"`
|
||||
Path string `json:"path"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
ExpiresAt time.Time `json:"expires_at"` // Zero time = never
|
||||
TimeLimitSec int `json:"time_limit_sec"` // 0 = unlimited
|
||||
FileCount int `json:"file_count"`
|
||||
TotalBytes int64 `json:"total_bytes"`
|
||||
Requests int64 `json:"requests"`
|
||||
BytesServed int64 `json:"bytes_served"`
|
||||
LastActive time.Time `json:"last_active"`
|
||||
TunnelActive bool `json:"tunnel_active"`
|
||||
TunnelURL string `json:"tunnel_url"`
|
||||
}
|
||||
|
||||
type AccessEvent struct {
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
IP string `json:"ip"`
|
||||
Method string `json:"method"`
|
||||
Path string `json:"path"`
|
||||
Status int `json:"status"`
|
||||
Bytes int64 `json:"bytes"`
|
||||
UserAgent string `json:"user_agent"`
|
||||
}
|
||||
|
||||
type HostState struct {
|
||||
mu sync.RWMutex
|
||||
sessions map[string]*SessionMeta
|
||||
relaySessions map[string]chan map[string]interface{}
|
||||
requestEvents map[string]chan []byte
|
||||
accessLogs map[string][]AccessEvent
|
||||
tunnelProcess *exec.Cmd
|
||||
tunnelURL string
|
||||
}
|
||||
|
||||
var globalState = &HostState{
|
||||
sessions: make(map[string]*SessionMeta),
|
||||
relaySessions: make(map[string]chan map[string]interface{}),
|
||||
requestEvents: make(map[string]chan []byte),
|
||||
accessLogs: make(map[string][]AccessEvent),
|
||||
}
|
||||
@@ -660,5 +660,16 @@ func NewRouter(pm *ProcessManager) http.Handler {
|
||||
http.Error(w, "Image manipulator not found", http.StatusNotFound)
|
||||
})
|
||||
|
||||
r.HandleFunc("/files/*", func(w http.ResponseWriter, req *http.Request) {
|
||||
_ = pm.EnsureRunning(req.Context(), "image-hoster")
|
||||
cfg := pm.getConfig("image-hoster")
|
||||
if cfg != nil {
|
||||
proxy := toolProxy(pm, "image-hoster", cfg.Port)
|
||||
proxy.ServeHTTP(w, req)
|
||||
return
|
||||
}
|
||||
http.Error(w, "Image hoster not found", http.StatusNotFound)
|
||||
})
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
+1086
-352
File diff suppressed because it is too large
Load Diff
+491
-99
@@ -2,127 +2,519 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Host It Now</title>
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/styles.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="theme-color" content="#030305">
|
||||
<meta name="color-scheme" content="dark">
|
||||
<title>Host It Now · Enterprise Cloud Vault & Edge Relay</title>
|
||||
|
||||
<!-- Google Fonts: Inter & JetBrains Mono -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
|
||||
<!-- QRCode.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
|
||||
|
||||
<!-- Styles -->
|
||||
<link rel="stylesheet" href="/styles.css?v=3.0">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Ambient Obsidian Background Mesh -->
|
||||
<div class="ambient-mesh"></div>
|
||||
|
||||
<div id="toast"></div>
|
||||
|
||||
<div class="app">
|
||||
|
||||
<!-- Topbar -->
|
||||
<div class="topbar">
|
||||
<div class="topbar-brand">
|
||||
<i class="fas fa-broadcast-tower"></i>
|
||||
Host It Now
|
||||
</div>
|
||||
<div class="topbar-right">
|
||||
<a href="/radheradhe/" target="_blank" class="btn btn-sm">
|
||||
<i class="fas fa-user-shield"></i> Admin
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Session Bar -->
|
||||
<div class="session-bar">
|
||||
<span class="session-label"><i class="fas fa-layer-group"></i> Sessions</span>
|
||||
<div class="session-tabs" id="sessionTabs"></div>
|
||||
<button class="btn btn-sm btn-cyan" onclick="createNewSession()" title="New Session">
|
||||
<i class="fas fa-plus"></i> New
|
||||
</button>
|
||||
<button class="btn btn-sm btn-danger" onclick="deleteSession()" title="Delete Session">
|
||||
<i class="fas fa-trash-alt"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Live Link Panel -->
|
||||
<div class="card live-panel" id="livePanel">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<i class="fas fa-globe" style="color: var(--green)"></i>
|
||||
Live Public Link
|
||||
<span id="liveBadge" class="badge badge-offline">
|
||||
<i class="fas fa-circle" style="font-size:0.5rem"></i> Offline
|
||||
</span>
|
||||
</div>
|
||||
<div style="display:flex; gap:8px; align-items:center;">
|
||||
<div id="liveSpinner" class="hidden" style="display:flex; align-items:center; gap:8px; color:var(--muted); font-size:0.85rem;">
|
||||
<div class="spinner"></div> Starting…
|
||||
<div class="app-root">
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
ENTERPRISE TOP APPLICATION HEADER
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
<header class="hin-header">
|
||||
<div class="header-left">
|
||||
<div class="brand-badge">
|
||||
<div class="brand-icon">
|
||||
<i class="fa-solid fa-cloud-arrow-up"></i>
|
||||
</div>
|
||||
<div class="brand-text">
|
||||
<h1>Host It Now</h1>
|
||||
<span>Enterprise Cloud Vault & Edge Relay</span>
|
||||
</div>
|
||||
</div>
|
||||
<button id="btnGoLive" class="btn btn-green" onclick="startTunnel()">
|
||||
<i class="fas fa-satellite-dish"></i> Go Live
|
||||
</button>
|
||||
<button id="btnStopLive" class="btn btn-danger hidden" onclick="stopTunnel()">
|
||||
<i class="fas fa-power-off"></i> Stop
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="liveUrlRow" class="card-body hidden" style="padding:16px 20px;">
|
||||
<div class="live-actions">
|
||||
<div class="live-url-box">
|
||||
<i class="fas fa-link" style="color:var(--cyan); flex-shrink:0;"></i>
|
||||
<span class="live-url-text" id="liveUrlText"></span>
|
||||
<div class="header-center">
|
||||
<!-- Global Metrics Strip -->
|
||||
<div class="header-metrics">
|
||||
<div class="metric-pill" title="Total active hosting sessions">
|
||||
<i class="fa-solid fa-layer-group text-cyan"></i>
|
||||
<span class="metric-label">Sessions:</span>
|
||||
<span class="metric-val" id="metric-total-sessions">0</span>
|
||||
</div>
|
||||
<div class="metric-pill" title="Total hosted files across active session">
|
||||
<i class="fa-solid fa-images text-purple"></i>
|
||||
<span class="metric-label">Files:</span>
|
||||
<span class="metric-val" id="metric-total-files">0</span>
|
||||
</div>
|
||||
<div class="metric-pill" title="Total requests served">
|
||||
<i class="fa-solid fa-bolt text-amber"></i>
|
||||
<span class="metric-label">Requests:</span>
|
||||
<span class="metric-val" id="metric-total-reqs">0</span>
|
||||
</div>
|
||||
<div class="metric-pill" title="Total bandwidth transferred">
|
||||
<i class="fa-solid fa-arrow-right-arrow-left text-green"></i>
|
||||
<span class="metric-label">Bandwidth:</span>
|
||||
<span class="metric-val" id="metric-total-bytes">0 MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-cyan btn-sm" onclick="copyLiveUrl()">
|
||||
<i class="fas fa-copy"></i> Copy
|
||||
</div>
|
||||
|
||||
<div class="header-right">
|
||||
<button class="btn btn-secondary btn-sm" onclick="openTelemetryModal()" title="View live server traffic and access telemetry">
|
||||
<i class="fa-solid fa-chart-line text-cyan"></i> Telemetry
|
||||
</button>
|
||||
<a id="liveOpenBtn" href="#" target="_blank" class="btn btn-sm">
|
||||
<i class="fas fa-external-link-alt"></i> Open
|
||||
<a href="/radheradhe/" target="_blank" class="btn btn-secondary btn-sm" title="Open administrator dashboard">
|
||||
<i class="fa-solid fa-shield-halved text-purple"></i> Admin
|
||||
</a>
|
||||
<button class="btn btn-sm" onclick="regenerateTunnel()" title="Regenerate">
|
||||
<i class="fas fa-sync-alt"></i>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
SESSION GOVERNANCE & SWITCHER RAIL
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
<section class="session-governance-strip">
|
||||
<div class="session-rail-left">
|
||||
<span class="rail-title"><i class="fa-solid fa-server"></i> Active Sessions</span>
|
||||
<div class="session-tabs-rail" id="sessionTabsRail">
|
||||
<!-- Populated dynamically by app.js -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="session-rail-actions">
|
||||
<button class="btn btn-cyan btn-sm" onclick="openNewSessionModal()" title="Create a new hosting session">
|
||||
<i class="fa-solid fa-plus"></i> New Session
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-sm" onclick="openGovernanceModal()" title="Configure time limit and session governance">
|
||||
<i class="fa-solid fa-clock"></i> Governance
|
||||
</button>
|
||||
<button class="btn btn-danger btn-sm" onclick="deleteCurrentSession()" title="Delete active session and free resources">
|
||||
<i class="fa-solid fa-trash-can"></i>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
PUBLIC LIVE LINK & TUNNEL HUD
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
<section class="live-tunnel-card" id="livePanel">
|
||||
<div class="tunnel-header">
|
||||
<div class="tunnel-info">
|
||||
<div class="tunnel-status-badge badge-offline" id="liveBadge">
|
||||
<span class="status-dot"></span>
|
||||
<span id="liveStatusText">Offline</span>
|
||||
</div>
|
||||
<div class="tunnel-governance-pill" id="tunnelGovernancePill" title="Session time limit countdown">
|
||||
<i class="fa-solid fa-hourglass-half"></i>
|
||||
<span id="sessionTtlText">Unlimited (Enterprise)</span>
|
||||
</div>
|
||||
<div class="tunnel-mode-pill" id="sessionModePill">
|
||||
<i class="fa-solid fa-cloud"></i>
|
||||
<span id="sessionModeText">Server Vault</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tunnel-controls">
|
||||
<div id="liveSpinner" class="tunnel-spinner hidden">
|
||||
<i class="fa-solid fa-circle-notch fa-spin"></i> Initializing Gateway…
|
||||
</div>
|
||||
<button id="btnGoLive" class="btn btn-green btn-sm" onclick="startTunnel()">
|
||||
<i class="fa-solid fa-satellite-dish"></i> Go Live (Public Tunnel)
|
||||
</button>
|
||||
<button id="btnStopLive" class="btn btn-danger btn-sm hidden" onclick="stopTunnel()">
|
||||
<i class="fa-solid fa-power-off"></i> Stop Tunnel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="liveUrlRow" class="tunnel-url-row hidden">
|
||||
<div class="url-input-box">
|
||||
<i class="fa-solid fa-link text-cyan"></i>
|
||||
<span class="url-text" id="liveUrlText"></span>
|
||||
</div>
|
||||
<div class="url-actions">
|
||||
<button class="btn btn-secondary btn-sm" onclick="copyLiveUrl()" title="Copy live URL to clipboard">
|
||||
<i class="fa-solid fa-copy"></i> Copy
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-sm" onclick="openQrModal('Public Session Link', document.getElementById('liveUrlText').textContent)" title="Display QR Code for mobile scanning">
|
||||
<i class="fa-solid fa-qrcode"></i> QR
|
||||
</button>
|
||||
<a id="liveOpenBtn" href="#" target="_blank" class="btn btn-secondary btn-sm" title="Open live URL in new tab">
|
||||
<i class="fa-solid fa-arrow-up-right-from-square"></i> Open
|
||||
</a>
|
||||
<button class="btn btn-secondary btn-sm" onclick="regenerateTunnel()" title="Regenerate tunnel URL">
|
||||
<i class="fa-solid fa-rotate"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
CONTENT INGESTION & HOSTING MODES
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
<section class="ingest-card">
|
||||
<!-- Mode Selector Tabs -->
|
||||
<div class="ingest-tabs">
|
||||
<button class="ingest-tab active" data-tab="vault" onclick="switchIngestMode('vault')">
|
||||
<i class="fa-solid fa-cloud-arrow-up"></i>
|
||||
<div class="tab-meta">
|
||||
<strong>Server Background Vault</strong>
|
||||
<span>Persistent 24/7 hosting · Survives browser close</span>
|
||||
</div>
|
||||
</button>
|
||||
<button class="ingest-tab" data-tab="path" onclick="switchIngestMode('path')">
|
||||
<i class="fa-solid fa-hard-drive"></i>
|
||||
<div class="tab-meta">
|
||||
<strong>Host Server Directory</strong>
|
||||
<span>Map any existing filesystem path on host</span>
|
||||
</div>
|
||||
</button>
|
||||
<button class="ingest-tab" data-tab="relay" onclick="switchIngestMode('relay')">
|
||||
<i class="fa-solid fa-tower-broadcast"></i>
|
||||
<div class="tab-meta">
|
||||
<strong>Browser Relay (P2P Memory)</strong>
|
||||
<span>Direct client stream · Zero disk footprint</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Ingest Body: Mode 1 - Server Background Vault -->
|
||||
<div class="ingest-content" id="mode-content-vault">
|
||||
<input type="file" id="vaultFolderInput" webkitdirectory directory multiple style="display:none" onchange="handleVaultUpload(event, 'folder')">
|
||||
<input type="file" id="vaultFileInput" multiple style="display:none" onchange="handleVaultUpload(event, 'file')">
|
||||
<input type="file" id="vaultZipInput" accept=".zip" style="display:none" onchange="handleZipUpload(event)">
|
||||
|
||||
<div class="vault-dropzone" id="vaultDropzone">
|
||||
<div class="dropzone-icon">
|
||||
<i class="fa-solid fa-cloud-arrow-up"></i>
|
||||
</div>
|
||||
<div class="dropzone-text">
|
||||
<h3>Drop Images, Folders, or ZIP Archives to Host in Background</h3>
|
||||
<p>Uploaded directly to the secure server vault so files remain online even if your browser is closed.</p>
|
||||
</div>
|
||||
<div class="dropzone-buttons">
|
||||
<button class="btn btn-cyan btn-sm" onclick="document.getElementById('vaultFileInput').click()">
|
||||
<i class="fa-solid fa-file-arrow-up"></i> Upload Files
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-sm" onclick="document.getElementById('vaultFolderInput').click()">
|
||||
<i class="fa-solid fa-folder-plus"></i> Upload Folder
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-sm" onclick="document.getElementById('vaultZipInput').click()" title="Automatically unpacks all contents into session">
|
||||
<i class="fa-solid fa-file-zipper"></i> Upload .ZIP Archive
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="upload-progress-container hidden" id="uploadProgressBox">
|
||||
<div class="progress-info">
|
||||
<span id="uploadStatusText">Uploading files to server vault...</span>
|
||||
<span id="uploadPercentText" class="font-mono">0%</span>
|
||||
</div>
|
||||
<div class="progress-bar-bg">
|
||||
<div class="progress-bar-fill" id="uploadProgressBar"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Ingest Body: Mode 2 - Host Server Directory -->
|
||||
<div class="ingest-content hidden" id="mode-content-path">
|
||||
<div class="path-input-group">
|
||||
<div class="input-wrapper">
|
||||
<i class="fa-solid fa-folder text-cyan"></i>
|
||||
<input type="text" class="text-input" id="pathInput" placeholder="Enter absolute server directory path — e.g. /home/user/images or /var/www/assets">
|
||||
</div>
|
||||
<button class="btn btn-cyan" onclick="setFolderPath()">
|
||||
<i class="fa-solid fa-map-pin"></i> Map Directory
|
||||
</button>
|
||||
<button class="btn btn-secondary" onclick="openServerDirModal()" title="Explore server filesystem visually">
|
||||
<i class="fa-solid fa-folder-tree"></i> Browse Server
|
||||
</button>
|
||||
</div>
|
||||
<p class="input-hint"><i class="fa-solid fa-shield-halved"></i> Directly mounts an existing directory from the server filesystem with zero upload delay.</p>
|
||||
</div>
|
||||
|
||||
<!-- Ingest Body: Mode 3 - Browser Relay (P2P) -->
|
||||
<div class="ingest-content hidden" id="mode-content-relay">
|
||||
<input type="file" id="relayFolderInput" webkitdirectory directory multiple style="display:none" onchange="handleRelaySelect(event, 'folder')">
|
||||
<input type="file" id="relayFileInput" multiple style="display:none" onchange="handleRelaySelect(event, 'file')">
|
||||
|
||||
<div class="relay-action-grid">
|
||||
<button class="relay-card-btn" onclick="document.getElementById('relayFolderInput').click()">
|
||||
<i class="fa-solid fa-folder-open text-purple"></i>
|
||||
<strong>Relay Folder from Device</strong>
|
||||
<span>Stream entire folder tree from browser memory</span>
|
||||
</button>
|
||||
<button class="relay-card-btn" onclick="document.getElementById('relayFileInput').click()">
|
||||
<i class="fa-solid fa-images text-cyan"></i>
|
||||
<strong>Relay Files from Device</strong>
|
||||
<span>Select individual images to stream directly</span>
|
||||
</button>
|
||||
</div>
|
||||
<p class="input-hint"><i class="fa-solid fa-circle-info"></i> Browser Relay streams files on-demand via SSE memory without writing to server disk. Note: browser tab must remain open.</p>
|
||||
</div>
|
||||
|
||||
<!-- Active Status Bar -->
|
||||
<div class="hin-status-bar" id="statusBar">
|
||||
<div class="status-left">
|
||||
<i class="fa-solid fa-circle-check text-green" id="statusIcon"></i>
|
||||
<span id="statusText">Session active</span>
|
||||
</div>
|
||||
<div class="status-right" id="statusDetails">
|
||||
<span id="statusFileCountPill" class="meta-pill">0 files</span>
|
||||
<span id="statusSizePill" class="meta-pill">0 MB</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
EXPLORER: SEARCH, FILTERS & BULK ACTIONS
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
<section class="explorer-card">
|
||||
<div class="explorer-toolbar">
|
||||
<div class="toolbar-search">
|
||||
<i class="fa-solid fa-magnifying-glass"></i>
|
||||
<input type="text" id="fileSearchInput" placeholder="Filter files by name, folder, or extension..." oninput="handleSearchFilter(this.value)">
|
||||
</div>
|
||||
|
||||
<div class="toolbar-filter-chips">
|
||||
<button class="filter-chip active" data-filter="all" onclick="setCategoryFilter('all')">All</button>
|
||||
<button class="filter-chip" data-filter="images" onclick="setCategoryFilter('images')">Images</button>
|
||||
<button class="filter-chip" data-filter="code" onclick="setCategoryFilter('code')">Code & JSON</button>
|
||||
<button class="filter-chip" data-filter="docs" onclick="setCategoryFilter('docs')">Docs & Other</button>
|
||||
</div>
|
||||
|
||||
<div class="toolbar-bulk-actions">
|
||||
<button class="btn btn-secondary btn-sm" onclick="openBatchExportModal()" title="Export all file URLs in multiple developer formats">
|
||||
<i class="fa-solid fa-share-nodes text-cyan"></i> Copy All URLs
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-sm" onclick="downloadSessionZip()" title="Download entire hosted session as a ZIP archive">
|
||||
<i class="fa-solid fa-file-zipper text-purple"></i> Download ZIP
|
||||
</button>
|
||||
<div class="view-toggle">
|
||||
<button class="view-btn active" id="btnViewGrid" onclick="setViewMode('grid')" title="Grid View"><i class="fa-solid fa-grip"></i></button>
|
||||
<button class="view-btn" id="btnViewList" onclick="setViewMode('list')" title="List View"><i class="fa-solid fa-list"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Dynamic File Container -->
|
||||
<div id="filesContainer" class="files-container grid-mode">
|
||||
<!-- Populated dynamically by app.js -->
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════
|
||||
MODALS & DIALOGS
|
||||
═══════════════════════════════════════════════════════════ -->
|
||||
|
||||
<!-- New Session & Governance Modal -->
|
||||
<div class="modal-backdrop" id="sessionGovModal" style="display: none;">
|
||||
<div class="modal-card">
|
||||
<div class="modal-header">
|
||||
<h3><i class="fa-solid fa-shield-halved text-cyan"></i> Session Governance & Time Limit</h3>
|
||||
<button class="modal-close-btn" onclick="closeGovernanceModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>Session Name</label>
|
||||
<input type="text" id="govSessionName" class="text-input" placeholder="e.g. Product Demo Assets">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Hosting Mode</label>
|
||||
<select id="govSessionMode" class="text-input">
|
||||
<option value="server_background">Server Background Vault (Persistent 24/7)</option>
|
||||
<option value="local_path">Local Server Directory Path</option>
|
||||
<option value="relay">Browser Relay (P2P Memory)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Governance Time Limit (Auto-Expiration)</label>
|
||||
<select id="govTimeLimitSel" class="text-input">
|
||||
<option value="0">Unlimited (Enterprise Permanent)</option>
|
||||
<option value="900">15 Minutes (Scratch Session)</option>
|
||||
<option value="3600">1 Hour (Quick QA Test)</option>
|
||||
<option value="14400">4 Hours (Standard Review)</option>
|
||||
<option value="86400">24 Hours (Full Day Demo)</option>
|
||||
<option value="604800">7 Days (Production Sprint)</option>
|
||||
</select>
|
||||
<span class="form-hint"><i class="fa-solid fa-hourglass-start"></i> When the time limit expires, the server automatically terminates the session and purges temporary files to free resources.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary btn-sm" onclick="closeGovernanceModal()">Cancel</button>
|
||||
<button class="btn btn-cyan btn-sm" onclick="saveSessionGovernance()">Apply Settings</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- QR Code Scan Modal -->
|
||||
<div class="modal-backdrop" id="qrModal" style="display: none;">
|
||||
<div class="modal-card" style="max-width: 420px; text-align: center;">
|
||||
<div class="modal-header">
|
||||
<h3 id="qrModalTitle"><i class="fa-solid fa-qrcode text-cyan"></i> Scan QR Code</h3>
|
||||
<button class="modal-close-btn" onclick="closeQrModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
<div class="modal-body" style="display: flex; flex-direction: column; align-items: center; gap: 14px;">
|
||||
<div class="qr-canvas-box" id="qrCodeContainer"></div>
|
||||
<div class="url-input-box" style="width: 100%;">
|
||||
<span class="url-text" id="qrUrlText" style="font-size: 11px;"></span>
|
||||
</div>
|
||||
<p style="font-size: 11.5px; color: var(--muted); margin: 0;">Scan with any smartphone or mobile camera to open this hosted asset directly.</p>
|
||||
</div>
|
||||
<div class="modal-footer" style="justify-content: center;">
|
||||
<button class="btn btn-cyan btn-sm" onclick="copyText(document.getElementById('qrUrlText').textContent)">
|
||||
<i class="fa-solid fa-copy"></i> Copy Link
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Host Content Card -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<i class="fas fa-folder-open" style="color:var(--cyan)"></i>
|
||||
Host Your Content
|
||||
<!-- Media Fullscreen Lightbox Modal -->
|
||||
<div class="modal-backdrop" id="lightboxModal" style="display: none;" onclick="closeLightbox(event)">
|
||||
<div class="lightbox-card" onclick="event.stopPropagation()">
|
||||
<div class="lightbox-header">
|
||||
<span class="lightbox-title" id="lightboxTitle">Image Preview</span>
|
||||
<div class="lightbox-actions">
|
||||
<a id="lightboxDlBtn" href="#" download class="btn btn-secondary btn-sm"><i class="fa-solid fa-download"></i> Download</a>
|
||||
<button class="modal-close-btn" onclick="closeLightbox()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<input type="file" id="folderInput" webkitdirectory directory multiple style="display:none" onchange="handleFileSelect(event,'folder')">
|
||||
<input type="file" id="fileInput" multiple style="display:none" onchange="handleFileSelect(event,'file')">
|
||||
|
||||
<div class="host-grid">
|
||||
<button class="host-btn" onclick="document.getElementById('folderInput').click()">
|
||||
<i class="fas fa-folder-plus"></i>
|
||||
Host a Folder
|
||||
</button>
|
||||
<button class="host-btn pink" onclick="document.getElementById('fileInput').click()">
|
||||
<i class="fas fa-file-upload"></i>
|
||||
Host Files
|
||||
</button>
|
||||
<div class="lightbox-body">
|
||||
<img id="lightboxImg" src="" alt="Fullscreen Preview">
|
||||
</div>
|
||||
|
||||
<div class="path-row">
|
||||
<input type="text" class="input-field" id="pathInput" placeholder="Or enter absolute server path — e.g. /home/user/images">
|
||||
<button class="btn" onclick="setFolderPath()">
|
||||
<i class="fas fa-map-pin"></i> Map
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="status-bar" id="statusBar">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
<span id="statusText">No active source — pick a folder or enter a server path.</span>
|
||||
<div class="lightbox-footer">
|
||||
<span id="lightboxDims" class="font-mono">Dimensions: --</span>
|
||||
<span id="lightboxSize" class="font-mono">Size: --</span>
|
||||
<span id="lightboxUrl" class="font-mono" style="max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Files List -->
|
||||
<div id="filesSection" class="files-section"></div>
|
||||
<!-- Code & JSON Viewer Modal -->
|
||||
<div class="modal-backdrop" id="codeModal" style="display: none;">
|
||||
<div class="modal-card" style="max-width: 760px;">
|
||||
<div class="modal-header">
|
||||
<h3 id="codeModalTitle"><i class="fa-solid fa-code text-cyan"></i> Document Viewer</h3>
|
||||
<div style="display: flex; gap: 8px;">
|
||||
<button class="btn btn-secondary btn-sm" onclick="copyCodeContent()"><i class="fa-solid fa-copy"></i> Copy Code</button>
|
||||
<button class="modal-close-btn" onclick="closeCodeModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body" style="padding: 0;">
|
||||
<pre class="code-viewport" id="codeModalContent"></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Server Directory Explorer Modal -->
|
||||
<div class="modal-backdrop" id="serverDirModal" style="display: none;">
|
||||
<div class="modal-card" style="max-width: 640px;">
|
||||
<div class="modal-header">
|
||||
<h3><i class="fa-solid fa-folder-tree text-cyan"></i> Server Filesystem Explorer</h3>
|
||||
<button class="modal-close-btn" onclick="closeServerDirModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="server-dir-breadcrumb">
|
||||
<span id="serverDirCurrent">/</span>
|
||||
</div>
|
||||
<div class="server-dir-list" id="serverDirList">
|
||||
<!-- Populated dynamically by app.js -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary btn-sm" onclick="closeServerDirModal()">Cancel</button>
|
||||
<button class="btn btn-cyan btn-sm" onclick="selectCurrentServerDir()">Select Directory</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Real-Time Telemetry & Traffic Modal -->
|
||||
<div class="modal-backdrop" id="telemetryModal" style="display: none;">
|
||||
<div class="modal-card" style="max-width: 820px;">
|
||||
<div class="modal-header">
|
||||
<h3><i class="fa-solid fa-chart-line text-cyan"></i> Live Telemetry & Access Traffic</h3>
|
||||
<div style="display: flex; gap: 8px;">
|
||||
<button class="btn btn-secondary btn-sm" onclick="refreshTelemetry()"><i class="fa-solid fa-rotate"></i> Refresh</button>
|
||||
<button class="modal-close-btn" onclick="closeTelemetryModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="telemetry-stats-row">
|
||||
<div class="t-stat-card">
|
||||
<span class="t-stat-val" id="t-reqs">0</span>
|
||||
<span class="t-stat-label">Total HTTP Requests</span>
|
||||
</div>
|
||||
<div class="t-stat-card">
|
||||
<span class="t-stat-val" id="t-bytes">0 MB</span>
|
||||
<span class="t-stat-label">Bandwidth Transferred</span>
|
||||
</div>
|
||||
<div class="t-stat-card">
|
||||
<span class="t-stat-val" id="t-active-time">Active</span>
|
||||
<span class="t-stat-label">Last Ping</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/app.js" defer></script>
|
||||
<div class="ps-section-title" style="margin-top: 14px; font-size: 12px; color: var(--text-2); text-transform: uppercase;">Recent Access Logs (Last 50 Requests)</div>
|
||||
<div class="telemetry-log-table-wrap">
|
||||
<table class="telemetry-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Method</th>
|
||||
<th>Path</th>
|
||||
<th>Status</th>
|
||||
<th>Bytes</th>
|
||||
<th>Client IP</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="telemetryLogsBody">
|
||||
<tr><td colspan="6" style="text-align:center; color: var(--muted); padding: 18px;">No traffic events recorded yet.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Batch URLs Export Modal -->
|
||||
<div class="modal-backdrop" id="batchExportModal" style="display: none;">
|
||||
<div class="modal-card" style="max-width: 700px;">
|
||||
<div class="modal-header">
|
||||
<h3><i class="fa-solid fa-share-nodes text-cyan"></i> Export All Hosted URLs</h3>
|
||||
<button class="modal-close-btn" onclick="closeBatchExportModal()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="batch-export-formats">
|
||||
<button class="seg-pill active" onclick="switchExportFormat('raw')">Plain List</button>
|
||||
<button class="seg-pill" onclick="switchExportFormat('json')">JSON Array</button>
|
||||
<button class="seg-pill" onclick="switchExportFormat('markdown')">Markdown</button>
|
||||
<button class="seg-pill" onclick="switchExportFormat('html')">HTML Img</button>
|
||||
<button class="seg-pill" onclick="switchExportFormat('curl')">cURL Script</button>
|
||||
</div>
|
||||
<textarea id="batchExportTextarea" class="code-viewport" style="width: 100%; height: 240px; margin-top: 12px; font-size: 11.5px;" readonly></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary btn-sm" onclick="closeBatchExportModal()">Close</button>
|
||||
<button class="btn btn-cyan btn-sm" onclick="copyBatchExportContent()"><i class="fa-solid fa-copy"></i> Copy to Clipboard</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Toast Notification Container -->
|
||||
<div id="toast-container" class="toast-container"></div>
|
||||
|
||||
<!-- App Script -->
|
||||
<script src="/app.js?v=3.0" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1455
-500
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user