Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
J0ris-K committed Feb 26, 2025
1 parent 2377405 commit 4813fa9
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 16 deletions.
8 changes: 4 additions & 4 deletions @xen-orchestra/lite/src/libs/xen-api/xen-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ export default class XenApi {
vmRefs: VmRef,
device: string,
networkRef: NetworkRef,
mac: string,
mtu: string,
MAC: string,
MTU: string,
other_config = {},
qos_algorithm_params = {},
qos_algorithm_type: string
Expand All @@ -475,8 +475,8 @@ export default class XenApi {
vmRef,
networkRef,
device,
mac,
mtu,
MAC,
MTU,
other_config,
qos_algorithm_params,
qos_algorithm_type,
Expand Down
27 changes: 15 additions & 12 deletions @xen-orchestra/lite/src/views/new-vm/NewVmView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,9 @@ const createVM = async () => {
const vifsToDestroy = [] as XenApiVif[]
const vmVifByDevice = keyBy(vifs, 'device')
vifs.forEach(vif => {
vifs.forEach(vif2 => {
const vif = getOpaqueRefVif(vif2)
if (vif.device === undefined) {
vif.device = devices.shift()
vifsToCreate.push(vif)
Expand All @@ -737,16 +739,16 @@ const createVM = async () => {
await Promise.all(vifsToDestroy.map(vif => xapi.vif.delete(vif.$ref)))
await Promise.all(
vifsToCreate.map(vif =>
xapi.vif.create({
ipv4_allowed: vif.ipv4_allowed,
ipv6_allowed: vif.ipv6_allowed,
device: vif.device,
locking_mode: isEmpty(vif.ipv4_allowed) && isEmpty(vif.ipv6_allowed) ? 'network_default' : 'locked',
MTU: vif.mtu,
network: vif.network,
VM: vmRef,
MAC: vif.mac,
})
xapi.vif.create(
vmRef,
vif.network,
vif.device,
vif.MAC,
vif.MTU,
vif.ipv4_allowed,
vif.ipv6_allowed
// !vif.ipv4_allowed && !vif.ipv6_allowed ? 'network_default' : 'locked'
)
)
)
}
Expand All @@ -769,7 +771,8 @@ const createVM = async () => {
}
watchEffect(() => {
console.log('selected network', vmState)
console.log('vmState', vmState)
console.log('vmState.new_vm_template?.VIFs', vmState.new_vm_template?.VIFs)
console.log('templates', templates)
})
</script>
Expand Down
39 changes: 39 additions & 0 deletions @xen-orchestra/web-core/lib/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,45 @@
"networks": "Networks",
"new": "New",
"new-features-are-coming": "New features are coming soon!",
"new-vm": "New VM",
"new-vm.add": "Add",
"new-vm.template": "Template",
"new-vm.pick-template": "Pick template",
"new-vm.install-settings": "Install settings",
"new-vm.no-config": "No configuration",
"new-vm.ssh-key": "SSH key",
"new-vm.custom-config": "Custom config",
"new-vm.user-config": "User config",
"new-vm.network-config": "Network config",
"new-vm.iso-dvd": "ISO/DVD",
"new-vm.pxe": "PXE",
"new-vm.system": "System",
"new-vm.multi-creation": "Multi creation",
"new-vm.vm-name": "VM name",
"new-vm.tags": "Tags",
"new-vm.boot-firmware": "Boot firmware",
"new-vm.copy-host": "Copy host",
"new-vm.vm-description": "VM description",
"new-vm.affinity-host": "Affinity host",
"new-vm.memory": "Memory",
"new-vm.vcpu": "VCPU",
"new-vm.ram": "RAM",
"new-vm.topology": "Topology",
"new-vm.network": "Network",
"new-vm.interfaces": "Interfaces",
"new-vm.mac-addresses": "Mac addresses",
"new-vm.new": "New",
"new-vm.storage": "Storage",
"new-vm.storage-repositories": "Storage repositories",
"new-vm.disk-name": "Disk name",
"new-vm.size": "Size",
"new-vm.description": "Description",
"new-vm.settings": "Settings",
"new-vm.boot-vm": "Boot VM",
"new-vm.auto-power": "Auto power",
"new-vm.fast-clone": "Fast clone",
"new-vm.summary": "Summary",
"new-vm.create": "Create",
"news": "News",
"news-name": "{name} news",
"no-alarm-triggered": "No alarm triggered",
Expand Down
39 changes: 39 additions & 0 deletions @xen-orchestra/web-core/lib/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,45 @@
"networks": "Réseaux",
"new": "Nouveau",
"new-features-are-coming": "De nouvelles fonctionnalités arrivent bientôt !",
"new-vm": "Nouvelle VM",
"new-vm.add": "Ajouter",
"new-vm.template": "Modèle",
"new-vm.pick-template": "Choisir un modèle",
"new-vm.install-settings": "Paramètres d'installation",
"new-vm.no-config": "Aucune configuration",
"new-vm.ssh-key": "Clé SSH",
"new-vm.custom-config": "Configuration personnalisée",
"new-vm.user-config": "Configuration utilisateur",
"new-vm.network-config": "Configuration réseau",
"new-vm.iso-dvd": "ISO/DVD",
"new-vm.pxe": "PXE",
"new-vm.system": "Système",
"new-vm.multi-creation": "Création multiple",
"new-vm.vm-name": "Nom de la VM",
"new-vm.tags": "Tags",
"new-vm.boot-firmware": "Firmware de démarrage",
"new-vm.copy-host": "Copier l'hôte",
"new-vm.vm-description": "Description de la VM",
"new-vm.affinity-host": "Affinity host",
"new-vm.memory": "Mémoire",
"new-vm.vcpu": "VCPU",
"new-vm.ram": "RAM",
"new-vm.topology": "Topologie",
"new-vm.network": "Réseau",
"new-vm.interfaces": "Interfaces",
"new-vm.mac-addresses": "Adresses MAC",
"new-vm.new": "Nouveau",
"new-vm.storage": "Stockage",
"new-vm.storage-repositories": "Dépôts de stockage",
"new-vm.disk-name": "Nom du disque",
"new-vm.size": "Taille",
"new-vm.description": "Description",
"new-vm.settings": "Paramètres",
"new-vm.boot-vm": "Démarrer la VM",
"new-vm.auto-power": "Alimentation automatique",
"new-vm.fast-clone": "Clonage rapide",
"new-vm.summary": "Résumé",
"new-vm.create": "Créer",
"news": "Actualités",
"news-name": "Actualités {name}",
"no-alarm-triggered": "Aucune alarme déclenchée",
Expand Down

0 comments on commit 4813fa9

Please sign in to comment.