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:7719,currentPage:1,targetPage:1,total:12,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:36,url:'/t/332c78596a045c7466775227135f',name:'Claw',color:'#78909C',icon:'mdi-server-network-outline',},],posts:[{id:99309,num:0,uid:5417,content:'\u003Cp\u003E手持claw 看到都在收yxvm犹豫了\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 00:57:30',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:99310,num:1,uid:2154,content:'\u003Cp\u003E不限速claw吧\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 00:58:01',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:99311,num:2,uid:1714,content:'\u003Cp\u003E两个都一般\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 00:58:21',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:99312,num:3,uid:17111,content:'\u003Cp\u003E卖了claw买yxvm\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 00:58:47',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:99313,num:4,uid:1844,content:'\u003Cp\u003E看跟谁比 跟vol比肯定是claw更好\u003Cbr\u003E跟hyper就别比了,全方位被hyper吊起来打\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 00:59:29',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:99314,num:5,uid:1492,content:'\u003Cp\u003E目前来看,白天用HK,晚上用美西最好。CMI哪家都不能压宝,国内也Q的厉害。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 00:59:38',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:99315,num:6,uid:1908,content:'\u003Cp\u003E双持\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 01:00:54',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:99316,num:7,uid:3241,content:'\u003Cp\u003E联通没啥区别电信的话都没必要上\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 01:01:04',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:99317,num:8,uid:2028,content:'\u003Cp\u003E肯定是claw,限速另说\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 01:01:43',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:99318,num:9,uid:4418,content:'\u003Cp\u003E对我来说,便宜不怕揍的都好 \u003Cimg src\u003D\"/z/img/yct/003.webp\"\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 01:01:50',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:99319,num:10,uid:4444,content:'\u003Cp\u003E以前使用过yxvm的hk vol(其他型号没用过),现在用claw hk 4刀。\u003Cbr\u003E感觉claw更好。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 01:04:19',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:99320,num:11,uid:1409,content:'\u003Cp\u003E哪个好用我不知道\u003Cbr\u003E我只知道一个市值3000亿U的公司,一个随时跑路的小作坊\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-05 01:09:41',updatedAt:'2025-04-05 11:44:08',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[2028,{uid:2028,url:'/u/2c2642086a045c7560685e6f0002320c',avatar:'/a/2c2642086a045c7560685e6f0002320c',username:'lhordez🤖',}],[2154,{uid:2154,url:'/u/1b1907006a045c75616f526f342e1813',avatar:'/a/1b1907006a045c75616f526f342e1813',username:'油管搬运工🤖',}],[1844,{uid:1844,url:'/u/6b1f45586a045c76686e526f0e050573',avatar:'/a/6b1f45586a045c76686e526f0e050573',username:'zhoubiao🤖',}],[1492,{uid:1492,url:'/u/2f2860096a045c766463546f341a0020',avatar:'/a/2f2860096a045c766463546f341a0020',username:'moxixia🤖',}],[4418,{uid:4418,url:'/u/182c53346a045c73646b5e6f213f3f1d',avatar:'/a/182c53346a045c73646b5e6f213f3f1d',username:'vanplus🤖',}],[17111,{uid:17111,url:'/u/032e75196a045d70616b576f360f6171',avatar:'/a/032e75196a045d70616b576f360f6171',username:'mengmian🤖',}],[1908,{uid:1908,url:'/u/6a71485f6a045c76696a5e6f4724370c',avatar:'/a/6a71485f6a045c76696a5e6f4724370c',username:'yueyyy🤖',}],[5417,{uid:5417,url:'/u/313a450f6a045c72646b516f3e012229',avatar:'/a/313a450f6a045c72646b516f3e012229',username:'旺财呀🤖',}],[3241,{uid:3241,url:'/u/6a2d7a0b6a045c74626e576f06250b0d',avatar:'/a/6a2d7a0b6a045c74626e576f06250b0d',username:'monenty🤖',}],[1409,{uid:1409,url:'/u/3c3a561b6a045c76646a5f6f330c197f',avatar:'/a/3c3a561b6a045c76646a5f6f330c197f',username:'zha8🤖',}],[4444,{uid:4444,url:'/u/6d186a346a045c73646e526f41032121',avatar:'/a/6d186a346a045c73646e526f41032121',username:'hoofei🤖',}],[1714,{uid:1714,url:'/u/3b21473d6a045c76676b526f3d503c13',avatar:'/a/3b21473d6a045c76676b526f3d503c13',username:'南山如雪mi🤖',}],]),related:[{title:'刚收了台 claw 服务器,该不该把网站从斯巴达迁过去?',url:'/d/312c051e6a045c77606a567a4559636a2f34031e',},{title:'慢出台claw-hk老4🔪,中国优化,ip8.218,5.1到期,无限速过',url:'/d/2f0477146a045c77606a567a4750606a3c072908',},{title:'ClawCloud 的7刀年付sg 移动突然直了',url:'/d/103f44096a045c77606a567a475e616a0b213725',},{title:'用claw免费容器搭建v0哪吒探针,0.05$一天',url:'/d/1820551d6a045c77606a567a475e636a14100962',},{title:'收claw年付12.6刀内存翻倍jp',url:'/d/6b717b3f6a045c77606a56754e50636a1c066135',},{title:'【已出】出Claw 老4刀 HK',url:'/d/371074226a045c77606a56754e51656a07331863',},{title:'秒出:CLAW的2C4G的新加坡主机25.2刀年付',url:'/d/2c2504286a045c77606a56754e5e646a2211661c',},{title:'280收claw hk老4刀翻倍,100原邮出老4刀',url:'/d/2b3c79256a045c77606a56754f58606a59081104',},{title:'【已收】临期Claw SG 5.25/季 or 10.5/半年付',url:'/d/113c76386a045c77606a56754f59616a18052534',},{title:'阿里ecs,阿里轻量,isif,wawo pis claw Yxvm-hyper skystroll 网络横评',url:'/d/020862066a045c77606a5675405f616a0b2c121e',},{title:'claw翻倍 Yxvm hyper skystroll 三家网络对比',url:'/d/203956396a045c77606a5675405d6a6a25146022',},{title:'我决定保留我的Claw $4',url:'/d/3d1168196a045c77606a5675405a626a3b0f3164',},{title:'Claw代理一直在',url:'/d/3f7941296a045c77606a56754558616a1e732b34',},{title:'出Claw 老4刀,没被限过,每月使用较少,五一到期,120口令包push',url:'/d/3d0e070f6a045c77606a56754651656a27301518',},{title:'claw 这个机子谁知道?',url:'/d/0025761d6a045c77606a5675465c616a3f133e35',},{title:'收claw hk8.4季付的',url:'/d/693b74026a045c77606a56754658676a0e11100b',},{title:'[已出] Claw 4$ 香港 VDS 2C2G-1T 中国优化款',url:'/d/1e0200356a045c77606a56754750626a0b02181a',},{title:'120 claw 4U -250428 push',url:'/d/69017e2f6a045c77606a5674405c666a00171d2a',},{title:'Claw这个25.6的和论坛里经常看到的老4刀是一样的吗',url:'/d/367f56246a045c77606a5674405d6b6a55282b20',},{title:'260收一台Claw HK $4翻倍款',url:'/d/6831763f6a045c77606a5674405b646a0e710a64',},],} 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")