diff --git a/backend/app/service/container.go b/backend/app/service/container.go index 3dbb56d85..147d4918b 100644 --- a/backend/app/service/container.go +++ b/backend/app/service/container.go @@ -144,10 +144,11 @@ func (u *ContainerService) Page(req dto.PageContainer) (int64, interface{}, erro var ports []string for _, port := range item.Ports { - if port.IP == "::" || port.PublicPort == 0 { - continue + itemPortStr := fmt.Sprintf("%v/%s", port.PrivatePort, port.Type) + if port.PublicPort != 0 { + itemPortStr = fmt.Sprintf("%s:%v->%v/%s", port.IP, port.PublicPort, port.PrivatePort, port.Type) } - ports = append(ports, fmt.Sprintf("%v:%v/%s", port.PublicPort, port.PrivatePort, port.Type)) + ports = append(ports, itemPortStr) } cpu, mem := loadCpuAndMem(client, item.ID) backDatas[i] = dto.ContainerInfo{ diff --git a/frontend/src/components/port-jump/index.vue b/frontend/src/components/port-jump/index.vue new file mode 100644 index 000000000..ef9ca2fff --- /dev/null +++ b/frontend/src/components/port-jump/index.vue @@ -0,0 +1,55 @@ + + diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 016e4c0d2..45545b157 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -468,6 +468,7 @@ const message = { cleanSuccessWithSpace: 'The operation is successful. The number of disks cleared this time is {0}. The disk space freed is {1}!', container: 'Container', + unExposedPort: 'The current port mapping address is 127.0.0.1, which cannot enable external access.', upTime: 'UpTime', all: 'All', fetch: 'Fetch', @@ -937,7 +938,7 @@ const message = { sessionTimeoutHelper: 'If you do not operate the panel for more than {0} seconds, the panel automatically logs out', systemIP: 'System IP', - systemIPWarning: 'Please set the system IP in the panel settings first.', + systemIPWarning: 'The server IP is not currently set. Please set it in the control panel first!', syncTime: 'Server time', timeZone: 'Time Zone', timeZoneChangeHelper: 'Changing the time zone requires restarting the service. Do you want to continue?', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index bd3b139b7..a4b1973de 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -432,7 +432,8 @@ const message = { localIP: '本機 IP', }, container: { - createContainer: '創建容器', + create: '創建容器', + edit: '編輯容器', updateContaienrHelper: '容器編輯需要重建容器,任何未持久化的數據將會丟失,是否繼續?', containerList: '容器列表', operatorHelper: '將對選中容器進行 {0} 操作,是否繼續?', @@ -459,6 +460,7 @@ const message = { cleanSuccess: '操作成功,本次清理數量: {0} 個!', cleanSuccessWithSpace: '操作成功,本次清理數量: {0} 個,釋放磁盤空間: {1}!', container: '容器', + unExposedPort: '當前端口映射地址為 127.0.0.1,無法實現外部訪問', upTime: '運行時長', all: '全部', fetch: '過濾', @@ -621,6 +623,8 @@ const message = { startIn: '中開啟', }, cronjob: { + create: '創建計劃任務', + edit: '編輯計劃任務', cronTask: '計劃任務', changeStatus: '狀態修改', disableMsg: '停止計劃任務會導致該任務不再自動執行。是否繼續?', @@ -898,7 +902,7 @@ const message = { sessionTimeoutError: '最小超時時間為 300 秒', sessionTimeoutHelper: '如果用戶超過 {0} 秒未操作面板,面板將自動退出登錄', systemIP: '服務器 IP', - systemIPWarning: '請先在面板設置中設置服務器 IP', + systemIPWarning: '當前未設置服務器 IP,請先在面板設置中設置!', syncTime: '服務器時間', timeZone: '系統時區', timeZoneChangeHelper: '系統時區修改需要重啟服務,是否繼續?', @@ -1406,6 +1410,8 @@ const message = { acmeHelper: 'Acme 賬戶用於申請免費證書', }, firewall: { + create: '創建規則', + edit: '編輯規則', notSupport: '未檢測到系統防火墻(firewalld 或者 ufw),請參考官方文檔進行安裝', ccDeny: 'CC 防護', ipWhiteList: 'IP 白名單', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index b096f9e10..6b08826a9 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -432,7 +432,8 @@ const message = { localIP: '本机 IP', }, container: { - createContainer: '创建容器', + create: '创建容器', + edit: '编辑容器', updateContaienrHelper: '容器编辑需要重建容器,任何未持久化的数据将会丢失,是否继续?', containerList: '容器列表', operatorHelper: '将对选中容器进行 {0} 操作,是否继续?', @@ -459,6 +460,7 @@ const message = { cleanSuccess: '操作成功,本次清理数量: {0} 个!', cleanSuccessWithSpace: '操作成功,本次清理数量: {0} 个,释放磁盘空间: {1}!', container: '容器', + unExposedPort: '当前端口映射地址为 127.0.0.1,无法实现外部访问', upTime: '运行时长', all: '全部', fetch: '过滤', @@ -621,6 +623,8 @@ const message = { startIn: '中开启', }, cronjob: { + create: '创建计划任务', + edit: '编辑计划任务', cronTask: '计划任务', changeStatus: '状态修改', disableMsg: '停止计划任务会导致该任务不再自动执行。是否继续?', @@ -904,7 +908,7 @@ const message = { sessionTimeoutError: '最小超时时间为 300 秒', sessionTimeoutHelper: '如果用户超过 {0} 秒未操作面板,面板将自动退出登录', systemIP: '服务器 IP', - systemIPWarning: '请先在面板设置中设置服务器 IP', + systemIPWarning: '当前未设置服务器 IP,请先在面板设置中设置!', syncTime: '服务器时间', timeZone: '系统时区', timeZoneChangeHelper: '系统时区修改需要重启服务,是否继续?', @@ -1412,6 +1416,8 @@ const message = { acmeHelper: 'Acme 账户用于申请免费证书', }, firewall: { + create: '创建规则', + edit: '编辑规则', notSupport: '未检测到系统防火墙(firewalld 或者 ufw),请参考官方文档进行安装', ccDeny: 'CC 防护', ipWhiteList: 'IP 白名单', diff --git a/frontend/src/utils/util.ts b/frontend/src/utils/util.ts index 9d4d64adc..432a88a2b 100644 --- a/frontend/src/utils/util.ts +++ b/frontend/src/utils/util.ts @@ -1,6 +1,4 @@ -import { getSettingInfo } from '@/api/modules/setting'; import i18n from '@/lang'; -import { MsgError } from './message'; export function deepCopy(obj: any): T { let newObj: any; @@ -258,16 +256,3 @@ export function downloadFile(filePath: string) { let url = `${import.meta.env.VITE_API_URL as string}/files/download?`; window.open(url + 'path=' + filePath, '_blank'); } - -export async function JumpDashboard(port: any) { - if (Number(port) === 0) { - MsgError(i18n.global.t('setting.errPort')); - return; - } - const res = await getSettingInfo(); - if (!res.data.systemIP) { - MsgError(i18n.global.t('setting.systemIPWarning')); - return; - } - window.open(`http://${res.data.systemIP}:${port}`, '_blank'); -} diff --git a/frontend/src/views/app-store/installed/index.vue b/frontend/src/views/app-store/installed/index.vue index 3b2aab73b..c05352a0e 100644 --- a/frontend/src/views/app-store/installed/index.vue +++ b/frontend/src/views/app-store/installed/index.vue @@ -193,7 +193,7 @@ {{ $t('app.busPort') }}:{{ installed.httpPort }} @@ -239,6 +239,8 @@ + +