Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,19 @@ INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (17, 6246);
INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (18, 6247);
INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (19, 6248);
INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (20, 6249);
INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (21, 6250);
INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (21, 6250);


-- BEGIN TABLE rackml_config
CREATE TABLE IF NOT EXISTS `rackml_config` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'primary key',
`zone_id` bigint unsigned NOT NULL COMMENT 'foreign key to data_center.id',
`name` varchar(100) NOT NULL COMMENT 'config name (e.g. default)',
`content` text NOT NULL COMMENT 'RackML content',
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'last update time',
PRIMARY KEY (`id`),
UNIQUE KEY `uc_rackml_zone_name` (`zone_id`, `name`),
CONSTRAINT `fk_rackml__zone` FOREIGN KEY (`zone_id`) REFERENCES `data_center` (`id`)
ON DELETE RESTRICT
ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3;
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public Answer execute(RestoreBackupCommand command, LibvirtComputingResource ser
}

private void restoreVolumesOfExistingVM(List<String> volumePaths, String backupPath,
String backupRepoType, String backupRepoAddress, String mountOptions) {
String backupRepoType, String backupRepoAddress, String mountOptions) {
String diskType = "root";
String mountDirectory = mountBackupDirectory(backupRepoAddress, backupRepoType, mountOptions);
try {
Expand Down Expand Up @@ -151,16 +151,6 @@ private String mountBackupDirectory(String backupRepoAddress, String backupRepoT
try {
mountDirectory = Files.createTempDirectory(mountDirectory).toString();
String mount = String.format(MOUNT_COMMAND, backupRepoType, backupRepoAddress, mountDirectory);
if ("cifs".equals(backupRepoType)) {
if (Objects.isNull(mountOptions) || mountOptions.trim().isEmpty()) {
mountOptions = "nobrl";
} else {
mountOptions += ",nobrl";
}
}
if (Objects.nonNull(mountOptions) && !mountOptions.trim().isEmpty()) {
mount += " -o " + mountOptions;
}
Script.runSimpleBashScript(mount);
} catch (Exception e) {
throw new CloudRuntimeException(String.format("Failed to mount %s to %s", backupRepoType, backupRepoAddress), e);
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4771,6 +4771,7 @@
"label.theme.polar.green": "Polar Green",
"label.theme.geek.blue": "Geek Blue",
"label.theme.golden.purple": "Golden Purple",
"label.zone.rack": "Rack"
"label.usb.devices": "USB Devices",
"label.lun.devices": "LUN Devices",
"label.other.devices": "Other Devices",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/ko_KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -4771,6 +4771,7 @@
"label.theme.polar.green": "\ud3f4\ub77c \uadf8\ub9b0",
"label.theme.geek.blue": "\uae31 \ube14\ub8e8",
"label.theme.golden.purple": "\uace8\ub4e0 \ud37c\ud50c",
"label.zone.rack": "\uB799\u0020\uC2DC\uAC01\uD654"
"label.usb.devices": "USB \ub514\ubc14\uc774\uc2a4",
"label.lun.devices": "LUN \ub514\ubc14\uc774\uc2a4",
"label.other.devices": "\uae30\ud0c0 \ub514\ubc14\uc774\uc2a4",
Expand Down
3 changes: 3 additions & 0 deletions ui/src/config/section/infra/zones.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export default {
}, {
name: 'physical.network',
component: shallowRef(defineAsyncComponent(() => import('@/views/infra/zone/PhysicalNetworksTab.vue')))
}, {
name: 'zone.rack',
component: shallowRef(defineAsyncComponent(() => import('@/views/plugins/IFrameRack.vue')))
}, {
name: 'ipv4.subnets',
component: shallowRef(defineAsyncComponent(() => import('@/views/infra/zone/Ipv4GuestSubnetsTab.vue'))),
Expand Down
59 changes: 59 additions & 0 deletions ui/src/views/plugins/IFrameRack.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

<template>
<div>
<iframe :src="uriInfo" width="100%" frameBorder="0" style="height: 90vh">
</iframe>
</div>
</template>

<script>
import { api } from '@/api'
export default {
name: 'IFrameWall',
props: {
resource: {
type: Object,
required: true
}
},
data () {
return {
uriInfo: ''
}
},
created () {
this.urlAction()
},
methods: {
urlAction () {
const port = 7077
const zoneId = this.resource.id

api('listCapabilities').then(json => {
const host = json.listcapabilitiesresponse.capability.host || []
this.uriInfo = `http://${host}:${port}/index.html?zone_id=${zoneId}`
this.uriCreateOk = true
}).catch(err => {
console.error('capabilities API 실패:', err)
this.uriInfo = ''
})
}
}
}
</script>
2 changes: 1 addition & 1 deletion ui/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const vueConfig = {
port: 5050,
proxy: {
'/client': {
target: process.env.CS_URL || 'http://localhost:8080',
target: process.env.CS_URL || 'http://10.10.253.29:8080',
secure: false,
ws: false,
changeOrigin: true,
Expand Down
Loading