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:6842,currentPage:1,targetPage:1,total:23,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:84559,num:0,uid:15329,content:'\u003Cp\u003E小姐姐太多,分不清了,我看刮削方案都是基于 nas 的,有没有基于 pc 的?\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 09:28:02',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84560,num:1,uid:5901,content:'pc 端也有 jellyfin',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 09:33:33',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84561,num:2,uid:12401,content:'虚拟机 肥牛?',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 09:44:09',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84562,num:3,uid:6052,content:'您是否是在寻找:JAVSP https://github.com/Yuukiy/J**SP',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 09:48:26',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84563,num:4,uid:2791,content:'tmm',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 09:49:39',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84564,num:5,uid:15330,content:'PLEX',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 09:51:57',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84565,num:6,uid:3778,content:'https://github.com/stashapp/stash\u003Cbr\u003E\u003Cbr\u003E试试这个',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 09:52:47',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84566,num:7,uid:8300,content:'mdcx',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 09:56:49',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84567,num:8,uid:13507,content:'https://github.com/mdc-ng/mdc-ng',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 09:57:41',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84568,num:9,uid:14185,content:'win 开个 vmware 装飞牛,win 开 **b 共享文件,飞牛影视挂载远程 **b 就可以。用 win 下载管理文件还是方便',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 10:07:11',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84569,num:10,uid:4172,content:'MDCX 有 GUI 界面一键刮削,不过原项目已经封库了 https://github.com/Magichcx/MDCx-win/releases',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 10:13:42',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84570,num:11,uid:3662,content:'kodi 也可的',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 10:14:33',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84571,num:12,uid:342,content:'有基于 docker 的全自动订阅下载刮削,但是作者不让宣传',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 10:19:44',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84572,num:13,uid:4677,content:'https://github.com/stashapp/stash 我叫雷钝',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 10:21:51',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84573,num:14,uid:15331,content:'tinyMediaManager',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 10:22:04',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[17,],mentionUsers:[],likeUsers:[],},{id:84574,num:15,uid:15332,content:'jellyfin 或者 emby ,都有 Windows 服务器版本,在 Windows 上装就可以自动刮削了,比 tmm 还是方便很多\u003Cbr\u003E要播放看,再装个客户端就行',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 10:38:18',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84575,num:16,uid:15333,content:'可以啊 WinNAS 而不自知?',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 11:26:28',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84576,num:17,uid:15334,content:'#14 tmm+1',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 12:28:54',updatedAt:'2025-03-30 11:39:17',mentionNum:14,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84577,num:18,uid:2836,content:'tmm 有 Windows 的 gui 版的',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 12:36:52',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:84578,num:19,uid:4106,content:'所挂可以用 **dc ,github 开源',ipRegion:'',updatedByUid:0,createdAt:'2025-03-27 14:08:01',updatedAt:'2025-03-30 11:39:17',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[5901,{uid:5901,url:'/u/3e2a5b0f6a045c72696a576f442f2b0d',avatar:'/a/3e2a5b0f6a045c72696a576f442f2b0d',username:'gunner168🤖',}],[6052,{uid:6052,url:'/u/313970036a045c71606f546f35023116',avatar:'/a/313970036a045c71606f546f35023116',username:'TerranceL🤖',}],[15334,{uid:15334,url:'/u/6d27585e6a045d726369526f13051e32',avatar:'/a/6d27585e6a045d726369526f13051e32',username:'jiangchenrui🤖',}],[15329,{uid:15329,url:'/u/692373556a045d7263685f6f26136128',avatar:'/a/692373556a045d7263685f6f26136128',username:'wty95🤖',}],[15333,{uid:15333,url:'/u/341044156a045d726369556f33063115',avatar:'/a/341044156a045d726369556f33063115',username:'azhaojingjing🤖',}],[4106,{uid:4106,url:'/u/350e6b296a045c73616a506f070f1633',avatar:'/a/350e6b296a045c73616a506f070f1633',username:'fanersai🤖',}],[4677,{uid:4677,url:'/u/383957076a045c73666d516f25180401',avatar:'/a/383957076a045c73666d516f25180401',username:'TimPeake🤖',}],[14185,{uid:14185,url:'/u/020362186a045d736162536f44000616',avatar:'/a/020362186a045d736162536f44000616',username:'sodulty🤖',}],[15331,{uid:15331,url:'/u/103b40376a045d726369576f20592a36',avatar:'/a/103b40376a045d726369576f20592a36',username:'WangRicky🤖',}],[3662,{uid:3662,url:'/u/3871615d6a045c74666c546f455e6704',avatar:'/a/3871615d6a045c74666c546f455e6704',username:'polarwolf🤖',}],[342,{uid:342,url:'/u/683e550f6a045c77636e546f2e312128',avatar:'/a/683e550f6a045c77636e546f2e312128',username:'SakuraYuki🤖',}],[4172,{uid:4172,url:'/u/080b442a6a045c73616d546f275c671f',avatar:'/a/080b442a6a045c73616d546f275c671f',username:'msywkylemon🤖',}],[8300,{uid:8300,url:'/u/032855006a045c7f636a566f3b196b2a',avatar:'/a/032855006a045c7f636a566f3b196b2a',username:'spike0100🤖',}],[2791,{uid:2791,url:'/u/09005b396a045c756763576f1b506129',avatar:'/a/09005b396a045c756763576f1b506129',username:'mouyase🤖',}],[3778,{uid:3778,url:'/u/360b0b386a045c74676d5e6f223c3c72',avatar:'/a/360b0b386a045c74676d5e6f223c3c72',username:'Goooooos🤖',}],[15330,{uid:15330,url:'/u/391b40546a045d726369566f0e01602b',avatar:'/a/391b40546a045d726369566f0e01602b',username:'basaka🤖',}],[12401,{uid:12401,url:'/u/123f675d6a045d75646a576f1a18170b',avatar:'/a/123f675d6a045d75646a576f1a18170b',username:'dabaibai🤖',}],[2836,{uid:2836,url:'/u/102601056a045c756869506f12022517',avatar:'/a/102601056a045c756869506f12022517',username:'Muniesa🤖',}],[13507,{uid:13507,url:'/u/682b073f6a045d74656a516f1c1d3c00',avatar:'/a/682b073f6a045d74656a516f1c1d3c00',username:'Jisxu🤖',}],[15332,{uid:15332,url:'/u/033d630e6a045d726369546f2f512716',avatar:'/a/033d630e6a045d726369546f2f512716',username:'ccwc🤖',}],]),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:'用 ZeroTier 访问家里 NAS 的数据,感觉网速很慢,有什么办法提升访问速度吗',url:'/d/207d5a346a045c77606a56744f586a6a2b2b3b1a',},{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")