2025-01-06 20:23:39 +01:00
|
|
|
|
<script setup>
|
|
|
|
|
|
|
2025-07-10 11:55:11 +02:00
|
|
|
|
import { FormGroup, Checkbox, NumberInput } from '@cloudron/pankow';
|
2025-01-06 20:23:39 +01:00
|
|
|
|
|
2025-04-24 20:17:37 +02:00
|
|
|
|
defineProps([ 'error', 'domainProvider' ]);
|
2025-01-06 20:23:39 +01:00
|
|
|
|
|
2025-03-03 21:24:27 +01:00
|
|
|
|
// all ports require a property called 'value' for the model to work
|
|
|
|
|
|
const tcpPorts = defineModel('tcp');
|
|
|
|
|
|
const udpPorts = defineModel('udp');
|
2025-01-06 20:23:39 +01:00
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
2025-01-19 12:00:22 +01:00
|
|
|
|
<template>
|
|
|
|
|
|
<div v-for="ports in [ tcpPorts, udpPorts ]" :key="ports">
|
2025-03-02 17:22:46 +01:00
|
|
|
|
<FormGroup v-for="(port, key) in ports" :key="key" style="margin-top: 10px;">
|
2025-01-19 12:00:22 +01:00
|
|
|
|
<Checkbox :label="port.title" v-model="port.enabled" />
|
2025-11-06 11:36:58 +01:00
|
|
|
|
<small>{{ port.description + (port.portCount > 1 ? ('. ' + port.portCount + ' ports. ') : '') }}</small>
|
2025-01-19 12:00:22 +01:00
|
|
|
|
<small v-show="port.readOnly">{{ $t('appstore.installDialog.portReadOnly') }}</small>
|
2025-03-03 21:24:27 +01:00
|
|
|
|
<small class="has-error" v-if="error.port === port.value">Port already taken {{ port }}</small>
|
2025-01-19 12:00:22 +01:00
|
|
|
|
<NumberInput v-model="port.value" :disabled="!port.enabled" :min="1"/>
|
2025-10-09 09:31:35 +02:00
|
|
|
|
<!-- 32768–60999 (inclusive) is the usual ephemeral port range -->
|
2025-10-14 10:23:34 +02:00
|
|
|
|
<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>
|
2025-10-09 09:31:35 +02:00
|
|
|
|
<div class="warning-label" v-if="domainProvider === 'cloudflare'">{{ $t('appstore.installDialog.cloudflarePortWarning') }}</div>
|
2025-01-19 12:00:22 +01:00
|
|
|
|
</FormGroup>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2025-11-06 11:36:58 +01:00
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.pankow-form-group small {
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
margin-bottom: 0.5rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|