Files
cloudron-box/dashboard/src/components/PortBindings.vue
T
2025-10-14 10:23:34 +02:00

27 lines
1.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup>
import { FormGroup, Checkbox, NumberInput } from '@cloudron/pankow';
defineProps([ 'error', 'domainProvider' ]);
// all ports require a property called 'value' for the model to work
const tcpPorts = defineModel('tcp');
const udpPorts = defineModel('udp');
</script>
<template>
<div v-for="ports in [ tcpPorts, udpPorts ]" :key="ports">
<FormGroup v-for="(port, key) in ports" :key="key" style="margin-top: 10px;">
<Checkbox :label="port.title" v-model="port.enabled" />
<small>{{ port.description + '. ' + (port.portCount >=1 ? (port.portCount + ' ports. ') : '') }}</small>
<small v-show="port.readOnly">{{ $t('appstore.installDialog.portReadOnly') }}</small>
<small class="has-error" v-if="error.port === port.value">Port already taken {{ port }}</small>
<NumberInput v-model="port.value" :disabled="!port.enabled" :min="1"/>
<!-- 3276860999 (inclusive) is the usual ephemeral port range -->
<div class="warning-label" v-if="[port.value, port.value + port.portCount].some(p => p >= 32768 && p <= 60999)">{{ $t('appstore.installDialog.ephemeralPortWarning') }} <sup><a href="https://docs.cloudron.io/apps/#port-bindings" class="help" target="_blank" tabindex="-1"><i class="fa fa-question-circle"></i></a></sup></div>
<div class="warning-label" v-if="domainProvider === 'cloudflare'">{{ $t('appstore.installDialog.cloudflarePortWarning') }}</div>
</FormGroup>
</div>
</template>