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:6819,currentPage:1,targetPage:1,total:11,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:34,url:'/t/0e24610c6a045c74647716303804',name:'NAS',color:'#66BB6A',icon:'mdi-nas',},],posts:[{id:84018,num:0,uid:14348,content:'\u003Cp\u003ENAS 上面下载了很多漫画,用 ZeroTier 实现走 Webd** 协议在软件上看 NAS 的漫画\u003C/p\u003E\u003Cp\u003E但是白天试了一下,感觉访问速度不太行?我下载的漫画平均一卷 200 张图的压缩包,大概 4-500M ,用漫画阅读器打开的时候,需要加载很久。\u003C/p\u003E\u003Cp\u003E是不是我使用 ZeroTier 的姿势不对呢,有什么办法提升网络的访问速度呢。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 12:37:57',updatedAt:'2025-03-29 12:05:39',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84019,num:1,uid:8080,content:'说一说我的看漫画方案\u003Cbr\u003E使用 easytier 打洞\u003Cbr\u003Enas 上使用 docker 安装 komga ,来管理 nas 上的漫画\u003Cbr\u003E安卓手机安装 mihon ,在 mihon 应用内安装 komga 插件,easytier 打洞成功后,连接 nas 上的 komga\u003Cbr\u003E一般只有翻页太快的时候会有 1 、2 秒的加载,其他情况下阅读都比较流畅',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 12:45:00',updatedAt:'2025-03-29 12:05:39',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84020,num:2,uid:254,content:'家里宽带的上行限制吧。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 13:35:58',updatedAt:'2025-03-29 12:05:39',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84021,num:3,uid:8727,content:'可能 是 zerotier 的问题,之前傍晚下班后 看电影完全看不了,后来换成 frp 就满速了,满画质观看',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 13:40:27',updatedAt:'2025-03-29 12:05:39',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84022,num:4,uid:3892,content:'这要看你 zerotier 的中继服务器的速度了吧,有公网 ip 就用 ddns 吧,不限速。\u003Cbr\u003E\u003Cbr\u003E说下我的方案\u003Cbr\u003E一、联通千兆宽带,有公网 IP ,光猫改了桥接。家里用的是 tplink 的 vpn 路由器,内置了 tpddns ,常用服务路由器设置了端口映射,平时直接通过 ddns 的域名访问,速度拉满。\u003Cbr\u003E二、不过 tpddns 近期要停止服务,所以又在 nas 单独 docker 部署了 ddns ,解析到 dnspod 中的域名解析,作为备选方案 2 ,后续将升为主要方案。\u003Cbr\u003E三、nas 上部署了 easytier ,老家路由器、岳父家路由器和公司电脑和手机都同步部署了 easytier 。组网方案作为备用方案 3 ,为了防止家里 nas 断网或其他情况导致组网故障,在我的一台云服务器上也部署了 easytier 作为备用节点,两个公网节点作为容灾方案。\u003Cbr\u003E四、因 ddns 和 easytier 都在 nas 上,一旦 nas 断电,以上方案都将无法访问家里设备。因我的 tplink 路由器支持 vpn ,我在路由器配置了 vpn ,手机和公司电脑都有 vpn 客户端,但 tplink 上的 vpn 技术太过老旧,只做备用方案 4 使用,也是保底方案,一旦路由器也出问题,那就没救了。\u003Cbr\u003E\u003Cbr\u003E这几套方案,基本可以保证不出啥问题了。平时在公司,基本用组网的内网地址直接访问 nas 影视资源,可以访问所有家里内网设备和服务,在其他非组网的设备上使用 ddns 的域名访问常用服务。岳父或老家父母有时候想看一些电影之类的,我也会直接通过组网方式推给他们(家里电视有安装爆米花映射,连接的 nas 的内网地址),有时候也会直接连他们的路由器处理一些网络问题。\u003Cbr\u003E\u003Cbr\u003E目前两三年了没啥问题。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 13:40:51',updatedAt:'2025-03-29 12:05:39',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84023,num:5,uid:6908,content:'最近有个新项目,easytier 据说很不错,有国内服务器,',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 13:46:04',updatedAt:'2025-03-29 12:05:39',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84024,num:6,uid:5956,content:'还要提示知识水平,家里上行速度,服务器带宽,要先搞清楚吧。\u003Cbr\u003E看漫画要什么 ZeroTier ,frp ,nps 之类映射简单高效。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 13:47:50',updatedAt:'2025-03-29 12:05:39',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84025,num:7,uid:11202,content:'用樱花 frp 吧,好像是咱论坛某个大佬维护的。我目前用这还行 https://www.natfrp.com/',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 14:40:34',updatedAt:'2025-03-29 12:05:39',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84026,num:8,uid:14467,content:'用的什么漫画软件?',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 15:41:02',updatedAt:'2025-03-29 12:05:39',mentionNum:0,mentionedBy:[9,],mentionUsers:[],likeUsers:[],},{id:84027,num:9,uid:14348,content:'#8 可达阅读器',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 17:23:42',updatedAt:'2025-03-29 12:05:39',mentionNum:8,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84028,num:10,uid:15252,content:'目前在用 zerotrust 感觉害行',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 23:08:55',updatedAt:'2025-03-29 12:05:39',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[8727,{uid:8727,url:'/u/322b731a6a045c7f6768516f1219062b',avatar:'/a/322b731a6a045c7f6768516f1219062b',username:'Xhack🤖',}],[11202,{uid:11202,url:'/u/3f7970146a045d76626a546f463f161f',avatar:'/a/3f7970146a045d76626a546f463f161f',username:'aicfe🤖',}],[14467,{uid:14467,url:'/u/6c18733b6a045d73646c516f472d101d',avatar:'/a/6c18733b6a045d73646c516f472d101d',username:'nananquj**a🤖',}],[15252,{uid:15252,url:'/u/2f2544226a045d72626f546f4119232a',avatar:'/a/2f2544226a045d72626f546f4119232a',username:'xzc0001🤖',}],[5956,{uid:5956,url:'/u/0e7b7e5e6a045c72696f506f1c272a70',avatar:'/a/0e7b7e5e6a045c72696f506f1c272a70',username:'chxf🤖',}],[8080,{uid:8080,url:'/u/2d245d546a045c7f6062566f03082935',avatar:'/a/2d245d546a045c7f6062566f03082935',username:'zhuweitung🤖',}],[14348,{uid:14348,url:'/u/340c7f0c6a045d73636e5e6f45583675',avatar:'/a/340c7f0c6a045d73636e5e6f45583675',username:'pujx233🤖',}],[6908,{uid:6908,url:'/u/14715e156a045c71696a5e6f1b0d1033',avatar:'/a/14715e156a045c71696a5e6f1b0d1033',username:'bigtear🤖',}],[3892,{uid:3892,url:'/u/303b48376a045c746863546f1b263f0c',avatar:'/a/303b48376a045c746863546f1b263f0c',username:'hnbcinfo🤖',}],[254,{uid:254,url:'/u/6f71715e6a045c77626f526f332e212f',avatar:'/a/6f71715e6a045c77626f526f332e212f',username:'zzzyk🤖',}],]),related:[{title:'回顾 2024 年及以前你入手的迷你主机',url:'/d/690846086a045c77606a567a4551616a542d3d03',},{title:'玩 NAS 的人到底是被它的什么吸引了?',url:'/d/3c3150186a045c77606a567a455a6b6a2d2d323e',},{title:'晚上睡觉大家是否被光猫/路由器/Nas 的网口灯闪烁困扰?',url:'/d/3b1146396a045c77606a567a4758666a09083117',},{title:'ts-464c 便宜不',url:'/d/3633045e6a045c77606a5675425d666a3c2c2514',},{title:'寻找一款支持 SSD 的 NAS 升级现有 DS218+',url:'/d/6f7a412e6a045c77606a5675445b636a3412231a',},{title:'发几个馒头药',url:'/d/037e7c2b6a045c77606a5675455b666a3e042321',},{title:'qnap 威联通 nas 是我用过最难用的 nas,谨慎避坑',url:'/d/1b0a763a6a045c77606a5675475e646a1d112a63',},{title:'NAS 求推荐,绿联 DXP2800 vs 群晖 DS224+ (轻度使用+注重隐私)',url:'/d/303864176a045c77606a5675475e656a0e190418',},{title:'Nas 求推荐 少折腾、备份文件、至少 8t、不算盘 3000 左右',url:'/d/363150086a045c77606a5675475d6a6a2f160125',},{title:'小体积低功耗+ECC 内存的 NAS 有没有解',url:'/d/1d3a6a556a045c77606a5675475b606a08131522',},{title:'n150 的性能是物理飞牛还是虚拟飞牛?',url:'/d/220f56596a045c77606a56744e59626a20310b37',},{title:'[求] NAS 备份盘推荐🙏',url:'/d/127b035b6a045c77606a56744f5c646a1a0c6667',},{title:'没有 nas, win10 电脑里的片,能刮削么?',url:'/d/343a7b586a045c77606a56744f5d616a00752b23',},{title:'玩bt必备——PeerBanHelper',url:'/d/08257a0f6a045c77606a5674405c646a0e3b2a18',},{title:'纠结要不要买,感觉给群晖 ddns 当域名挺好的',url:'/d/3b18505d6a045c77606a56744150626a29080366',},{title:'要不要从 FnOS 回到群晖?',url:'/d/2b2d581b6a045c77606a567441596b6a59306300',},{title:'6 路监控摄像头 存储到 nas 有什么好的方案吗?',url:'/d/140b5b0a6a045c77606a56744159616a15243433',},{title:'群晖 NAS DS920+如何实现在 iPad 上任何格式视频都能播放的效果?目前很多视频播放不了。',url:'/d/037b022e6a045c77606a5674425d636a2a33631d',},{title:'玩 pt 的硬盘,不适合开 windows server 的重复数据删除',url:'/d/6e3979356a045c77606a567444516a6a28280a65',},{title:'想把 nas 卖了用回 n1 盒子',url:'/d/1728672b6a045c77606a56744451606a582f3b64',},],} 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")