编写v203更新日志
This commit is contained in:
17
CHANGELOG
17
CHANGELOG
@@ -1,3 +1,20 @@
|
||||
## [203.0.0] - 2025-12-17
|
||||
|
||||
### Added
|
||||
- 首页新增即将上映模块
|
||||
- 新增剧集屏蔽功能
|
||||
- 换源增加重新测试和质量排序
|
||||
|
||||
### Changed
|
||||
- IOS全屏体验优化
|
||||
- 站点配置中的注册相关配置移动到了新的注册配置大项中
|
||||
- 默认站名从MoonTV改为MoonTVPlus
|
||||
- 用户管理现在会给oidc注册的用户显示oidc标识
|
||||
|
||||
### Fixed
|
||||
- 修复压缩节目单无法加载
|
||||
- 修复Docker环境下离线下载无法开启
|
||||
|
||||
## [202.0.0] - 2025-12-14
|
||||
|
||||
### Added
|
||||
|
||||
@@ -1 +1 @@
|
||||
202.0.0
|
||||
203.0.0
|
||||
@@ -27,6 +27,7 @@ import PageLayout from '@/components/PageLayout';
|
||||
import ScrollableRow from '@/components/ScrollableRow';
|
||||
import { useSite } from '@/components/SiteProvider';
|
||||
import VideoCard from '@/components/VideoCard';
|
||||
import HttpWarningDialog from '@/components/HttpWarningDialog';
|
||||
|
||||
function HomeClient() {
|
||||
const [activeTab, setActiveTab] = useState<'home' | 'favorites'>('home');
|
||||
@@ -41,6 +42,7 @@ function HomeClient() {
|
||||
const { announcement } = useSite();
|
||||
|
||||
const [showAnnouncement, setShowAnnouncement] = useState(false);
|
||||
const [showHttpWarning, setShowHttpWarning] = useState(true);
|
||||
|
||||
// 检查公告弹窗状态
|
||||
useEffect(() => {
|
||||
@@ -507,6 +509,11 @@ function HomeClient() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* HTTP 环境警告弹窗 */}
|
||||
{showHttpWarning && (
|
||||
<HttpWarningDialog onClose={() => setShowHttpWarning(false)} />
|
||||
)}
|
||||
|
||||
{/* 公告弹窗 */}
|
||||
{showAnnouncement && (
|
||||
<div className='fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-4'>
|
||||
|
||||
122
src/components/HttpWarningDialog.tsx
Normal file
122
src/components/HttpWarningDialog.tsx
Normal file
@@ -0,0 +1,122 @@
|
||||
'use client';
|
||||
|
||||
import { AlertTriangle } from 'lucide-react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { getAuthInfoFromBrowserCookie } from '@/lib/auth';
|
||||
|
||||
interface HttpWarningDialogProps {
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export default function HttpWarningDialog({ onClose }: HttpWarningDialogProps) {
|
||||
const [isVisible, setIsVisible] = useState(false);
|
||||
const [shouldShow, setShouldShow] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
// 检查是否应该显示弹窗
|
||||
const checkShouldShow = () => {
|
||||
// 只在客户端执行
|
||||
if (typeof window === 'undefined') return false;
|
||||
|
||||
// 检查是否已经选择不再提示
|
||||
const dontShowAgain = localStorage.getItem('httpWarningDismissed');
|
||||
if (dontShowAgain === 'true') return false;
|
||||
|
||||
// 检查是否是站长
|
||||
const authInfo = getAuthInfoFromBrowserCookie();
|
||||
if (!authInfo || authInfo.role !== 'owner') return false;
|
||||
|
||||
// 检查是否是 HTTP 环境(非 localhost 和 127.0.0.1)
|
||||
const { protocol, hostname } = window.location;
|
||||
const isHttp = protocol === 'http:';
|
||||
const isLocalhost = hostname === 'localhost' || hostname === '127.0.0.1';
|
||||
|
||||
// 只在 HTTP 且非本地环境下显示
|
||||
return isHttp && !isLocalhost;
|
||||
};
|
||||
|
||||
const shouldDisplay = checkShouldShow();
|
||||
setShouldShow(shouldDisplay);
|
||||
|
||||
if (shouldDisplay) {
|
||||
// 延迟显示动画
|
||||
setTimeout(() => setIsVisible(true), 100);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const handleDontShowAgain = () => {
|
||||
localStorage.setItem('httpWarningDismissed', 'true');
|
||||
handleClose();
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
setIsVisible(false);
|
||||
setTimeout(() => {
|
||||
onClose();
|
||||
}, 300);
|
||||
};
|
||||
|
||||
// 如果不需要显示,直接返回 null
|
||||
if (!shouldShow) return null;
|
||||
|
||||
return createPortal(
|
||||
<div
|
||||
className={`fixed inset-0 bg-black bg-opacity-50 z-[9999] flex items-center justify-center p-4 transition-opacity duration-300 ${
|
||||
isVisible ? 'opacity-100' : 'opacity-0'
|
||||
}`}
|
||||
onClick={handleClose}
|
||||
>
|
||||
<div
|
||||
className={`bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full border border-yellow-200 dark:border-yellow-800 transition-all duration-300 ${
|
||||
isVisible ? 'scale-100' : 'scale-95'
|
||||
}`}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<div className="p-6">
|
||||
{/* 图标和标题 */}
|
||||
<div className="flex items-start gap-4 mb-4">
|
||||
<div className="flex-shrink-0">
|
||||
<AlertTriangle className="w-8 h-8 text-yellow-500" />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<h3 className="text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2">
|
||||
HTTP 环境功能限制提示
|
||||
</h3>
|
||||
<div className="text-sm text-gray-600 dark:text-gray-400 space-y-2">
|
||||
<p>
|
||||
检测到您正在使用 HTTP 协议访问本站。由于浏览器安全策略限制,以下功能将无法正常使用:
|
||||
</p>
|
||||
<ul className="list-disc list-inside space-y-1 ml-2">
|
||||
<li>视频超分(AI 画质增强)</li>
|
||||
<li>麦克风语音功能</li>
|
||||
<li>其他需要安全上下文的高级功能</li>
|
||||
</ul>
|
||||
<p className="mt-3 text-yellow-600 dark:text-yellow-500 font-medium">
|
||||
建议配置 HTTPS 证书以获得完整功能体验。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 按钮组 */}
|
||||
<div className="flex gap-3 mt-6">
|
||||
<button
|
||||
onClick={handleDontShowAgain}
|
||||
className="flex-1 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors"
|
||||
>
|
||||
不再提示
|
||||
</button>
|
||||
<button
|
||||
onClick={handleClose}
|
||||
className="flex-1 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors"
|
||||
>
|
||||
我知道了
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>,
|
||||
document.body
|
||||
);
|
||||
}
|
||||
@@ -11,6 +11,25 @@ export interface ChangelogEntry {
|
||||
|
||||
export const changelog: ChangelogEntry[] = [
|
||||
{
|
||||
version: '203.0.0',
|
||||
date: '2025-12-17',
|
||||
added: [
|
||||
'首页新增即将上映模块',
|
||||
'新增剧集屏蔽功能',
|
||||
'换源增加重新测试和质量排序'
|
||||
],
|
||||
changed: [
|
||||
'IOS全屏体验优化',
|
||||
'站点配置中的注册相关配置移动到了新的注册配置大项中',
|
||||
'默认站名从MoonTV改为MoonTVPlus',
|
||||
'用户管理现在会给oidc注册的用户显示oidc标识',
|
||||
],
|
||||
fixed: [
|
||||
'修复压缩节目单无法加载',
|
||||
'修复Docker环境下离线下载无法开启'
|
||||
]
|
||||
},
|
||||
{
|
||||
version: '202.0.0',
|
||||
date: '2025-12-14',
|
||||
added: [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const CURRENT_VERSION = '202.0.0';
|
||||
const CURRENT_VERSION = '203.0.0';
|
||||
|
||||
// 导出当前版本号供其他地方使用
|
||||
export { CURRENT_VERSION };
|
||||
|
||||
Reference in New Issue
Block a user