foreman_ipam 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f31c5336e7af5c2bbd55e985c0ed650882bebbe7fde5a3f8db6b8a3a09bc0e8
|
4
|
+
data.tar.gz: 113734549fb60d8757154856f0ba060ea5444de7548efc0613764f62ad75e443
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9116369232448ab4a74bfebff5b84024bf738953a18a9673c463abee542bbef33623cb8586575b0ec2eb0e4db553b58ee2e64a32cf6e54e0e7109bef510a953
|
7
|
+
data.tar.gz: 034a3883b57626c0925878e874e07605a83b7dc2220ad3fc577e81f1eda910c4a530174ca24773f20365c2f0b248c2e8d4300637c39901ce41cb1762381901bc
|
@@ -2,11 +2,19 @@
|
|
2
2
|
module ForemanIpam
|
3
3
|
class DashboardController < ::DashboardController
|
4
4
|
def ipam
|
5
|
-
|
5
|
+
begin
|
6
|
+
@response = Phpipam.proxy.get_sections
|
7
|
+
rescue
|
8
|
+
@response = nil
|
9
|
+
end
|
6
10
|
end
|
7
11
|
|
8
12
|
def subnets
|
9
|
-
|
13
|
+
begin
|
14
|
+
@subnets = Phpipam.proxy.get_subnets_by_section(params[:section_name])
|
15
|
+
rescue
|
16
|
+
@subnets = nil
|
17
|
+
end
|
10
18
|
render :json => @subnets.to_json, :status => :ok
|
11
19
|
end
|
12
20
|
end
|
@@ -1,6 +1,11 @@
|
|
1
1
|
<h1>IPAM Integration Dashboard</h1>
|
2
2
|
|
3
|
-
<% if @response
|
3
|
+
<% if @response.nil? %>
|
4
|
+
<div class="alert alert-warning ">
|
5
|
+
<span class="pficon pficon-warning-triangle-o "></span>
|
6
|
+
<span class="text"><%= _("Cannot connect to External IPAM.") %></span>
|
7
|
+
</div>
|
8
|
+
<% elsif @response['data'] && @response['data'].length > 0 %>
|
4
9
|
<h2>phpIPAM</h2>
|
5
10
|
<h3>Sections:</h3>
|
6
11
|
<table class="<%= table_css_classes 'table-fixed' %>">
|
@@ -41,20 +46,31 @@
|
|
41
46
|
type: "GET", url: "/ipam/phpipam/subnets",
|
42
47
|
data: {"section_name": encodeURI(section_name)},
|
43
48
|
success: function(data) {
|
44
|
-
if (data
|
45
|
-
subnet_container.innerHTML +=
|
46
|
-
|
47
|
-
|
49
|
+
if (!data) {
|
50
|
+
subnet_container.innerHTML += 'Cannot connect to External IPAM';
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
if (data.message === 'No subnets found')
|
54
|
+
subnet_container.innerHTML += data.message;
|
55
|
+
else
|
56
|
+
displaySubnets(data);
|
57
|
+
}
|
48
58
|
}
|
49
59
|
});
|
50
60
|
}
|
51
61
|
|
52
62
|
function displaySubnets(data) {
|
53
63
|
var subnets = data;
|
54
|
-
|
55
|
-
|
56
|
-
<div class='col-md-
|
57
|
-
|
64
|
+
|
65
|
+
if (subnets['data'].length == 0) {
|
66
|
+
subnet_container.innerHTML += "<div class='col-md-2'><strong>No Subnets</strong></div>"
|
67
|
+
}
|
68
|
+
else {
|
69
|
+
subnet_container.innerHTML += `
|
70
|
+
<div class='col-md-2'><strong>Subnet</strong></div>
|
71
|
+
<div class='col-md-6'><strong>Description</strong></strong></div><br />
|
72
|
+
`;
|
73
|
+
}
|
58
74
|
|
59
75
|
subnets['data'].forEach(function(item) {
|
60
76
|
subnet_container.innerHTML += `
|
data/lib/foreman_ipam/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_ipam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Plugin for IPAM integration with various IPAM providers
|
14
14
|
email:
|