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:7320,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:92588,num:0,uid:16433,content:'\u003Cp\u003E目前的群晖 DS218+对我来说完全够用。唯一的缺点就是 docker 跑太多,机械硬盘时不时就响一下。正好 CPU 单核性能稍微有点力不从心,希望升级解决这一问题。\u003C/p\u003E\u003Cp\u003E需求如下:\u003C/p\u003E维持现在的双盘位 raid 1 ,机器不要太大,最好是 2 HDD + 1 ~ 2 SSD路由器是 1G 网口,所以 2.5G 及以上不是刚需CPU 没有任何硬解的需求,只要能装 Plex 即可内置 8GB 内存,或能加内存条系统要装在 SSD 单独的分区上,不要做缓存的那种docker 镜像也必须要装在 SSD 分区,彻底解决噪音问题像群晖一样省心的 https 证书配置\u003Cp\u003E大概看了一圈,群晖就是 DS723+/725+,威联通就是 TS-264C ,也都不便宜。感觉我这个需求 4 盘位好找,2 盘位不好找。如果有那种自己组的小机器装 unraid 也可以考虑。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 05:38:04',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92589,num:1,uid:533,content:'sata ssd 也算 别把豆包不当干粮',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 06:34:07',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92590,num:2,uid:12249,content:'tank 众筹的 6 仓 n100/n305 已经开始出货了,配置拉满,可以看看',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 07:08:02',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[15,],mentionUsers:[],likeUsers:[],},{id:92591,num:3,uid:12249,content:'TAD6S4N10G N100 305 6 盘 M.2 双万兆机械固态混合高速存储 NAS 全铝',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 07:10:18',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92592,num:4,uid:16433,content:'所以群晖其实已经超预算了。买两块 4TB SATA SSD 同样解决问题。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 07:16:45',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92593,num:5,uid:5081,content:'可以看看极摩客 g9 这类的机型,n150 加双网口,可以装虚拟机',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 07:28:24',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92594,num:6,uid:12630,content:'畅网 p5 开发板+闲鱼机箱',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 07:52:10',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92595,num:7,uid:1100,content:'原来的 nas 够用,可以考虑加一台小主机专门放 docker ,nas 不动。推荐 2 款:arm cpu 选 nanopi r3s 200 元+,x64 cpu 选联想百应 NUC Go N100 680 元+',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 07:57:07',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92596,num:8,uid:7547,content:'《零刻 NAS 型迷你主机 ME mini 预热:双 2.5G 网口 + 6 盘位 M.2 固态最高 24TB ,内置电源》\u003Cbr\u003E2025/3/21\u003Cbr\u003Ehttps://www.ithome.com/0/839/656.htm\u003Cbr\u003E\u003Cbr\u003E这款还未发布,可以关注一下。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 09:14:58',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92597,num:9,uid:16433,content:'docker 的 https 证书如果没有群晖的网页门户那种便利程度还是算了。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 09:20:57',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92598,num:10,uid:1100,content:'用 acme.sh 全自动更新证书,然后将证书文件 volume 到 docker 容器里。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 09:34:37',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92599,num:11,uid:2962,content:'确实四盘位的好找,同年的我 918 都有 ssd 口',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 09:36:38',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92600,num:12,uid:4972,content:'做存储的机器和跑 docker 的机器不建议用一个,功能不一样,跑 docker 买个 mini 主机就好',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 10:28:18',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92601,num:13,uid:3795,content:'如果只是你这个需求的话,很多国产品牌也可以考虑的',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 10:58:07',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92602,num:14,uid:4983,content:'看上去不错,最近在关注纯固态 NAS ,主打一个无噪音😄',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 11:11:15',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92603,num:15,uid:12298,content:'#2 哪? tank 是啥',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 12:00:25',updatedAt:'2025-04-03 11:14:02',mentionNum:2,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92604,num:16,uid:12249,content:'淘宝搜 TAD6S4N10G',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 12:48:04',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92605,num:17,uid:16434,content:'暴风二期 J3455 ?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 13:20:51',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92606,num:18,uid:4978,content:'机械硬盘换 SATA',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 13:33:55',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:92607,num:19,uid:16435,content:'我买的 TS-264C 早期支持加内存条的版本,加了 32G 内存感觉完全用不完',ipRegion:'',updatedByUid:0,createdAt:'2025-04-01 13:43:38',updatedAt:'2025-04-03 11:14:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[4978,{uid:4978,url:'/u/2c0f5c156a045c73696d5e6f1858182b',avatar:'/a/2c0f5c156a045c73696d5e6f1858182b',username:'cherryas🤖',}],[7547,{uid:7547,url:'/u/112064556a045c70656e516f353d250c',avatar:'/a/112064556a045c70656e516f353d250c',username:'jifengg🤖',}],[4972,{uid:4972,url:'/u/6c7862086a045c73696d546f1e5d152f',avatar:'/a/6c7862086a045c73696d546f1e5d152f',username:'chairuosen🤖',}],[533,{uid:533,url:'/u/113159026a045c776569556f13392114',avatar:'/a/113159026a045c776569556f13392114',username:'YsHaNg🤖',}],[2962,{uid:2962,url:'/u/317951286a045c75696c546f193d2634',avatar:'/a/317951286a045c75696c546f193d2634',username:'dfdd1811🤖',}],[12249,{uid:12249,url:'/u/230e5b386a045d75626e5f6f222a6577',avatar:'/a/230e5b386a045d75626e5f6f222a6577',username:'cxtrinityy🤖',}],[3795,{uid:3795,url:'/u/3d0465356a045c746763536f3a583e14',avatar:'/a/3d0465356a045c746763536f3a583e14',username:'HAYABUSA🤖',}],[16433,{uid:16433,url:'/u/3e1f4a006a045d716469556f312c6420',avatar:'/a/3e1f4a006a045d716469556f312c6420',username:'xuegy🤖',}],[12630,{uid:12630,url:'/u/392c061e6a045d756669566f1931367e',avatar:'/a/392c061e6a045d756669566f1931367e',username:'zhj9709🤖',}],[16435,{uid:16435,url:'/u/1f0a75156a045d716469536f1e5a3e0e',avatar:'/a/1f0a75156a045d716469536f1e5a3e0e',username:'infoscope🤖',}],[12298,{uid:12298,url:'/u/322a7d176a045d7562635e6f0f250b7e',avatar:'/a/322a7d176a045d7562635e6f0f250b7e',username:'SilentlyYc🤖',}],[4983,{uid:4983,url:'/u/6c18682c6a045c736962556f1c1f1d24',avatar:'/a/6c18682c6a045c736962556f1c1f1d24',username:'Smilencer🤖',}],[16434,{uid:16434,url:'/u/1f0c555e6a045d716469526f1e5b6516',avatar:'/a/1f0c555e6a045d716469526f1e5b6516',username:'quanjw🤖',}],[5081,{uid:5081,url:'/u/390a41006a045c726062576f32510923',avatar:'/a/390a41006a045c726062576f32510923',username:'SodaPopBoy🤖',}],[1100,{uid:1100,url:'/u/0b2d76226a045c76616a566f153e173e',avatar:'/a/0b2d76226a045c76616a566f153e173e',username:'yinmin🤖',}],]),related:[{title:'回顾 2024 年及以前你入手的迷你主机',url:'/d/690846086a045c77606a567a4551616a542d3d03',},{title:'玩 NAS 的人到底是被它的什么吸引了?',url:'/d/3c3150186a045c77606a567a455a6b6a2d2d323e',},{title:'晚上睡觉大家是否被光猫/路由器/Nas 的网口灯闪烁困扰?',url:'/d/3b1146396a045c77606a567a4758666a09083117',},{title:'ts-464c 便宜不',url:'/d/3633045e6a045c77606a5675425d666a3c2c2514',},{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:'用 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")