mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
feat: support vboard status
This commit is contained in:
1 parent
697a4d22da
commit
a443567df8
9 files changed
+248
-228
No files matched your search
@@ -1,207 +1,207 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>IconFonts Preview Demo -- iconfont</title>
|
||||
<meta name="description" content="An Icon Font Generated By webpack-iconfont-plugin-nodejs">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="font.css">
|
||||
<style>
|
||||
.info {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.flex-tb {
|
||||
display: flex;
|
||||
flex-flow: wrap;
|
||||
margin-bottom: 150px;
|
||||
}
|
||||
|
||||
.flex-tb > section {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
flex: 0 0 240px;
|
||||
align-items: center;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.flex-tb > section > header {
|
||||
height: 30px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.flex-tb i {
|
||||
font-size: 40px;
|
||||
line-height: 1;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.flex-tb div:hover {
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.flex-tb div:hover > i {
|
||||
font-size: 200px;
|
||||
}
|
||||
body{
|
||||
background: #ddd;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div class="info">
|
||||
<h3>iconfont (29)</h3>
|
||||
<div>Class name prefix: icon-</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="flex-tb">
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-Link_disconnect</header>
|
||||
<div><i class="icon-Link_disconnect"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-alert</header>
|
||||
<div><i class="icon-alert"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-caret-down</header>
|
||||
<div><i class="icon-caret-down"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-caret-up</header>
|
||||
<div><i class="icon-caret-up"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-chakandaorujilu</header>
|
||||
<div><i class="icon-chakandaorujilu"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-chevron-left</header>
|
||||
<div><i class="icon-chevron-left"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-chevron-right</header>
|
||||
<div><i class="icon-chevron-right"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-chuangjiangongdan1</header>
|
||||
<div><i class="icon-chuangjiangongdan1"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-clock2</header>
|
||||
<div><i class="icon-clock2"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-cloud-sync</header>
|
||||
<div><i class="icon-cloud-sync"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-cloud</header>
|
||||
<div><i class="icon-cloud"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-coding_alert_circle</header>
|
||||
<div><i class="icon-coding_alert_circle"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-daoru</header>
|
||||
<div><i class="icon-daoru"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-daoruzupu-xianxing</header>
|
||||
<div><i class="icon-daoruzupu-xianxing"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-delete</header>
|
||||
<div><i class="icon-delete"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-dian</header>
|
||||
<div><i class="icon-dian"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-earth</header>
|
||||
<div><i class="icon-earth"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-heart</header>
|
||||
<div><i class="icon-heart"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-help-circle-outline</header>
|
||||
<div><i class="icon-help-circle-outline"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-label</header>
|
||||
<div><i class="icon-label"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-lianjie</header>
|
||||
<div><i class="icon-lianjie"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-loading_ico</header>
|
||||
<div><i class="icon-loading_ico"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-logout</header>
|
||||
<div><i class="icon-logout"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-setting</header>
|
||||
<div><i class="icon-setting"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-share</header>
|
||||
<div><i class="icon-share"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-sync</header>
|
||||
<div><i class="icon-sync"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-wave</header>
|
||||
<div><i class="icon-wave"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-wendangxiugai</header>
|
||||
<div><i class="icon-wendangxiugai"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-winfo-icon-chakanbaogao</header>
|
||||
<div><i class="icon-winfo-icon-chakanbaogao"></i></div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>IconFonts Preview Demo -- iconfont</title>
|
||||
<meta name="description" content="An Icon Font Generated By webpack-iconfont-plugin-nodejs">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="font.css">
|
||||
<style>
|
||||
.info {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.flex-tb {
|
||||
display: flex;
|
||||
flex-flow: wrap;
|
||||
margin-bottom: 150px;
|
||||
}
|
||||
|
||||
.flex-tb > section {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
flex: 0 0 240px;
|
||||
align-items: center;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.flex-tb > section > header {
|
||||
height: 30px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.flex-tb i {
|
||||
font-size: 40px;
|
||||
line-height: 1;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.flex-tb div:hover {
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.flex-tb div:hover > i {
|
||||
font-size: 200px;
|
||||
}
|
||||
body{
|
||||
background: #ddd;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div class="info">
|
||||
<h3>iconfont (29)</h3>
|
||||
<div>Class name prefix: icon-</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="flex-tb">
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-Link_disconnect</header>
|
||||
<div><i class="icon-Link_disconnect"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-alert</header>
|
||||
<div><i class="icon-alert"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-caret-down</header>
|
||||
<div><i class="icon-caret-down"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-caret-up</header>
|
||||
<div><i class="icon-caret-up"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-chakandaorujilu</header>
|
||||
<div><i class="icon-chakandaorujilu"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-chevron-left</header>
|
||||
<div><i class="icon-chevron-left"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-chevron-right</header>
|
||||
<div><i class="icon-chevron-right"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-chuangjiangongdan1</header>
|
||||
<div><i class="icon-chuangjiangongdan1"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-clock2</header>
|
||||
<div><i class="icon-clock2"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-cloud-sync</header>
|
||||
<div><i class="icon-cloud-sync"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-cloud</header>
|
||||
<div><i class="icon-cloud"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-coding_alert_circle</header>
|
||||
<div><i class="icon-coding_alert_circle"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-daoru</header>
|
||||
<div><i class="icon-daoru"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-daoruzupu-xianxing</header>
|
||||
<div><i class="icon-daoruzupu-xianxing"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-delete</header>
|
||||
<div><i class="icon-delete"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-dian</header>
|
||||
<div><i class="icon-dian"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-earth</header>
|
||||
<div><i class="icon-earth"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-heart</header>
|
||||
<div><i class="icon-heart"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-help-circle-outline</header>
|
||||
<div><i class="icon-help-circle-outline"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-label</header>
|
||||
<div><i class="icon-label"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-lianjie</header>
|
||||
<div><i class="icon-lianjie"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-loading_ico</header>
|
||||
<div><i class="icon-loading_ico"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-logout</header>
|
||||
<div><i class="icon-logout"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-setting</header>
|
||||
<div><i class="icon-setting"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-share</header>
|
||||
<div><i class="icon-share"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-sync</header>
|
||||
<div><i class="icon-sync"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-wave</header>
|
||||
<div><i class="icon-wave"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-wendangxiugai</header>
|
||||
<div><i class="icon-wendangxiugai"></i></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header contenteditable>icon-winfo-icon-chakanbaogao</header>
|
||||
<div><i class="icon-winfo-icon-chakanbaogao"></i></div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+5
-1
@@ -310,7 +310,11 @@
|
||||
>
|
||||
<b-field
|
||||
v-if="tab === subi + 2"
|
||||
:label="`${sub.host.toUpperCase()}(${sub.servers.length})`"
|
||||
:label="
|
||||
`${sub.host.toUpperCase()}(${sub.servers.length}${
|
||||
sub.info ? ') (' : ''
|
||||
}${sub.info})`
|
||||
"
|
||||
>
|
||||
<b-table
|
||||
:paginated="sub.servers.length >= 150"
|
||||
|
||||
@@ -3,8 +3,10 @@ package httpClient
|
||||
import "net/http"
|
||||
|
||||
func HttpGetUsingSpecificClient(c *http.Client, url string) (resp *http.Response, err error) {
|
||||
if resp, err = c.Get(url); err != nil {
|
||||
resp, err = http.Get(url)
|
||||
req, _ := http.NewRequest("GET", url, nil)
|
||||
req.Header.Set("User-Agent", "v2rayA (like shadowrocket)")
|
||||
if resp, err = c.Do(req); err != nil {
|
||||
resp, err = http.DefaultClient.Do(req)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package touch
|
||||
|
||||
import (
|
||||
"github.com/mzz2017/v2rayA/db/configure"
|
||||
"fmt"
|
||||
"github.com/mzz2017/v2rayA/db/configure"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -32,6 +32,7 @@ type Subscription struct {
|
||||
TYPE configure.TouchType `json:"_type"`
|
||||
Host string `json:"host"`
|
||||
Status SubscriptionStatus `json:"status"`
|
||||
Info string `json:"info"`
|
||||
Servers []TouchServer `json:"servers"`
|
||||
}
|
||||
|
||||
@@ -104,6 +105,7 @@ func GenerateTouch() (t Touch) {
|
||||
Host: u.Host,
|
||||
Status: SubscriptionStatus(v.Status),
|
||||
Servers: serverRawsToServers(v.Servers),
|
||||
Info: v.Info,
|
||||
}
|
||||
}
|
||||
t.ConnectedServer = configure.GetConnectedServer()
|
||||
|
||||
@@ -11,4 +11,5 @@ type SubscriptionRaw struct {
|
||||
Address string `json:"address"`
|
||||
Status string `json:"status"` //update time, error info, etc.
|
||||
Servers []ServerRaw `json:"servers"`
|
||||
Info string `json:"info"` // maybe include some info from provider
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
"github.com/mzz2017/v2rayA/common/httpClient"
|
||||
"github.com/mzz2017/v2rayA/core/nodeData"
|
||||
"github.com/mzz2017/v2rayA/core/touch"
|
||||
"github.com/mzz2017/v2rayA/core/v2ray"
|
||||
"github.com/mzz2017/v2rayA/db/configure"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Import(url string, which *configure.Which) (err error) {
|
||||
@@ -54,7 +54,7 @@ func Import(url string, which *configure.Which) (err error) {
|
||||
return err
|
||||
}
|
||||
c.Timeout = 90 * time.Second
|
||||
infos, err := ResolveSubscriptionWithClient(url, c)
|
||||
infos, status, err := ResolveSubscriptionWithClient(url, c)
|
||||
if err != nil {
|
||||
return newError("failed to resolve subscription address").Base(err)
|
||||
}
|
||||
@@ -79,6 +79,7 @@ func Import(url string, which *configure.Which) (err error) {
|
||||
Address: url,
|
||||
Status: string(touch.NewUpdateStatus()),
|
||||
Servers: uniqueServers,
|
||||
Info: status,
|
||||
}})
|
||||
}
|
||||
return
|
||||
|
||||
@@ -237,6 +237,7 @@ func httpLatency(which *configure.Which, port string, timeout time.Duration) {
|
||||
return http.ErrUseLastResponse
|
||||
}
|
||||
req, _ := http.NewRequest("GET", "http://www.msftconnecttest.com/connecttest.txt", nil)
|
||||
//req, _ := http.NewRequest("GET", "http://www.gstatic.com/generate_204", nil)
|
||||
req.Header.Set("Accept", "*/*")
|
||||
req.Header.Set("Cache-Control", "no-cache")
|
||||
req.Header.Set("Accept-Encoding", "gzip, deflate, br")
|
||||
|
||||
@@ -2,13 +2,13 @@ package service
|
||||
|
||||
import (
|
||||
"github.com/json-iterator/go"
|
||||
"github.com/mzz2017/v2rayA/common"
|
||||
"github.com/mzz2017/v2rayA/core/nodeData"
|
||||
"github.com/mzz2017/v2rayA/core/vmessInfo"
|
||||
"log"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strings"
|
||||
"github.com/mzz2017/v2rayA/common"
|
||||
"github.com/mzz2017/v2rayA/core/nodeData"
|
||||
"github.com/mzz2017/v2rayA/core/vmessInfo"
|
||||
)
|
||||
|
||||
/*
|
||||
@@ -44,11 +44,15 @@ func ResolveVmessURL(vmess string) (data *nodeData.NodeData, err error) {
|
||||
return
|
||||
}
|
||||
q := u.Query()
|
||||
ps := q.Get("remarks")
|
||||
if ps == "" {
|
||||
ps = q.Get("remark")
|
||||
}
|
||||
info = vmessInfo.VmessInfo{
|
||||
ID: subMatch[1],
|
||||
Add: subMatch[2],
|
||||
Port: subMatch[3],
|
||||
Ps: q.Get("remarks"),
|
||||
Ps: ps,
|
||||
Host: q.Get("obfsParam"),
|
||||
Path: q.Get("path"),
|
||||
Net: q.Get("obfs"),
|
||||
|
||||
@@ -2,23 +2,23 @@ package service
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
"v2ray.com/core/common/errors"
|
||||
"github.com/mzz2017/v2rayA/common"
|
||||
"github.com/mzz2017/v2rayA/common/httpClient"
|
||||
"github.com/mzz2017/v2rayA/core/nodeData"
|
||||
"github.com/mzz2017/v2rayA/core/touch"
|
||||
"github.com/mzz2017/v2rayA/db/configure"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
"v2ray.com/core/common/errors"
|
||||
)
|
||||
|
||||
func ResolveSubscription(source string) (infos []*nodeData.NodeData, err error) {
|
||||
return ResolveSubscriptionWithClient(source, http.DefaultClient)
|
||||
}
|
||||
//func ResolveSubscription(source string) (infos []*nodeData.NodeData, err error) {
|
||||
// return ResolveSubscriptionWithClient(source, http.DefaultClient)
|
||||
//}
|
||||
|
||||
func ResolveSubscriptionWithClient(source string, client *http.Client) (infos []*nodeData.NodeData, err error) {
|
||||
func ResolveSubscriptionWithClient(source string, client *http.Client) (infos []*nodeData.NodeData, status string, err error) {
|
||||
// get请求source
|
||||
c := *client
|
||||
c.Timeout = 30 * time.Second
|
||||
@@ -39,6 +39,10 @@ func ResolveSubscriptionWithClient(source string, client *http.Client) (infos []
|
||||
// 解析
|
||||
infos = make([]*nodeData.NodeData, 0)
|
||||
for _, row := range rows {
|
||||
if strings.HasPrefix(row, "STATUS=") {
|
||||
status = strings.TrimPrefix(row, "STATUS=")
|
||||
continue
|
||||
}
|
||||
var data *nodeData.NodeData
|
||||
data, err = ResolveURL(row)
|
||||
if err != nil {
|
||||
@@ -61,7 +65,7 @@ func UpdateSubscription(index int, disconnectIfNecessary bool) (err error) {
|
||||
reason := "failed to get proxy"
|
||||
return newError(reason)
|
||||
}
|
||||
infos, err := ResolveSubscriptionWithClient(addr, c)
|
||||
infos, status, err := ResolveSubscriptionWithClient(addr, c)
|
||||
if err != nil {
|
||||
reason := "failed to resolve subscription address: " + err.Error()
|
||||
log.Println(infos, err)
|
||||
@@ -118,6 +122,7 @@ func UpdateSubscription(index int, disconnectIfNecessary bool) (err error) {
|
||||
}
|
||||
subscriptions[index].Servers = tsrs
|
||||
subscriptions[index].Status = string(touch.NewUpdateStatus())
|
||||
subscriptions[index].Info = status
|
||||
return configure.SetSubscription(index, &subscriptions[index])
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user