Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ const message = {
driver: 'Driver',
option: 'Option',
attachable: 'Attachable',
parentNetworkCard: 'Parent Network Card',
subnet: 'Subnet',
scope: 'IP scope',
gateway: 'Gateway',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/es-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ const message = {
driver: 'Driver',
option: 'Opción',
attachable: 'Adjuntable',
parentNetworkCard: 'Tarjeta de Red Principal',
subnet: 'Subred',
scope: 'Rango de IP',
gateway: 'Puerta de enlace',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ const message = {
driver: 'ドライバ',
option: 'オプション',
attachable: '取り付け可能',
parentNetworkCard: '親ネットワークカード',
subnet: 'サブネット',
scope: 'IPスコープ',
gateway: 'ゲートウェイ',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ const message = {
driver: '드라이버',
option: '옵션',
attachable: '연결 가능',
parentNetworkCard: '부모 네트워크 카드',
subnet: '서브넷',
scope: 'IP 범위',
gateway: '게이트웨이',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ const message = {
driver: 'Pemacu',
option: 'Pilihan',
attachable: 'Boleh dilampirkan',
parentNetworkCard: 'Kad Rangkaian Induk',
subnet: 'Subnet',
scope: 'Skop IP',
gateway: 'Gerbang',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ const message = {
driver: 'Driver',
option: 'Opção',
attachable: 'Anexável',
parentNetworkCard: 'Placa de Rede Principal',
subnet: 'Sub-rede',
scope: 'Escopo IP',
gateway: 'Gateway',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ const message = {
driver: 'Драйвер',
option: 'Опция',
attachable: 'Подключаемая',
parentNetworkCard: 'Родительская Сетевая Карта',
subnet: 'Подсеть',
scope: 'Диапазон IP',
gateway: 'Шлюз',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ const message = {
driver: 'Sürücü',
option: 'Seçenek',
attachable: 'Eklenebilir',
parentNetworkCard: 'Ana Ağ Kartı',
subnet: 'Alt ağ',
scope: 'IP kapsamı',
gateway: 'Ağ geçidi',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@ const message = {
driver: '模式',
option: '參數',
attachable: '可用',
parentNetworkCard: '父網卡',
subnet: '子網',
scope: 'IP 範圍',
gateway: '閘道器',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ const message = {
driver: '模式',
option: '参数',
attachable: '可用',
parentNetworkCard: '父网卡',
subnet: '子网',
scope: 'IP 范围',
gateway: '网关',
Expand Down
26 changes: 26 additions & 0 deletions frontend/src/views/container/network/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
<el-option label="overlay" value="overlay" />
</el-select>
</el-form-item>
<el-form-item
v-if="form.driver === 'macvlan'"
:label="$t('container.parentNetworkCard')"
prop="parentNetworkCard"
>
<el-select v-model="form.parentNetworkCard">
<span v-for="item in netOptions" :key="item">
<el-option v-if="item !== 'all'" :label="item" :value="item" />
</span>
</el-select>
</el-form-item>

<el-checkbox v-model="form.ipv4">IPv4</el-checkbox>
<div v-if="form.ipv4">
Expand Down Expand Up @@ -133,12 +144,14 @@ import { ElForm } from 'element-plus';
import { createNetwork } from '@/api/modules/container';
import { MsgSuccess } from '@/utils/message';
import { checkIp, checkIpV6 } from '@/utils/util';
import { getNetworkOptions } from '@/api/modules/host';

const loading = ref(false);

const drawerVisible = ref(false);
const form = reactive({
name: '',
parentNetworkCard: '',
labelStr: '',
labels: [] as Array<string>,
optionStr: '',
Expand All @@ -163,6 +176,7 @@ const acceptParams = (): void => {
form.optionStr = '';
form.options = [];
form.driver = 'bridge';
form.parentNetworkCard = '';
form.ipv4 = true;
form.subnet = '';
form.gateway = '';
Expand All @@ -174,16 +188,20 @@ const acceptParams = (): void => {
form.ipRangeV6 = '';
form.auxAddressV6 = [];
drawerVisible.value = true;
loadNetworkOptions();
};
const emit = defineEmits<{ (e: 'search'): void }>();

const handleClose = () => {
drawerVisible.value = false;
};

const netOptions = ref();

const rules = reactive({
name: [Rules.requiredInput],
driver: [Rules.requiredSelect],
parentNetworkCard: [Rules.requiredSelect],
subnet: [{ validator: checkCidr, trigger: 'blur' }, Rules.requiredInput],
gateway: [{ validator: checkGateway, trigger: 'blur' }],
ipRange: [{ validator: checkCidr, trigger: 'blur' }],
Expand Down Expand Up @@ -263,6 +281,11 @@ const handleV6Delete = (index: number) => {
form.auxAddressV6.splice(index, 1);
};

const loadNetworkOptions = async () => {
const res = await getNetworkOptions();
netOptions.value = res.data;
};

type FormInstance = InstanceType<typeof ElForm>;
const formRef = ref<FormInstance>();
const onSubmit = async (formEl: FormInstance | undefined) => {
Expand All @@ -276,6 +299,9 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
form.options = form.optionStr.split('\n');
}
loading.value = true;
if (form.driver === 'macvlan') {
form.options.push('parent=' + form.parentNetworkCard);
}
await createNetwork(form)
.then(() => {
loading.value = false;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/cronjob/library/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ const onDelete = async (row: Cronjob.ScriptInfo | null) => {
};

const onSync = async () => {
ElMessageBox.confirm(i18n.global.t('cronjob.library.syncHelper'), i18n.global.t('commons.button.syncNow'), {
ElMessageBox.confirm(i18n.global.t('cronjob.library.syncHelper'), i18n.global.t('cronjob.library.syncNow'), {
confirmButtonText: i18n.global.t('commons.button.confirm'),
cancelButtonText: i18n.global.t('commons.button.cancel'),
type: 'info',
Expand Down
Loading