const{createApp}=Vue const{createVuetify,useGoTo,useDisplay}=Vuetify var data={alert:{show:false,color:'success',text:'',timeout:0,},theme:{dark:false,},nav:{showDrawer:false,showTOC:true,tocPanel:0,tab:'account',post:{discussionId:5880,currentPage:1,targetPage:1,total:9,anchor:0,goToOptions:{container:null,duration:0,easing:'easeInOutCubic',offset:-100,},worker:null,task:[],active:[],apiLock:[],originLike:new Map([]),},related:{block:1,}},search:{width:80,text:null,loading:false,},tags:[{id:3,url:'/t/2b05770f6a045c7763772a264105',name:'Bandwagon',color:'#FF8F00',icon:'mdi-server-plus',},],posts:[{id:67349,num:0,uid:1468,content:'\u003Cp\u003E刚玩VPS那会老馋这个机了,可惜现在出了新盒子,Plan系列全成小丑了,甚至觉得这款还不如MINIBOX。。今天看到有坛友在出,就收来体验一下,到期还得抛。网络质量体检脚本跑一半关机了也是没绷住。\u003Cbr\u003E\u003Cimg src\u003D\"https://img.xxxh.de/1742567839885.png\" alt\u003D\"image\"\u003E\u003C/p\u003E\u003Ccode\u003E--------------------- A Bench Script By spiritlhl ---------------------- 测评频道: https://t.me/vps_reviews VPS融合怪版本:2025.02.12Shell项目地址:https://github.com/spiritLHLS/ecsGo项目地址:https://github.com/oneclickvirt/ecs---------------------基础信息查询--感谢所有开源项目--------------------- CPU 型号 : QEMU Virtual CPU version (cpu64-rhel6) CPU 核心数 : 1 CPU 频率 : 2599.998 MHz CPU 缓存 : L1: 64.00 KB / L2: 4.00 MB / L3: 16.00 MB AES-NI指令集 : ✔ Enabled VM-x/AMD-V支持 : ❌ Disabled 内存 : 171.01 MiB / 788.40 MiB Swap : 14.08 MiB / 417.00 MiB 硬盘空间 : 2.46 GiB / 14.32 GiB 启动盘路径 : /dev/sda2 系统在线时间 : 0 days, 0 hour 8 min 负载 : 1.34, 1.40, 0.66 系统 : Debian GNU/Linux 11 (bullseye) (x86_64) 架构 : x86_64 (64 Bit) 内核 : 5.10.0-8-amd64 TCP加速方式 : bbr 虚拟化架构 : KVM NAT类型 : Full Cone IPV4 ASN : AS25820 IT7 Networks Inc IPV4 位置 : Los Angeles / California / US----------------------CPU测试--通过sysbench测试------------------------- -\u0026gt; CPU 测试中 (Fast Mode, 1-Pass @ 5sec) 1 线程测试(单核)得分: 620 Scores---------------------内存测试--感谢lemonbench开源----------------------- -\u0026gt; 内存测试 Test (Fast Mode, 1-Pass @ 5sec) 单线程读测试: 13172.45 MB/s 单线程写测试: 10253.98 MB/s------------------磁盘dd读写测试--感谢lemonbench开源-------------------- -\u0026gt; 磁盘IO测试中 (4K Block/1M Block, Direct Mode) 测试操作 写速度 读速度 100MB-4K Block 11.3 MB/s (2754 IOPS, 9.29s) 12.6 MB/s (3069 IOPS, 8.34s) 1GB-1M Block 212 MB/s (202 IOPS, 4.95s) 688 MB/s (655 IOPS, 1.52s)---------------------磁盘fio读写测试--感谢yabs开源----------------------Block Size | 4k (IOPS) | 64k (IOPS) ------ | --- ---- | ---- ---- Read | 30.13 MB/s (7.5k) | 359.82 MB/s (5.6k)Write | 30.14 MB/s (7.5k) | 361.71 MB/s (5.6k)Total | 60.27 MB/s (15.0k) | 721.53 MB/s (11.2k) | | Block Size | 512k (IOPS) | 1m (IOPS) ------ | --- ---- | ---- ---- Read | 720.33 MB/s (1.4k) | 845.30 MB/s (825)Write | 758.61 MB/s (1.4k) | 901.59 MB/s (880)Total | 1.47 GB/s (2.8k) | 1.74 GB/s (1.7k)------------流媒体解锁--基于oneclickvirt/CommonMediaTests开源-----------以下测试的解锁地区是准确的,但是不是完整解锁的判断可能有误,这方面仅作参考使用----------------Netflix-----------------[IPV4]您的出口IP可以使用Netflix,但仅可看Netflix自制剧NF所识别的IP地域信息:美国[IPV6]您的网络可能没有正常配置IPv6,或者没有IPv6网络接入----------------Youtube-----------------[IPV4]连接方式: Youtube Video Server视频缓存节点地域: 美国 洛杉机(LAX31S13)[IPV6]Youtube在您的出口IP所在的国家不提供服务---------------DisneyPlus---------------[IPV4]当前IPv4出口所在地区即将开通DisneyPlus[IPV6]DisneyPlus在您的出口IP所在的国家不提供服务解锁Netflix,Youtube,DisneyPlus上面和下面进行比较,不同之处自行判断----------------流媒体解锁--感谢RegionRestrictionCheck开源-------------- 以下为IPV4网络测试,若无IPV4网络则无输出\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D[ Multination ]\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D Dazn: Failed (Error: ) Disney+: No (IP Banned By Disney+ 1) Netflix: Originals Only YouTube Premium: Yes (Region: US) Amazon Prime Video: Yes (Region: US) TVBAnywhere+: Yes Spotify Registration: Yes (Region: US) OneTrust Region: US [California] iQyi Oversea Region: US Bing Region: US (Risky) Apple Region: US YouTube CDN: Los Angeles, CA Netflix Preferred CDN: Los Angeles, CA ChatGPT: Yes Google Gemini: Yes (Region: USA) Claude: Yes Wikipedia Editability: No Google Play Store: United States Google Search CAPTCHA Free: Yes Steam Currency: USD ---Forum--- Reddit: No\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D\u003D 以下为IPV6网络测试,若无IPV6网络则无输出---------------TikTok解锁--感谢lmc999的源脚本及fscarmen PR-------------- Tiktok Region: 【US】-------------IP质量检测--基于oneclickvirt/securityCheck使用-------------数据仅作参考,不代表100%准确,如果和实际情况不一致请手动查询多个数据库比对以下为各数据库编号,输出结果后将自带数据库来源对应的编号ipinfo数据库 [0] | scamalytics数据库 [1] | virustotal数据库 [2] | abuseipdb数据库 [3] | ip2location数据库 [4]ip-api数据库 [5] | ipwhois数据库 [6] | ipregistry数据库 [7] | ipdata数据库 [8] | db-ip数据库 [9]ipapiis数据库 [A] | ipapicom数据库 [B] | bigdatacloud数据库 [C] | cheervision数据库 [D] | ipqualityscore数据库 [E]IPV4:安全得分:声誉(越高越好): 0 [2]信任得分(越高越好): 0 [8] VPN得分(越低越好): 100 [8] 代理得分(越低越好): 100 [8] 社区投票-无害: 0 [2] 社区投票-恶意: 0 [2] 威胁得分(越低越好): 100 [8] 欺诈得分(越低越好): 0 [1] 65 [E]滥用得分(越低越好): 0 [3] ASN滥用得分(越低越好): 0.0021 (Low) [A] 公司滥用得分(越低越好): 0.0029 (Low) [A] 威胁级别: low [9 B] 黑名单记录统计:(有多少黑名单网站有记录):无害记录数: 0 [2] 恶意记录数: 0 [2] 可疑记录数: 0 [2] 无记录数: 94 [2] 安全信息:使用类型: hosting [0 7 8 9] unknown [C] DataCenter/WebHosting/Transit [3] isp [A]公司类型: hosting [0] business [7 A]是否云提供商: Yes [7 D] 是否数据中心: No [1 C] Yes [0 5 6 8 A]是否移动设备: No [5 A C] Yes [E]是否代理: Yes [5 E] No [0 1 4 6 7 8 9 A B C D]是否VPN: Yes [6 7 A D E] No [0 1 C]是否Tor: No [0 1 3 6 7 8 A B C D E] 是否Tor出口: No [1 7 D]是否网络爬虫: No [9 A B E] 是否匿名: Yes [6 7 D] No [1 8]是否攻击者: No [7 8 D] 是否滥用者: No [7 8 A C D E] 是否威胁: No [7 8 C D] 是否中继: No [0 7 8 C D] 是否Bogon: No [7 8 A C D] 是否机器人: No [E] DNS-黑名单: 313(Total_Check) 0(Clean) 9(Blacklisted) 22(Other) Google搜索可行性:NO-------------邮件端口检测--基于oneclickvirt/portchecker开源-------------Platform SMTP SMTPS POP3 POP3S IMAP IMAPSLocalPort ✔ ✔ ✔ ✔ ✔ ✔ QQ ✔ ✔ ✔ ✘ ✔ ✘ 163 ✔ ✔ ✔ ✘ ✔ ✘ Sohu ✔ ✔ ✔ ✘ ✔ ✘ Yandex ✔ ✔ ✔ ✘ ✔ ✘ Gmail ✔ ✔ ✘ ✘ ✘ ✘ Outlook ✔ ✘ ✔ ✘ ✔ ✘ Office365 ✔ ✘ ✔ ✘ ✔ ✘ Yahoo ✔ ✔ ✘ ✘ ✘ ✘ MailCOM ✔ ✔ ✔ ✘ ✔ ✘ MailRU ✔ ✔ ✘ ✘ ✔ ✘ AOL ✔ ✔ ✘ ✘ ✘ ✘ GMX ✔ ✘ ✔ ✘ ✔ ✘ Sina ✔ ✔ ✔ ✘ ✔ ✘ Apple ✘ ✔ ✘ ✘ ✘ ✘ FastMail ✘ ✔ ✘ ✘ ✘ ✘ ProtonMail✘ ✘ ✘ ✘ ✘ ✘ MXRoute ✔ ✘ ✔ ✘ ✔ ✘ Namecrane ✔ ✔ ✔ ✘ ✔ ✘ XYAMail ✘ ✘ ✘ ✘ ✘ ✘ ZohoMail ✘ ✔ ✘ ✘ ✘ ✘ Inbox_eu ✔ ✔ ✔ ✘ ✘ ✘ Free_fr ✘ ✔ ✔ ✘ ✔ ✘ ----------------三网回程--基于oneclickvirt/backtrace开源----------------北京电信 219.141.140.10 电信CN2GIA [精品线路] 北京联通 202.106.195.68 电信CN2GIA [精品线路] 北京移动 221.179.155.161 移动CMIN2 [精品线路] 上海电信 202.96.209.133 电信CN2GIA [精品线路] 上海联通 210.22.97.1 电信CN2GIA [精品线路] 联通4837 [普通线路] 上海移动 211.136.112.200 移动CMIN2 [精品线路] 广州电信 58.60.188.222 电信CN2GIA [精品线路] 广州联通 210.21.196.6 电信CN2GIA [精品线路] 联通4837 [普通线路] 广州移动 120.196.165.24 移动CMIN2 [精品线路] 成都电信 61.139.2.69 电信CN2GIA [精品线路] 成都联通 119.6.6.6 电信CN2GIA [精品线路] 联通4837 [普通线路] 成都移动 211.137.96.205 移动CMIN2 [精品线路] 准确线路自行查看详细路由,本测试结果仅作参考同一目标地址多个线路时,可能检测已越过汇聚层,除了第一个线路外,后续信息可能无效---------------------回程路由--感谢fscarmen开源及PR---------------------依次测试电信/联通/移动经过的地区及线路,核心程序来自nexttrace,请知悉!广州电信 58.60.188.2229.96 ms * RFC19182.78 ms * RFC19180.45 ms AS25820 美国 加利福尼亚州 洛杉矶 it7.net154.09 ms * [CN2-Global] 中国 广东 广州 X-I chinatelecom.cn 电信155.68 ms * [CN2-Global] 中国 广东 广州 chinatelecom.cn 电信158.66 ms * [CN2-BackBone] 中国 广东 广州 chinatelecom.cn 电信162.63 ms * [CN2-BackBone] 中国 广东 广州 chinatelecom.cn 电信210.54 ms AS4134 中国 广东 佛山市 www.chinatelecom.com.cn 电信161.76 ms AS4134 中国 广东 深圳 福田区 www.chinatelecom.com.cn 电信广州联通 210.21.196.644.11 ms * RFC19184.99 ms * RFC19180.48 ms AS25820 美国 加利福尼亚州 洛杉矶 it7.net146.56 ms * [CN2-BackBone] 中国 广东 广州 chinatelecom.cn 电信159.75 ms * [CN2-BackBone] 中国 广东 广州 chinatelecom.cn 电信231.18 ms AS4837 [CU169-BACKBONE] 中国 广东 广州 chinaunicom.cn 联通237.46 ms AS4837 [CU169-BACKBONE] 中国 广东 广州 chinaunicom.cn 联通227.25 ms AS17816 [UNICOM-GD] 中国 广东省 广州市 chinaunicom.cn 联通213.43 ms AS17623 [APNIC-AP] 中国 广东 深圳 chinaunicom.cn 联通195.75 ms AS17623 中国 广东 深圳 宝安区 chinaunicom.cn 联通广州移动 120.196.165.2422.13 ms * RFC19185.66 ms * RFC19181.23 ms AS25820 美国 加利福尼亚州 洛杉矶 it7.net1.49 ms AS25820 美国 加利福尼亚州 洛杉矶 it7.net127.18 ms AS58807 [CMIN2-NET] 美国 加利福尼亚 洛杉矶 cmi.chinamobile.com 移动126.72 ms AS58807 [CMIN2-NET] 中国 上海 cmi.chinamobile.com 移动142.44 ms AS9808 [CMNET] 中国 上海 chinamobileltd.com 移动126.97 ms AS9808 [CMNET] 中国 上海 chinamobileltd.com 移动128.41 ms AS9808 [CMNET] 中国 上海 chinamobileltd.com 移动151.28 ms AS9808 [CMNET] 中国 北京 chinamobileltd.com 移动152.71 ms AS9808 [CMNET] 中国 北京 chinamobileltd.com 移动155.53 ms AS9808 [CMNET] 中国 北京 chinamobileltd.com 移动154.49 ms AS56040 [APNIC-AP] 中国 广东 深圳 gd.10086.cn 移动--------------------自动更新测速节点列表--本脚本原创--------------------位置 上传速度 下载速度 延迟 丢包率Speedtest.net 7117.04 Mbps 2921.10 Mbps 0.35 0.0%洛杉矶 5231.07 Mbps 3278.27 Mbps 0.69 0.0%联通成都 258.14 Mbps 4.19 Mbps 257.95 NULL电信Zhenjiang5G 405.55 Mbps 1018.56 Mbps 131.04 NULL电信Suzhou5G 426.02 Mbps 1063.33 Mbps 131.47 NULL------------------------------------------------------------------------ 总共花费 : 6 分 0 秒 时间 : Fri Mar 21 22:35:19 CST 2025------------------------------------------------------------------------\u003C/code\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:45:29',updatedAt:'2025-03-22 12:14:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67350,num:1,uid:1714,content:'\u003Cp\u003E这辣鸡cpu,全方位不如minibox\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:46:38',updatedAt:'2025-03-22 12:14:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67351,num:2,uid:6744,content:'\u003Cp\u003E瓦工最近背刺严重\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:46:46',updatedAt:'2025-03-22 12:14:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67352,num:3,uid:1496,content:'\u003Cp\u003E男人就是这样,最是意难平 \u003Cimg src\u003D\"/z/img/xhj/008.webp\"\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:47:50',updatedAt:'2025-03-22 12:14:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67353,num:4,uid:12577,content:'\u003Cp\u003E这款只有CMIN2线路还不错,其他规格都不太行\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 22:56:11',updatedAt:'2025-03-22 12:14:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67354,num:5,uid:5294,content:'\u003Cp\u003Edc9线路跟满意,马上到期,转dc1了。 \u003Cimg src\u003D\"/z/img/yct/022.webp\"\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 23:07:49',updatedAt:'2025-03-22 12:14:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67355,num:6,uid:1542,content:'\u003Cp\u003E古董cpu,该淘汰了\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-21 23:32:25',updatedAt:'2025-03-22 12:14:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67356,num:7,uid:1385,content:'\u003Cp\u003E当初小甜甜 如今牛夫人\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-22 07:30:43',updatedAt:'2025-03-22 12:14:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:67357,num:8,uid:1712,content:'\u003Cp\u003Eplan成最大小丑🤡\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-22 08:10:00',updatedAt:'2025-03-22 12:14:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[5294,{uid:5294,url:'/u/13204a5a6a045c726263526f00063604',avatar:'/a/13204a5a6a045c726263526f00063604',username:'chrimast🤖',}],[12577,{uid:12577,url:'/u/630c670c6a045d75656d516f391b6731',avatar:'/a/630c670c6a045d75656d516f391b6731',username:'ularry🤖',}],[1712,{uid:1712,url:'/u/3f3c75086a045c76676b546f2258057f',avatar:'/a/3f3c75086a045c76676b546f2258057f',username:'zhenhua🤖',}],[1496,{uid:1496,url:'/u/30304a3e6a045c766463506f235f3d34',avatar:'/a/30304a3e6a045c766463506f235f3d34',username:'先生在发呆🤖',}],[1542,{uid:1542,url:'/u/0008781a6a045c76656e546f363d1170',avatar:'/a/0008781a6a045c76656e546f363d1170',username:'RockyRoll🤖',}],[6744,{uid:6744,url:'/u/3e7a5a5f6a045c71676e526f110f1509',avatar:'/a/3e7a5a5f6a045c71676e526f110f1509',username:'Probert🤖',}],[1468,{uid:1468,url:'/u/337e063c6a045c76646c5e6f402a0610',avatar:'/a/337e063c6a045c76646c5e6f402a0610',username:'Ltachtm🤖',}],[1714,{uid:1714,url:'/u/3b21473d6a045c76676b526f3d503c13',avatar:'/a/3b21473d6a045c76676b526f3d503c13',username:'南山如雪mi🤖',}],[1385,{uid:1385,url:'/u/353a4b1e6a045c766362536f045d1d28',avatar:'/a/353a4b1e6a045c766362536f045d1d28',username:'oldthree2033🤖',}],]),related:[{title:'瓦工 SG CN2 46刀,市场价去到多少?听说线路很好。',url:'/d/2f01760c6a045c77606a567a475f656a06241e24',},{title:'求推荐个三网优化的鸡 要买',url:'/d/3d275f096a045c77606a567540516b6a227b1130',},{title:'请教各位,Bwg 跟Dmit 哪个能打一点?',url:'/d/1c1a06596a045c77606a5675405e656a002b6330',},{title:'请问付了一年前斯巴达的服务工单还能正常用吗,和搬瓦工 Plan 比该留哪一个',url:'/d/372a0a356a045c77606a56744551666a28162401',},{title:'瓦工的v6将来会做优化吗?',url:'/d/3f2c581f6a045c77606a5674465a656a3d253964',},{title:'你们对瓦工的megabox满意吗',url:'/d/6f207b016a045c77606a56774f5f646a240c2234',},{title:'去年的瓦工DC9 ,有人要么?$35.42 USD( 已出)',url:'/d/0e0f68246a045c77606a56774f5c616a262f0662',},{title:'搬瓦工 dc9 不到一个月,2025-04-15到期,放生了,改过邮 20出',url:'/d/382f74076a045c77606a56774f5a616a1b70061d',},{title:'我这个bwg的powerbox还能卖多少?',url:'/d/030660086a045c77606a5677405d616a5f700125',},{title:'biggerbox升级megabox pro记录贴',url:'/d/1e1874086a045c77606a5677405b646a3d373725',},{title:'瓦工日本还会重新推出吗',url:'/d/0d11035d6a045c77606a567742506b6a3f223d6b',},{title:'搬瓦工逆天 Bug',url:'/d/2e195c1c6a045c77606a567742516a6a357b360a',},{title:'150折价出瓦工BIGGERBOX',url:'/d/2c0660276a045c77606a5677435f666a152f0210',},{title:'MINIBOX也是CN2GIA了吗?',url:'/d/193068356a045c77606a5677435c656a29101015',},{title:'[出] 搬瓦工DC99机房POWERBOX-30-1536',url:'/d/020f7c2e6a045c77606a5677435c666a08053a22',},{title:'(出)原邮瓦工biggerbox未付订单,已承诺线路保障,也可升级到最新DC1机房',url:'/d/323e64156a045c77606a5677435b606a5e2d611c',},{title:'搬瓦工Box系列补货,可升级Pro更高级套餐,最后末班车速速上车,赶快升级MegaBox',url:'/d/032a5f226a045c77606a567743586b6a1c053c39',},{title:'【收到了】溢价收个瓦工minibox',url:'/d/027b75146a045c77606a56774358666a2a251227',},{title:'继续用dc99还是升级dc1好',url:'/d/1c7945236a045c77606a5677455e636a35151034',},{title:'DC99 box可以升级到DC1 box pro了。',url:'/d/0e187b546a045c77606a5677455d656a1d2c3e10',},],} const App={setup(){const goTo=useGoTo() const{mdAndUp}=useDisplay() return{goTo,mdAndUp}},data(){return data;},mounted(){const themeDark=localStorage.getItem("themeDark") if(themeDark!==null){this.theme.dark=JSON.parse(themeDark)} if(this.nav.post.total>(this.nav.post.currentPage-1)*100+20){let moreLen=100 if(this.nav.post.total({id:null,num:(this.nav.post.currentPage-1)*100+v,uid:null,content:null,ipRegion:null,updatedByUid:null,createdAt:null,updatedAt:null,mentionNum:null,mentionedBy:null,mentionUsers:null,likeUsers:null,})) this.posts.push(...morePosts.slice(20))} this.workerStart() const hash=window.location.hash const match=hash.match(/#(\d+)/) if(match){const n=parseInt(match[1],10) if(n>=(this.nav.post.currentPage-1)*100&&n{this.jumpTo(n)})}} this.$nextTick(()=>{this.addHeadingIds() tocbot.init({tocSelector:'.toc',contentSelector:'#post-content-0',headingSelector:'h2, h3, h4',headingsOffset:100,scrollSmoothOffset:-100,scrollSmooth:true,collapseDepth:6,onClick:function(e){setTimeout(()=>{history.replaceState(null,'',window.location.pathname+window.location.search)},0)},}) tocbot.refresh()});},beforeUnmount(){this.workerStop() if(this.quill){this.quill.destroy() this.quill=null}},computed:{dposts(){return this.posts.slice(20);},},created(){},methods:{successAlert(msg){this.alert={show:true,color:'success',text:msg,timeout:1500,}},failureAlert(msg){this.alert={show:true,color:'error',text:msg,timeout:5000,}},flipThemeDark(){this.theme.dark=!this.theme.dark localStorage.setItem("themeDark",JSON.stringify(this.theme.dark))},toSearch(){if(!this.search.text){this.failureAlert('搜索词不能为空') return} let keywords=this.search.text.trim() if(keywords.length<1){this.failureAlert('搜索词不能为空') return} if(keywords.length>100){this.failureAlert('搜索词过长') return} this.doSearch(keywords)},toReg(){window.location.href="/reg"},toLogin(){window.location.href="/login"},toPage(){let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,this.nav.post.targetPage>1?`/${this.nav.post.targetPage}`:'') window.location.href=url},toLoadRelated({done}){if(this.my&&this.my.uid){this.apiLoadRelated({done})}else{done('ok')}},workerStart(){this.nav.post.worker=setInterval(()=>{this.workerLoad()},500);},workerStop(){if(this.nav.post.worker){clearInterval(this.nav.post.worker);this.nav.post.worker=null;}},async jumpTo(num){const page=Math.floor(num/100)+1 const i=num-(page-1)*100 if(page===this.nav.post.currentPage){this.goTo("#post-"+num,this.nav.post.goToOptions) if(!this.posts[i].id){const block=Math.floor(num/20)+1 this.nav.post.apiLock[block]=true await this.apiLoadPosts(block) this.$nextTick(()=>{this.goTo("#post-"+num,this.nav.post.goToOptions)})}}else{let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,page>1?`/${page}`:'') url=url+"#"+num window.location.href=url}},postIntersect(num){return(isIntersecting,entries,observer)=>{if(isIntersecting){this.nav.post.task.push(num) this.nav.post.active.push(num) this.nav.post.active=this.nav.post.active.filter(item=>Math.abs(item-num)<=5) this.nav.post.active.sort((a,b)=>a-b)}else{this.nav.post.active=this.nav.post.active.filter(item=>item!==num)} if(this.nav.post.active[0]){this.nav.post.anchor=this.nav.post.active[0]}else{this.nav.post.anchor=0}}},async apiLoadPosts(block){try{const response=await axios.post('/fapi/v1/post/block/'+block,{discussionId:this.nav.post.discussionId,}) if(response.data.code===0){response.data.data.posts.forEach(post=>{const i=post.num%100 Object.assign(this.posts[i],post)}) response.data.data.users.forEach(user=>{this.usersMap.set(user.uid,user)})}else{this.failureAlert('回帖数据加载失败: '+response.data.msg)}}catch(error){this.failureAlert('回帖数据加载失败: '+error)} this.nav.post.apiLock[block]=false},workerLoad(){while(this.nav.post.task.length){const num=this.nav.post.task.pop() const i=num-(this.nav.post.currentPage-1)*100 if(!this.posts[i].id){const block=Math.floor(num/20)+1 if(!this.nav.post.apiLock[block]){this.nav.post.apiLock[block]=true this.apiLoadPosts(block)}}}},getTimeInfo(t){if(!t){return ""} const now=new Date();const then=new Date(t);const diff=now-then;const minute=60*1000;const hour=minute*60;const day=hour*24;const month=day*30;const year=month*12;if(diffpost.num===num) if(!post){return "#"+num} const uid=post.uid const username=this.usersMap.get(uid)?.username if(!username){return "#"+num} return username},getUsernameByPostId(id){const post=this.posts.find(post=>post.id===id) if(!post){return "#"+this.getPostNumByPostId(id)} const uid=post.uid const username=this.usersMap.get(uid).username if(!username){return "#"+this.getPostNumByPostId(id)} return username},getPostNumByPostId(id){const post=this.posts.find(post=>post.id===id) return post.num},getPostById(id){const post=this.posts.find(post=>post.id===id) return post},getPostByNum(num){const post=this.posts.find(post=>post.num===num) return post},getAvatarByUid(uid){const avatar=this.usersMap.get(uid)?.avatar if(!avatar){return this.getRandomAvatar()} return avatar},getAvatarByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post){return this.getRandomAvatar()} const uid=post.uid return this.getAvatarByUid(uid)},getRandomAvatar(){const num=Math.floor(Math.random()*100) return "https://randomuser.me/api/portraits/men/"+num+".jpg"},getUrlByUid(uid){const url=this.usersMap.get(uid)?.url if(!url){return ""} return url},getTextByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post||!post.content){return '点击跳转到#'+num+'查看'} const parser=new DOMParser() const doc=parser.parseFromString(post.content,'text/html') const text=doc.body.textContent||'' return text.slice(0,100)},addHeadingIds(){const content=document.getElementById('post-content-0') if(!content){this.nav.showTOC=false return} const headings=content.querySelectorAll('h2, h3, h4') headings.forEach((heading,index)=>{if(!heading.id){heading.id=`toc-nav-${index}`}}) if(headings.length==0){this.nav.showTOC=false}},async doSearch(keywords){this.search.loading=true try{const response=await axios.post('/fapi/v1/search',{keywords:keywords,}) if(response.data.code===0){if(response.data.data.hash&&response.data.data.hash.length===32){window.location.href="/s/"+response.data.data.hash}else{this.failureAlert('搜索失败: 搜索服务异常')}}else{this.failureAlert('搜索失败: '+response.data.msg)}}catch(error){this.failureAlert('搜索失败: '+error)} this.search.loading=false},debounce(fn,delay){let timer=null return function(...args){if(timer)clearTimeout(timer) timer=setTimeout(()=>{fn.apply(this,args)},delay);};},},watch:{'nav.post.targetPage':{handler:async function(newV,oldV){this.toPage()},immediate:false},},} const vuetify=createVuetify({defaults:{global:{ripple:true,},},}) const app=createApp(App) app.use(vuetify).mount("#app")