-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathindex.html
41 lines (37 loc) · 1.89 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Woql Client</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>
<body onload="startTerminusdb();">
<div id="root" class="container">
<div class="alert alert-primary" role="alert">WE ARE TESTING TerminusDB Client ......</div>
<div class="alert alert-warning" role="alert" id="success-alert"></div>
<div class="alert alert-warning" role="alert" id="success-alert01"></div>
<div class="alert alert-success" role="alert" id="success-alert02"></div>
</div>
<script>
async function startTerminusdb(){
var dbClient= new TerminusDBClient.WOQLClient("http://127.0.0.1:6363",{user:"admin","key":"root",organization:"admin"});
const db__01 = `myDB___${Date.now()}`
try{
await dbClient.createDatabase(db__01, {label: db__01 , comment: "add db", schema: true})
const h5 = document.getElementById("success-alert");
const newContent = document.createTextNode(`THE DATABASE ${db__01} HAS BEEN CREATED `);
h5.appendChild(newContent)
await dbClient.deleteDatabase(db__01)
const h6 = document.getElementById("success-alert01");
const newContent01 = document.createTextNode(`THE DATABASE ${db__01} HAS BEEN DELETED`);
h6.appendChild(newContent01)
const h7 = document.getElementById("success-alert02");
const newContent02 = document.createTextNode(`CREATE/DELETE TerminusDB DATABASE TEST PASSED......`);
h7.appendChild(newContent02)
}catch(err){
console.log(err)
}
}
</script>
</body>
</html>