v1.5.1 增强程序稳定性
This commit is contained in:
@@ -47,7 +47,7 @@ function build() {
|
||||
|
||||
# checking environment
|
||||
echo "checking required commands ..."
|
||||
commands=("zip" "unzip" "go" "find" "sed")
|
||||
commands=("zip" "unzip" "go" "find" "sed" "protoc")
|
||||
for cmd in "${commands[@]}"; do
|
||||
if [ "$(which "${cmd}")" ]; then
|
||||
echo "checking ${cmd}: ok"
|
||||
@@ -65,6 +65,19 @@ function build() {
|
||||
ZIP="${NAME}-${OS}-${ARCH}-${TAG}-v${VERSION}.zip"
|
||||
fi
|
||||
|
||||
# regenerate protobuf files to keep rawDesc in sync with .proto
|
||||
echo "regenerating protobuf files ..."
|
||||
EDGE_COMMON_BUILD="$ROOT/../../EdgeCommon/build"
|
||||
if [ -f "$EDGE_COMMON_BUILD/build.sh" ]; then
|
||||
(cd "$EDGE_COMMON_BUILD" && ./build.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "protobuf generation failed! Fix errors before building."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "EdgeCommon/build/build.sh not found, skipping protobuf generation"
|
||||
fi
|
||||
|
||||
# build edge-api
|
||||
APINodeVersion=$(lookup-version "$ROOT""/../../EdgeAPI/internal/const/const.go")
|
||||
echo "building edge-api v${APINodeVersion} ..."
|
||||
|
||||
@@ -5,7 +5,7 @@ default:
|
||||
dbs:
|
||||
prod:
|
||||
driver: "mysql"
|
||||
dsn: "root:123456@tcp(127.0.0.1:3306)/db_edge?charset=utf8mb4&timeout=30s"
|
||||
dsn: "root:123456@tcp(127.0.0.1:3308)/db_edge?charset=utf8mb4&timeout=30s"
|
||||
prefix: "edge"
|
||||
models:
|
||||
package: internal/web/models
|
||||
|
||||
@@ -10,7 +10,7 @@ require (
|
||||
github.com/TeaOSLab/EdgeCommon v0.0.0-00010101000000-000000000000
|
||||
github.com/TeaOSLab/EdgePlus v0.0.0-00010101000000-000000000000
|
||||
github.com/cespare/xxhash/v2 v2.3.0
|
||||
github.com/go-sql-driver/mysql v1.5.0
|
||||
github.com/go-sql-driver/mysql v1.7.0
|
||||
github.com/iwind/TeaGo v0.0.0-20240429060313-31a7bc8e9cc9
|
||||
github.com/iwind/gosock v0.0.0-20211103081026-ee4652210ca4
|
||||
github.com/miekg/dns v1.1.43
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/TeaOSLab/EdgeAPI v1.3.9 h1:qUSQJsDmxb6XBatu2tKMZ24+6hmJHhBBGx5WXBTbfN4=
|
||||
github.com/TeaOSLab/EdgeAPI v1.3.9/go.mod h1:/XK/wF+DcEeQ0v42VpWC/co5sRUuExbs7wvTNv6b8EE=
|
||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
@@ -7,14 +13,16 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
|
||||
github.com/frankban/quicktest v1.5.0/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o=
|
||||
github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY=
|
||||
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
|
||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
|
||||
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
@@ -34,8 +42,12 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/iwind/TeaGo v0.0.0-20240429060313-31a7bc8e9cc9 h1:lqSd+OeAMzPlejoVtsmHJEeQ6/MWXCr+Ws2eX9/Rewg=
|
||||
github.com/iwind/TeaGo v0.0.0-20240429060313-31a7bc8e9cc9/go.mod h1:SfqVbWyIPdVflyA6lMgicZzsoGS8pyeLiTRe8/CIpGI=
|
||||
github.com/iwind/TeaGo v0.0.0-20240508072741-7647e70b7070 h1:0YHZBcuXYbvtQ0XfEdtzr/XybiMrwD8vV1lvgAwzUW4=
|
||||
github.com/iwind/TeaGo v0.0.0-20240508072741-7647e70b7070/go.mod h1:SfqVbWyIPdVflyA6lMgicZzsoGS8pyeLiTRe8/CIpGI=
|
||||
github.com/iwind/gosock v0.0.0-20211103081026-ee4652210ca4 h1:VWGsCqTzObdlbf7UUE3oceIpcEKi4C/YBUszQXk118A=
|
||||
github.com/iwind/gosock v0.0.0-20211103081026-ee4652210ca4/go.mod h1:H5Q7SXwbx3a97ecJkaS2sD77gspzE7HFUafBO0peEyA=
|
||||
github.com/iwind/gosock v0.0.0-20220505115348-f88412125a62 h1:HJH6RDheAY156DnIfJSD/bEvqyXzsZuE2gzs8PuUjoo=
|
||||
github.com/iwind/gosock v0.0.0-20220505115348-f88412125a62/go.mod h1:H5Q7SXwbx3a97ecJkaS2sD77gspzE7HFUafBO0peEyA=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
@@ -43,11 +55,16 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
|
||||
github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg=
|
||||
github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
|
||||
github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4=
|
||||
github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||
github.com/mozillazg/go-pinyin v0.18.0 h1:hQompXO23/0ohH8YNjvfsAITnCQImCiR/Fny8EhIeW0=
|
||||
github.com/mozillazg/go-pinyin v0.18.0/go.mod h1:iR4EnMMRXkfpFVV5FMi4FNB6wGq9NV6uDWbUuPhP4Yc=
|
||||
github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8=
|
||||
github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs=
|
||||
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
|
||||
@@ -81,6 +98,8 @@ github.com/shirou/gopsutil/v3 v3.22.5 h1:atX36I/IXgFiB81687vSiBI5zrMsxcIBkP9cQMJ
|
||||
github.com/shirou/gopsutil/v3 v3.22.5/go.mod h1:so9G9VzeHt/hsd0YwqprnjHnfARAUktauykSbr+y2gA=
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
@@ -122,24 +141,18 @@ golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
|
||||
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
|
||||
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
|
||||
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
|
||||
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
|
||||
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
|
||||
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
|
||||
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
|
||||
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
|
||||
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package teaconst
|
||||
|
||||
const (
|
||||
Version = "1.5.0" //1.3.9
|
||||
Version = "1.5.1" //1.3.9
|
||||
|
||||
APINodeVersion = "1.5.0" //1.3.9
|
||||
APINodeVersion = "1.5.1" //1.3.9
|
||||
|
||||
ProductName = "Edge Admin"
|
||||
ProcessName = "edge-admin"
|
||||
|
||||
@@ -377,6 +377,10 @@ func (this *RPCClient) HTTPDNSRuntimeLogRPC() pb.HTTPDNSRuntimeLogServiceClient
|
||||
return pb.NewHTTPDNSRuntimeLogServiceClient(this.pickConn())
|
||||
}
|
||||
|
||||
func (this *RPCClient) HTTPDNSBoardRPC() pb.HTTPDNSBoardServiceClient {
|
||||
return pb.NewHTTPDNSBoardServiceClient(this.pickConn())
|
||||
}
|
||||
|
||||
func (this *RPCClient) HTTPDNSSandboxRPC() pb.HTTPDNSSandboxServiceClient {
|
||||
return pb.NewHTTPDNSSandboxServiceClient(this.pickConn())
|
||||
}
|
||||
|
||||
@@ -249,6 +249,3 @@ func (this *RPCClient) PostRPC() pb.PostServiceClient {
|
||||
return pb.NewPostServiceClient(this.pickConn())
|
||||
}
|
||||
|
||||
func (this *RPCClient) HTTPDNSBoardRPC() pb.HTTPDNSBoardServiceClient {
|
||||
return pb.NewHTTPDNSBoardServiceClient(this.pickConn())
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ func (this *MySQLInstaller) InstallFromFile(xzFilePath string, targetDir string)
|
||||
// waiting for startup
|
||||
for i := 0; i < 30; i++ {
|
||||
var conn net.Conn
|
||||
conn, err = net.Dial("tcp", "127.0.0.1:3306")
|
||||
conn, err = net.Dial("tcp", "127.0.0.1:3308")
|
||||
if err != nil {
|
||||
time.Sleep(1 * time.Second)
|
||||
} else {
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
package main; import ("fmt"; "github.com/TeaOSLab/EdgeAPI/internal/db/models"; _ "github.com/go-sql-driver/mysql"; "github.com/iwind/TeaGo/dbs"; "github.com/iwind/TeaGo/Tea"); func main() { Tea.Env = "prod"; dbConfig := &dbs.Config{Driver: "mysql", Dsn: "edge:123456@tcp(127.0.0.1:3306)/edge?charset=utf8mb4&parseTime=true&loc=Local", Prefix: "edge"}; dbs.DefaultDB(dbConfig); apps, _ := models.SharedHTTPDNSAppDAO.FindAllEnabledApps(nil); for _, app := range apps { fmt.Printf("App: %s, Primary: %d\n", app.AppId, app.PrimaryClusterId) } }
|
||||
@@ -126,8 +126,8 @@
|
||||
<!-- 模块 -->
|
||||
<div v-for="module in teaModules">
|
||||
<a class="item" :href="Tea.url(module.code)"
|
||||
:class="{active:teaMenu == module.code && teaSubMenu.length == 0, separator:module.code.length == 0, expend: teaMenu == module.code}"
|
||||
:style="(teaMenu == module.code && teaSubMenu.length == 0) ? 'background: rgba(230, 230, 230, 0.45) !important;' : ''"
|
||||
:class="{active:teaMenu == module.code, separator:module.code.length == 0, expend: teaMenu == module.code}"
|
||||
:style="(teaMenu == module.code) ? 'background: rgba(230, 230, 230, 0.45) !important;' : ''"
|
||||
v-if="module.isOn !== false">
|
||||
<span v-if="module.code.length > 0">
|
||||
<i class="window restore outline icon" v-if="module.icon == null"></i>
|
||||
|
||||
@@ -37,6 +37,7 @@ Tea.context(function () {
|
||||
this.reloadHourlyTrafficChart = function () {
|
||||
let stats = this.hourlyStats
|
||||
if (stats == null || stats.length == 0) {
|
||||
this.renderEmptyBarChart("hourly-traffic-chart", "暂无请求趋势数据")
|
||||
return
|
||||
}
|
||||
this.reloadTrafficChart("hourly-traffic-chart", stats, function (args) {
|
||||
@@ -47,6 +48,7 @@ Tea.context(function () {
|
||||
this.reloadDailyTrafficChart = function () {
|
||||
let stats = this.dailyStats
|
||||
if (stats == null || stats.length == 0) {
|
||||
this.renderEmptyBarChart("daily-traffic-chart", "暂无请求趋势数据")
|
||||
return
|
||||
}
|
||||
this.reloadTrafficChart("daily-traffic-chart", stats, function (args) {
|
||||
@@ -116,6 +118,7 @@ Tea.context(function () {
|
||||
|
||||
this.reloadTopAppsChart = function () {
|
||||
if (this.topAppStats == null || this.topAppStats.length == 0) {
|
||||
this.renderEmptyBarChart("top-apps-chart", "暂无应用请求数据")
|
||||
return
|
||||
}
|
||||
let axis = teaweb.countAxis(this.topAppStats, function (v) {
|
||||
@@ -140,6 +143,7 @@ Tea.context(function () {
|
||||
|
||||
this.reloadTopDomainsChart = function () {
|
||||
if (this.topDomainStats == null || this.topDomainStats.length == 0) {
|
||||
this.renderEmptyBarChart("top-domains-chart", "暂无域名请求数据")
|
||||
return
|
||||
}
|
||||
let axis = teaweb.countAxis(this.topDomainStats, function (v) {
|
||||
@@ -164,6 +168,7 @@ Tea.context(function () {
|
||||
|
||||
this.reloadTopNodesChart = function () {
|
||||
if (this.topNodeStats == null || this.topNodeStats.length == 0) {
|
||||
this.renderEmptyBarChart("top-nodes-chart", "暂无节点访问数据")
|
||||
return
|
||||
}
|
||||
let axis = teaweb.countAxis(this.topNodeStats, function (v) {
|
||||
@@ -189,4 +194,39 @@ Tea.context(function () {
|
||||
})
|
||||
}
|
||||
|
||||
this.renderEmptyBarChart = function (chartId, message) {
|
||||
let chartBox = document.getElementById(chartId)
|
||||
if (chartBox == null) {
|
||||
return
|
||||
}
|
||||
let chart = teaweb.initChart(chartBox)
|
||||
chart.setOption({
|
||||
xAxis: {
|
||||
data: [],
|
||||
axisLabel: { show: false }
|
||||
},
|
||||
yAxis: {
|
||||
axisLabel: { show: false },
|
||||
splitLine: { show: true }
|
||||
},
|
||||
grid: {
|
||||
left: 50,
|
||||
top: 40,
|
||||
right: 20,
|
||||
bottom: 20
|
||||
},
|
||||
graphic: [{
|
||||
type: "text",
|
||||
left: "center",
|
||||
top: "middle",
|
||||
style: {
|
||||
text: message,
|
||||
fontSize: 13,
|
||||
fill: "#999"
|
||||
}
|
||||
}],
|
||||
series: []
|
||||
})
|
||||
chart.resize()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -37,6 +37,7 @@ Tea.context(function () {
|
||||
this.reloadHourlyTrafficChart = function () {
|
||||
let stats = this.hourlyStats
|
||||
if (stats == null || stats.length == 0) {
|
||||
this.renderEmptyBarChart("hourly-traffic-chart", "暂无请求趋势数据")
|
||||
return
|
||||
}
|
||||
this.reloadTrafficChart("hourly-traffic-chart", stats, function (args) {
|
||||
@@ -47,6 +48,7 @@ Tea.context(function () {
|
||||
this.reloadDailyTrafficChart = function () {
|
||||
let stats = this.dailyStats
|
||||
if (stats == null || stats.length == 0) {
|
||||
this.renderEmptyBarChart("daily-traffic-chart", "暂无请求趋势数据")
|
||||
return
|
||||
}
|
||||
this.reloadTrafficChart("daily-traffic-chart", stats, function (args) {
|
||||
@@ -116,6 +118,7 @@ Tea.context(function () {
|
||||
|
||||
this.reloadTopAppsChart = function () {
|
||||
if (this.topAppStats == null || this.topAppStats.length == 0) {
|
||||
this.renderEmptyBarChart("top-apps-chart", "暂无应用请求数据")
|
||||
return
|
||||
}
|
||||
let axis = teaweb.countAxis(this.topAppStats, function (v) {
|
||||
@@ -140,6 +143,7 @@ Tea.context(function () {
|
||||
|
||||
this.reloadTopDomainsChart = function () {
|
||||
if (this.topDomainStats == null || this.topDomainStats.length == 0) {
|
||||
this.renderEmptyBarChart("top-domains-chart", "暂无域名请求数据")
|
||||
return
|
||||
}
|
||||
let axis = teaweb.countAxis(this.topDomainStats, function (v) {
|
||||
@@ -164,6 +168,7 @@ Tea.context(function () {
|
||||
|
||||
this.reloadTopNodesChart = function () {
|
||||
if (this.topNodeStats == null || this.topNodeStats.length == 0) {
|
||||
this.renderEmptyBarChart("top-nodes-chart", "暂无节点访问数据")
|
||||
return
|
||||
}
|
||||
let axis = teaweb.countAxis(this.topNodeStats, function (v) {
|
||||
@@ -188,4 +193,40 @@ Tea.context(function () {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.renderEmptyBarChart = function (chartId, message) {
|
||||
let chartBox = document.getElementById(chartId)
|
||||
if (chartBox == null) {
|
||||
return
|
||||
}
|
||||
let chart = teaweb.initChart(chartBox)
|
||||
chart.setOption({
|
||||
xAxis: {
|
||||
data: [],
|
||||
axisLabel: { show: false }
|
||||
},
|
||||
yAxis: {
|
||||
axisLabel: { show: false },
|
||||
splitLine: { show: true }
|
||||
},
|
||||
grid: {
|
||||
left: 50,
|
||||
top: 40,
|
||||
right: 20,
|
||||
bottom: 20
|
||||
},
|
||||
graphic: [{
|
||||
type: "text",
|
||||
left: "center",
|
||||
top: "middle",
|
||||
style: {
|
||||
text: message,
|
||||
fontSize: 13,
|
||||
fill: "#999"
|
||||
}
|
||||
}],
|
||||
series: []
|
||||
})
|
||||
chart.resize()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -355,7 +355,8 @@ Tea.context(function () {
|
||||
cluster.nodes.forEach(function (node) {
|
||||
if (node.id == nodeId && installStatus != null) {
|
||||
node.installStatus = installStatus
|
||||
// 升级完成后移除跟踪
|
||||
// 仅在升级完成(isFinished)时才移除跟踪
|
||||
// 不要仅凭 !isRunning 就移除,因为批量升级时排队的节点尚未开始
|
||||
if (installStatus.isFinished) {
|
||||
node.isUpgrading = false
|
||||
let idx = that.upgradingNodeIds[moduleCode].indexOf(nodeId)
|
||||
|
||||
Reference in New Issue
Block a user