added bootstrap

This commit is contained in:
CHIEFSOFT\ameye
2025-09-22 15:33:20 -04:00
parent 6ced10281f
commit 979ea25b10
438 changed files with 85306 additions and 271 deletions
+73 -72
View File
@@ -6,84 +6,85 @@ class Home extends BaseController
{
public function index(): string
{
return view('welcome_message');
$data['label_env'] = $this->what_env();
return view('welcome_message',$data);
}
public function what_env(): string
{
$curr_env = env('CONFIG_NAME','undefined?');
echo env('CI_ENVIRONMENT');
// echo env('CI_ENVIRONMENT');
return $curr_env;
}
public function provision(): string
{
$public_path = FCPATH;
$ansible_folder = str_replace("public/", "ANSIBLE", $public_path);
$partMachineLocal = "/home/chiefsoft/MermsProvision/ANSIBLE/parts/";
if (!is_dir($ansible_folder."/parts") ){
mkdir($ansible_folder."/parts", 0700);
}
$mysql = "SELECT id, uid, internal_url,product_id,status,provision_port FROM members_products WHERE provision_port = 0 ";
$query = $this->db->query($mysql);
// $num = $query->num_rows();
$provision_list= $query->getResult();
//$provision_list =[];
foreach ($provision_list as $pr){
$provisionPort = $pr->provision_port;
$productId = $pr->product_id;
$provisionUID = $pr->uid;
$ContainerName= $productId.str_pad( $pr->id, 10, "0", STR_PAD_LEFT);
$partFolder = $ansible_folder."/parts/".$provisionUID;
$allocatedPort = 8011;
if (!is_dir($partFolder) ){
mkdir($partFolder, 0700);
}
// THIS PROVISONING COMPOSERS
$composer_template_path = $ansible_folder."/templates/composers/".$productId."/docker-compose.yml";
$composer_template_path_local = $partMachineLocal.$provisionUID;
$prov_name = str_replace(".", "_", $pr->internal_url).".yml";
$template_file = $ansible_folder ."/templates/".$pr->product_id.".yml";
//Get the domposer template file
$composer_template_contents = file_get_contents($composer_template_path);
// Do the processing
$composer_template_contents = str_replace("WHAT_CONTAINER_NAME", $ContainerName, $composer_template_contents);
$destinationHomeFolder = "/home/chiefsoft/SITES/".$ContainerName;
$composer_template_contents = str_replace("DESTINATION_FOLDER", $destinationHomeFolder, $composer_template_contents);
$composer_template_contents = str_replace("ALLOCATED_PORT", $allocatedPort, $composer_template_contents);
$composer_template_contents = str_replace("CNT_DB_NAME", $ContainerName, $composer_template_contents);
$composer_template_contents = str_replace("CNT_DB_PASS", $provisionUID, $composer_template_contents);
$composer_template_contents = str_replace("PROVISION_UID_REPLACE", $provisionUID, $composer_template_contents);
//Save to the specific path
$destination_composer_path = $ansible_folder."/parts/".$provisionUID."/docker-compose.yml";
$composerFile = fopen( $destination_composer_path, "w") or die("Unable to open file!");
fwrite($composerFile, $composer_template_contents);
fclose($composerFile);
// GET THE TEMPLATE FOR THIS PROVISIONING
$template_content = file_get_contents($template_file);
$template_content_processed = str_replace("WHAT_HOST_IN_USE", $productId."_SERVER", $template_content);
$template_content_processed = str_replace("WHAT_PART_FOLDER", $partFolder, $template_content_processed);
$template_content_processed = str_replace("DESTINATION_FOLDER", $destinationHomeFolder, $template_content_processed);
$template_content_processed = str_replace("WHAT_PART_LOCAL", $composer_template_path_local, $template_content_processed); // depends on the local machine
// CREATE PROVISOINING FILE
$myfile = fopen( $ansible_folder ."/".$prov_name, "w") or die("Unable to open file!");
fwrite($myfile, $template_content_processed);
fclose($myfile);
}
// echo (__dir__);
return view('welcome_message');
}
// public function provision(): string
// {
// $public_path = FCPATH;
// $ansible_folder = str_replace("public/", "ANSIBLE", $public_path);
// $partMachineLocal = "/home/chiefsoft/MermsProvision/ANSIBLE/parts/";
// if (!is_dir($ansible_folder."/parts") ){
// mkdir($ansible_folder."/parts", 0700);
// }
//
// $mysql = "SELECT id, uid, internal_url,product_id,status,provision_port FROM members_products WHERE provision_port = 0 ";
// $query = $this->db->query($mysql);
// // $num = $query->num_rows();
// $provision_list= $query->getResult();
// //$provision_list =[];
// foreach ($provision_list as $pr){
// $provisionPort = $pr->provision_port;
// $productId = $pr->product_id;
// $provisionUID = $pr->uid;
// $ContainerName= $productId.str_pad( $pr->id, 10, "0", STR_PAD_LEFT);
// $partFolder = $ansible_folder."/parts/".$provisionUID;
//
// $allocatedPort = 8011;
//
// if (!is_dir($partFolder) ){
// mkdir($partFolder, 0700);
// }
//
//
// // THIS PROVISONING COMPOSERS
// $composer_template_path = $ansible_folder."/templates/composers/".$productId."/docker-compose.yml";
// $composer_template_path_local = $partMachineLocal.$provisionUID;
//
// $prov_name = str_replace(".", "_", $pr->internal_url).".yml";
// $template_file = $ansible_folder ."/templates/".$pr->product_id.".yml";
// //Get the domposer template file
// $composer_template_contents = file_get_contents($composer_template_path);
// // Do the processing
// $composer_template_contents = str_replace("WHAT_CONTAINER_NAME", $ContainerName, $composer_template_contents);
// $destinationHomeFolder = "/home/chiefsoft/SITES/".$ContainerName;
// $composer_template_contents = str_replace("DESTINATION_FOLDER", $destinationHomeFolder, $composer_template_contents);
// $composer_template_contents = str_replace("ALLOCATED_PORT", $allocatedPort, $composer_template_contents);
// $composer_template_contents = str_replace("CNT_DB_NAME", $ContainerName, $composer_template_contents);
// $composer_template_contents = str_replace("CNT_DB_PASS", $provisionUID, $composer_template_contents);
// $composer_template_contents = str_replace("PROVISION_UID_REPLACE", $provisionUID, $composer_template_contents);
// //Save to the specific path
// $destination_composer_path = $ansible_folder."/parts/".$provisionUID."/docker-compose.yml";
// $composerFile = fopen( $destination_composer_path, "w") or die("Unable to open file!");
// fwrite($composerFile, $composer_template_contents);
// fclose($composerFile);
//
// // GET THE TEMPLATE FOR THIS PROVISIONING
// $template_content = file_get_contents($template_file);
// $template_content_processed = str_replace("WHAT_HOST_IN_USE", $productId."_SERVER", $template_content);
// $template_content_processed = str_replace("WHAT_PART_FOLDER", $partFolder, $template_content_processed);
// $template_content_processed = str_replace("DESTINATION_FOLDER", $destinationHomeFolder, $template_content_processed);
// $template_content_processed = str_replace("WHAT_PART_LOCAL", $composer_template_path_local, $template_content_processed); // depends on the local machine
// // CREATE PROVISOINING FILE
// $myfile = fopen( $ansible_folder ."/".$prov_name, "w") or die("Unable to open file!");
// fwrite($myfile, $template_content_processed);
// fclose($myfile);
// }
//
// // echo (__dir__);
//
//
//
// $data['label_env'] = "Olusesan";
//
// return view('welcome_message',$data);
// }
}
+44 -190
View File
@@ -8,199 +8,53 @@
<link rel="shortcut icon" type="image/png" href="/favicon.ico">
<!-- STYLES -->
<link rel="stylesheet" href="/bootstrap-4.0.0/dist/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="bootstrap-4.0.0/dist/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
<style {csp-style-nonce}>
* {
transition: background-color 300ms ease, color 300ms ease;
}
*:focus {
background-color: rgba(221, 72, 20, .2);
outline: none;
}
html, body {
color: rgba(33, 37, 41, 1);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
font-size: 16px;
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
header {
background-color: rgb(34, 113, 192);
padding: .4rem 0 0;
}
.menu {
padding: .4rem 2rem;
}
header ul {
border-bottom: 1px solid rgba(242, 242, 242, 1);
list-style-type: none;
margin: 0;
overflow: hidden;
padding: 0;
text-align: right;
}
header li {
display: inline-block;
}
header li a {
border-radius: 5px;
color: rgba(0, 0, 0, .5);
display: block;
height: 44px;
text-decoration: none;
}
header li.menu-item a {
border-radius: 5px;
margin: 5px 0;
height: 38px;
line-height: 36px;
padding: .4rem .65rem;
text-align: center;
}
header li.menu-item a:hover,
header li.menu-item a:focus {
background-color: rgba(221, 72, 20, .2);
color: rgba(221, 72, 20, 1);
}
header .logo {
float: left;
height: 44px;
padding: .4rem .5rem;
}
header .menu-toggle {
display: none;
float: right;
font-size: 2rem;
font-weight: bold;
}
header .menu-toggle button {
background-color: rgba(221, 72, 20, .6);
border: none;
border-radius: 3px;
color: rgba(255, 255, 255, 1);
cursor: pointer;
font: inherit;
font-size: 1.3rem;
height: 36px;
padding: 0;
margin: 11px 0;
overflow: visible;
width: 40px;
}
header .menu-toggle button:hover,
header .menu-toggle button:focus {
background-color: rgba(221, 72, 20, .8);
color: rgba(255, 255, 255, .8);
}
header .heroe {
margin: 0 auto;
max-width: 1100px;
padding: 1rem 1.75rem 1.75rem 1.75rem;
}
header .heroe h1 {
font-size: 2.5rem;
font-weight: 500;
}
header .heroe h2 {
font-size: 1.5rem;
font-weight: 300;
}
section {
margin: 0 auto;
max-width: 1100px;
padding: 2.5rem 1.75rem 3.5rem 1.75rem;
}
section h1 {
margin-bottom: 2.5rem;
}
section h2 {
font-size: 120%;
line-height: 2.5rem;
padding-top: 1.5rem;
}
section pre {
background-color: rgba(247, 248, 249, 1);
border: 1px solid rgba(242, 242, 242, 1);
display: block;
font-size: .9rem;
margin: 2rem 0;
padding: 1rem 1.5rem;
white-space: pre-wrap;
word-break: break-all;
}
section code {
display: block;
}
section a {
color: rgba(221, 72, 20, 1);
}
section svg {
margin-bottom: -5px;
margin-right: 5px;
width: 25px;
}
.further {
background-color: rgba(247, 248, 249, 1);
border-bottom: 1px solid rgba(242, 242, 242, 1);
border-top: 1px solid rgba(242, 242, 242, 1);
}
.further h2:first-of-type {
padding-top: 0;
}
.svg-stroke {
fill: none;
stroke: #000;
stroke-width: 32px;
}
footer {
background-color: rgba(221, 72, 20, .8);
text-align: center;
}
footer .environment {
color: rgba(255, 255, 255, 1);
padding: 2rem 1.75rem;
}
footer .copyrights {
background-color: rgba(62, 62, 62, 1);
color: rgba(200, 200, 200, 1);
padding: .25rem 1.75rem;
}
@media (max-width: 629px) {
header ul {
padding: 0;
}
header .menu-toggle {
padding: 0 1rem;
}
header .menu-item {
background-color: rgba(244, 245, 246, 1);
border-top: 1px solid rgba(242, 242, 242, 1);
margin: 0 15px;
width: calc(100% - 30px);
}
header .menu-toggle {
display: block;
}
header .hidden {
display: none;
}
header li.menu-item a {
background-color: rgba(221, 72, 20, .1);
}
header li.menu-item a:hover,
header li.menu-item a:focus {
background-color: rgba(221, 72, 20, .7);
color: rgba(255, 255, 255, .8);
}
}
</style>
</head>
<body style="font-size: 60px; margin-top: auto; margin-bottom: auto; text-align: center">
<body style="font-size: 14px; margin-top: auto; margin-bottom: auto; text-align: center; background-color: #fafac9; padding: 15px">
<span style="font-size: 60px; margin-top: auto; margin-bottom: auto; text-align: center;">
MERMS Provision <?=$label_env??''?>
</span>
MERMS Provision
<table class="table table-hover table-dark">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</body>
</html>