Commit cdcd6351 authored by Stefan Dähling's avatar Stefan Dähling
Browse files

use js modules

parent 5f99fa19
Pipeline #306190 passed with stages
in 1 minute and 8 seconds
......@@ -51,6 +51,8 @@ COPY pkg/frontend pkg/frontend
COPY pkg/common pkg/common
COPY pkg/schemas pkg/schemas
COPY pkg/ams/client pkg/ams/client
COPY pkg/df/client pkg/df/client
COPY pkg/logger/client pkg/logger/client
COPY web web
ENV PATH="/clonemap:${PATH}"
RUN cd cmd/frontend; CGO_ENABLED=0 GOOS=linux go build -ldflags '-s' -o frontend; cp frontend /clonemap/
......
......@@ -6,7 +6,7 @@
<title>Document</title>
<link rel="stylesheet" href="css/main.css">
<script src="js/jquery.js"></script>
<script src="js/main.js"></script>
<script type="module" src="js/main.js"></script>
</head>
<body>
<div class="maincontainer">
......
import * as request from "./request.js";
$(document).ready(function(){
$("#sideoverview").click(sideoverview);
......@@ -24,7 +26,7 @@ function sideplatform(){
function sidemas(){
$(".modules").show();
masID = this.id.split("sidemas")
var masID = this.id.split("sidemas")
$("#headertitle").text("MAS"+masID[1]);
contentAMS(parseInt(masID[1]))
}
......@@ -53,13 +55,20 @@ function contentPlatform() {
}
function contentAMS(masID){
fetch('/api/ams/mas/'+masID.toString())
.then(response => response.json())
.then(masInfo => {
$(".contenttitle").replaceWith("<h2 class=\"contenttitle\">MAS"+masID.toString()+"</h2>");
contentMasInfo(masInfo);
console.log(masInfo);
})
// fetch('/api/ams/mas/'+masID.toString())
// .then(response => response.json())
// .then(masInfo => {
// $(".contenttitle").replaceWith("<h2 class=\"contenttitle\">MAS"+masID.toString()+"</h2>");
// contentMasInfo(masInfo);
// console.log(masInfo);
// })
request.get('/api/ams/mas/'+masID.toString(),showAMSContent)
}
function showAMSContent(masInfo) {
$(".contenttitle").replaceWith("<h2 class=\"contenttitle\">MAS"+masInfo.id.toString()+"</h2>");
contentMasInfo(masInfo);
console.log(masInfo);
}
function clearContent() {
......
function get(url, callback) {
fetch(url)
.then(response => response.json())
.then(json => {callback(json)})
}
export {get};
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment