From 9248eb08dac85de39202e203f5584092781601aa Mon Sep 17 00:00:00 2001 From: TeamsSix Date: Wed, 28 Jun 2023 15:02:46 +0800 Subject: [PATCH] perf: optimized public IP display --- .github/ISSUE_TEMPLATE/bug.yml | 2 +- .github/ISSUE_TEMPLATE/feat.yml | 2 +- .github/ISSUE_TEMPLATE/perf.yml | 2 +- pkg/cloud/alibaba/aliecs/ecsLs.go | 2 ++ pkg/cloud/tencent/tencentcvm/cvmLs.go | 2 ++ pkg/cloud/tencent/tencentlh/lhLs.go | 2 ++ 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 6259798..8ca596e 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -1,6 +1,6 @@ name: Bug 反馈 (Bug Feedback) description: 提交一个 issue 帮助改进这个项目 (Submit an issue to help improve this project) -title: "[Bug] <在这里输入你的标题 (Enter your title here)>" +title: "[Bug] 在这里输入你的标题 (Enter your title here)" labels: ["bug"] assignees: - teamssix diff --git a/.github/ISSUE_TEMPLATE/feat.yml b/.github/ISSUE_TEMPLATE/feat.yml index 50dc48d..512b325 100644 --- a/.github/ISSUE_TEMPLATE/feat.yml +++ b/.github/ISSUE_TEMPLATE/feat.yml @@ -1,6 +1,6 @@ name: 新功能反馈 (Feedback on new features) description: 提交一个功能需求帮助完善这个项目 (Submit a feature request to help improve this project) -title: "[Feat] <在这里输入你的标题 (Enter your title here)>" +title: "[Feat] 在这里输入你的标题 (Enter your title here)" labels: ["enhancement"] assignees: - teamssix diff --git a/.github/ISSUE_TEMPLATE/perf.yml b/.github/ISSUE_TEMPLATE/perf.yml index 787574b..9b9a1e6 100644 --- a/.github/ISSUE_TEMPLATE/perf.yml +++ b/.github/ISSUE_TEMPLATE/perf.yml @@ -1,6 +1,6 @@ name: 功能优化反馈 (Feature optimization feedback) description: 提交一个功能优化需求帮助改进这个项目 (Submit a feature optimization request to help improve this project) -title: "[Perf] <在这里输入你的标题 (Enter your title here)>" +title: "[Perf] 在这里输入你的标题 (Enter your title here)" labels: ["performance"] assignees: - teamssix diff --git a/pkg/cloud/alibaba/aliecs/ecsLs.go b/pkg/cloud/alibaba/aliecs/ecsLs.go index a5f7b87..812e204 100644 --- a/pkg/cloud/alibaba/aliecs/ecsLs.go +++ b/pkg/cloud/alibaba/aliecs/ecsLs.go @@ -95,6 +95,8 @@ func DescribeInstances(region string, running bool, SpecifiedInstanceId string, b, _ := json.Marshal(PublicIpAddressList) if len(PublicIpAddressList) == 1 { PublicIpAddress = i.PublicIpAddress.IpAddress[0] + } else if len(PublicIpAddressList) == 0 { + PublicIpAddress = "" } else { PublicIpAddress = string(b) } diff --git a/pkg/cloud/tencent/tencentcvm/cvmLs.go b/pkg/cloud/tencent/tencentcvm/cvmLs.go index 4cb7729..179b3d1 100644 --- a/pkg/cloud/tencent/tencentcvm/cvmLs.go +++ b/pkg/cloud/tencent/tencentcvm/cvmLs.go @@ -77,6 +77,8 @@ func DescribeInstances(region string, running bool, specifiedInstanceId string, b, _ := json.Marshal(PublicIpAddressList) if len(PublicIpAddressList) == 1 { PublicIpAddress = PublicIpAddressList[0] + } else if len(PublicIpAddressList) == 0 { + PublicIpAddress = "" } else { PublicIpAddress = string(b) } diff --git a/pkg/cloud/tencent/tencentlh/lhLs.go b/pkg/cloud/tencent/tencentlh/lhLs.go index 6a6cd9d..4930d74 100644 --- a/pkg/cloud/tencent/tencentlh/lhLs.go +++ b/pkg/cloud/tencent/tencentlh/lhLs.go @@ -76,6 +76,8 @@ func DescribeInstances(region string, running bool, specifiedInstanceId string, b, _ := json.Marshal(PublicIpAddressList) if len(PublicIpAddressList) == 1 { PublicIpAddress = PublicIpAddressList[0] + } else if len(PublicIpAddressList) == 0 { + PublicIpAddress = "" } else { PublicIpAddress = string(b) }