Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions WebContent/Controller.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ sap.ui.define([ "sap/ui/core/mvc/Controller"], function(Controller) {
return Controller.extend("io.rtdi.bigdata.rulesservice.Controller", {

onInit : function() {
var oModel = new sap.ui.model.json.JSONModel();
oModel.loadData("./rest/config/service");
this.getView().setModel(oModel);
}

});
Expand Down
43 changes: 4 additions & 39 deletions WebContent/View.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,47 +67,12 @@
<Text text="Generate sample data" wrapping="true"/>
</VBox>
</VBox>
</HBox>
</Page>
<Page>
<layoutData>
<FlexItemData growFactor="3"/>
</layoutData>
<customHeader>
<OverflowToolbar>
<Text text="All topics with rules" />
</OverflowToolbar>
</customHeader>

<HBox id="Rules"
wrap="Wrap"
items="{/topicstatus}"
width="100%"
height="100%">

<VBox justifyContent="SpaceBetween" width="200px" height="150px" backgroundDesign="Solid" class="sapUiSmallMargin" tooltip="{tooltip}" >
<VBox class="sapUiSmallMargin">
<Text text="Topic: {topicname}" wrapping="true"/>
<ObjectNumber
number="{rulecount}"
unit="rule(s)"
emphasized="false"
state="None" />
<ObjectNumber
number="{avgtime}"
unit="ms avg"
emphasized="false"
state="None" />
<ObjectNumber
number="{rowsprocessed}"
unit="rows"
emphasized="false"
state="None" />
<ObjectStatus
class="sapUiSmallMarginBottom"
text="{= ${status} === true ? 'Active' : 'Inactive' }"
inverted="true"
icon="{= ${status} === true ? 'sap-icon://sys-enter-2' : 'sap-icon://alert' }"
state="{= ${status} === true ? 'Success' : 'Warning' }" />
<core:Icon src="sap-icon://order-status" class="sapUiTinyMarginBottom"/>
<Link text="Sample" href="ui5/Status.html" target="_blank" class="sapUiTinyMarginTop" />
<Text text="Rule status" wrapping="true"/>
</VBox>
</VBox>
</HBox>
Expand Down
11 changes: 11 additions & 0 deletions WebContent/ui5/Status.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sap.ui.define(["sap/ui/core/mvc/Controller"],
function(Controller) {"use strict";
return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Status", {
onInit : function() {
var oModel = new sap.ui.model.json.JSONModel();
oModel.loadData("../rest/config/service");
this.getView().setModel(oModel);
}
});
});

35 changes: 35 additions & 0 deletions WebContent/ui5/Status.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html style="height: 100%;">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Topics and rules</title>

<script id="sap-ui-bootstrap"
src="/openui5/resources/sap-ui-core.js"
data-sap-ui-theme="sap_fiori_3"
data-sap-ui-libs="sap.m"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-xx-supportedLanguages="en"
data-sap-ui-resourceroots='{
"io.rtdi.bigdata.rulesservice.ui5": "./"
}'
data-sap-ui-async="true"
data-sap-ui-compatVersion="edge"
data-sap-ui-frameOptions="trusted" >
</script>
<script>
sap.ui.getCore().attachInit(function () {
document.body.innerHTML=''
new sap.ui.xmlview({
viewName: "io.rtdi.bigdata.rulesservice.ui5.Status"
}).placeAt("content");
});
</script>
</head>

<body class="sapUiBody" id="content" style="height: 100%;">
<p>Loading OpenUI5 from <a href="/openui5/resources/sap-ui-core.js">here</a></p>
</body>
</html>

60 changes: 60 additions & 0 deletions WebContent/ui5/Status.view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<mvc:View height="100%" class="sapUiSizeCompact"
controllerName="io.rtdi.bigdata.rulesservice.ui5.Status"
xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:t="sap.ui.table" xmlns:tnt="sap.tnt" xmlns:controls="io.rtdi.bigdata.rulesservice.ui5.lib">
<controls:RulesToolPage sideExpanded="false">
<controls:header>
<tnt:ToolHeader>
<Text text="Status" />
<ToolbarSpacer/>
</tnt:ToolHeader>
</controls:header>
<controls:mainContents>
<FlexBox direction="Column" fitContainer="true">
<Page>
<layoutData>
<FlexItemData growFactor="3"/>
</layoutData>
<customHeader>
<OverflowToolbar>
<Text text="All topics with rules" />
</OverflowToolbar>
</customHeader>

<HBox id="Rules"
wrap="Wrap"
items="{/topicstatus}"
width="100%"
height="100%">
<VBox justifyContent="SpaceBetween" width="200px" height="150px" backgroundDesign="Solid" class="sapUiSmallMargin" tooltip="{tooltip}" >
<VBox class="sapUiSmallMargin">
<Text text="Topic: {topicname}" wrapping="true"/>
<ObjectNumber
number="{rulecount}"
unit="rule(s)"
emphasized="false"
state="None" />
<ObjectNumber
number="{avgtime}"
unit="ms avg"
emphasized="false"
state="None" />
<ObjectNumber
number="{rowsprocessed}"
unit="rows"
emphasized="false"
state="None" />
<ObjectStatus
class="sapUiSmallMarginBottom"
text="{= ${status} === true ? 'Active' : 'Inactive' }"
inverted="true"
icon="{= ${status} === true ? 'sap-icon://sys-enter-2' : 'sap-icon://alert' }"
state="{= ${status} === true ? 'Success' : 'Warning' }" />
</VBox>
</VBox>
</HBox>
</Page>
</FlexBox>
</controls:mainContents>
</controls:RulesToolPage>
</mvc:View>

6 changes: 6 additions & 0 deletions WebContent/ui5/lib/RulesToolPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ sap.ui.define([
icon: "sap-icon://wrench",
href: "./Config.html",
tooltip: "Configure the connections"
}),
new sap.tnt.NavigationListItem({
text: "Config",
icon: "sap-icon://order-status",
href: "./Status.html",
tooltip: "Status of all rules"
})
]}
)
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM rtdi/connectorrootapp

LABEL maintainer="info@rtdi.io"

ADD https://raw.githubusercontent.com/rtdi/RulesService/master/docker/global.properties conf/rtdiconfig/RulesService/
ADD https://raw.githubusercontent.com/rtdi/RulesService/master/docker/tomcat-users-orig.xml conf/
ADD https://github.com/rtdi/RulesService/releases/latest/download/rulesservice.war ./webapps/

EXPOSE 8080
Expand Down
45 changes: 45 additions & 0 deletions docker/tomcat-users-orig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><tomcat-users version="1.0" xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
<!--
NOTE: The sample user and role entries below are intended for use with the
examples web application. They are wrapped in a comment and thus are ignored
when reading this file. If you wish to configure these users for use with the
examples web application, do not forget to remove the <!.. ..> that surrounds
them. You will also need to set the passwords to something appropriate.
-->
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
-->
<role rolename="manager-gui" />
<role rolename="rulesview" />
<role rolename="rulesedit" />
<role rolename="rulesadmin" />
<user username="rtdi" password="rtdi!io" roles="rulesview, rulesadmin, rulesedit, manager-gui"/>
</tomcat-users>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>0.9.29</revision>
<revision>0.9.30</revision>
<log4j.version>2.24.1</log4j.version>
<kafka.version>3.8.0</kafka.version>
<jersey>3.1.8</jersey>
Expand Down
Loading