Files
op-packages/luci-app-quickstart/htdocs/luci-static/quickstart/FastnetInstallDialog.js
T

2 lines
4.4 KiB
JavaScript

import{defineComponent as N,computed as c,openBlock as d,createBlock as y,withCtx as I,createElementVNode as e,createVNode as k,toDisplayString as l,createElementBlock as r,createTextVNode as h,createCommentVNode as g}from"/luci-static/quickstart/card-runtime-v1.js";import{N as F,_ as p,n as w}from"./app.js?v=txJtMzYh";import"./vendor.js?v=B46K-l76";const C={class:"fastnet-install","data-fastnet-install-dialog":""},_={class:"fastnet-install-product"},$={class:"fastnet-install-icon"},B={class:"fastnet-install-badge"},V={class:"fastnet-install-description",role:"status"},D={key:0,class:"fastnet-install-error",role:"alert"},U={key:1,class:"fastnet-install-note"},q={class:"fastnet-install-footer"},M={class:"fastnet-install-links"},R={href:"/cgi-bin/luci/admin/store",target:"_blank",rel:"noopener"},T=["disabled"],x={class:"fastnet-install-actions"},A=["disabled","aria-busy"],E={key:0,class:"fastnet-install-spinner","aria-hidden":"true"},P=N({__name:"FastnetInstallDialog",props:{state:{},installing:{type:Boolean},error:{}},emits:["close","install","recheck"],setup(s){const n=s,f=window.vue_lang==="en",t=(o,a)=>f?a:o,i=c(()=>n.installing||n.state==="installing"),m=c(()=>i.value?t("正在安装","Installing"):n.state==="checking"?t("检查中","Checking"):n.state==="update_required"?t("需要更新","Update needed"):n.state==="unknown"?t("待确认","Unconfirmed"):n.state==="failed"?t("安装未完成","Incomplete"):t("尚未安装","Not installed")),v=c(()=>i.value?t("正在安装 FastNet,完成后即可添加外网测速卡片。","Installing FastNet. You can add the Internet speed card once it is ready."):n.state==="checking"?t("正在确认插件和安装状态,请稍候。","Checking the plugin and installation status."):n.state==="update_required"?t("当前插件版本尚未提供可用卡片,请先升级或修复 FastNet。","Update or repair FastNet to make this card available."):n.state==="unknown"?t("暂时无法确认安装状态,请重新读取或到软件中心检查。","Reload the installation status or check FastNet in the software center."):n.state==="failed"?t("FastNet 安装未完成,请检查软件源后重试。","FastNet installation did not complete. Check the package source and retry."):t("添加外网测速模块前,需要先安装 FastNet 插件。","Install FastNet before adding the Internet speed module.")),b=c(()=>n.installing?t("正在安装","Installing"):n.state==="checking"?t("正在检查","Checking"):n.state==="installing"?t("查看安装进度","View progress"):n.state==="update_required"?t("升级或修复","Update or repair"):n.state==="failed"?t("重试安装","Retry installation"):t("安装插件","Install plugin"));return(o,a)=>(d(),y(F,{title:t("安装 FastNet 插件","Install FastNet"),onClose:a[3]||(a[3]=u=>o.$emit("close"))},{default:I(()=>[e("div",C,[e("div",_,[e("span",$,[k(p,{name:"activity"})]),e("div",null,[a[4]||(a[4]=e("strong",null,"FastNet",-1)),e("p",null,l(t("外网速率 · NAT · IPv6","Internet speed · NAT · IPv6")),1)]),e("span",B,l(m.value),1)]),e("p",V,l(v.value),1),s.error?(d(),r("div",D,[a[5]||(a[5]=e("span",{"aria-hidden":"true"},"!",-1)),e("p",null,l(s.error),1)])):(d(),r("div",U,[k(p,{name:i.value?"clock":"check"},null,8,["name"]),e("p",null,l(i.value?t("可以关闭此窗口,安装会在后台继续。","You can close this window. Installation continues in the background."):t("安装后再选择卡片位置,不会自动开始测速。","Choose a card position after installation. No speed test starts automatically.")),1)])),e("div",q,[e("div",M,[e("a",R,[h(l(t("软件中心","Software center")),1),a[6]||(a[6]=e("svg",{viewBox:"0 0 16 16","aria-hidden":"true"},[e("path",{d:"M9 3h4v4M13 3 6 10M7 3H3v10h10V9"})],-1))]),s.installing?g("",!0):(d(),r("button",{key:0,type:"button",onClick:a[0]||(a[0]=u=>o.$emit("recheck")),disabled:s.state==="checking","data-recheck-card-install":""},l(t("重新读取","Reload status")),9,T))]),e("div",x,[e("button",{type:"button",class:"fastnet-install-back",onClick:a[1]||(a[1]=u=>o.$emit("close"))},l(t("返回","Back")),1),s.state!=="unknown"?(d(),r("button",{key:0,type:"button",class:"fastnet-install-primary",disabled:s.installing||s.state==="checking","aria-busy":i.value||s.state==="checking",onClick:a[2]||(a[2]=u=>o.$emit("install")),"data-confirm-card-install":""},[i.value||s.state==="checking"?(d(),r("span",E)):g("",!0),h(l(b.value),1)],8,A)):g("",!0)])])])]),_:1},8,["title"]))}}),W=w(P,[["__scopeId","data-v-a66b8b77"]]);export{W as default};