feat: add versioning support for assets and update version to 1.0.0
All checks were successful
Deploy / deploy (push) Successful in 12s

This commit is contained in:
M1ngdaXie
2026-05-07 21:46:53 +08:00
parent 74554210dd
commit 01a429f8e1
6 changed files with 17 additions and 6 deletions

View File

@@ -2,8 +2,10 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg?v=1.0.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="version" content="1.0.0" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
<title>MingdaOS</title> <title>MingdaOS</title>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

View File

@@ -1,7 +1,7 @@
{ {
"name": "mingda-os", "name": "mingda-os",
"private": true, "private": true,
"version": "0.0.0", "version": "1.0.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@@ -1,3 +1,5 @@
import { APP_VERSION } from '../config/version';
export default function AboutMe() { export default function AboutMe() {
return ( return (
<div <div
@@ -134,7 +136,7 @@ export default function AboutMe() {
Signed Identity Signed Identity
</span> </span>
<a <a
href="/pgp.asc" href={`/pgp.asc?v=${APP_VERSION}`}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
style={{ style={{

View File

@@ -1,5 +1,6 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import './MenuBar.css'; import './MenuBar.css';
import { APP_VERSION } from '../../config/version';
const MENU_ITEMS = ['encrypt', 'sign', 'verify', 'wipe', 'about']; const MENU_ITEMS = ['encrypt', 'sign', 'verify', 'wipe', 'about'];
const BOOT_AT = Date.now(); const BOOT_AT = Date.now();
@@ -19,7 +20,7 @@ export default function MenuBar() {
return ( return (
<div className="menubar"> <div className="menubar">
<div className="menubar-left"> <div className="menubar-left">
<span className="menubar-logo">[ MingdaOS ]</span> <span className="menubar-logo">[ MingdaOS v{APP_VERSION} ]</span>
{MENU_ITEMS.map(item => ( {MENU_ITEMS.map(item => (
<span key={item} className="menubar-item">{item}</span> <span key={item} className="menubar-item">{item}</span>
))} ))}

View File

@@ -7,6 +7,7 @@ import Alfred from '../apps/Alfred';
import Chengyu from '../apps/Chengyu'; import Chengyu from '../apps/Chengyu';
import Poker from '../apps/Poker'; import Poker from '../apps/Poker';
import Trash from '../apps/Trash'; import Trash from '../apps/Trash';
import { withVersion } from './version';
export const APPS: AppConfig[] = [ export const APPS: AppConfig[] = [
{ {
@@ -94,7 +95,7 @@ export const APPS: AppConfig[] = [
title: 'Collab', title: 'Collab',
emoji: '', emoji: '',
iconGradient: 'linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02))', iconGradient: 'linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02))',
iconImage: '/docnest-icon-32.png', iconImage: withVersion('/docnest-icon-32.png'),
defaultSize: { width: 400, height: 360 }, defaultSize: { width: 400, height: 360 },
defaultPosition: { x: 0, y: 0 }, defaultPosition: { x: 0, y: 0 },
component: Links, component: Links,
@@ -120,5 +121,5 @@ export const WALLPAPERS = [
// Solid dark — flat and minimal // Solid dark — flat and minimal
`linear-gradient(135deg, #050510 0%, #080818 100%)`, `linear-gradient(135deg, #050510 0%, #080818 100%)`,
// Pixel city — neon cityscape // Pixel city — neon cityscape
`url(/wallpaper-city.png)`, `url(${withVersion('/wallpaper-city.png')})`,
]; ];

5
src/config/version.ts Normal file
View File

@@ -0,0 +1,5 @@
export const APP_VERSION = '1.0.0';
export function withVersion(url: string): string {
return url.includes('?') ? `${url}&v=${APP_VERSION}` : `${url}?v=${APP_VERSION}`;
}