compass-web/public/ods/ui/host_config/host_config_test.html
jiahuay 4bb020fe4e Add management IP/tenant IP/hostname customization
Change-Id: Ifc7486f8eec840239d0988b564470e45ae870a7e
2014-02-14 18:14:39 -08:00

119 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>host_config Widget Unit Test</title>
<link rel="stylesheet" type="text/css" href="../../../css/base.css" />
<link rel="stylesheet" type="text/css" href="../../../css/style.css" />
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div id="host_config-test"> </div>
</div>
</div>
<script type='text/javascript' src='../../../steal/steal.js'></script>
<script type='text/javascript'>
steal('jquery/dom/route', 'ods/fixtures','ods/ui/host_config').then(function($) {
var config = [];
var server1 = {
clusterhost_id: 100,
hostname: "",
id: 10,
mac: "28:6e:31:47:c8:6c",
port: "1",
management_ip: "",
tenant_ip: "",
switch_ip: "172.29.8.40",
vlan: "1",
roles: []
};
var server2 = {
clusterhost_id: 100,
hostname: "",
id: 10,
mac: "28:6e:31:34:fd:28",
port: "2",
management_ip: "",
tenant_ip: "",
switch_ip: "172.29.8.40",
vlan: "2",
roles: []
};
if (config["172.29.8.40"] == undefined) {
config["172.29.8.40"] = [server1];
config["172.29.8.40"].push(server2);
} else {
config["172.29.8.40"].push(server1);
config["172.29.8.40"].push(server2);
}
var odsState = {
networking: null,
servers: [],
servers_config: null,
cluster_id: null,
security: null,
partition: null,
feature: null,
machines: [],
switches: [],
snmp: 1,
adapter_id: 1
};
var state = new $.Observe(odsState);
state.servers_config = config;
state.cluster_id = 1;
state.networking = {
"interfaces": {
"management": {
"ip_start": "255.255.250.1",
"ip_end": "10.10.10.255",
"netmask": "255.255.255.0",
"gateway": "10.10.10.1",
"nic": "eth0",
"promisc": 0
},
"tenant": {
"ip_start": "192.168.100.100",
"ip_end": "192.168.100.200",
"netmask": "255.255.255.0",
"gateway": "192.168.100.1",
"nic": "eth0",
"promisc": 0
},
"public": {
"ip_start": "172.29.3.100",
"ip_end": "172.29.3.200",
"netmask": "255.255.255.0",
"gateway": "172.29.3.1",
"nic": "eth1",
"promisc": 1
},
"storage": {
"ip_start": "172.16.128.10",
"ip_end": "172.16.128.200",
"netmask": "255.255.255.0",
"gateway": "172.16.128.1",
"nic": "eth0",
"promisc": 0
}
}
};
$('#host_config-test').ods_ui_host_config({ "odsState" : state });
});
</script>
</body>
</html>