milvus/internal/http/webui/index.html
jaime 4746f47282
feat: management WebUI homepage (#36822)
issue: #36784
1. Implement an embedded web server for WebUI access.  
2. Complete the homepage development.

Home page demo:
<img width="2177" alt="iShot_2024-10-10_17 57 34"
src="https://github.com/user-attachments/assets/38539917-ce09-4e54-a5b5-7f4f7eaac353">

Signed-off-by: jaime <yun.zhang@zilliz.com>
2024-10-23 11:29:28 +08:00

94 lines
2.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Milvus WebUI</title>
<meta name="description" content="Milvus Management WebUI">
<link href="./static/css/bootstrap.min.css" rel="stylesheet">
<link href="./static/css/style.css" rel="stylesheet">
<script src="./static/js/jquery.min.js"></script>
<script src="./static/js/bootstrap.min.js"></script>
<script src="./static/js/bootstrap.bundle.min.js"></script>
<script src="./static/js/scripts.js"></script>
<script>
$(document).ready(function(){
$('#header').load("header.html");
$('#footer').load("footer.html");
});
const handleError = (error) => {
console.error('Error fetching data:', error);
const errorMessage = encodeURIComponent(error.message || 'Unknown error');
window.location.href = `5xx.html?error=${errorMessage}`;
};
document.addEventListener("DOMContentLoaded", function() {
fetch(MILVUS_URI + "/_cluster/info")
.then(response => response.json())
.then(text => {
data = JSON.parse(text)
renderSysInfo(data)
renderComponentInfo(data)
})
.catch(error => {
handleError(error);
});
fetch(MILVUS_URI + "/_cluster/clients")
.then(response => response.json())
.then(text => {
data = JSON.parse(text)
renderClientsInfo(data)
})
.catch(error => {
handleError(error);
});
fetch(MILVUS_URI + "/_cluster/dependencies")
.then(response => response.json())
.then(text => {
data = JSON.parse(text)
renderDependencies(data)
})
.catch(error => {
handleError(error);
});
});
</script>
</head>
<body>
<div class="container-fluid">
<div id="header"></div>
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-8">
<h2>
System Information
</h2>
<table id="sysInfo" class="table table-hover"></table>
<h2>
Component Information
</h2>
<table id="components" class="table table-hover"></table>
<h2>
Connected Clients
</h2>
<table id="clients" class="table table-hover"></table>
<h2>
System Dependencies
</h2>
<table id="3rdDependency" class="table table-hover"></table>
</div>
<div class="col-md-2">
</div>
</div>
<div id="footer"></div>
</div>
</body>
</html>