Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ COPY . .

# Build the project with Trunk for production (Docker settings overridden)
RUN trunk build --release --dist dist --public-url / && \
git rev-parse HEAD > dist/version
git rev-parse --short HEAD > dist/version && \
TZ=Europe/Moscow date '+%Y-%m-%d %H:%M:%S %Z' > dist/build_time

FROM nginx:alpine
WORKDIR /usr/share/nginx/html
Expand Down
31 changes: 30 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
animation: spin 1s linear infinite;
margin-right: 15px;
}

#build-info {
position: fixed;
top: 0;
left: 50%;
transform: translateX(-50%);
background: #34495e;
color: #4ade80;
padding: 4px 8px;
z-index: 1000;
font-size: 14px;
}

@keyframes spin {
0% { transform: rotate(0deg); }
Expand All @@ -41,6 +53,7 @@
</style>
</head>
<body>
<div id="build-info"></div>
<!-- Loading screen -->
<div id="loading">
<div class="spinner"></div>
Expand All @@ -52,5 +65,21 @@ <h2>🦀 Loading Crypto Chart...</h2>

<!-- Trunk will attach the WASM here automatically -->
<link data-trunk rel="rust" data-wasm-opt="z" />
<script>
async function loadBuildInfo() {
try {
const [commitRes, timeRes] = await Promise.all([
fetch('version'),
fetch('build_time'),
]);
const commit = (await commitRes.text()).trim();
const time = (await timeRes.text()).trim();
document.getElementById('build-info').textContent = `Build: ${commit} (${time})`;
} catch (e) {
console.error('Failed to load build info', e);
}
}
loadBuildInfo();
</script>
</body>
</html>
</html>
Loading