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:6516,currentPage:1,targetPage:1,total:14,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:15,url:'/t/0f074b236a045c7665770f3a1528',name:'软路由',color:'#66BB6A',icon:'mdi-router-wireless-settings',},],posts:[{id:79008,num:0,uid:2834,content:'书房的主路由器是 192.168.50.1 。\u003Cbr\u003E客厅的副路由器是 10.0.0.1\u003Cbr\u003E因为是老房子,墙里没网线,又隔了 3 堵墙,用上了电力猫,来解决客厅网络信号的问题\u003Cbr\u003E现在的问题是,连上主路由器的网,ping 不通副路由器,没法管理副路由器。在客厅能正常上网。\u003Cbr\u003E\u003Cbr\u003E记得以前没用电力猫的时候是可以的,还是说当时副路由器是 AP 模式,所以可以?\u003Cbr\u003E\u003Cbr\u003E电力猫是需要打开 DHCP 还是要怎么配,请教大佬。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 08:26:00',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79009,num:1,uid:14504,content:'都 25 年了,电力猫经过社会市场的检验,已经被淘汰,稳定性不足。建议 在闲鱼上淘一组光纤收发机 + 隐形光纤 布置房间,这样网络的稳定性 和 体验会大大提高。至于客厅副路由 ip 地址不一样,我建议改成 AP 模式就行啦,当个信号发射器,所有的性能运算交给主路由,反正性能够用',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 08:49:07',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79010,num:2,uid:5995,content:'我之前 100M 电力猫稳的很,没有任何丢包延迟。电力猫唯一问题就是带宽拉不高,其他的玩个游戏上个网没有压力。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 09:07:34',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79011,num:3,uid:8207,content:'多摆一个点的设备,用 mesh 接力 ?',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 09:08:36',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79012,num:4,uid:5995,content:'你主副都不在一个网段,而且一个网络内本来就没两个路由器的说法,其中一个肯定是当交换机用。槽点太多了,你自己问 AI 补补网络知识先比较好。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 09:09:52',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79013,num:5,uid:2834,content:'嗯嗯,是的,之前就是 AP 模式。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 09:13:33',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79014,num:6,uid:2834,content:'感谢改成 AP 模式就行了。客厅目前就是连接几个家居智能设备和监控摄像头,目前的方法性能够用了。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 09:15:04',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79015,num:7,uid:2834,content:'是的,我这个电力猫 10 年前买的,我这边大概能跑到 50M ,是很富裕了。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 09:17:15',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79016,num:8,uid:237,content:'电力猫退版本了😂个人会选择无线 Mesh',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 10:09:09',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79017,num:9,uid:2834,content:'我这个场景,就算用 mesh ,也得用上电力猫吧',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 10:53:05',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79018,num:10,uid:2942,content:'走明线',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 12:27:55',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79019,num:11,uid:236,content:'副路由关闭 dhcp ,电力猫出口网线接副路由 lan 口,搞定。',ipRegion:'',updatedByUid:0,createdAt:'2025-03-25 13:13:49',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79020,num:12,uid:14505,content:'但凡我要没用过电力猫我都会信了你的鬼话,我还真用洋**电力猫跑了 7x24x3 年的监控,根本没有一丁点问题。洋**最大的问题就是老芯片发热高,然后也就带宽不太高,500M SISO 的也就只能跑 100 出个头',ipRegion:'',updatedByUid:0,createdAt:'2025-03-26 16:57:00',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:79021,num:13,uid:14505,content:'手滑 不止 3 年,是 5 年',ipRegion:'',updatedByUid:0,createdAt:'2025-03-26 17:00:37',updatedAt:'2025-03-27 11:47:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[14504,{uid:14504,url:'/u/1e02013c6a045d73656a526f3933040e',avatar:'/a/1e02013c6a045d73656a526f3933040e',username:'xxx88xxx🤖',}],[2942,{uid:2942,url:'/u/2a2a70586a045c75696e546f0f1b223e',avatar:'/a/2a2a70586a045c75696e546f0f1b223e',username:'cskeleton🤖',}],[8207,{uid:8207,url:'/u/0b7803066a045c7f626a516f1e081133',avatar:'/a/0b7803066a045c7f626a516f1e081133',username:'kkk1234567🤖',}],[236,{uid:236,url:'/u/6b385b0f6a045c776269506f44003014',avatar:'/a/6b385b0f6a045c776269506f44003014',username:'dream7758522🤖',}],[2834,{uid:2834,url:'/u/081956256a045c756869526f425c373f',avatar:'/a/081956256a045c756869526f425c373f',username:'NonClockworkChen🤖',}],[14505,{uid:14505,url:'/u/11135a196a045d73656a536f1b2d1571',avatar:'/a/11135a196a045d73656a536f1b2d1571',username:'skylancer🤖',}],[237,{uid:237,url:'/u/6226745b6a045c776269516f433a3231',avatar:'/a/6226745b6a045c776269516f433a3231',username:'rxg9527🤖',}],[5995,{uid:5995,url:'/u/03385b286a045c726963536f410e192a',avatar:'/a/03385b286a045c726963536f410e192a',username:'idealhs🤖',}],]),related:[{title:'tailscale 和 zerotier 哪个好用,功能多?',url:'/d/360b75096a045c77606a567a445d6a6a2b280405',},{title:'Openwrt 上如何设置递归静态路由',url:'/d/2f2c575e6a045c77606a567a465f676a5b2f3139',},{title:'小米 wifi7 路由器千兆都跑不满',url:'/d/313003376a045c77606a567a475c606a1c101014',},{title:'家庭路由器组网求助',url:'/d/3711025f6a045c77606a56754f5e636a3b0c3505',},{title:'EasyTier 组网是真不错',url:'/d/6a035e586a045c77606a56744051666a5d332b01',},{title:'目前好像感受到了 openwrt 作为主路由的无力感',url:'/d/373048036a045c77606a56744051616a2517642b',},{title:'路由器选择就推荐,小米还是中兴呢?或者华硕呢',url:'/d/6a3e555a6a045c77606a5674405f676a282f0920',},{title:'畅网 N100 软路由死机频繁, PVE + 爱快 + IstoreOS 配置,换硬盘后仍未解决,求助!',url:'/d/037d540e6a045c77606a56744251656a38131d3e',},{title:'城中村租房 OpenWrt 抢共享带宽问题求助',url:'/d/6b3b512b6a045c77606a5674425d626a2e731038',},{title:'大佬们能帮我看看拓扑图吗?现在旁路无法上网,折腾两天了,头都大了。',url:'/d/3f2c713a6a045c77606a56744358656a15356b34',},{title:'求推荐带两路 SFP+口的路由器',url:'/d/620859076a045c77606a5674455f656a1b131f15',},{title:'你们的AdGuard home能去youtube客户端广告吗',url:'/d/1c7c482c6a045c77606a5674465f6a6a5b2f0319',},{title:'有什么好用的软路由系统推荐吗',url:'/d/3d3b7e1d6a045c77606a5674465b636a2902231f',},{title:'openwrt 去广告的方案',url:'/d/1f3c621a6a045c77606a56774550656a0d326304',},{title:'r2s 的内存卡(带op系统 ) 插r4s 上能否直接使用。',url:'/d/2f38780f6a045c77606a5677455b6b6a0a7a1a2a',},{title:'AdGuard现在哪里还有活动吗?',url:'/d/1d1077186a045c77606a56764e5b616a162f6736',},{title:'r2s 只能跑满300兆啊。4s 5s 哪个能跑满千啊',url:'/d/080b7a2b6a045c77606a5676415c6a6a1c20270b',},{title:'分享一下用AdguardHome和Nginx的配置,让你可以自由DIY路径',url:'/d/6d10533f6a045c77606a5676415a626a0f273467',},{title:'adguard home的doh服务终于搭建成功了',url:'/d/69707b0c6a045c77606a567641586b6a5d361b64',},{title:'AdGuard home过滤手机广告——服务端',url:'/d/2a250a046a045c77606a5671405e636a0a3a2126',},],} 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")