mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-14 10:36:30 +08:00
fix: Resolve the "No Port Specified" Error When Creating a Website Runtime Environment (#10041)
This commit is contained in:
parent
7bcc897379
commit
83ed835c9e
12 changed files with 57 additions and 35 deletions
|
@ -407,9 +407,10 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error)
|
|||
}
|
||||
case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDotNet:
|
||||
proxyPort := runtime.Port
|
||||
if create.Port > 0 {
|
||||
proxyPort = strconv.Itoa(create.Port)
|
||||
if proxyPort == "" {
|
||||
return buserr.New("ErrRuntimeNoPort")
|
||||
}
|
||||
proxyPort = strconv.Itoa(create.Port)
|
||||
website.Proxy = fmt.Sprintf("127.0.0.1:%s", proxyPort)
|
||||
}
|
||||
case constant.Subsite:
|
||||
|
|
|
@ -125,6 +125,7 @@ ErrProxyIsUsed: "Load balancing has been used by reverse proxy, cannot be delete
|
|||
ErrSSLValid: 'Certificate file is abnormal, please check the certificate status!'
|
||||
ErrWebsiteDir: "Please select a directory within the website directory."
|
||||
ErrComposerFileNotFound: "composer.json file does not exist"
|
||||
ErrRuntimeNoPort: "The runtime environment is not set with a port, please edit the runtime environment first."
|
||||
|
||||
#ssl
|
||||
ErrSSLCannotDelete: 'The {{ .name }} certificate is being used by a website and cannot be deleted'
|
||||
|
|
|
@ -125,6 +125,7 @@ ErrProxyIsUsed: "ロードバランシングはリバースプロキシによっ
|
|||
ErrSSLValid: '証明書ファイルが異常です、証明書の状態を確認してください!'
|
||||
ErrWebsiteDir: "ウェブサイトディレクトリ内のディレクトリを選択してください。"
|
||||
ErrComposerFileNotFound: "composer.json ファイルが存在しません"
|
||||
ErrRuntimeNoPort: "ランタイム環境にポートが設定されていません。先にランタイム環境を編集してください。"
|
||||
|
||||
#ssl
|
||||
ErrSSLCannotDelete: '{{ .name }} 証明書は Web サイトで使用されているため、削除できません'
|
||||
|
|
|
@ -125,6 +125,7 @@ ErrProxyIsUsed: "로드 밸런싱이 역방향 프록시에 의해 사용되었
|
|||
ErrSSLValid: '인증서 파일에 문제가 있습니다. 인증서 상태를 확인하세요!'
|
||||
ErrWebsiteDir: "웹사이트 디렉토리 내의 디렉토리를 선택하세요."
|
||||
ErrComposerFileNotFound: "composer.json 파일이 존재하지 않습니다"
|
||||
ErrRuntimeNoPort: "런타임 환경에 포트가 설정되지 않았습니다. 먼저 런타임 환경을 편집하세요."
|
||||
|
||||
#SSL인증
|
||||
ErrSSLCannotDelete: '{{ .name }} 인증서는 웹사이트에서 사용 중이므로 삭제할 수 없습니다.'
|
||||
|
|
|
@ -124,6 +124,7 @@ ErrProxyIsUsed: "Pengimbang beban telah digunakan oleh pengganti terbalik, tidak
|
|||
ErrSSLValid: 'Fail sijil bermasalah, sila periksa status sijil!'
|
||||
ErrWebsiteDir: "Sila pilih direktori dalam direktori laman web."
|
||||
ErrComposerFileNotFound: "Fail composer.json tidak wujud"
|
||||
ErrRuntimeNoPort: "Persekitaran runtime tidak diset dengan port, sila edit persekitaran runtime terlebih dahulu."
|
||||
|
||||
#ssl
|
||||
ErrSSLCannotDelete: 'Sijil {{ .name }} sedang digunakan oleh tapak web dan tidak boleh dipadamkan'
|
||||
|
|
|
@ -125,6 +125,7 @@ ErrProxyIsUsed: "Balanceamento de carga foi usado por proxy reverso, não pode s
|
|||
ErrSSLValid: 'O arquivo do certificado está anormal, verifique o status do certificado!'
|
||||
ErrWebsiteDir: "Por favor, selecione um diretório dentro do diretório do site."
|
||||
ErrComposerFileNotFound: "O arquivo composer.json não existe"
|
||||
ErrRuntimeNoPort: "O ambiente de tempo de execução não está configurado com uma porta, edite o ambiente de tempo de execução primeiro."
|
||||
|
||||
#ssl
|
||||
ErrSSLCannotDelete: 'O certificado {{ .name }} está sendo usado por um site e não pode ser excluído'
|
||||
|
|
|
@ -125,6 +125,7 @@ ErrProxyIsUsed: "Балансировка нагрузки использует
|
|||
ErrSSLValid: 'Файл сертификата аномален, проверьте статус сертификата!'
|
||||
ErrWebsiteDir: "Пожалуйста, выберите директорию внутри директории сайта."
|
||||
ErrComposerFileNotFound: "Файл composer.json не существует"
|
||||
ErrRuntimeNoPort: "Среда выполнения не настроена с портом, сначала отредактируйте среду выполнения."
|
||||
|
||||
#ssl
|
||||
ErrSSLCannotDelete: 'Сертификат {{ .name }} используется веб-сайтом и не может быть удален'
|
||||
|
|
|
@ -125,6 +125,7 @@ ErrProxyIsUsed: "Yük dengeleme ters proxy tarafından kullanıldı, silinemez"
|
|||
ErrSSLValid: 'Sertifika dosyası anormal, lütfen sertifika durumunu kontrol edin!'
|
||||
ErrWebsiteDir: "Lütfen web sitesi dizini içindeki bir dizin seçin."
|
||||
ErrComposerFileNotFound: "composer.json dosyası mevcut değil"
|
||||
ErrRuntimeNoPort: "Çalışma zamanı ortamı bir porta sahip değil, lütfen önce çalışma zamanı ortamını düzenleyin."
|
||||
|
||||
#ssl
|
||||
ErrSSLCannotDelete: '{{ .name }} sertifikası bir web sitesi tarafından kullanılıyor ve silinemez'
|
||||
|
|
|
@ -124,6 +124,7 @@ ErrProxyIsUsed: "負載均衡已被反向代理使用,無法刪除"
|
|||
ErrSSLValid: '證書文件異常,請檢查證書狀態!'
|
||||
ErrWebsiteDir: "請選擇網站目錄下的目錄"
|
||||
ErrComposerFileNotFound: "composer.json 文件不存在"
|
||||
ErrRuntimeNoPort: "運行環境未設置端口,請先編輯運行環境"
|
||||
|
||||
#ssl
|
||||
ErrSSLCannotDelete: '{{ .name }} 憑證正在被網站使用,無法刪除'
|
||||
|
|
|
@ -124,6 +124,7 @@ ErrProxyIsUsed: "负载均衡已被反向代理使用,无法删除"
|
|||
ErrSSLValid: '证书文件异常,请检查证书状态!'
|
||||
ErrWebsiteDir: '请选择网站目录下的目录'
|
||||
ErrComposerFileNotFound: 'composer.json 文件不存在'
|
||||
ErrRuntimeNoPort: '运行环境未设置端口,请先编辑运行环境'
|
||||
|
||||
#ssl
|
||||
ErrSSLCannotDelete: "{{ .name }} 证书正在被网站使用,无法删除"
|
||||
|
|
|
@ -17,36 +17,7 @@
|
|||
</span>
|
||||
</template>
|
||||
<div v-loading="loading" :class="{ mask: !versionExist }">
|
||||
<el-alert
|
||||
v-if="website.type == 'deployment'"
|
||||
:title="$t('website.websiteDeploymentHelper')"
|
||||
type="info"
|
||||
:closable="false"
|
||||
/>
|
||||
<el-alert
|
||||
v-if="website.type == 'static'"
|
||||
:title="$t('website.websiteStatictHelper')"
|
||||
type="info"
|
||||
:closable="false"
|
||||
/>
|
||||
<el-alert
|
||||
v-if="website.type == 'proxy'"
|
||||
:title="$t('website.websiteProxyHelper')"
|
||||
type="info"
|
||||
:closable="false"
|
||||
/>
|
||||
<el-alert
|
||||
v-if="website.type == 'runtime'"
|
||||
:title="$t('website.runtimeProxyHelper')"
|
||||
type="info"
|
||||
:closable="false"
|
||||
/>
|
||||
<el-alert
|
||||
v-if="website.type == 'subsite'"
|
||||
:title="$t('website.subsiteHelper')"
|
||||
type="info"
|
||||
:closable="false"
|
||||
/>
|
||||
<SSLAlert :websiteType="website.type" />
|
||||
<br />
|
||||
<el-form
|
||||
ref="websiteForm"
|
||||
|
@ -480,6 +451,7 @@ import DomainCreate from '@/views/website/website/domain-create/index.vue';
|
|||
import { getPathByType } from '@/api/modules/files';
|
||||
import { getWebsiteTypes } from '@/global/mimetype';
|
||||
import AppInstallForm from '@/views/app-store/detail/form/index.vue';
|
||||
import SSLAlert from '@/views/website/website/create/site-alert/index.vue';
|
||||
|
||||
const websiteForm = ref<FormInstance>();
|
||||
|
||||
|
@ -721,9 +693,11 @@ const getRuntimes = async () => {
|
|||
const first = runtimes.value[0];
|
||||
website.value.runtimeID = first.id;
|
||||
runtimeResource.value = first.resource;
|
||||
runtimePorts.value = first.port.split(',').map((port: string) => parseInt(port.trim(), 10));
|
||||
if (runtimePorts.value.length > 0) {
|
||||
website.value.port = runtimePorts.value[0];
|
||||
if (first.port != '') {
|
||||
runtimePorts.value = first.port.split(',').map((port: string) => parseInt(port.trim(), 10));
|
||||
if (runtimePorts.value.length > 0) {
|
||||
website.value.port = runtimePorts.value[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-alert
|
||||
v-if="websiteType == 'deployment'"
|
||||
:title="$t('website.websiteDeploymentHelper')"
|
||||
type="info"
|
||||
:closable="false"
|
||||
/>
|
||||
<el-alert
|
||||
v-if="websiteType == 'static'"
|
||||
:title="$t('website.websiteStatictHelper')"
|
||||
type="info"
|
||||
:closable="false"
|
||||
/>
|
||||
<el-alert
|
||||
v-if="websiteType == 'proxy'"
|
||||
:title="$t('website.websiteProxyHelper')"
|
||||
type="info"
|
||||
:closable="false"
|
||||
/>
|
||||
<el-alert
|
||||
v-if="websiteType == 'runtime'"
|
||||
:title="$t('website.runtimeProxyHelper')"
|
||||
type="info"
|
||||
:closable="false"
|
||||
/>
|
||||
<el-alert v-if="websiteType == 'subsite'" :title="$t('website.subsiteHelper')" type="info" :closable="false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
defineProps({
|
||||
websiteType: {
|
||||
type: String,
|
||||
default: 'deployment',
|
||||
},
|
||||
});
|
||||
</script>
|
Loading…
Add table
Reference in a new issue