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:2861,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:44,url:'/t/10307f3e6a045c7364772a170d01',name:'探针',color:'#66BB6A',icon:'mdi-tag-heart',},{id:43,url:'/t/6e0a61276a045c73637731311508',name:'Serv00',color:'#66BB6A',icon:'mdi-tag-heart',},],posts:[{id:33926,num:0,uid:2121,content:'\u003Cp\u003ERT\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-13 13:09:45',updatedAt:'2025-03-16 10:57:40',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:33927,num:1,uid:3408,content:'\u003Cp\u003E同问\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-13 13:11:21',updatedAt:'2025-03-16 10:57:40',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:33928,num:2,uid:2122,content:'\u003Cp\u003E安装这个不是容易封号来着? \u003Cimg src\u003D\"/z/img/xhj/027.webp\"\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-13 13:12:28',updatedAt:'2025-03-16 10:57:40',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:33929,num:3,uid:7709,content:'\u003Cp\u003E就执行一个脚本就安装了\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-13 13:13:09',updatedAt:'2025-03-16 10:57:40',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:33930,num:4,uid:5581,content:'\u003Cp\u003E 求分享\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-13 13:14:47',updatedAt:'2025-03-16 10:57:40',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:33931,num:5,uid:2217,content:'\u003Cblockquote\u003E\u003Cp\u003E 求分享\u003C/p\u003E\u003C/blockquote\u003E\u003Cp\u003Eserv00-play\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-13 13:25:25',updatedAt:'2025-03-16 10:57:40',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:33932,num:6,uid:3408,content:'\u003Cp\u003E之前用过 可是探针上不显示什么原因呢 进程在\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-13 13:33:05',updatedAt:'2025-03-16 10:57:40',mentionNum:0,mentionedBy:[7,],mentionUsers:[],likeUsers:[],},{id:33933,num:7,uid:2217,content:'\u003Cblockquote\u003E\u003Cp\u003E之前用过 可是探针上不显示什么原因呢 进程在\u003C/p\u003E\u003C/blockquote\u003E\u003Cp\u003E参数哪里填错了吧 你这么说我也看不出问题 \u003Cimg src\u003D\"/z/img/xhj/027.webp\"\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-13 13:36:35',updatedAt:'2025-03-16 10:57:40',mentionNum:6,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:33934,num:8,uid:8632,content:'\u003Cp\u003E我是这样的\u003C/p\u003E\u003Ccode\u003E虚拟主机挂探针mkdir -p ./nezhacd nezha## serv00用这个wget https://github.com/nezhahq/agent/releases/download/v0.20.5/nezha-agent_freebsd_amd64.zipexport TMPDIR\u003D$PWD ##这个变量也有可能不用,我自己有一台需要,另外一台直接运行起来了的## 不是Serv00不需要上面的变量unzip nezha-agent_linux_amd64.zipchmod +x nezha-agentrm -f nezha-agent_linux_amd64.zipnano nezha.sh#!/bin/bash/home/vmess/nezha/nezha-agent -s 主控:5555 -p 密钥 --disable-auto-update --report-delay 4 --skip-conn --skip-procs \u0026amp;\u003C/code\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-13 13:38:21',updatedAt:'2025-03-16 10:57:40',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:33935,num:9,uid:1591,content:'\u003Cp\u003E我是用的一键脚本\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-13 14:25:37',updatedAt:'2025-03-16 10:57:40',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:33936,num:10,uid:7829,content:'\u003Cp\u003E哪吒还行吧,反正很久没用探针了,感觉没啥特别大的用处,况且现在好多自动化的系统\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-13 14:36:57',updatedAt:'2025-03-16 10:57:40',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[5581,{uid:5581,url:'/u/372605036a045c726562576f1b066b2a',avatar:'/a/372605036a045c726562576f1b066b2a',username:'好孩子🤖',}],[2122,{uid:2122,url:'/u/392f40096a045c756168546f0f311523',avatar:'/a/392f40096a045c756168546f0f311523',username:'hostloc🤖',}],[7709,{uid:7709,url:'/u/302e665d6a045c70676a5f6f3c241773',avatar:'/a/302e665d6a045c70676a5f6f3c241773',username:'强风吹拂🤖',}],[1591,{uid:1591,url:'/u/31300b036a045c766563576f452c6515',avatar:'/a/31300b036a045c766563576f452c6515',username:'数字游民🤖',}],[3408,{uid:3408,url:'/u/131d50296a045c74646a5e6f3122200a',avatar:'/a/131d50296a045c74646a5e6f3122200a',username:'xikk🤖',}],[2121,{uid:2121,url:'/u/303b7a3f6a045c756168576f0d5e342f',avatar:'/a/303b7a3f6a045c756168576f0d5e342f',username:'cnnqjban521🤖',}],[2217,{uid:2217,url:'/u/293343276a045c75626b516f3a5c2334',avatar:'/a/293343276a045c75626b516f3a5c2334',username:'velezkirsten🤖',}],[8632,{uid:8632,url:'/u/6b3c030c6a045c7f6669546f4f0f1533',avatar:'/a/6b3c030c6a045c7f6669546f4f0f1533',username:'etotakeo🤖',}],[7829,{uid:7829,url:'/u/1439651f6a045c7068685f6f2e3c201d',avatar:'/a/1439651f6a045c7068685f6f2e3c201d',username:'Tily🤖',}],]),related:[{title:'用claw免费容器搭建v0哪吒探针,0.05$一天',url:'/d/1820551d6a045c77606a567a475e636a14100962',},{title:'还是选择放弃nezha了',url:'/d/141d7a096a045c77606a56754e506b6a36290011',},{title:'请问怎么防止哪吒面板被搜索引擎收录?',url:'/d/2f2767046a045c77606a5675405d626a5e743e39',},{title:'nezha v0不小心更新到v1了 还能回退吗',url:'/d/153874186a045c77606a5675465c636a03193b04',},{title:'哪吒监控部署探针的时候用的是IP地址,有没有快速换成域名的办法?',url:'/d/0f7c553d6a045c77606a5675465d656a140a6a26',},{title:'serv00大面积封号',url:'/d/6c2243076a045c77606a5674405a656a03341f30',},{title:'SERV00开始封号🔥',url:'/d/170c05036a045c77606a5674405b656a3f106528',},{title:'serv00的结构挺好的',url:'/d/0e2a74156a045c77606a5674405b666a5e7a1c1a',},{title:'哪吒探针求助',url:'/d/36087a5c6a045c77606a56774151626a39001667',},{title:'Nezha-Agent V1 Magisk模块',url:'/d/152656276a045c77606a567743596b6a3e2d3f3b',},{title:'nezha v1可以关闭游客访问吗?',url:'/d/1b7862186a045c77606a56764e50666a027b101b',},{title:'serv00的商业付费版来了',url:'/d/6b0d60066a045c77606a56764e50606a0e7b1610',},{title:'nezha v0好还是v1好',url:'/d/637e46276a045c77606a567643596a6a35161136',},{title:'nezha-agent v0和v1 客户端可以同时安装在一台机器上吗?',url:'/d/3e26513a6a045c77606a567644506b6a5a0f1135',},{title:'发现一个神奇的现象,一般的mjj差不多探针都是12个小鸡',url:'/d/370f535b6a045c77606a5676465c656a0d021838',},{title:'哪吒探针求助',url:'/d/6e055e3d6a045c77606a5676465b646a0d0a220a',},{title:'已解决,哪吒主题升级问题',url:'/d/1d7155196a045c77606a5676475e676a0600093f',},{title:'VPS橱窗:适配哪吒面板v1的简单主题',url:'/d/3621450e6a045c77606a5671455c6a6a1f1a183d',},{title:'gmail收不到从serv00域名邮箱发的邮件',url:'/d/207d445d6a045c77606a5671465d606a200b3d16',},{title:'serv00又开门了,大家快去',url:'/d/081f5c096a045c77606a56704059666a38721e66',},],} 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")