Merge "Make labels in Network Topology translatable"
This commit is contained in:
commit
e63d8a4506
@ -508,17 +508,17 @@ horizon.network_topology = {
|
||||
try {
|
||||
ip_address = port.fixed_ips[0].ip_address;
|
||||
}catch(e){
|
||||
ip_address = 'no info';
|
||||
ip_address = gettext('None');
|
||||
}
|
||||
var device_owner = '';
|
||||
try {
|
||||
device_owner = port.device_owner.replace('network:','');
|
||||
}catch(e){
|
||||
device_owner = 'no info';
|
||||
device_owner = gettext('None');
|
||||
}
|
||||
object.ip_address = ip_address;
|
||||
object.device_owner = device_owner;
|
||||
object.is_interface = (device_owner === 'router_interface') ? true : false;
|
||||
object.is_interface = (device_owner === 'router_interface');
|
||||
ports.push(object);
|
||||
});
|
||||
var html_data = {
|
||||
@ -527,19 +527,19 @@ horizon.network_topology = {
|
||||
url:d.url,
|
||||
name:d.name,
|
||||
type:d.type,
|
||||
type_capital:d.type.replace(/^\w/, function($0) {
|
||||
return $0.toUpperCase();
|
||||
}),
|
||||
delete_label: gettext("Delete"),
|
||||
status:d.status,
|
||||
status_class:(d.status === "ACTIVE")? 'active' : 'down',
|
||||
status_label: gettext("STATUS"),
|
||||
id_label: gettext("ID"),
|
||||
interfaces_label: gettext("Interfaces"),
|
||||
interface_label: gettext("Interface"),
|
||||
open_console_label: gettext("open console"),
|
||||
view_details_label: interpolate(gettext("view %s details"), [d.type])
|
||||
delete_interface_label: gettext("Delete Interface"),
|
||||
open_console_label: gettext("Open Console"),
|
||||
view_details_label: gettext("View Details")
|
||||
};
|
||||
if (d.type === 'router') {
|
||||
html_data.delete_label = gettext("Delete Router");
|
||||
html_data.view_details_label = gettext("View Router Details");
|
||||
html_data.port = ports;
|
||||
html_data.add_interface_url = d.url + 'addinterface';
|
||||
html_data.add_interface_label = gettext("Add Interface");
|
||||
@ -548,6 +548,8 @@ horizon.network_topology = {
|
||||
table2:(ports.length > 0) ? port_tmpl : null
|
||||
});
|
||||
} else if (d.type === 'instance') {
|
||||
html_data.delete_label = gettext("Terminate Instance");
|
||||
html_data.view_details_label = gettext("View Instance Details")
|
||||
html_data.console_id = d.id;
|
||||
html_data.console = d.console;
|
||||
html = balloon_tmpl.render(html_data,{
|
||||
@ -582,7 +584,7 @@ horizon.network_topology = {
|
||||
}
|
||||
$balloon.find('.delete-device').click(function(e){
|
||||
var $this = $(this);
|
||||
$this.addClass('deleting');
|
||||
$this.prop('disabled', true);
|
||||
d3.select('#id_' + $this.data('device-id')).classed('loading',true);
|
||||
self.delete_device($this.data('type'),$this.data('device-id'));
|
||||
});
|
||||
|
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<a class="add-interface btn btn-primary btn-xs ajax-modal [[type]]" href="[[add_interface_url]]">[[add_interface_label]]</a>
|
||||
<div class="cell delete">
|
||||
<button class="delete-device btn btn-danger btn-xs [[type]]" data-type="[[type]]" data-device-id="[[id]]">[[type_capital]]</button>
|
||||
<button class="delete-device btn btn-danger btn-xs [[type]]" data-type="[[type]]" data-device-id="[[id]]">[[delete_label]]</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -22,7 +22,7 @@
|
||||
</td>
|
||||
<td class="delete">
|
||||
[[#is_interface]]
|
||||
<button class="delete-port btn btn-danger btn-xs" data-router-id="[[router_id]]" data-port-id="[[id]]">[[interface_label]]</button>
|
||||
<button class="delete-port btn btn-danger btn-xs" data-router-id="[[router_id]]" data-port-id="[[id]]">[[delete_interface_label]]</button>
|
||||
[[/is_interface]]
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -2040,22 +2040,6 @@ label.log-length {
|
||||
.delete {
|
||||
padding-right: 0;
|
||||
text-align: right;
|
||||
.btn {
|
||||
&:before {
|
||||
content:"Delete ";
|
||||
}
|
||||
&.deleting:before {
|
||||
content:"Deleting ";
|
||||
}
|
||||
}
|
||||
.btn.instance {
|
||||
&:before {
|
||||
content:"Terminate ";
|
||||
}
|
||||
&.deleting:before {
|
||||
content:"Terminating ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
table.detailInfoTable {
|
||||
@ -2099,12 +2083,6 @@ label.log-length {
|
||||
.btn {
|
||||
line-height: 1.4;
|
||||
}
|
||||
.btn:before {
|
||||
content:"Delete ";
|
||||
}
|
||||
.btn.deleting:before {
|
||||
content:"Deleting ";
|
||||
}
|
||||
}
|
||||
font-size: 11px;
|
||||
@include box-shadow(0px 1px 6px #777);
|
||||
|
Loading…
Reference in New Issue
Block a user