This commit is contained in:
olevole
2020-11-27 12:59:46 +03:00
parent 7cd1029ac6
commit 2564efe365
2 changed files with 46 additions and 28 deletions

16
public/curl.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
$ch = curl_init("https://bitclouds.convectix.com:1443/clusters");
//$fp = fopen("example_homepage.txt", "w");
curl_setopt($ch, CURLOPT_FILE, $stdout);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
if(curl_error($ch)) {
fwrite($stdout, curl_error($ch));
}
curl_close($ch);
//fclose($fp);
?>

View File

@@ -1,33 +1,35 @@
<?php
$res=json_decode('{
"clusters": [
{
"name": "ole",
"cluster": "k8s.bhyve.io",
"masters": 3,
"workers": 3,
"bhyves": [
"master1",
"master2",
"master3",
"worker1",
"worker2",
"worker3"
]
},
{
"name": "mon",
"cluster": "mon.bhyve.io",
"masters": 1,
"workers": 1,
"bhyves": [
"master1",
"worker1"
]
}
]
}',true);
function getSslPage($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
$file=$getSslPage('https://bitclouds.convectix.com:1443/clusters');
/*
$url='https://bitclouds.convectix.com:1443/clusters';
$arrContextOptions=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
),
);
$response = file_get_contents($url, false, stream_context_create($arrContextOptions));
echo $response;
*/
//$file=file_get_contents('https://bitclouds.convectix.com:1443/clusters');
//echo $file;
$res=json_decode($file,true);
$nth=0;
$hres=$this->getTableChunk('k8slist','tbody');