Revision 213a8396 snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_networks_view.js
b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_networks_view.js | ||
---|---|---|
455 | 455 |
} |
456 | 456 |
if (this.model.id == "snf-combined-public-network" && !_.contains( |
457 | 457 |
["CONNECTING", "DISCONNECTING"], status)) { |
458 |
return "Internet"
|
|
458 |
return "Public connectivity"
|
|
459 | 459 |
} |
460 | 460 |
|
461 | 461 |
return this.status_map[status]; |
... | ... | |
574 | 574 |
get_vm_icon: function() { |
575 | 575 |
return $(snf.ui.helpers.vm_icon_tag(this.model, "small")).attr("src") |
576 | 576 |
}, |
577 |
|
|
578 | 577 |
status_cls: function() { |
579 | 578 |
return (views.IconView.STATE_CLASSES[this.model.get("state")] || []).join(" ") + " status clearfix" |
580 | 579 |
}, |
... | ... | |
753 | 752 |
classes: 'public-network', |
754 | 753 |
post_init_element: function() { |
755 | 754 |
views.NetworkSelectPublicNetwork.__super__.post_init_element.apply(this); |
756 |
//$(this.el).attr('title', 'Public network tooltip'); |
|
757 |
//$(this.el).tooltip({ |
|
758 |
//'tipClass': 'tooltip', |
|
759 |
//'position': 'top center', |
|
760 |
//'offset': [-5, 0] |
|
761 |
//}); |
|
762 |
|
|
763 | 755 |
} |
764 | 756 |
}); |
765 | 757 |
|
... | ... | |
836 | 828 |
e.preventDefault(); |
837 | 829 |
self.create_ip(); |
838 | 830 |
}); |
839 |
this.update_available();
|
|
831 |
this.reset_creating();
|
|
840 | 832 |
}, |
841 | 833 |
|
842 | 834 |
hide_parent: function() { |
... | ... | |
877 | 869 |
no_available_el.show(); |
878 | 870 |
} else { |
879 | 871 |
// available floating ip |
880 |
var available_text = "{0} IP's available.".format(
|
|
872 |
var available_text = "".format( |
|
881 | 873 |
this.collection.length + this.quota.get_available()); |
882 | 874 |
available_el.removeClass("hidden").text(available_text).show(); |
883 | 875 |
available_el.show(); |
... | ... | |
893 | 885 |
} else { |
894 | 886 |
// no available quota |
895 | 887 |
create.addClass("no-available"); |
896 |
create.show();
|
|
888 |
create.hide();
|
|
897 | 889 |
create_link.hide(); |
898 |
create_no_available.show(); |
|
890 |
//create_no_available.show();
|
|
899 | 891 |
} |
900 |
// |
|
901 | 892 |
this.update_selected(); |
902 | 893 |
}, |
903 | 894 |
|
904 | 895 |
update_selected: function() { |
896 |
_.each(this.selected_ips.length, function(ip) { |
|
897 |
if (!this.collection.get(ip.id)) { |
|
898 |
this.selected_ips = _.without(this.selected_ips, ip); |
|
899 |
} |
|
900 |
}, this); |
|
901 |
|
|
905 | 902 |
if (this.selected_ips.length) { |
906 | 903 |
this.parent_view.input.attr("checked", true); |
907 | 904 |
this.parent_view.item.addClass("selected"); |
... | ... | |
919 | 916 |
}, |
920 | 917 |
|
921 | 918 |
handle_create_error: function() {}, |
919 |
|
|
920 |
set_creating: function() { |
|
921 |
var create_link = this.$(".create a"); |
|
922 |
var create_no_available = this.$(".create .no-available"); |
|
923 |
var loading = this.$(".create .loading"); |
|
924 |
create_link.hide(); |
|
925 |
loading.show(); |
|
926 |
}, |
|
927 |
|
|
928 |
reset_creating: function() { |
|
929 |
var loading = this.$(".create .loading"); |
|
930 |
loading.hide(); |
|
931 |
this.update_available(); |
|
932 |
}, |
|
922 | 933 |
|
923 | 934 |
create_ip: function() { |
924 | 935 |
if (!this.quota.get_available()) { return } |
936 |
var self = this; |
|
937 |
this.set_creating(); |
|
925 | 938 |
synnefo.storage.floating_ips.create({floatingip:{}}, { |
926 | 939 |
error: _.bind(this.handle_create_error, this), |
940 |
complete: function() { |
|
941 |
synnefo.storage.quotas.fetch(); |
|
942 |
self.reset_creating(); |
|
943 |
}, |
|
927 | 944 |
skip_api_error: true |
928 | 945 |
}); |
929 | 946 |
}, |
... | ... | |
975 | 992 |
select_public: true, |
976 | 993 |
|
977 | 994 |
forced_values_title_map: { |
978 |
"SNF:ANY_PUBLIC_IPV6": "Public IPv6 Network",
|
|
979 |
"SNF:ANY_PUBLIC_IPV4": "Public IPv4 Network"
|
|
995 |
"SNF:ANY_PUBLIC_IPV6": "Internet (public IPv6)",
|
|
996 |
"SNF:ANY_PUBLIC_IPV4": "Internet (public IPv4)"
|
|
980 | 997 |
}, |
981 | 998 |
|
982 | 999 |
initialize: function(options) { |
... | ... | |
1019 | 1036 |
|
1020 | 1037 |
// combined public |
1021 | 1038 |
this.combined_public = new models.networks.CombinedPublicNetwork(); |
1022 |
this.combined_public.set({noselect: true, name: 'Internet', forced: false}); |
|
1039 |
this.combined_public.set({noselect: true, |
|
1040 |
name: 'Internet (public IPv4)', |
|
1041 |
forced: false}); |
|
1023 | 1042 |
this.public_networks.add(this.combined_public); |
1024 | 1043 |
|
1025 | 1044 |
model_attrs = { |
Also available in: Unified diff