Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelGauthier committed Oct 26, 2023
1 parent 638f170 commit 632b970
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ class SrvGrid(

val nodeIds = nodes.map(nodes => JsArray(nodes.map(n => Str(n.id.value)).toList).toJsCmd).getOrElse("undefined")
JsRaw(s"""nodeIds = ${nodeIds};
|var main = document.getElementById("nodes-app")
|var initValues = {
| contextPath : "${S.contextPath}"
| , hasReadRights : hasReadRights
| , policyMode : "${globalPolicyMode.mode.name}"
|};
|var app = Elm.Nodes.init({node: main, flags: initValues});
|app.ports.errorNotification.subscribe(function(msg) {
| createErrorNotification(msg);
|});
| createNodeTable("${tableId}",function() {reloadTable("${tableId}")} );
""".stripMargin)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
<lift:surround with="common-layout" at="content">
<head>
<title>Rudder - Nodes</title>
<style>
.rudder-template > .one-col{
flex: 1;
}
.template-main{
flex-basis : initial !important;
flex: auto !important;
}
#nodes tbody tr td .rudder-label.label-sm{
padding: 3px 24px !important;
margin-right: 0;
font-size: inherit;
height: initial;
}
</style>
<script data-lift="with-cached-resource" src="/javascript/rudder/elm/rudder-nodes.js"></script>
</head>
<script>
var hasReadRights = false;
</script>
<lift:authz role="node_read">
<script>
hasReadRights = true;
</script>
</lift:authz>
<div id="nodes-app"></div>
<div data-lift="node.Nodes.table"></div>
<div data-lift="node.Nodes.loadData"></div>
</lift:surround>

<!--
<lift:surround with="common-layout" at="content">
<head>
<title>Rudder - Nodes</title>
Expand Down Expand Up @@ -39,3 +73,4 @@ <h1>
</div>
<div data-lift="node.Nodes.loadData"></div>
</lift:surround>
-->

0 comments on commit 632b970

Please sign in to comment.