init commit

This commit is contained in:
2025-11-07 09:40:06 -08:00
commit c0ad223ac5
10 changed files with 521 additions and 0 deletions
+71
View File
@@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>GPO Query</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h2>Query GPOs by Group</h2>
<?php if (isset($_GET['group'])) : ?>
<form action="index.php" method="GET">
<label for="group">Group Name:</label>
<input type="text" id="group" name="group" value="<?php echo htmlspecialchars($_GET['group']); ?>" required>
<button type="submit">Query</button>
</form>
<?php else : ?>
<form action="index.php" method="GET">
<label for="group">Group Name:</label>
<input type="text" id="group" name="group" required>
<button type="submit">Query</button>
</form>
<?php endif; ?>
<?php
if (isset($_GET['group'])) {
$group = urlencode($_GET['group']); // Encode the group name for URL
$url = "http://10.34.115.140:5000/gpo?group=$group"; // API endpoint
// Initialize cURL session
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
// Execute the request and fetch the response
$response = curl_exec($ch);
// Check for errors
if ($e = curl_error($ch)) {
die("Curl error: $e");
} else {
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode != 200) {
die("Error: Received HTTP code $httpCode");
}
}
// Decode the JSON response
$data = json_decode($response, true);
// Display the data in a table
if (isset($data['error'])) {
echo "<p>Error: {$data['error']}</p>";
} else {
echo "<table><tr><th>AD Group</th><th>GPO</th><th>Local Group</th></tr>";
foreach ($data as $item) {
echo "<tr><td>{$item['ad_group']}</td><td>{$item['gpo']}</td><td>{$item['local_group']}</td></tr>";
}
echo "</table>";
}
// Close cURL session
curl_close($ch);
} else {
echo "<p>No group specified.</p>";
}
?>
</body>
</html>
+92
View File
@@ -0,0 +1,92 @@
/* styles.css */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #2c3e50; /* Dark background color */
color: #bdc3c7; /* Dimmer text color */
}
.hidden-info {
display: none;
}
.title-button {
background-color: #34495e;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.container {
max-width: 950px;
margin: 0 auto;
padding: 20px;
background-color: #34495e; /* Darker background for container */
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* Slightly darker shadow */
margin-top: 20px;
}
h1, h2, h3, h4 {
color: #bdc3c7; /* Dimmer text color */
}
ul {
list-style-type: none;
padding: 0;
}
li {
margin-bottom: 10px;
color: #bdc3c7; /* Dimmer text color */
}
.group-columns {
display: flex;
}
.group-rows {
display: flex;
flex-wrap: wrap;
justify-content: flex-start; /* Left justification */
margin-top: 10px;
}
.group-column {
flex: 0 0 calc(33% - 10px); /* Adjust width of each column */
}
.column {
flex: 1;
padding: 0 10px; /* Adjust spacing between columns */
}
.subcolumn {
margin-left: 10px;
}
.grid {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 5px;
}
.meter {
width: calc(90% - 5px);
max-width: calc(45% - 5px);
margin-bottom: 5px;
border: 1px solid #7f8c8d; /* Light border color */
border-radius: 5px;
padding: 5px;
text-align: center;
background-color: #2c3e50; /* Dark background for meter */
}