2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 14:57:16 +08:00

fix: 容器列表空切片

This commit is contained in:
耗子
2024-06-08 14:48:15 +08:00
parent 0da3f7b8e0
commit fd0e43fb26
2 changed files with 9 additions and 12 deletions

View File

@@ -63,11 +63,8 @@ func (r *ContainerController) ContainerList(ctx http.Context) http.Response {
endIndex = len(containers)
}
paged := containers[startIndex:endIndex]
if paged == nil {
paged = []types.Container{}
}
var items []any
items := make([]any, 0)
for _, item := range paged {
var name string
if len(item.Names) > 0 {

View File

@@ -122,13 +122,13 @@ Prepare_System() {
if [ "${OS}" == "centos" ]; then
if ${inChina}; then
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.cloud.tencent.com/rocky|g' \
-e 's|^# baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.cloud.tencent.com/rocky|g' \
-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.tencent.com/rocky|g' \
-e 's|^# baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.tencent.com/rocky|g' \
-i.bak \
/etc/yum.repos.d/[Rr]ocky*.repo
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=https://repo.almalinux.org|baseurl=https://mirrors.cloud.tencent.com|g' \
-e 's|^# baseurl=https://repo.almalinux.org|baseurl=https://mirrors.cloud.tencent.com|g' \
-e 's|^#baseurl=https://repo.almalinux.org|baseurl=https://mirrors.tencent.com|g' \
-e 's|^# baseurl=https://repo.almalinux.org|baseurl=https://mirrors.tencent.com|g' \
-i.bak \
/etc/yum.repos.d/[Aa]lmalinux*.repo
@@ -138,8 +138,8 @@ Prepare_System() {
dnf install epel-release -y
dnf config-manager --set-enabled epel
if ${inChina}; then
sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.cloud.tencent.com|' /etc/yum.repos.d/epel*
sed -i 's|^# baseurl=https://download.example/pub|baseurl=https://mirrors.cloud.tencent.com|' /etc/yum.repos.d/epel*
sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.tencent.com|' /etc/yum.repos.d/epel*
sed -i 's|^# baseurl=https://download.example/pub|baseurl=https://mirrors.tencent.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
dnf makecache -y
fi
@@ -153,8 +153,8 @@ Prepare_System() {
dnf install -y curl wget zip unzip tar p7zip p7zip-plugins git jq git-core dos2unix podman rsyslog
elif [ "${OS}" == "debian" ]; then
if ${inChina}; then
sed -i 's/deb.debian.org/mirrors.cloud.tencent.com/g' /etc/apt/sources.list
sed -i 's/security.debian.org/mirrors.cloud.tencent.com/g' /etc/apt/sources.list
sed -i 's/deb.debian.org/mirrors.tencent.com/g' /etc/apt/sources.list
sed -i 's/security.debian.org/mirrors.tencent.com/g' /etc/apt/sources.list
fi
apt-get update -y
apt-get install -y curl wget zip unzip tar p7zip p7zip-full git jq git dos2unix podman rsyslog