diff --git a/Dockerfile b/Dockerfile index 3d73d38..88fa7e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,9 @@ RUN mkdir -p assets/plugins && \ /build/node_modules/jquery-tags-input/ \ assets/plugins/ +# Move custom assets +RUN cp -r /build/custom/ assets/ + # Get go modules and build tool RUN go mod download && \ go get github.com/GeertJohan/go.rice/rice diff --git a/custom/js/helper.js b/custom/js/helper.js new file mode 100644 index 0000000..b911ba7 --- /dev/null +++ b/custom/js/helper.js @@ -0,0 +1,59 @@ +function renderClientList(data) { + $.each(data, function(index, obj) { + // render client status css tag style + let clientStatusHtml = '>' + if (obj.Client.enabled) { + clientStatusHtml = `style="visibility: hidden;">` + } + + // render client allocated ip addresses + let allocatedIpsHtml = ""; + $.each(obj.Client.allocated_ips, function(index, obj) { + allocatedIpsHtml += `${obj}`; + }) + + // render client allowed ip addresses + let allowedIpsHtml = ""; + $.each(obj.Client.allowed_ips, function(index, obj) { + allowedIpsHtml += `${obj}`; + }) + + // render client html content + let html = `