ENTAXY-248 release 1.8.1
201
ui/entaxy-hawtio/LICENSE.txt
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed 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.
|
201
ui/entaxy-hawtio/artemis-plugin-entaxy/LICENSE.txt
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed 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.
|
233
ui/entaxy-hawtio/artemis-plugin-entaxy/pom.xml
Normal file
@ -0,0 +1,233 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.ui</groupId>
|
||||
<artifactId>entaxy-hawtio</artifactId>
|
||||
<version>1.8.1</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.ui.hawtio</groupId>
|
||||
<artifactId>artemis-plugin-entaxy</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>ENTAXY :: UI :: HAWTIO :: ARTEMIS PLUGIN</name>
|
||||
<description>ENTAXY :: UI :: HAWTIO :: ARTEMIS PLUGIN</description>
|
||||
|
||||
<properties>
|
||||
<activemq.basedir>${project.basedir}/../..</activemq.basedir>
|
||||
|
||||
<!-- filtered plugin properties, we don't define plugin-scripts here
|
||||
as we build that dynamically using maven-antrun-plugin below. -->
|
||||
<!-- plugin-context is what context this plugin will handle requests on
|
||||
in the application server -->
|
||||
<plugin-context>/artemis-plugin</plugin-context>
|
||||
|
||||
<!-- plugin-name is the name of our plugin, affects the name used for
|
||||
the plugin's mbean -->
|
||||
<plugin-name>artemis-plugin</plugin-name>
|
||||
|
||||
<!-- plugin-domain is currently unused, we just define it to an empty
|
||||
string -->
|
||||
<plugin-domain />
|
||||
|
||||
<!-- this lets this plugin deploy nicely into karaf, these get used
|
||||
for the ImportPackage directive for maven-bundle-plugin -->
|
||||
<bundle.osgi.import.pkg>
|
||||
javax.servlet,
|
||||
*;resolution:=optional
|
||||
</bundle.osgi.import.pkg>
|
||||
|
||||
<webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
|
||||
<webapp-outdir>${basedir}/target/${webapp-dir}</webapp-outdir>
|
||||
<schema-outdir>${basedir}/src/main/webapp/lib</schema-outdir>
|
||||
<appjs-outfile>${webapp-outdir}/app/app.js</appjs-outfile>
|
||||
|
||||
<!--
|
||||
<angular.version>1.7.9</angular.version>
|
||||
-->
|
||||
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.hawt</groupId>
|
||||
<artifactId>hawtio-plugin-mbean</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- dependency>
|
||||
<groupId>com.google.errorprone</groupId>
|
||||
<artifactId>error_prone_core</artifactId>
|
||||
</dependency -->
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
<!-- we want to ensure src/main/resources/WEB-INF/web.xml is being filtered
|
||||
so that it picks up all of our javascript files -->
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
|
||||
<!-- We use maven-antrun-plugin to build up a list of
|
||||
javascript files for our plugin mbean, this means
|
||||
it needs to run before the maven-resources-plugin
|
||||
copies and filters the web.xml, since for this
|
||||
example we use contextParam settings to configure
|
||||
our plugin mbean -->
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>${maven-antrun-plugin.version}</version>
|
||||
<executions>
|
||||
|
||||
<execution>
|
||||
<!-- we run this early in the build process before
|
||||
maven-resources-plugin is run. We're exporting the
|
||||
plugin-scripts property from here, so we need to
|
||||
use maven-antrun-plugin 1.6 or up -->
|
||||
<id>generate-sources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<echo>Building plugin javascript file list</echo>
|
||||
<!-- javascript-files will contain all of the javascript in
|
||||
our project -->
|
||||
<fileset id="javascript-files" dir="${basedir}/src/main/webapp">
|
||||
<include name="**/*.js" />
|
||||
</fileset>
|
||||
<!-- we need to strip out the top level path which is
|
||||
our source directory and be sure to change the directory
|
||||
separators to forward slashes -->
|
||||
<pathconvert pathsep="," dirsep="/" property="plugin-scripts" refid="javascript-files">
|
||||
<map from="${basedir}/src/main/webapp/" to="" />
|
||||
</pathconvert>
|
||||
<echo>Files: ${plugin-scripts}</echo>
|
||||
|
||||
</target>
|
||||
<!-- this exports plugin-scripts to the maven build, without
|
||||
this line ${plugin-scripts} in the web.xml file won't be
|
||||
replaced -->
|
||||
<exportAntProperties>true</exportAntProperties>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<!-- version>${maven-resources-plugin-version}</version -->
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- defining this maven plugin in the same phase as the
|
||||
maven-antrun-plugin but *after* we've configured the
|
||||
maven-antrun-plugin ensures we filter resources *after*
|
||||
we've discovered the plugin .js files. -->
|
||||
<id>copy-resources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>resources</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- maven-bundle-plugin config, needed to make this war
|
||||
deployable in karaf, defines the context that this bundle
|
||||
should handle requests on -->
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-manifest</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<manifestLocation>${webapp-outdir}/META-INF</manifestLocation>
|
||||
<supportedProjectTypes>
|
||||
<supportedProjectType>jar</supportedProjectType>
|
||||
<supportedProjectType>bundle</supportedProjectType>
|
||||
<supportedProjectType>war</supportedProjectType>
|
||||
</supportedProjectTypes>
|
||||
<instructions>
|
||||
<Webapp-Context>${plugin-context}</Webapp-Context>
|
||||
<Web-ContextPath>${plugin-context}</Web-ContextPath>
|
||||
|
||||
<Embed-Directory>WEB-INF/lib</Embed-Directory>
|
||||
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
|
||||
<Embed-Transitive>true</Embed-Transitive>
|
||||
|
||||
<!-- Export-Package>${osgi.export}</Export-Package>
|
||||
<Import-Package>${osgi.import}</Import-Package>
|
||||
<DynamicImport-Package>${osgi.dynamic}</DynamicImport-Package>
|
||||
<Private-Package>${osgi.private.pkg}</Private-Package -->
|
||||
|
||||
<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
|
||||
|
||||
<Bundle-Name>${project.name}</Bundle-Name>
|
||||
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
|
||||
<Implementation-Title>Entaxy</Implementation-Title>
|
||||
<Implementation-Version>${project.version}</Implementation-Version>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- We define the maven-war-plugin here and make sure it uses
|
||||
the manifest file generated by the maven-bundle-plugin. We
|
||||
also ensure it picks up our filtered web.xml and not the one
|
||||
in src/main/resources -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
|
||||
<packagingExcludes>**/classes/OSGI-INF/**</packagingExcludes>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<archive>
|
||||
<manifestFile>${webapp-outdir}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
<webResources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>log4j.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</webResources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,90 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
package org.apache.activemq.hawtio.plugin;
|
||||
|
||||
import io.hawt.web.plugin.HawtioPlugin;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
/**
|
||||
* The Plugin Context Listener used to load in the plugin
|
||||
**/
|
||||
public class PluginContextListener implements ServletContextListener {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(PluginContextListener.class);
|
||||
|
||||
HawtioPlugin plugin = null;
|
||||
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent servletContextEvent) {
|
||||
|
||||
ServletContext context = servletContextEvent.getServletContext();
|
||||
|
||||
plugin = new HawtioPlugin();
|
||||
plugin.setContext(context.getContextPath());
|
||||
plugin.setName(context.getInitParameter("plugin-name"));
|
||||
plugin.setScripts(context.getInitParameter("plugin-scripts"));
|
||||
plugin.setDomain(null);
|
||||
|
||||
try {
|
||||
plugin.init();
|
||||
} catch (Exception e) {
|
||||
throw createServletException(e);
|
||||
}
|
||||
|
||||
LOG.info("Initialized {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent servletContextEvent) {
|
||||
try {
|
||||
plugin.destroy();
|
||||
} catch (Exception e) {
|
||||
throw createServletException(e);
|
||||
}
|
||||
|
||||
LOG.info("Destroyed {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
protected RuntimeException createServletException(Exception e) {
|
||||
return new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
artemis-plugin-entaxy
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
|
||||
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
|
||||
<description>An Artemis Plugin</description>
|
||||
<display-name>An Artemis plugin</display-name>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-context</param-name>
|
||||
<param-value>${plugin-context}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-name</param-name>
|
||||
<param-value>${project.artifactId}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-domain</param-name>
|
||||
<param-value>${plugin-domain}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-scripts</param-name>
|
||||
<param-value>${plugin-scripts}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Disable listing of directories and files</description>
|
||||
<param-name>org.eclipse.jetty.servlet.Default.dirAllowed</param-name>
|
||||
<param-value>false</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
<listener-class>org.apache.activemq.hawtio.plugin.PluginContextListener</listener-class>
|
||||
</listener>
|
||||
|
||||
|
||||
</web-app>
|
||||
|
@ -0,0 +1,42 @@
|
||||
###
|
||||
# ~~~~~~licensing~~~~~~
|
||||
# artemis-plugin-entaxy
|
||||
# ==========
|
||||
# Copyright (C) 2020 - 2021 EmDev LLC
|
||||
# ==========
|
||||
# Licensed 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.
|
||||
# ~~~~~~/licensing~~~~~~
|
||||
###
|
||||
## ---------------------------------------------------------------------------
|
||||
## 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.
|
||||
## ---------------------------------------------------------------------------
|
||||
|
||||
log4j.rootLogger=INFO, console
|
||||
|
||||
log4j.appender.console=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.console.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.console.layout.ConversionPattern=%-5p | %t | %m%n
|
||||
|
@ -0,0 +1,47 @@
|
||||
<!--
|
||||
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.
|
||||
Architecture
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
artemis-plugin-entaxy
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Artemis plugin</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hawtio :: Artemis plugin</h1>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,19 @@
|
||||
### Artemis
|
||||
|
||||
Click [Artemis](#/jmx/attributes?tab=artemis) in the top navigation bar to see the Artemis specific plugin. (The Artemis tab won't appear if there is no broker in this JVM). The Artemis plugin works very much the same as the JMX plugin however with a focus on interacting with an Artemis broker.
|
||||
|
||||
The tree view on the left-hand side shows the top level JMX tree of each broker instance running in the JVM. Expanding the tree will show the various MBeans registered by Artemis that you can inspect via the **Attributes** tab.
|
||||
|
||||
#### Creating a new Address
|
||||
|
||||
To create a new address simply click on the broker or the address folder in the jmx tree and click on the create tab.
|
||||
|
||||
Once you have created an address you should be able to **Send** to it by clicking on it in the jmx tree and clicking on the send tab.
|
||||
|
||||
#### Creating a new Queue
|
||||
|
||||
To create a new queue click on the address you want to bind the queue to and click on the create tab.
|
||||
|
||||
Once you have created a queue you should be able to **Send** a message to it or **Browse** it or view the **Attributes** or **Charts**. Simply click on the queue in th ejmx tree and click on the appropriate tab.
|
||||
|
||||
You can also see a graphical view of all brokers, addresses, queues and their consumers using the **Diagram** tab.
|
@ -0,0 +1,93 @@
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
artemis-plugin-entaxy
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
<!--
|
||||
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.
|
||||
Architecture
|
||||
-->
|
||||
<form class="form-horizontal artemis-preferences-form" ng-controller="Artemis.PreferencesController">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisUserName">
|
||||
Artemis user name
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="The user name to be used when connecting to the broker"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input id="artemisUserName" type="text" class="form-control" ng-model="artemisUserName"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisPassword">
|
||||
Artemis password
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="The user name to be used when connecting to the broker"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input id="artemisPassword" type="password" class="form-control" ng-model="artemisPassword"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisDLQ">
|
||||
Dead-letter address regex
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="A regular expression to match one or more dead-letter addresses"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" id="artemisDLQ" ng-model="artemisDLQ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisExpiryQueue">
|
||||
Expiry address regex
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="A regular expression to match one or more expiry addresses"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" id="artemisExpiryQueue" ng-model="artemisExpiryQueue">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisBrowseBytesMessages">
|
||||
Display message body as
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="Browsing byte messages should display the message body as"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<select id="artemisBrowseBytesMessages"
|
||||
ng-model="artemisBrowseBytesMessages"
|
||||
ng-options="key for (key, value) in messageBodyDisplayOptions"
|
||||
ng-selected="artemisBrowseBytesMessages === value">
|
||||
</select>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
</form>
|
@ -0,0 +1,39 @@
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
artemis-plugin-entaxy
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
<!--
|
||||
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.
|
||||
Architecture
|
||||
-->
|
||||
<div class="tree-nav-sidebar-content">
|
||||
<div id="artemistree" class="treeview-pf-hover treeview-pf-select"></div>
|
||||
</div>
|
@ -0,0 +1,60 @@
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
artemis-plugin-entaxy
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
<!--
|
||||
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.
|
||||
Architecture
|
||||
-->
|
||||
<div class="tree-nav-sidebar-header">
|
||||
<form role="form" class="search-pf has-button">
|
||||
<div class="form-group has-clear">
|
||||
<div class="search-pf-input-group">
|
||||
<label for="input-search" class="sr-only">Search Tree:</label>
|
||||
<input id="input-search" type="search" class="form-control" placeholder="Search tree:"
|
||||
ng-model="$ctrl.filter">
|
||||
<button type="button" class="clear" aria-hidden="true"
|
||||
ng-hide="$ctrl.filter.length === 0"
|
||||
ng-click="$ctrl.filter = ''">
|
||||
<span class="pficon pficon-close"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group tree-nav-buttons">
|
||||
<span class="badge" ng-class="{positive: $ctrl.result.length > 0}"
|
||||
ng-show="$ctrl.filter.length > 0">
|
||||
{{$ctrl.result.length}}
|
||||
</span>
|
||||
<i class="fa fa-plus-square-o" title="Expand All" ng-click="$ctrl.expandAll()"></i>
|
||||
<i class="fa fa-minus-square-o" title="Collapse All" ng-click="$ctrl.contractAll()"></i>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
@ -0,0 +1,58 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
function artemisJmxDomain() {
|
||||
return localStorage['artemisJmxDomain'] || "org.apache.activemq.artemis";
|
||||
}
|
||||
Artemis.artemisJmxDomain = artemisJmxDomain;;
|
||||
|
||||
function ownUnescape(name) {
|
||||
//simple return unescape(name); does not work for this :(
|
||||
return name.replace(/\\\\/g, "\\").replace(/\\\*/g, "*").replace(/\\\?/g, "?");
|
||||
};
|
||||
Artemis.ownUnescape = ownUnescape;
|
||||
|
||||
function getBrokerMBean(workspace, jolokia) {
|
||||
var mbean = null;
|
||||
var selection = workspace.selection;
|
||||
var folderNames = selection.folderNames;
|
||||
mbean = "" + folderNames[0] + ":broker=\"" + folderNames[1] + "\"";
|
||||
return mbean;
|
||||
}
|
||||
Artemis.getBrokerMBean = getBrokerMBean;
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,101 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/**
|
||||
* The main entry point for the Simple module
|
||||
*/
|
||||
var Artemis = (function (Artemis) {
|
||||
|
||||
/**
|
||||
* The name of this plugin
|
||||
*/
|
||||
Artemis.pluginName = 'artemis-plugin';
|
||||
|
||||
/**
|
||||
* This plugin's logger instance
|
||||
*/
|
||||
Artemis.log = Logger.get('artemis-plugin');
|
||||
|
||||
/**
|
||||
* The top level path of this plugin on the server
|
||||
*/
|
||||
Artemis.contextPath = "/artemis-plugin/";
|
||||
|
||||
Artemis.log.info("loading artemis plugin")
|
||||
Artemis._module = angular.module(Artemis.pluginName, [
|
||||
'angularResizable'
|
||||
])
|
||||
.component('artemis', {
|
||||
template:
|
||||
`<div class="tree-nav-layout">
|
||||
<div class="sidebar-pf sidebar-pf-left" resizable r-directions="['right']">
|
||||
<artemis-tree-header></artemis-tree-header>
|
||||
<artemis-tree></artemis-tree>
|
||||
</div>
|
||||
<div class="tree-nav-main">
|
||||
<jmx-header></jmx-header>
|
||||
<artemis-navigation></artemis-navigation>
|
||||
<div class="contents" ng-view></div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
.run(configurePlugin);
|
||||
|
||||
function configurePlugin(mainNavService, workspace, helpRegistry, preferencesRegistry, localStorage, preLogoutTasks, documentBase, $templateCache) {
|
||||
var artemisJmxDomain = localStorage['artemisJmxDomain'] || "org.apache.activemq.artemis";
|
||||
mainNavService.addItem({
|
||||
title: 'Artemis',
|
||||
basePath: '/artemis',
|
||||
template: '<artemis></artemis>',
|
||||
isValid: function () { return workspace.treeContainsDomainAndProperties(artemisJmxDomain); }
|
||||
});
|
||||
|
||||
// clean up local storage upon logout
|
||||
preLogoutTasks.addTask('CleanupArtemisCredentials', function () {
|
||||
Artemis.log.debug("Clean up Artemis credentials in local storage");
|
||||
localStorage.removeItem('artemisUserName');
|
||||
localStorage.removeItem('artemisPassword');
|
||||
});
|
||||
}
|
||||
configurePlugin.$inject = ['mainNavService', 'workspace', 'helpRegistry', 'preferencesRegistry', 'localStorage', 'preLogoutTasks', 'documentBase', '$templateCache'];
|
||||
|
||||
return Artemis;
|
||||
|
||||
})(Artemis || {});
|
||||
|
||||
// tell the Hawtio plugin loader about our plugin so it can be
|
||||
// bootstrapped with the rest of AngularJS
|
||||
hawtioPluginLoader.addModule(Artemis.pluginName);
|
@ -0,0 +1,175 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/// <reference path="tree.component.ts"/>
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis.log.debug("loading address send message");
|
||||
Artemis._module.component('artemisAddressSendMessage', {
|
||||
template:
|
||||
`<h1>Send Message
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'send-message-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
|
||||
<div class="alert alert-warning" ng-show="$ctrl.message.noCredentials">
|
||||
<span class="pficon pficon-warning-triangle-o"></span>
|
||||
<strong>No credentials set for endpoint!</strong>
|
||||
Please set your username and password in the
|
||||
<a href="#" class="alert-link" ng-click="$ctrl.message.openPrefs()">Preferences</a> page.
|
||||
</div>
|
||||
|
||||
<div class="row artemis-message-configuration">
|
||||
|
||||
<div class="col-sm-12">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label>Durable </label>
|
||||
<input id="durable" type="checkbox" ng-model="$ctrl.message.durable" value="true">
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'durable-info.html'" popover-placement="bottom-left"
|
||||
popover-title="Durable" popover-trigger="'mouseenter'">
|
||||
<span class="pficon pficon-info"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Create Message ID </label>
|
||||
<input id="messageID" type="checkbox" ng-model="$ctrl.message.messageID" value="true">
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'message-id-info.html'" popover-placement="bottom-left"
|
||||
popover-title="Message ID" popover-trigger="'mouseenter'">
|
||||
<span class="pficon pficon-info"></span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Headers</h3>
|
||||
|
||||
<div class="form-group" ng-if="$ctrl.message.headers.length > 0">
|
||||
<table class="scr-component-references-table table">
|
||||
<tbody>
|
||||
<tr class="input-group" ng-repeat="header in $ctrl.message.headers">
|
||||
<td><input type="text" class="form-control" ng-model="header.name" placeholder="Name" autocomplete="off" id="name"></td>
|
||||
<td><input type="text" class="form-control" ng-model="header.value" placeholder="Value" autocomplete="off" id="value"></td>
|
||||
<td><div class="input-group-prepend">
|
||||
<button type="button" class="btn btn-default" title="Delete" ng-click="$ctrl.message.removeHeader(header)">
|
||||
<span class="pficon pficon-delete"></span>
|
||||
</button>
|
||||
</div></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<button type="button" class="btn btn-primary artemis-add-message-button" ng-click="$ctrl.message.addHeader()">Add Header</button>
|
||||
</p>
|
||||
|
||||
<h3>Body</h3>
|
||||
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<div hawtio-editor="$ctrl.message.message" mode="codeMirrorOptions.mode.name"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select class="form-control artemis-send-message-format" ng-model="codeMirrorOptions.mode.name">
|
||||
<option value="javascript">JSON</option>
|
||||
<option value="xml">XML</option>
|
||||
</select>
|
||||
<button class="btn btn-default" ng-click="$ctrl.message.formatMessage()"
|
||||
title="Automatically pretty prints the message so its easier to read">Format
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<p>
|
||||
<button type="button" class="btn btn-primary artemis-send-message-button" ng-click="$ctrl.message.sendMessage($ctrl.message.durable, $ctrl.message.messageID)">Send message</button>
|
||||
</p>
|
||||
<script type="text/ng-template" id="send-message-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to send a message to the chosen address. The message will be of type <code>text</code>
|
||||
message and it will be possible to add headers to the message. The sending of the message will be authenticated
|
||||
using the username and password set ion <code>preferences</code>, if this is not set then these will
|
||||
be null.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="message-id-info.html">
|
||||
<div>
|
||||
<p>
|
||||
The Message ID is an automatically generated UUID that is set on the Message by the broker before it is routed.
|
||||
If using a JMS client this would be the JMS Message ID on the JMS Message, this typically would not get
|
||||
set for non JMS clients. Historically and on some other tabs this is also referred to as the User ID.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="durable-info.html">
|
||||
<div>
|
||||
<p>
|
||||
If durable the message will be marked persistent and written to the brokers journal if the destination queue is durable.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: AddressSendMessageController
|
||||
})
|
||||
.name;
|
||||
Artemis.log.debug("loaded queue " + Artemis.createQueueModule);
|
||||
|
||||
function AddressSendMessageController($route, $scope, $element, $timeout, workspace, jolokia, localStorage, $location, artemisMessage, messageCreator) {
|
||||
Core.initPreferenceScope($scope, localStorage, {
|
||||
'durable': {
|
||||
'value': true,
|
||||
'converter': Core.parseBooleanValue
|
||||
},
|
||||
'messageID': {
|
||||
'value': true,
|
||||
'converter': Core.parseBooleanValue
|
||||
}
|
||||
});
|
||||
var ctrl = this;
|
||||
ctrl.messageCreator = messageCreator;
|
||||
ctrl.message = ctrl.messageCreator.createNewMessage($scope, $location, $route, localStorage, artemisMessage, workspace, $element, $timeout, jolokia);
|
||||
|
||||
}
|
||||
AddressSendMessageController.$inject = ['$route', '$scope', '$element', '$timeout', 'workspace', 'jolokia', 'localStorage', '$location', 'artemisMessage', 'messageCreator'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,272 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
//Artemis.log.debug("loading addresses");
|
||||
Artemis._module.component('artemisAddresses', {
|
||||
template:
|
||||
`<h1>Browse Addresses
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'addresses-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
<div ng-include="'plugin/artemistoolbar.html'"></div>
|
||||
<pf-table-view config="$ctrl.tableConfig"
|
||||
dt-options="$ctrl.dtOptions"
|
||||
columns="$ctrl.tableColumns"
|
||||
action-buttons="$ctrl.tableActionButtons"
|
||||
items="$ctrl.addresses">
|
||||
</pf-table-view>
|
||||
<div ng-include="'plugin/artemispagination.html'"></div>
|
||||
<script type="text/ng-template" id="addresses-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to browse all address on the broker. These can be narrowed down
|
||||
by specifying a filter and also sorted using the sort function in the toolbar. To execute a query
|
||||
click on the <span class="fa fa-search"></span> button.
|
||||
</p>
|
||||
<p>
|
||||
You can also navigate directly to the JMX attributes and operations tabs by using the <code>attributes</code>
|
||||
and <code>operations</code> button under the <code>Actions</code> column.You can navigate to the
|
||||
addresses queues by clicking on the <code>Queue Count</code> field.
|
||||
</p>
|
||||
<p>
|
||||
Note that each page is loaded in from the broker when navigating to a new page or when a query is executed.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: AddressesController
|
||||
})
|
||||
.name;
|
||||
|
||||
|
||||
function AddressesController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisAddress) {
|
||||
var ctrl = this;
|
||||
ctrl.pagination = pagination;
|
||||
ctrl.pagination.reset();
|
||||
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
ctrl.allAddresses = [];
|
||||
ctrl.addresses = [];
|
||||
ctrl.workspace = workspace;
|
||||
ctrl.refreshed = false;
|
||||
ctrl.dtOptions = {
|
||||
// turn of ordering as we do it ourselves
|
||||
ordering: false,
|
||||
columns: [
|
||||
{name: "ID", visible: true},
|
||||
{name: "Name", visible: true},
|
||||
{name: "Routing Types", visible: true},
|
||||
{name: "Queue Count", visible: true}
|
||||
]
|
||||
};
|
||||
|
||||
Artemis.log.debug('sessionStorage: addressColumnDefs =', localStorage.getItem('addressColumnDefs'));
|
||||
if (localStorage.getItem('addressColumnDefs')) {
|
||||
loadedDefs = JSON.parse(localStorage.getItem('addressColumnDefs'));
|
||||
//sanity check to make sure columns havent been added
|
||||
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
|
||||
ctrl.dtOptions.columns = loadedDefs;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ctrl.updateColumns = function () {
|
||||
var attributes = [];
|
||||
ctrl.dtOptions.columns.forEach(function (column) {
|
||||
attributes.push({name: column.name, visible: column.visible});
|
||||
});
|
||||
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
|
||||
localStorage.setItem('addressColumnDefs', JSON.stringify(attributes));
|
||||
}
|
||||
|
||||
ctrl.filter = {
|
||||
fieldOptions: [
|
||||
{id: 'id', name: 'ID'},
|
||||
{id: 'name', name: 'Name'},
|
||||
{id: 'routingTypes', name: 'Routing Types'},
|
||||
{id: 'queueCount', name: 'Queue Count'}
|
||||
],
|
||||
operationOptions: [
|
||||
{id: 'EQUALS', name: 'Equals'},
|
||||
{id: 'CONTAINS', name: 'Contains'},
|
||||
{id: 'NOT_CONTAINS', name: 'Does Not Contain'},
|
||||
{id: 'GREATER_THAN', name: 'Greater Than'},
|
||||
{id: 'LESS_THAN', name: 'Less Than'}
|
||||
],
|
||||
sortOptions: [
|
||||
{id: 'asc', name: 'ascending'},
|
||||
{id: 'desc', name: 'descending'}
|
||||
],
|
||||
values: {
|
||||
field: "",
|
||||
operation: "",
|
||||
value: "",
|
||||
sortOrder: "asc",
|
||||
sortColumn: "id"
|
||||
},
|
||||
text: {
|
||||
fieldText: "Filter Field..",
|
||||
operationText: "Operation..",
|
||||
sortOrderText: "ascending",
|
||||
sortByText: "ID"
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.tableActionButtons = [
|
||||
{
|
||||
name: 'attributes',
|
||||
title: 'Navigate to attributes',
|
||||
actionFn: navigateToAddressAtts
|
||||
},
|
||||
{
|
||||
name: 'operations',
|
||||
title: 'navigate to operations',
|
||||
actionFn: navigateToAddressOps
|
||||
}
|
||||
];
|
||||
ctrl.tableConfig = {
|
||||
selectionMatchProp: 'id',
|
||||
showCheckboxes: false
|
||||
};
|
||||
ctrl.tableColumns = [
|
||||
{ header: 'ID', itemField: 'id' },
|
||||
{ header: 'Name', itemField: 'name' },
|
||||
{ header: 'Routing Types', itemField: 'routingTypes' },
|
||||
{ header: 'Queue Count', itemField: 'queueCount' , templateFn: function(value, item) { return '<a href="#" onclick="selectQueues(' + item.idx + ')">' + $sanitize(value) + '</a>' }}
|
||||
];
|
||||
|
||||
ctrl.refresh = function () {
|
||||
ctrl.refreshed = true;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
ctrl.reset = function () {
|
||||
ctrl.filter.values.field = "";
|
||||
ctrl.filter.values.operation = "";
|
||||
ctrl.filter.values.value = "";
|
||||
ctrl.filter.sortOrder = "asc";
|
||||
ctrl.filter.sortColumn = "id";
|
||||
ctrl.refreshed = true;
|
||||
artemisAddress.address = null;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
|
||||
if (artemisAddress.address) {
|
||||
Artemis.log.debug("navigating to address = " + artemisAddress.address.address);
|
||||
ctrl.filter.values.field = ctrl.filter.fieldOptions[1].id;
|
||||
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
|
||||
ctrl.filter.values.value = artemisAddress.address.address;
|
||||
artemisAddress.address = null;
|
||||
}
|
||||
|
||||
selectQueues = function (idx) {
|
||||
var address = ctrl.addresses[idx].name;
|
||||
Artemis.log.debug("navigating to queues:" + address)
|
||||
artemisAddress.address = { address: address };
|
||||
$location.path("artemis/artemisQueues");
|
||||
};
|
||||
|
||||
function navigateToAddressAtts(action, item) {
|
||||
$location.path("artemis/attributes").search({"tab": "artemis", "nid": getAddressNid(item.name, $location)});
|
||||
};
|
||||
function navigateToAddressOps(action, item) {
|
||||
$location.path("artemis/operations").search({"tab": "artemis", "nid": getAddressNid(item.name, $location)});
|
||||
};
|
||||
function getAddressNid(address, $location) {
|
||||
var rootNID = getRootNid($location);
|
||||
var targetNID = rootNID + "addresses-" + address;
|
||||
Artemis.log.debug("targetNID=" + targetNID);
|
||||
return targetNID;
|
||||
}
|
||||
function getRootNid($location) {
|
||||
var currentNid = $location.search()['nid'];
|
||||
Artemis.log.debug("current nid=" + currentNid);
|
||||
var firstDash = currentNid.indexOf('-');
|
||||
var secondDash = currentNid.indexOf('-', firstDash + 1);
|
||||
var thirdDash = currentNid.indexOf('-', secondDash + 1);
|
||||
if (thirdDash < 0) {
|
||||
return currentNid + "-";
|
||||
}
|
||||
var rootNID = currentNid.substring(0, thirdDash + 1);
|
||||
return rootNID;
|
||||
}
|
||||
ctrl.loadOperation = function () {
|
||||
if (mbean) {
|
||||
var method = 'listAddresses(java.lang.String, int, int)';
|
||||
var addressFilter = {
|
||||
field: ctrl.filter.values.field,
|
||||
operation: ctrl.filter.values.operation,
|
||||
value: ctrl.filter.values.value,
|
||||
sortOrder: ctrl.filter.values.sortOrder,
|
||||
sortColumn: ctrl.filter.values.sortColumn
|
||||
};
|
||||
|
||||
if (ctrl.refreshed == true) {
|
||||
ctrl.pagination.reset();
|
||||
ctrl.refreshed = false;
|
||||
}
|
||||
jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [JSON.stringify(addressFilter), ctrl.pagination.pageNumber, ctrl.pagination.pageSize] }, Core.onSuccess(populateTable, { error: onError }));
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.pagination.setOperation(ctrl.loadOperation);
|
||||
|
||||
function onError(response) {
|
||||
Core.notification("error", "could not invoke list sessions" + response.error);
|
||||
$scope.workspace.selectParentNode();
|
||||
};
|
||||
|
||||
function populateTable(response) {
|
||||
var data = JSON.parse(response.value);
|
||||
ctrl.addresses = [];
|
||||
angular.forEach(data["data"], function (value, idx) {
|
||||
value.idx = idx;
|
||||
ctrl.addresses.push(value);
|
||||
});
|
||||
ctrl.pagination.page(data["count"]);
|
||||
allAddresses = ctrl.addresses;
|
||||
ctrl.addresses = allAddresses;
|
||||
Core.$apply($scope);
|
||||
}
|
||||
|
||||
ctrl.pagination.load();
|
||||
}
|
||||
AddressesController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage', 'artemisMessage', '$location', '$timeout', '$filter', '$sanitize', 'pagination', 'artemisAddress'];
|
||||
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,295 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis.log.debug("loading connections");
|
||||
Artemis._module.component('artemisConnections', {
|
||||
template:
|
||||
`
|
||||
<h1>Browse Connections
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'connections-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
<div ng-include="'plugin/artemistoolbar.html'"></div>
|
||||
<pf-table-view config="$ctrl.tableConfig"
|
||||
dt-options="$ctrl.dtOptions"
|
||||
columns="$ctrl.tableColumns"
|
||||
action-buttons="$ctrl.tableActionButtons"
|
||||
items="$ctrl.connections">
|
||||
</pf-table-view>
|
||||
<div ng-include="'plugin/artemispagination.html'"></div>
|
||||
<div hawtio-confirm-dialog="$ctrl.closeDialog" title="Close Connection?"
|
||||
ok-button-text="Close"
|
||||
cancel-button-text="Cancel"
|
||||
on-ok="$ctrl.closeConnection()">
|
||||
<div class="dialog-body">
|
||||
<p class="alert alert-warning">
|
||||
<span class="pficon pficon-warning-triangle-o"></span>
|
||||
You are about to close the selected connection: {{$ctrl.connectionToDelete}}
|
||||
<p>Are you sure you want to continue.</p>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/ng-template" id="connections-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to browse all connections currently connected to the broker, including client, cluster
|
||||
and bridge connections. These can be narrowed down by specifying a filter and also sorted using the sort
|
||||
function in the toolbar. To execute a query click on the <span class="fa fa-search"></span> button.
|
||||
</p>
|
||||
<p>
|
||||
Connections can be closed by using the <code>close</code> button under the <code>Actions</code> column and you can
|
||||
navigate to the connections sessions open by clicking on the <code>Session Count</code> field.
|
||||
</p>
|
||||
<p>
|
||||
Note that each page is loaded in from the broker when navigating to a new page or when a query is executed.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: ConnectionsController
|
||||
})
|
||||
.name;
|
||||
|
||||
|
||||
function ConnectionsController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisConnection, artemisSession) {
|
||||
var ctrl = this;
|
||||
ctrl.pagination = pagination;
|
||||
ctrl.pagination.reset();
|
||||
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
ctrl.allConnections = [];
|
||||
ctrl.connections = [];
|
||||
ctrl.pageNumber = 1;
|
||||
ctrl.workspace = workspace;
|
||||
ctrl.refreshed = false;
|
||||
ctrl.connectionToDelete = '';
|
||||
ctrl.closeDialog = false;
|
||||
ctrl.dtOptions = {
|
||||
// turn of ordering as we do it ourselves
|
||||
ordering: false,
|
||||
columns: [
|
||||
{name: "ID", visible: true},
|
||||
{name: "Client ID", visible: true},
|
||||
{name: "Users", visible: true},
|
||||
{name: "Protocol", visible: true},
|
||||
{name: "Session Count", visible: true},
|
||||
{name: "Remote Address", visible: true},
|
||||
{name: "Local Address", visible: true},
|
||||
{name: "Session ID", visible: true},
|
||||
{name: "Creation Time", visible: true}
|
||||
]
|
||||
};
|
||||
|
||||
Artemis.log.debug('localStorage: connectionsColumnDefs =', localStorage.getItem('connectionsColumnDefs'));
|
||||
if (localStorage.getItem('connectionsColumnDefs')) {
|
||||
loadedDefs = JSON.parse(localStorage.getItem('connectionsColumnDefs'));
|
||||
//sanity check to make sure columns havent been added
|
||||
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
|
||||
ctrl.dtOptions.columns = loadedDefs;
|
||||
}
|
||||
Artemis.log.debug('loaded' + ctrl.dtOptions.columns);
|
||||
}
|
||||
|
||||
ctrl.updateColumns = function () {
|
||||
var attributes = [];
|
||||
ctrl.dtOptions.columns.forEach(function (column) {
|
||||
attributes.push({name: column.name, visible: column.visible});
|
||||
});
|
||||
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
|
||||
localStorage.setItem('connectionsColumnDefs', JSON.stringify(attributes));
|
||||
}
|
||||
|
||||
ctrl.filter = {
|
||||
fieldOptions: [
|
||||
{id: 'connectionID', name: 'ID'},
|
||||
{id: 'clientID', name: 'Client ID'},
|
||||
{id: 'users', name: 'Users'},
|
||||
{id: 'protocol', name: 'Protocol'},
|
||||
{id: 'sessionCount', name: 'Session Count'},
|
||||
{id: 'remoteAddress', name: 'Remote Address'},
|
||||
{id: 'localAddress', name: 'Local Address'},
|
||||
{id: 'sessionID', name: 'Session ID'}
|
||||
],
|
||||
operationOptions: [
|
||||
{id: 'EQUALS', name: 'Equals'},
|
||||
{id: 'CONTAINS', name: 'Contains'},
|
||||
{id: 'NOT_CONTAINS', name: 'Does Not Contain'},
|
||||
{id: 'GREATER_THAN', name: 'Greater Than'},
|
||||
{id: 'LESS_THAN', name: 'Less Than'}
|
||||
],
|
||||
sortOptions: [
|
||||
{id: 'asc', name: 'ascending'},
|
||||
{id: 'desc', name: 'descending'}
|
||||
],
|
||||
values: {
|
||||
field: "",
|
||||
operation: "",
|
||||
value: "",
|
||||
sortOrder: "asc",
|
||||
sortColumn: "connectionID"
|
||||
},
|
||||
text: {
|
||||
fieldText: "Filter Field..",
|
||||
operationText: "Operation..",
|
||||
sortOrderText: "ascending",
|
||||
sortByText: "ID"
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.tableActionButtons = [
|
||||
{
|
||||
name: 'Close',
|
||||
title: 'Close the Connection',
|
||||
actionFn: openCloseDialog
|
||||
}
|
||||
];
|
||||
|
||||
ctrl.tableConfig = {
|
||||
selectionMatchProp: 'connectionID',
|
||||
showCheckboxes: false
|
||||
};
|
||||
ctrl.tableColumns = [
|
||||
{ header: 'ID', itemField: 'connectionID' },
|
||||
{ header: 'Client ID', itemField: 'clientID' },
|
||||
{ header: 'Users', itemField: 'users' },
|
||||
{ header: 'protocol', itemField: 'protocol' },
|
||||
{ header: 'Session Count', itemField: 'sessionCount', templateFn: function(value, item) { return '<a href="#" onclick="selectSessions(' + item.idx + ')">' + $sanitize(value) + '</a>' }},
|
||||
{ header: 'Remote Address', itemField: 'remoteAddress' },
|
||||
{ header: 'Local Address', itemField: 'localAddress' },
|
||||
{ header: 'Creation Time', itemField: 'creationTime' }
|
||||
];
|
||||
|
||||
selectSessions = function (idx) {
|
||||
var connection = ctrl.connections[idx].connectionID;
|
||||
Artemis.log.debug("navigating to connection:" + connection)
|
||||
artemisConnection.connection = { connectionID: connection };
|
||||
$location.path("artemis/artemisSessions");
|
||||
};
|
||||
|
||||
if (artemisSession.session) {
|
||||
Artemis.log.debug("navigating to session = " + artemisSession.session.connectionID);
|
||||
ctrl.filter.values.field = ctrl.filter.fieldOptions[0].id;
|
||||
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
|
||||
ctrl.filter.values.value = artemisSession.session.connectionID;
|
||||
artemisSession.session = null;
|
||||
}
|
||||
|
||||
ctrl.refresh = function () {
|
||||
ctrl.refreshed = true;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
ctrl.reset = function () {
|
||||
ctrl.filter.values.field = "";
|
||||
ctrl.filter.values.operation = "";
|
||||
ctrl.filter.values.value = "";
|
||||
ctrl.filter.sortOrder = "asc";
|
||||
ctrl.filter.sortColumn = "connectionID";
|
||||
ctrl.filter.text.fieldText = "Filter Field..";
|
||||
ctrl.filter.text.operationText = "Operation..";
|
||||
ctrl.filter.text.sortOrderText = "ascending";
|
||||
ctrl.filter.text.sortByText = "ID";
|
||||
ctrl.refreshed = true;
|
||||
artemisSession.session = null;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
|
||||
ctrl.loadOperation = function () {
|
||||
if (mbean) {
|
||||
var method = 'listConnections(java.lang.String, int, int)';
|
||||
var connectionsFilter = {
|
||||
field: ctrl.filter.values.field,
|
||||
operation: ctrl.filter.values.operation,
|
||||
value: ctrl.filter.values.value,
|
||||
sortOrder: ctrl.filter.values.sortOrder,
|
||||
sortColumn: ctrl.filter.values.sortColumn
|
||||
};
|
||||
|
||||
if (ctrl.refreshed == true) {
|
||||
ctrl.pagination.reset();
|
||||
ctrl.refreshed = false;
|
||||
}
|
||||
Artemis.log.info(JSON.stringify(connectionsFilter));
|
||||
jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [JSON.stringify(connectionsFilter), ctrl.pagination.pageNumber, ctrl.pagination.pageSize] }, Core.onSuccess(populateTable, { error: onError }));
|
||||
}
|
||||
};
|
||||
|
||||
function openCloseDialog(action, item) {
|
||||
ctrl.connectionToDelete = item.connectionID;
|
||||
ctrl.closeDialog = true;
|
||||
}
|
||||
|
||||
ctrl.closeConnection = function () {
|
||||
Artemis.log.debug("closing connection: " + ctrl.connectionToDelete);
|
||||
if (mbean) {
|
||||
jolokia.request({ type: 'exec',
|
||||
mbean: mbean,
|
||||
operation: 'closeConnectionWithID(java.lang.String)',
|
||||
arguments: [ctrl.connectionToDelete] },
|
||||
Core.onSuccess(ctrl.pagination.load(), { error: function (response) {
|
||||
Core.defaultJolokiaErrorHandler("Could not close connection: " + response);
|
||||
}}));
|
||||
}
|
||||
};
|
||||
|
||||
pagination.setOperation(ctrl.loadOperation);
|
||||
|
||||
function onError(response) {
|
||||
Core.notification("error", "could not invoke list connections" + response.error);
|
||||
$scope.workspace.selectParentNode();
|
||||
};
|
||||
|
||||
function populateTable(response) {
|
||||
var data = JSON.parse(response.value);
|
||||
ctrl.connections = [];
|
||||
angular.forEach(data["data"], function (value, idx) {
|
||||
value.idx = idx;
|
||||
ctrl.connections.push(value);
|
||||
});
|
||||
ctrl.pagination.page(data["count"]);
|
||||
allConnections = ctrl.connections;
|
||||
ctrl.connections = allConnections;
|
||||
Core.$apply($scope);
|
||||
}
|
||||
|
||||
ctrl.pagination.load();
|
||||
}
|
||||
ConnectionsController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage', 'artemisMessage', '$location', '$timeout', '$filter', '$sanitize', 'pagination', 'artemisConnection', 'artemisSession'];
|
||||
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,320 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis._module.component('artemisConsumers', {
|
||||
template:
|
||||
`<h1>Browse Consumers
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'consumers-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
<div ng-include="'plugin/artemistoolbar.html'"></div>
|
||||
<pf-table-view config="$ctrl.tableConfig"
|
||||
dt-options="$ctrl.dtOptions"
|
||||
columns="$ctrl.tableColumns"
|
||||
action-buttons="$ctrl.tableActionButtons"
|
||||
items="$ctrl.consumers">
|
||||
</pf-table-view>
|
||||
<div ng-include="'plugin/artemispagination.html'"></div>
|
||||
<div hawtio-confirm-dialog="$ctrl.closeDialog" title="Close Consumer?"
|
||||
ok-button-text="Close"
|
||||
cancel-button-text="Cancel"
|
||||
on-ok="$ctrl.closeConsumer()">
|
||||
<div class="dialog-body">
|
||||
<p class="alert alert-warning">
|
||||
<span class="pficon pficon-warning-triangle-o"></span>
|
||||
You are about to close the selected consumer: {{$ctrl.consumerToDelete}}
|
||||
<p>Are you sure you want to continue.</p>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/ng-template" id="consumers-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to browse all consumers currently open on the broker. These can be narrowed down
|
||||
by specifying a filter and also sorted using the sort function in the toolbar. To execute a query
|
||||
click on the <span class="fa fa-search"></span> button.
|
||||
</p>
|
||||
<p>
|
||||
Consumers can be closed by using the <code>close</code> button under the <code>Actions</code> column and you can
|
||||
navigate to the consumers session, address and queue by clicking on the appropriate field.
|
||||
</p>
|
||||
<p>
|
||||
Note that each page is loaded in from the broker when navigating to a new page or when a query is executed.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: ConsumersController
|
||||
})
|
||||
.name;
|
||||
|
||||
|
||||
function ConsumersController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisConsumer, artemisQueue, artemisAddress, artemisSession) {
|
||||
var ctrl = this;
|
||||
ctrl.pagination = pagination;
|
||||
ctrl.pagination.reset();
|
||||
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
ctrl.allConsumers = [];
|
||||
ctrl.consumers = [];
|
||||
ctrl.pageNumber = 1;
|
||||
ctrl.workspace = workspace;
|
||||
ctrl.refreshed = false;
|
||||
ctrl.consumerToDeletesSession = '';
|
||||
ctrl.consumerToDelete = '';
|
||||
ctrl.closeDialog = false;
|
||||
ctrl.dtOptions = {
|
||||
// turn of ordering as we do it ourselves
|
||||
ordering: false,
|
||||
columns: [
|
||||
{name: "ID", visible: true},
|
||||
{name: "Session", visible: true},
|
||||
{name: "Client ID", visible: true},
|
||||
{name: "Protocol", visible: true},
|
||||
{name: "Queue", visible: true},
|
||||
{name: "Queue Type", visible: true},
|
||||
{name: "Filter", visible: true},
|
||||
{name: "Address", visible: true},
|
||||
{name: "Remote Address", visible: true},
|
||||
{name: "Local Address", visible: true},
|
||||
{name: "Creation Time", visible: true}
|
||||
]
|
||||
};
|
||||
|
||||
Artemis.log.debug('localStorage: consumersColumnDefs =', localStorage.getItem('consumersColumnDefs'));
|
||||
if (localStorage.getItem('consumersColumnDefs')) {
|
||||
loadedDefs = JSON.parse(localStorage.getItem('consumersColumnDefs'));
|
||||
//sanity check to make sure columns havent been added
|
||||
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
|
||||
ctrl.dtOptions.columns = loadedDefs;
|
||||
}
|
||||
}
|
||||
|
||||
ctrl.updateColumns = function () {
|
||||
var attributes = [];
|
||||
ctrl.dtOptions.columns.forEach(function (column) {
|
||||
attributes.push({name: column.name, visible: column.visible});
|
||||
});
|
||||
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
|
||||
localStorage.setItem('consumersColumnDefs', JSON.stringify(attributes));
|
||||
}
|
||||
ctrl.filter = {
|
||||
fieldOptions: [
|
||||
{id: 'id', name: 'ID'},
|
||||
{id: 'session', name: 'Session'},
|
||||
{id: 'clientID', name: 'Client ID'},
|
||||
{id: 'user', name: 'User'},
|
||||
{id: 'address', name: 'Address'},
|
||||
{id: 'queue', name: 'Queue'},
|
||||
{id: 'protocol', name: 'Protocol'},
|
||||
{id: 'localAddress', name: 'Local Address'},
|
||||
{id: 'remoteAddress', name: 'Remote Address'}
|
||||
],
|
||||
operationOptions: [
|
||||
{id: 'EQUALS', name: 'Equals'},
|
||||
{id: 'CONTAINS', name: 'Contains'},
|
||||
{id: 'NOT_CONTAINS', name: 'Does Not Contain'},
|
||||
{id: 'GREATER_THAN', name: 'Greater Than'},
|
||||
{id: 'LESS_THAN', name: 'Less Than'}
|
||||
],
|
||||
sortOptions: [
|
||||
{id: 'asc', name: 'ascending'},
|
||||
{id: 'desc', name: 'descending'}
|
||||
],
|
||||
values: {
|
||||
field: "",
|
||||
operation: "",
|
||||
value: "",
|
||||
sortOrder: "asc",
|
||||
sortColumn: "id"
|
||||
},
|
||||
text: {
|
||||
fieldText: "Filter Field..",
|
||||
operationText: "Operation..",
|
||||
sortOrderText: "ascending",
|
||||
sortByText: "ID"
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.tableActionButtons = [
|
||||
{
|
||||
name: 'Close',
|
||||
title: 'Close the Consumer',
|
||||
actionFn: openCloseDialog
|
||||
}
|
||||
];
|
||||
ctrl.tableConfig = {
|
||||
selectionMatchProp: 'id',
|
||||
showCheckboxes: false
|
||||
};
|
||||
ctrl.tableColumns = [
|
||||
{ header: 'ID', itemField: 'id' },
|
||||
{ header: 'Session', itemField: 'session' , templateFn: function(value, item) { return '<a href="#" onclick="selectSession(' + item.idx + ')">' + $sanitize(value) + '</a>' }},
|
||||
{ header: 'Client ID', itemField: 'clientID' },
|
||||
{ header: 'Protocol', itemField: 'protocol' },
|
||||
{ header: 'Queue', itemField: 'queue', templateFn: function(value, item) { return '<a href="#" onclick="selectQueue(' + item.idx + ')">' + $sanitize(value) + '</a>' }},
|
||||
{ header: 'Queue Type', itemField: 'queueType' },
|
||||
{ header: 'Filter', itemField: 'filter' },
|
||||
{ header: 'Address', itemField: 'address' , templateFn: function(value, item) { return '<a href="#" onclick="selectAddress(' + item.idx + ')">' + $sanitize(value) + '</a>' }},
|
||||
{ header: 'Remote Address', itemField: 'remoteAddress' },
|
||||
{ header: 'Local Address', itemField: 'localAddress' },
|
||||
{ header: 'Creation Time', itemField: 'creationTime' }
|
||||
];
|
||||
|
||||
ctrl.refresh = function () {
|
||||
ctrl.refreshed = true;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
ctrl.reset = function () {
|
||||
ctrl.filter.values.field = "";
|
||||
ctrl.filter.values.operation = "";
|
||||
ctrl.filter.values.value = "";
|
||||
ctrl.filter.sortOrder = "asc";
|
||||
ctrl.filter.sortColumn = "id";
|
||||
ctrl.filter.text.fieldText = "Filter Field..";
|
||||
ctrl.filter.text.operationText = "Operation..";
|
||||
ctrl.filter.text.sortOrderText = "ascending";
|
||||
ctrl.filter.text.sortByText = "ID";
|
||||
ctrl.refreshed = true;
|
||||
artemisConsumer.consumer = null;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
|
||||
if (artemisConsumer.consumer) {
|
||||
Artemis.log.debug("navigating to consumer = " + artemisConsumer.consumer.session);
|
||||
ctrl.filter.values.field = ctrl.filter.fieldOptions[1].id;
|
||||
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
|
||||
ctrl.filter.values.value = artemisConsumer.consumer.session;
|
||||
artemisConsumer.consumer = null;
|
||||
}
|
||||
|
||||
if (artemisQueue.queue) {
|
||||
Artemis.log.info("navigating to consumer = " + artemisQueue.queue.queue);
|
||||
ctrl.filter.values.field = ctrl.filter.fieldOptions[5].id;
|
||||
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
|
||||
ctrl.filter.values.value = artemisQueue.queue.queue;
|
||||
artemisQueue.queue = null;
|
||||
}
|
||||
|
||||
selectQueue = function (idx) {
|
||||
var queue = ctrl.consumers[idx].queue;
|
||||
Artemis.log.debug("navigating to queue:" + queue)
|
||||
artemisQueue.queue = { queue: queue };
|
||||
$location.path("artemis/artemisQueues");
|
||||
};
|
||||
|
||||
selectAddress = function (idx) {
|
||||
var address = ctrl.consumers[idx].address;
|
||||
Artemis.log.debug("navigating to address:" + address)
|
||||
artemisAddress.address = { address: address };
|
||||
$location.path("artemis/artemisAddresses");
|
||||
};
|
||||
|
||||
selectSession = function (idx) {
|
||||
var session = ctrl.consumers[idx].session;
|
||||
Artemis.log.debug("navigating to session:" + session)
|
||||
artemisSession.session = { session: session };
|
||||
$location.path("artemis/artemisSessions");
|
||||
};
|
||||
|
||||
function openCloseDialog(action, item) {
|
||||
ctrl.consumerToDelete = item.id;
|
||||
ctrl.consumerToDeletesSession = item.session;
|
||||
ctrl.closeDialog = true;
|
||||
}
|
||||
|
||||
ctrl.closeConsumer = function () {
|
||||
Artemis.log.debug("closing session: " + ctrl.consumerToDelete);
|
||||
if (mbean) {
|
||||
jolokia.request({ type: 'exec',
|
||||
mbean: mbean,
|
||||
operation: 'closeConsumerWithID(java.lang.String,java.lang.String)',
|
||||
arguments: [ctrl.consumerToDeletesSession, ctrl.consumerToDelete] },
|
||||
Core.onSuccess(ctrl.pagination.load(), { error: function (response) {
|
||||
Core.defaultJolokiaErrorHandler("Could not close session: " + response);
|
||||
}}));
|
||||
}
|
||||
};
|
||||
ctrl.loadOperation = function () {
|
||||
if (mbean) {
|
||||
var method = 'listConsumers(java.lang.String, int, int)';
|
||||
var sessionsFilter = {
|
||||
field: ctrl.filter.values.field,
|
||||
operation: ctrl.filter.values.operation,
|
||||
value: ctrl.filter.values.value,
|
||||
sortOrder: ctrl.filter.values.sortOrder,
|
||||
sortColumn: ctrl.filter.values.sortColumn
|
||||
};
|
||||
|
||||
if (ctrl.refreshed == true) {
|
||||
ctrl.pagination.reset();
|
||||
ctrl.refreshed = false;
|
||||
}
|
||||
|
||||
Artemis.log.info(JSON.stringify(sessionsFilter));
|
||||
jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [JSON.stringify(sessionsFilter), ctrl.pagination.pageNumber, ctrl.pagination.pageSize] }, Core.onSuccess(populateTable, { error: onError }));
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.pagination.setOperation(ctrl.loadOperation);
|
||||
|
||||
function onError(response) {
|
||||
Core.notification("error", "could not invoke list sessions" + response.error);
|
||||
$scope.workspace.selectParentNode();
|
||||
};
|
||||
|
||||
function populateTable(response) {
|
||||
var data = JSON.parse(response.value);
|
||||
ctrl.consumers = [];
|
||||
angular.forEach(data["data"], function (value, idx) {
|
||||
value.idx = idx;
|
||||
ctrl.consumers.push(value);
|
||||
});
|
||||
ctrl.pagination.page(data["count"]);
|
||||
allConsumers = ctrl.consumers;
|
||||
ctrl.consumers = allConsumers;
|
||||
Core.$apply($scope);
|
||||
}
|
||||
|
||||
ctrl.pagination.load();
|
||||
}
|
||||
ConsumersController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage', 'artemisMessage', '$location', '$timeout', '$filter', '$sanitize', 'pagination', 'artemisConsumer', 'artemisQueue', 'artemisAddress', 'artemisSession'];
|
||||
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,158 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/// <reference path="tree.component.ts"/>
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis._module.component('artemisCreateAddress', {
|
||||
template:
|
||||
`
|
||||
<h1>Create Address
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'create-address-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
<form class="form-horizontal">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="name-markup">Address name</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<input id="name-markup" class="form-control" type="text" maxlength="300"
|
||||
name="addressName" ng-model="$ctrl.addressName" placeholder="Address name"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Routing type</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<label class="checkbox">
|
||||
<input type="radio" ng-model="$ctrl.routingType" value="Multicast"> Multicast
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="radio" ng-model="$ctrl.routingType" value="Anycast"> Anycast
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="radio" ng-model="$ctrl.routingType" value="Both"> Both
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-primary"
|
||||
ng-click="$ctrl.createAddress($ctrl.addressName, $ctrl.routingType)"
|
||||
ng-disabled="!$ctrl.addressName">Create Address
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hawtio-confirm-dialog="$ctrl.createDialog"
|
||||
ok-button-text="Create"
|
||||
cancel-button-text="Cancel"
|
||||
on-ok="$ctrl.createAddress($ctrl.addressName, $ctrl.routingType)">
|
||||
<div class="dialog-body">
|
||||
<p>Address name <b>{{$ctrl.addressName}}</b> contains unrecommended characters: <code>:</code></p>
|
||||
<p>This may cause unexpected problems. Are you really sure to create this {{$ctrl.uncapitalisedDestinationType()}}?</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<script type="text/ng-template" id="create-address-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to create a new address on the broker, if you want the address to support JMS like
|
||||
queues, i.e. point to point, then choose anycast. If you want your address to support JMS like topic
|
||||
subscriptions, publish/subscribe, then choose multicast.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: CreateAddressController
|
||||
})
|
||||
.name;
|
||||
Artemis.log.debug("loaded address " + Artemis.addressModule);
|
||||
|
||||
function CreateAddressController($scope, workspace, jolokia, localStorage) {
|
||||
Artemis.log.debug("loaded address controller");
|
||||
var ctrl = this;
|
||||
ctrl.addressName = "";
|
||||
ctrl.routingType = "Anycast";
|
||||
ctrl.workspace = workspace;
|
||||
ctrl.message = "";
|
||||
|
||||
$scope.$watch('workspace.selection', function () {
|
||||
workspace.moveIfViewInvalid();
|
||||
});
|
||||
|
||||
function operationSuccess() {
|
||||
ctrl.addressName = "";
|
||||
ctrl.workspace.operationCounter += 1;
|
||||
Core.$apply($scope);
|
||||
Core.notification("success", $scope.message);
|
||||
ctrl.workspace.loadTree();
|
||||
}
|
||||
|
||||
function onError(response) {
|
||||
Core.notification("error", "Could not create address: " + response.error);
|
||||
}
|
||||
|
||||
ctrl.createAddress = function (name, routingType) {
|
||||
Artemis.log.debug("creating " + routingType);
|
||||
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
if (mbean) {
|
||||
if (routingType == "Multicast") {
|
||||
$scope.message = "Created Multicast Address " + name;
|
||||
Artemis.log.debug(ctrl.message);
|
||||
jolokia.execute(mbean, "createAddress(java.lang.String,java.lang.String)", name, "MULTICAST", Core.onSuccess(operationSuccess, { error: onError }));
|
||||
}
|
||||
else if (routingType == "Anycast") {
|
||||
$scope.message = "Created Anycast Address " + name;
|
||||
Artemis.log.debug(ctrl.message);
|
||||
jolokia.execute(mbean, "createAddress(java.lang.String,java.lang.String)", name, "ANYCAST", Core.onSuccess(operationSuccess, { error: onError }));
|
||||
}
|
||||
else {
|
||||
$scope.message = "Created Anycast/Multicast Address " + name;
|
||||
Artemis.log.debug(ctrl.message);
|
||||
jolokia.execute(mbean, "createAddress(java.lang.String,java.lang.String)", name, "ANYCAST,MULTICAST", Core.onSuccess(operationSuccess, { error: onError }));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
CreateAddressController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,238 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/// <reference path="tree.component.ts"/>
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis._module.component('artemisCreateQueue', {
|
||||
template:
|
||||
`
|
||||
<h1>Create Queue
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'create-queue-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
<form class="form-horizontal">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="name-markup">Queue name</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<input id="name-markup" class="form-control" type="text" maxlength="300"
|
||||
name="queueName" ng-model="$ctrl.queueName" placeholder="Queue name"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Routing type</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<label class="checkbox">
|
||||
<input type="radio" ng-model="$ctrl.routingType" value="Anycast"> Anycast
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="radio" ng-model="$ctrl.routingType" value="Multicast"> Multicast
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Durable</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" ng-model="$ctrl.durable">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="filter-markup">Filter</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<input id="filter-markup" class="form-control" type="text" maxlength="300"
|
||||
name="filter" ng-model="$ctrl.filter" placeholder="Filter"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="maxConsumers-markup">Max consumers</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<input id="maxConsumers-markup" class="form-control" type="integer" maxlength="300"
|
||||
name="filter" ng-model="$ctrl.maxConsumers" placeholder="Max consumers"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Purge when no consumers</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" ng-model="$ctrl.purgeWhenNoConsumers">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-primary"
|
||||
ng-click="$ctrl.createQueue($ctrl.queueName, $ctrl.routingType, $ctrl.durable, $ctrl.filter, $ctrl.maxConsumers, $ctrl.purgeWhenNoConsumers)"
|
||||
ng-disabled="!$ctrl.queueName">Create Queue
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hawtio-confirm-dialog="$ctrl.createDialog"
|
||||
ok-button-text="Create"
|
||||
cancel-button-text="Cancel"
|
||||
on-ok="$ctrl.createQueue($ctrl.queueName, $ctrl.routingType, $ctrl.durable, $ctrl.filter, $ctrl.maxConsumers, $ctrl.purgeWhenNoConsumers)">
|
||||
<div class="dialog-body">
|
||||
<p>Queue name <b>{{$ctrl.queueName}}</b> contains unrecommended characters: <code>:</code></p>
|
||||
<p>This may cause unexpected problems. Are you really sure to create this {{$ctrl.uncapitalisedDestinationType()}}?</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<script type="text/ng-template" id="create-queue-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to create a queue bound to the chosen address.
|
||||
</p>
|
||||
<p>
|
||||
if you want the queue to support JMS like queues, i.e. point to point, then choose anycast. If you
|
||||
want your address to support JMS like topic subscriptions, publish/subscribe, then choose multicast.
|
||||
</p>
|
||||
<p>
|
||||
Selecting durable means that the queue will survive a restart of the broker.
|
||||
</p>
|
||||
<p>
|
||||
Adding a filter expression will mean that only messages that match that filter will be routed to this queue:
|
||||
see <a href="https://activemq.apache.org/components/artemis/documentation/latest/filter-expressions.html" target="_blank">Filter Expressions</a>
|
||||
</p>
|
||||
<p>
|
||||
Max consumers will limit how many consumers can consume from a queue at any one time, -1 means no limit.
|
||||
</p>
|
||||
<p>
|
||||
Purge on no consumers means the queue will not start receiving messages until a consumer is attached.
|
||||
When the last consumer is detached from the queue. The queue is purged (its messages are removed)
|
||||
and will not receive any more messages until a new consumer is attached.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: CreateQueueController
|
||||
})
|
||||
.name;
|
||||
Artemis.log.debug("loaded queue " + Artemis.createQueueModule);
|
||||
|
||||
function CreateQueueController($scope, workspace, jolokia, localStorage) {
|
||||
Artemis.log.debug("loaded queue controller");
|
||||
var ctrl = this;
|
||||
Core.initPreferenceScope($scope, localStorage, {
|
||||
'durable': {
|
||||
'value': true,
|
||||
'converter': Core.parseBooleanValue
|
||||
},
|
||||
'maxConsumers': {
|
||||
'value': -1,
|
||||
'converter': parseInt,
|
||||
'formatter': parseInt
|
||||
},
|
||||
'purgeWhenNoConsumers': {
|
||||
'value': false,
|
||||
'converter': Core.parseBooleanValue
|
||||
}
|
||||
});
|
||||
var artemisJmxDomain = localStorage['artemisJmxDomain'] || "org.apache.activemq.artemis";
|
||||
ctrl.workspace = workspace;
|
||||
ctrl.maxConsumers = -1;
|
||||
ctrl.routingType = "Anycast";
|
||||
ctrl.filter = "";
|
||||
ctrl.purgeWhenNoConsumers = false;
|
||||
ctrl.durable = true;
|
||||
ctrl.queueName = '';
|
||||
|
||||
$scope.$watch('workspace.selection', function () {
|
||||
workspace.moveIfViewInvalid();
|
||||
});
|
||||
|
||||
function operationSuccess() {
|
||||
ctrl.queueName = "";
|
||||
ctrl.workspace.operationCounter += 1;
|
||||
Core.$apply($scope);
|
||||
Core.notification("success", $scope.message);
|
||||
ctrl.workspace.loadTree();
|
||||
}
|
||||
function onError(response) {
|
||||
Core.notification("error", "Could not create queue: " + response.error);
|
||||
}
|
||||
this.createQueue = function (queueName, routingType, durable, filter, maxConsumers, purgeWhenNoConsumers) {
|
||||
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
if (mbean) {
|
||||
var selection = workspace.selection;
|
||||
var entries = selection.entries;
|
||||
var address = entries["address"];
|
||||
if (address.charAt(0) === '"' && address.charAt(address.length -1) === '"')
|
||||
{
|
||||
address = address.substr(1,address.length -2);
|
||||
}
|
||||
address = unescape(address)
|
||||
$scope.message = "Created queue " + queueName + " durable=" + durable + " filter=" + filter + " routing type=" + routingType + " max consumers=" + maxConsumers + " purge..=" + purgeWhenNoConsumers + " on address " + address;
|
||||
if (routingType == "Multicast") {
|
||||
Artemis.log.debug($scope.message);
|
||||
jolokia.execute(mbean, "createQueue(java.lang.String,java.lang.String,java.lang.String,java.lang.String,boolean,int,boolean,boolean)", address, "MULTICAST", queueName, filter, durable, maxConsumers, purgeWhenNoConsumers, true, Core.onSuccess(operationSuccess, { error: onError }));
|
||||
} else {
|
||||
Artemis.log.debug($scope.message);
|
||||
jolokia.execute(mbean, "createQueue(java.lang.String,java.lang.String,java.lang.String,java.lang.String,boolean,int,boolean,boolean)", address, "ANYCAST", queueName, filter, durable, maxConsumers, purgeWhenNoConsumers, true, Core.onSuccess(operationSuccess, { error: onError }));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// unescape name from JMX https://docs.oracle.com/en/java/javase/11/docs/api/java.management/javax/management/ObjectName.html#quote(java.lang.String)
|
||||
function unescape(input) {
|
||||
var result = input;
|
||||
|
||||
result = result.replace('\\"', '"');
|
||||
result = result.replace("\\*", "*");
|
||||
result = result.replace("\\?", "?");
|
||||
result = result.replace("\\\\", "\\");
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
CreateQueueController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,145 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/// <reference path="tree.component.ts"/>
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis._module.component('artemisDeleteAddress', {
|
||||
template:
|
||||
`
|
||||
<h1>Delete Address
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'delete-address-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
<p>
|
||||
<div class="alert alert-warning">
|
||||
<span class="pficon pficon-warning-triangle-o"></span>
|
||||
This operation cannot be undone. Please be careful!
|
||||
</div>
|
||||
</p>
|
||||
|
||||
<h2>Delete address</h2>
|
||||
<p>Remove the address completely.</p>
|
||||
<button type="submit" class="btn btn-danger" ng-click="$ctrl.deleteDialog = true">
|
||||
Delete address
|
||||
</button>
|
||||
|
||||
<div hawtio-confirm-dialog="$ctrl.deleteDialog"
|
||||
title="Confirm delete address"
|
||||
ok-button-text="Delete"
|
||||
cancel-button-text="Cancel"
|
||||
on-ok="$ctrl.deleteAddress()">
|
||||
<div class="dialog-body">
|
||||
<p>You are about to delete address <b>{{ $ctrl.selectedName() }}</b>.</p>
|
||||
<p>This operation cannot be undone so please be careful.</p>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/ng-template" id="delete-address-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to delete the chosen address on the broker.
|
||||
</p>
|
||||
<p>
|
||||
Note that this will only succeed if the address has no queues bound to it.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: DeleteAddressController
|
||||
})
|
||||
.name;
|
||||
Artemis.log.debug("loaded address " + Artemis.addressModule);
|
||||
|
||||
function DeleteAddressController($scope, workspace, jolokia, localStorage) {
|
||||
var ctrl = this;
|
||||
ctrl.workspace = workspace;
|
||||
ctrl.deleteDialog = false;
|
||||
|
||||
$onInit = function () {
|
||||
Artemis.log.debug("loaded address controller");
|
||||
}
|
||||
|
||||
$scope.$watch('workspace.selection', function () {
|
||||
workspace.moveIfViewInvalid();
|
||||
});
|
||||
|
||||
function operationSuccess() {
|
||||
// lets set the selection to the parent
|
||||
workspace.removeAndSelectParentNode();
|
||||
ctrl.workspace.operationCounter += 1;
|
||||
Core.$apply($scope);
|
||||
Core.notification("success", $scope.message);
|
||||
ctrl.workspace.loadTree();
|
||||
}
|
||||
|
||||
function onError(response) {
|
||||
Core.notification("error", "Could not delete address: " + response.error);
|
||||
}
|
||||
|
||||
ctrl.deleteAddress = function () {
|
||||
var selection = workspace.selection;
|
||||
var entries = selection.entries;
|
||||
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
Artemis.log.debug(mbean);
|
||||
if (mbean) {
|
||||
if (selection && jolokia && entries) {
|
||||
var domain = selection.domain;
|
||||
var name = entries["address"];
|
||||
Artemis.log.debug("name = " + name)
|
||||
name = Core.unescapeHTML(name);
|
||||
if (name.charAt(0) === '"' && name.charAt(name.length -1) === '"')
|
||||
{
|
||||
name = name.substr(1,name.length -2);
|
||||
}
|
||||
name = Artemis.ownUnescape(name);
|
||||
Artemis.log.debug(name);
|
||||
var operation;
|
||||
$scope.message = "Deleted address " + name;
|
||||
jolokia.execute(mbean, "deleteAddress(java.lang.String)", name, Core.onSuccess(operationSuccess, { error: onError }));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.selectedName = function () {
|
||||
var selection = ctrl.workspace.selection;
|
||||
return selection ? _.unescape(selection.text) : null;
|
||||
};
|
||||
}
|
||||
DeleteAddressController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,191 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/// <reference path="tree.component.ts"/>
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis._module.component('artemisDeleteQueue', {
|
||||
template:
|
||||
`<p>
|
||||
<div class="alert alert-warning">
|
||||
<span class="pficon pficon-warning-triangle-o"></span>
|
||||
These operations cannot be undone. Please be careful!
|
||||
</div>
|
||||
</p>
|
||||
|
||||
<h2>Delete queue
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'delete-queue-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h2>
|
||||
<p>Remove the queue completely.</p>
|
||||
<button type="submit" class="btn btn-danger" ng-click="$ctrl.deleteDialog = true">
|
||||
Delete Queue
|
||||
</button>
|
||||
|
||||
<div hawtio-confirm-dialog="$ctrl.deleteDialog"
|
||||
title="Confirm delete address"
|
||||
ok-button-text="Delete"
|
||||
cancel-button-text="Cancel"
|
||||
on-ok="$ctrl.deleteQueue()">
|
||||
<div class="dialog-body">
|
||||
<p>You are about to delete queue <b>{{$ctrl.selectedName()}}</b>.</p>
|
||||
<p>This operation cannot be undone so please be careful.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Purge queue
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'purge-queue-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h2>
|
||||
<p>Remove all messages from queue.</p>
|
||||
<button type="submit" class="btn btn-danger" ng-click="$ctrl.purgeDialog = true">
|
||||
Purge Queue
|
||||
</button>
|
||||
|
||||
<div hawtio-confirm-dialog="$ctrl.purgeDialog"
|
||||
title="Confirm purge address"
|
||||
ok-button-text="Purge"
|
||||
cancel-button-text="Cancel"
|
||||
on-ok="$ctrl.purgeQueue()">
|
||||
<div class="dialog-body">
|
||||
<p>You are about to purge queue <b>{{$ctrl.selectedName()}}</b>.</p>
|
||||
<p>This operation cannot be undone so please be careful.</p>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/ng-template" id="delete-queue-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This will delete the queue and all of the messages it holds
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="purge-queue-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This will delete all of the messages held within the queue but will not delete the queue
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: DeleteQueueController
|
||||
})
|
||||
.name;
|
||||
Artemis.log.debug("loaded delete queue " + Artemis.createQueueModule);
|
||||
|
||||
function DeleteQueueController($scope, workspace, jolokia, localStorage) {
|
||||
Artemis.log.debug("loaded queue controller");
|
||||
var ctrl = this;
|
||||
ctrl.workspace = workspace;
|
||||
ctrl.deleteDialog = false;
|
||||
ctrl.purgeDialog = false;
|
||||
|
||||
$scope.$watch('workspace.selection', function () {
|
||||
ctrl.workspace.moveIfViewInvalid();
|
||||
});
|
||||
|
||||
function operationSuccess() {
|
||||
// lets set the selection to the parent
|
||||
ctrl.workspace.removeAndSelectParentNode();
|
||||
ctrl.workspace.operationCounter += 1;
|
||||
Core.$apply($scope);
|
||||
Core.notification("success", $scope.message);
|
||||
ctrl.workspace.loadTree();
|
||||
}
|
||||
|
||||
function onError(response) {
|
||||
Core.notification("error", "Could not delete address: " + response.error);
|
||||
}
|
||||
|
||||
function operationPurgeSuccess() {
|
||||
// lets set the selection to the parent
|
||||
/*$scope.workspace.operationCounter += 1;
|
||||
Core.$apply($scope);*/
|
||||
Core.notification("success", $scope.message);
|
||||
}
|
||||
|
||||
function onPurgeError(response) {
|
||||
Core.notification("error", "Could not purge address: " + response.error);
|
||||
}
|
||||
|
||||
this.deleteQueue = function () {
|
||||
var selection = ctrl.workspace.selection;
|
||||
var entries = selection.entries;
|
||||
var mbean = Artemis.getBrokerMBean(ctrl.workspace, jolokia);
|
||||
Artemis.log.debug(mbean);
|
||||
if (mbean) {
|
||||
if (selection && jolokia && entries) {
|
||||
var domain = selection.domain;
|
||||
var name = entries["queue"];
|
||||
Artemis.log.debug("name = " + name)
|
||||
name = Core.unescapeHTML(name);
|
||||
if (name.charAt(0) === '"' && name.charAt(name.length -1) === '"')
|
||||
{
|
||||
name = name.substr(1,name.length -2);
|
||||
}
|
||||
name = Artemis.ownUnescape(name);
|
||||
Artemis.log.debug(name);
|
||||
var operation;
|
||||
$scope.message = "Deleted queue " + name;
|
||||
jolokia.execute(mbean, "destroyQueue(java.lang.String)", name, Core.onSuccess(operationPurgeSuccess, { error: onError }));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.purgeQueue = function () {
|
||||
var selection = ctrl.workspace.selection;
|
||||
var entries = selection.entries;
|
||||
var mbean = selection.objectName;
|
||||
if (selection && jolokia && entries) {
|
||||
var name = entries["Destination"] || entries["destinationName"] || selection.title;
|
||||
name = Core.unescapeHTML(name);
|
||||
$scope.message = "Purged queue " + name;
|
||||
jolokia.execute(mbean, "removeAllMessages()", Core.onSuccess(operationSuccess, { error: onPurgeError }));
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.selectedName = function () {
|
||||
var selection = ctrl.workspace.selection;
|
||||
return selection ? _.unescape(selection.text) : null;
|
||||
};
|
||||
}
|
||||
DeleteQueueController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,529 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/// <reference path="tree.component.ts"/>
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis._module.component('artemisBrokerDiagram', {
|
||||
template:
|
||||
`<div class="container-topology">
|
||||
<h1>Broker Diagram
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'diagram-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
<!-- Inhibit the context menu of pf-topology for the its items -->
|
||||
<style type="text/css">pf-topology .popup { visibility: hidden; }</style>
|
||||
<pf-topology items="$ctrl.data.items" relations="$ctrl.data.relations" kinds="$ctrl.kinds" icons="$ctrl.data.icons" nodes="$ctrl.nodes" item-selected="$ctrl.itemSelected(item)" search-text="searchText" show-labels="$ctrl.showLabels" tooltip-function="$ctrl.tooltip(node)" chart-rendered="$ctrl.chartRendered(vertices, added)">
|
||||
|
||||
<label style="margin-right: 1em">Show labels:
|
||||
<input type="checkbox" ng-model="$ctrl.showLabels">
|
||||
</label>
|
||||
<label style="margin-right: 1em">Show addresses:
|
||||
<input type="checkbox" ng-model="$ctrl.showAddresses">
|
||||
</label>
|
||||
<label style="margin-right: 1em">Show queues:
|
||||
<input type="checkbox" ng-model="$ctrl.showQueues">
|
||||
</label>
|
||||
<label style="margin-right: 1em">Show internal addresses:
|
||||
<input type="checkbox" ng-model="$ctrl.showInternalAddresses">
|
||||
</label>
|
||||
<label style="margin-right: 1em">Show internal queues:
|
||||
<input type="checkbox" ng-model="$ctrl.showInternalQueues">
|
||||
</label>
|
||||
|
||||
<label style="margin-right: 1em">Show Live Brokers:
|
||||
<input type="checkbox" ng-model="$ctrl.showLiveBrokers">
|
||||
</label>
|
||||
<label style="margin-right: 1em">Show Backup Brokers:
|
||||
<input type="checkbox" ng-model="$ctrl.showBackupBrokers">
|
||||
</label>
|
||||
<label style="margin-right: 1em">Show Connectors:
|
||||
<input type="checkbox" ng-model="$ctrl.showConnectors">
|
||||
</label>
|
||||
<button type="submit" class="btn btn-primary"
|
||||
ng-click="$ctrl.refresh()">Refresh
|
||||
</button>
|
||||
</div>
|
||||
<div ng-show="$ctrl.showAttributes">
|
||||
<pf-table-view
|
||||
config="$ctrl.config"
|
||||
columns="$ctrl.tableColumns"
|
||||
items="$ctrl.attributes">
|
||||
</div>
|
||||
<script type="text/ng-template" id="diagram-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page is a graphical representation of the cluster topology. It will show all the brokers in the cluster
|
||||
as well as well as any Adresses and Queues on the broker the console is connected to.
|
||||
</p>
|
||||
<p>
|
||||
It is possible to view the attributes of the addresses, queues and connected broker by left clicking
|
||||
on each node.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: BrokerDiagramController
|
||||
})
|
||||
.name;
|
||||
|
||||
|
||||
function BrokerDiagramController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter) {
|
||||
Artemis.log.debug("loaded browse " + Artemis.browseQueueModule);
|
||||
var ctrl = this;
|
||||
ctrl.index = 0;
|
||||
ctrl.showLabels = false;
|
||||
ctrl.showAddresses = true;
|
||||
ctrl.showQueues = true;
|
||||
ctrl.showInternalAddresses = false;
|
||||
ctrl.showInternalQueues = false;
|
||||
ctrl.showLiveBrokers = true;
|
||||
ctrl.showBackupBrokers = true;
|
||||
ctrl.showConnectors = true;
|
||||
ctrl.hiddenRelations = [];
|
||||
function updateAddressKind() {
|
||||
if(ctrl.kinds.Address && !ctrl.showAddresses) {
|
||||
delete ctrl.kinds.Address;
|
||||
} else if (!ctrl.kinds.Address && ctrl.showAddresses) {
|
||||
ctrl.kinds.Address = true;
|
||||
}
|
||||
}
|
||||
$scope.$watch('$ctrl.showAddresses', function () {
|
||||
updateAddressKind();
|
||||
});
|
||||
function updateQueueKind() {
|
||||
if(ctrl.kinds.Queue && !ctrl.showQueues) {
|
||||
delete ctrl.kinds.Queue;
|
||||
} else if (!ctrl.kinds.Queue && ctrl.showQueues) {
|
||||
ctrl.kinds.Queue = true;
|
||||
}
|
||||
}
|
||||
$scope.$watch('$ctrl.showQueues', function () {
|
||||
updateQueueKind();
|
||||
});
|
||||
function updateInternalAddressKind() {
|
||||
if(ctrl.kinds.InternalAddress && !ctrl.showInternalAddresses) {
|
||||
delete ctrl.kinds.InternalAddress;
|
||||
} else if (!ctrl.kinds.InternalAddress && ctrl.showInternalAddresses) {
|
||||
ctrl.kinds.InternalAddress = true;
|
||||
}
|
||||
}
|
||||
$scope.$watch('$ctrl.showInternalAddresses', function () {
|
||||
updateInternalAddressKind();
|
||||
});
|
||||
function updateInternalQueueKind() {
|
||||
if(ctrl.kinds.InternalQueue && !ctrl.showInternalQueues) {
|
||||
delete ctrl.kinds.InternalQueue;
|
||||
} else if (!ctrl.kinds.InternalQueue && ctrl.showInternalQueues) {
|
||||
ctrl.kinds.InternalQueue = true;
|
||||
}
|
||||
}
|
||||
$scope.$watch('$ctrl.showInternalQueues', function () {
|
||||
updateInternalQueueKind();
|
||||
});
|
||||
function updateLiveBrokerKind() {
|
||||
if(ctrl.kinds.ThisBroker && !ctrl.showLiveBrokers) {
|
||||
delete ctrl.kinds.ThisBroker;
|
||||
} else if (!ctrl.kinds.ThisBroker && ctrl.showLiveBrokers) {
|
||||
ctrl.kinds.ThisBroker = true;
|
||||
}
|
||||
if(ctrl.kinds.MasterBroker && !ctrl.showLiveBrokers) {
|
||||
delete ctrl.kinds.MasterBroker;
|
||||
} else if (!ctrl.kinds.MasterBroker && ctrl.showLiveBrokers) {
|
||||
ctrl.kinds.MasterBroker = true;
|
||||
}
|
||||
}
|
||||
$scope.$watch('$ctrl.showLiveBrokers', function () {
|
||||
updateLiveBrokerKind();
|
||||
});
|
||||
function updateBackupBrokerKind() {
|
||||
if(ctrl.kinds.SlaveBroker && !ctrl.showBackupBrokers) {
|
||||
delete ctrl.kinds.SlaveBroker;
|
||||
} else if (!ctrl.kinds.SlaveBroker && ctrl.showBackupBrokers) {
|
||||
ctrl.kinds.SlaveBroker = true;
|
||||
}
|
||||
}
|
||||
$scope.$watch('$ctrl.showBackupBrokers', function () {
|
||||
updateBackupBrokerKind();
|
||||
});
|
||||
function updateConnectors() {
|
||||
if(!ctrl.showConnectors) {
|
||||
ctrl.data.relations = [];
|
||||
} else {
|
||||
ctrl.data.relations = ctrl.hiddenRelations;
|
||||
}
|
||||
}
|
||||
$scope.$watch('$ctrl.showConnectors', function () {
|
||||
updateConnectors();
|
||||
});
|
||||
ctrl.datasets = [];
|
||||
//icons can be found at https://www.patternfly.org/v3/styles/icons/index.html
|
||||
ctrl.serverIcon = "\ue90d";
|
||||
Artemis.log.debug(ctrl.serverIcon);
|
||||
ctrl.addressIcon = "";//\ue91a";
|
||||
ctrl.queueIcon = "";//\ue90a";
|
||||
ctrl.icons = {
|
||||
"ThisBroker": {
|
||||
"type": "glyph",
|
||||
"icon": ctrl.serverIcon,
|
||||
"background": "#456BD9",
|
||||
"fontfamily": "PatternFlyIcons-webfont"
|
||||
},
|
||||
"MasterBroker": {
|
||||
"type": "glyph",
|
||||
"icon": ctrl.serverIcon,
|
||||
"fontfamily": "PatternFlyIcons-webfont"
|
||||
},
|
||||
"SlaveBroker": {
|
||||
"type": "glyph",
|
||||
"icon": ctrl.serverIcon,
|
||||
"fontfamily": "PatternFlyIcons-webfont"
|
||||
},
|
||||
"Address": {
|
||||
"type": "glyph",
|
||||
"icon": ctrl.addressIcon,
|
||||
"fontfamily": "PatternFlyIcons-webfont"
|
||||
},
|
||||
"InternalAddress": {
|
||||
"type": "glyph",
|
||||
"icon": ctrl.addressIcon,
|
||||
"fontfamily": "PatternFlyIcons-webfont"
|
||||
},
|
||||
"Queue": {
|
||||
"type": "glyph",
|
||||
"background": "#456BD9",
|
||||
"icon": ctrl.queueIcon,
|
||||
"fontfamily": "PatternFlyIcons-webfont"
|
||||
},
|
||||
"InternalQueue": {
|
||||
"type": "glyph",
|
||||
"background": "#456BD9",
|
||||
"icon": ctrl.queueIcon,
|
||||
"fontfamily": "PatternFlyIcons-webfont"
|
||||
}
|
||||
};
|
||||
|
||||
load();
|
||||
ctrl.hiddenRelations = ctrl.relations;
|
||||
function load() {
|
||||
ctrl.items = {};
|
||||
|
||||
ctrl.relations = [];
|
||||
|
||||
ctrl.datasets.push({
|
||||
"items": ctrl.items,
|
||||
"relations": ctrl.relations,
|
||||
"icons": ctrl.icons
|
||||
});
|
||||
|
||||
Artemis.log.debug("index " + ctrl.index);
|
||||
|
||||
ctrl.data = ctrl.datasets[ctrl.index];
|
||||
|
||||
ctrl.data.url = "fooBar";
|
||||
|
||||
ctrl.kinds = {
|
||||
"ThisBroker": true,
|
||||
"MasterBroker": true,
|
||||
"SlaveBroker": true,
|
||||
"Address": true,
|
||||
"Queue": true
|
||||
};
|
||||
|
||||
ctrl.icons = ctrl.data.icons;
|
||||
|
||||
ctrl.nodes = {
|
||||
"ThisBroker": {
|
||||
"name": "ThisBroker",
|
||||
"title": "hello",
|
||||
"enabled": true,
|
||||
"radius": 28,
|
||||
"textX": 0,
|
||||
"textY": 5,
|
||||
"height": 30,
|
||||
"width": 30,
|
||||
"icon": ctrl.icons["ThisBroker"].icon,
|
||||
"fontFamily": ctrl.icons["ThisBroker"].fontfamily
|
||||
},
|
||||
"MasterBroker": {
|
||||
"name": "MasterBroker",
|
||||
"enabled": true,
|
||||
"radius": 28,
|
||||
"textX": 0,
|
||||
"textY": 5,
|
||||
"height": 30,
|
||||
"width": 30,
|
||||
"icon": ctrl.icons["MasterBroker"].icon,
|
||||
"fontFamily": ctrl.icons["MasterBroker"].fontfamily
|
||||
},
|
||||
"SlaveBroker": {
|
||||
"name": "SlaveBroker",
|
||||
"enabled": true,
|
||||
"radius": 28,
|
||||
"textX": 0,
|
||||
"textY": 5,
|
||||
"height": 30,
|
||||
"icon": ctrl.icons["SlaveBroker"].icon,
|
||||
"fontFamily": ctrl.icons["SlaveBroker"].fontfamily
|
||||
},
|
||||
"Address": {
|
||||
"name": "Address",
|
||||
"enabled": ctrl.showDestinations,
|
||||
"radius": 16,
|
||||
"textX": 0,
|
||||
"textY": 5,
|
||||
"height": 18,
|
||||
"width": 18,
|
||||
"icon": ctrl.icons["Address"].icon,
|
||||
"fontFamily": ctrl.icons["Address"].fontfamily
|
||||
},
|
||||
"Queue": {
|
||||
"name": "Queue",
|
||||
"enabled": ctrl.showDestinations,
|
||||
"radius": 16,
|
||||
"textX": 0,
|
||||
"textY": 5,
|
||||
"height": 18,
|
||||
"width": 18,
|
||||
"icon": ctrl.icons["Queue"].icon,
|
||||
"fontFamily": ctrl.icons["Queue"].fontfamily
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.tableColumns = [
|
||||
{ header: 'attribute', itemField: 'attribute' },
|
||||
{ header: 'value', itemField: 'value' }
|
||||
];
|
||||
ctrl.attributes = [];
|
||||
ctrl.config = {
|
||||
selectionMatchProp: 'attribute',
|
||||
showCheckboxes: false
|
||||
};
|
||||
ctrl.showAttributes = false;
|
||||
|
||||
updateAddressKind();
|
||||
updateQueueKind();
|
||||
updateInternalAddressKind();
|
||||
updateInternalQueueKind();
|
||||
updateLiveBrokerKind();
|
||||
updateBackupBrokerKind();
|
||||
updateConnectors();
|
||||
|
||||
loadThisBroker();
|
||||
Core.$apply($scope);
|
||||
}
|
||||
ctrl.itemSelected = function(item) {
|
||||
ctrl.showAttributes = false;
|
||||
ctrl.attributes = [];
|
||||
if (!item || !item.mbean) {
|
||||
Core.$apply($scope);
|
||||
return;
|
||||
}
|
||||
var atts = jolokia.request({ type: "read", mbean: item.mbean}, {method: "post"});
|
||||
var val = atts.value;
|
||||
if (val) {
|
||||
angular.forEach(val, function (value, key) {
|
||||
attribute = {
|
||||
"attribute": key,
|
||||
"value": value
|
||||
}
|
||||
ctrl.attributes.push(attribute);
|
||||
});
|
||||
}
|
||||
ctrl.showAttributes = true;
|
||||
Core.$apply($scope);
|
||||
}
|
||||
ctrl.tooltip = function (node) {
|
||||
var status = [
|
||||
'Name: ' + node.item.name,
|
||||
'Type: ' + node.item.brokerKind
|
||||
];
|
||||
return status;
|
||||
}
|
||||
ctrl.chartRendered = function (vertices, added) {
|
||||
// Inhibit the dblclick handler of pf-topology for the its items.
|
||||
added.each(function (d) { d.url = "javascript:void(0)"; });
|
||||
}
|
||||
ctrl.refresh = function () {
|
||||
ctrl.datasets = [];
|
||||
load();
|
||||
}
|
||||
|
||||
function loadThisBroker() {
|
||||
var mBean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
var atts = jolokia.request({ type: "read", mbean: mBean}, {method: "post"});
|
||||
var val = atts.value;
|
||||
var details = Core.parseMBean(mBean);
|
||||
|
||||
if (details) {
|
||||
var properties = details['attributes'];
|
||||
Artemis.log.debug("Got broker: " + mBean + " properties: " + angular.toJson(properties, true));
|
||||
if (properties) {
|
||||
var brokerAddress = properties["broker"] || "unknown";
|
||||
var brokerName = artemisJmxDomain + ":broker=" + brokerAddress;
|
||||
var backupRes = jolokia.request({ type: "read", mbean: mBean, attribute: "Backup"}, {method: "get"});
|
||||
|
||||
var isBackup = backupRes.value;
|
||||
var nodeId = val["NodeID"];
|
||||
var response = jolokia.request({ type: 'exec', mbean: mBean, operation: 'listNetworkTopology()' }, Core.onSuccess(null));
|
||||
var responseValue = response.value;
|
||||
var remoteBrokers = angular.fromJson(responseValue);
|
||||
var thisBroker = remoteBrokers.find(broker => broker.nodeID == nodeId);
|
||||
if(!thisBroker) {
|
||||
if(isBackup) {
|
||||
thisBroker = {
|
||||
backup: "broker"
|
||||
};
|
||||
} else {
|
||||
thisBroker = {
|
||||
live: "broker"
|
||||
};
|
||||
}
|
||||
}
|
||||
if (thisBroker.live) {
|
||||
ctrl.items[thisBroker.live] = {
|
||||
"name": thisBroker.live,
|
||||
"kind": "ThisBroker",
|
||||
"brokerKind": "master",
|
||||
"status": "broker",
|
||||
"display_kind": "Server",
|
||||
"mbean": mBean
|
||||
}
|
||||
}
|
||||
if (thisBroker.backup) {
|
||||
ctrl.items[thisBroker.backup] = {
|
||||
"name": thisBroker.backup,
|
||||
"kind": "SlaveBroker",
|
||||
"brokerKind": "slave",
|
||||
"status": "broker",
|
||||
"display_kind": "Server"
|
||||
};
|
||||
if (thisBroker.live) {
|
||||
ctrl.relations.push({
|
||||
"source": thisBroker.live,
|
||||
"target": thisBroker.backup
|
||||
});
|
||||
}
|
||||
}
|
||||
createAddresses(mBean, thisBroker.live)
|
||||
}
|
||||
|
||||
angular.forEach(remoteBrokers, function (remoteBroker) {
|
||||
if (nodeId != remoteBroker.nodeID) {
|
||||
if (remoteBroker.live) {
|
||||
ctrl.items[remoteBroker.live] = {
|
||||
"name": remoteBroker.live,
|
||||
"kind": "MasterBroker",
|
||||
"brokerKind": "master",
|
||||
"status": "broker",
|
||||
"display_kind": "Server"
|
||||
};
|
||||
//if we arent a backup then connect to it as we are in the cluster
|
||||
if(!isBackup) {}
|
||||
ctrl.relations.push({
|
||||
"source": thisBroker.live,
|
||||
"target": remoteBroker.live
|
||||
});
|
||||
}
|
||||
if (remoteBroker.backup) {
|
||||
ctrl.items[remoteBroker.backup] = {
|
||||
"name": remoteBroker.backup,
|
||||
"kind": "SlaveBroker",
|
||||
"brokerKind": "slave",
|
||||
"status": "broker",
|
||||
"display_kind": "Server"
|
||||
};
|
||||
ctrl.relations.push({
|
||||
"source": remoteBroker.backup,
|
||||
"target": remoteBroker.live
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function createAddresses(brokerMBean, brokerId) {
|
||||
jolokia.search(brokerMBean + ",component=addresses,*", Core.onSuccess(function (response) {
|
||||
angular.forEach(response, function (objectName) {
|
||||
var details = Core.parseMBean(objectName);
|
||||
if (details) {
|
||||
var properties = details['attributes'];
|
||||
if (properties) {
|
||||
if (!properties.subcomponent) {
|
||||
|
||||
Artemis.log.debug("Got Address: " + objectName + " properties: " + angular.toJson(properties, true));
|
||||
addressKind = properties.address.startsWith("$", 1) || properties.address.startsWith("notif", 1) ? "InternalAddress" : "Address";
|
||||
ctrl.items[properties.address] = {
|
||||
"name": properties.address,
|
||||
"kind": addressKind,
|
||||
"brokerKind": "address",
|
||||
"status": "Valid",
|
||||
"display_kind": "Server",
|
||||
"mbean": objectName
|
||||
}
|
||||
ctrl.relations.push({
|
||||
"source": brokerId,
|
||||
"target": properties.address
|
||||
});
|
||||
}
|
||||
if (properties.queue) {
|
||||
Artemis.log.debug("Got Queue: " + objectName + " properties: " + angular.toJson(properties, true));
|
||||
queueKind = properties.queue.startsWith("$", 1) || properties.queue.startsWith("notif", 1) ? "InternalQueue" : "Queue";
|
||||
ctrl.items["queue." + properties.queue] = {
|
||||
"name": properties.queue,
|
||||
"kind": queueKind,
|
||||
"brokerKind": "queue",
|
||||
"status": "Valid",
|
||||
"display_kind": "Service",
|
||||
"mbean": objectName
|
||||
}
|
||||
ctrl.relations.push({
|
||||
"source": properties.address,
|
||||
"target": "queue." + properties.queue
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
}
|
||||
BrokerDiagramController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage', 'artemisMessage', '$location', '$timeout', '$filter'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,70 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis._module
|
||||
.run(configureHelp)
|
||||
.name;
|
||||
|
||||
function configureHelp(helpRegistry, $templateCache) {
|
||||
var path = 'plugin/help.md';
|
||||
helpRegistry.addUserDoc('artemis', path);
|
||||
//this is indented to render correctly as it is markdown
|
||||
$templateCache.put(path, `
|
||||
### Artemis
|
||||
|
||||
Click [Artemis](#/jmx/attributes?tab=artemis) in the top navigation bar to see the Artemis specific plugin. (The Artemis tab won't appear if there is no broker in this JVM). The Artemis plugin works very much the same as the JMX plugin however with a focus on interacting with an Artemis broker.
|
||||
|
||||
The tree view on the left-hand side shows the top level JMX tree of each broker instance running in the JVM. Expanding the tree will show the various MBeans registered by Artemis that you can inspect via the **Attributes** tab.
|
||||
|
||||
#### Creating a new Address
|
||||
|
||||
To create a new address simply click on the broker or the address folder in the jmx tree and click on the create tab.
|
||||
|
||||
Once you have created an address you should be able to **Send** to it by clicking on it in the jmx tree and clicking on the send tab.
|
||||
|
||||
#### Creating a new Queue
|
||||
|
||||
To create a new queue click on the address you want to bind the queue to and click on the create tab.
|
||||
|
||||
Once you have created a queue you should be able to **Send** a message to it or **Browse** it or view the **Attributes** or **Charts**. Simply click on the queue in th ejmx tree and click on the appropriate tab.
|
||||
|
||||
You can also see a graphical view of all brokers, addresses, queues and their consumers using the **Diagram** tab.
|
||||
`);
|
||||
}
|
||||
configureHelp.$inject = ['helpRegistry', '$templateCache'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,269 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/// <reference path="tree.component.ts"/>
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis.log.debug("loading navigation");
|
||||
var TAB_CONFIG = {
|
||||
attributes: {
|
||||
title: 'Attributes',
|
||||
route: '/artemis/attributes'
|
||||
},
|
||||
operations: {
|
||||
title: 'Operations',
|
||||
route: '/artemis/operations'
|
||||
},
|
||||
chart: {
|
||||
title: 'Chart',
|
||||
route: '/artemis/charts'
|
||||
},
|
||||
createAddress: {
|
||||
title: 'Create address',
|
||||
route: '/artemis/artemisCreateAddress'
|
||||
},
|
||||
deleteAddress: {
|
||||
title: 'Delete address',
|
||||
route: '/artemis/artemisDeleteAddress'
|
||||
},
|
||||
createQueue: {
|
||||
title: 'Create queue',
|
||||
route: '/artemis/artemisCreateQueue'
|
||||
},
|
||||
deleteQueue: {
|
||||
title: 'Delete queue',
|
||||
route: '/artemis/artemisDeleteQueue'
|
||||
},
|
||||
sendMessage: {
|
||||
title: 'Send message',
|
||||
route: '/artemis/artemisSendMessage'
|
||||
},
|
||||
addressSendMessage: {
|
||||
title: 'Send message',
|
||||
route: '/artemis/artemisAddressSendMessage'
|
||||
},
|
||||
browseQueue: {
|
||||
title: 'Browse queue',
|
||||
route: '/artemis/artemisBrowseQueue'
|
||||
},
|
||||
brokerDiagram: {
|
||||
title: 'Broker diagram',
|
||||
route: '/artemis/artemisBrokerDiagram'
|
||||
},
|
||||
artemisStatus: {
|
||||
title: 'Status',
|
||||
route: '/artemis/artemisStatus'
|
||||
},
|
||||
artemisConnections: {
|
||||
title: 'Connections',
|
||||
route: '/artemis/artemisConnections'
|
||||
},
|
||||
artemisSessions: {
|
||||
title: 'Sessions',
|
||||
route: '/artemis/artemisSessions'
|
||||
},
|
||||
artemisConsumers: {
|
||||
title: 'Consumers',
|
||||
route: '/artemis/artemisConsumers'
|
||||
},
|
||||
artemisProducers: {
|
||||
title: 'Producers',
|
||||
route: '/artemis/artemisProducers'
|
||||
},
|
||||
artemisAddresses: {
|
||||
title: 'Addresses',
|
||||
route: '/artemis/artemisAddresses'
|
||||
},
|
||||
artemisQueues: {
|
||||
title: 'Queues',
|
||||
route: '/artemis/artemisQueues'
|
||||
}
|
||||
};
|
||||
Artemis._module
|
||||
.config(configureRoutes)
|
||||
.component('artemisNavigation', {
|
||||
template: `<hawtio-tabs tabs="$ctrl.tabs" on-change="$ctrl.goto(tab)"></hawtio-tabs>`,
|
||||
controller: ArtemisNavigationController
|
||||
})
|
||||
.name;
|
||||
Artemis.log.debug("loaded navigation " + Artemis.navigationModule);
|
||||
|
||||
function ArtemisNavigationController($scope, $location, workspace, localStorage, jolokia) {
|
||||
'ngInject';
|
||||
var ctrl = this;
|
||||
this.$location = $location;
|
||||
artemisJmxDomain = localStorage['artemisJmxDomain'] || "org.apache.activemq.artemis";
|
||||
|
||||
$scope.$on('jmxTreeClicked', function () {
|
||||
ctrl.tabs = getTabs();
|
||||
var tab = _.find(ctrl.tabs, { path: ctrl.$location.path() });
|
||||
if (!tab) {
|
||||
tab = ctrl.tabs[0];
|
||||
}
|
||||
ctrl.$location.path(tab.path);
|
||||
});
|
||||
|
||||
ArtemisNavigationController.prototype.$onInit = function () {
|
||||
this.tabs = getTabs();
|
||||
};
|
||||
|
||||
ArtemisNavigationController.prototype.goto = function (tab) {
|
||||
this.$location.path(tab.path);
|
||||
};
|
||||
|
||||
ctrl.showCreateAddress = hasInvokeRights(jolokia, Artemis.getBrokerMBean(workspace, jolokia), 'createAddress');
|
||||
ctrl.showDeleteAddress = hasInvokeRights(jolokia, Artemis.getBrokerMBean(workspace, jolokia), 'deleteAddress');
|
||||
ctrl.showCreateQueue = hasInvokeRights(jolokia, Artemis.getBrokerMBean(workspace, jolokia), 'createQueue');
|
||||
ctrl.showDeleteQueue = hasInvokeRights(jolokia, Artemis.getBrokerMBean(workspace, jolokia), 'destroyQueue');
|
||||
|
||||
function getTabs() {
|
||||
|
||||
var tabs = [];
|
||||
var enabledRoutes = Object.keys(TAB_CONFIG)
|
||||
.map(function (config) { return TAB_CONFIG[config].route; })
|
||||
.filter(function (route) { return _.startsWith(route, '/artemis'); });
|
||||
if (enabledRoutes.length > 0) {
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.artemisStatus.title, TAB_CONFIG.artemisStatus.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.artemisConnections.title, TAB_CONFIG.artemisConnections.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.artemisSessions.title, TAB_CONFIG.artemisSessions.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.artemisConsumers.title, TAB_CONFIG.artemisConsumers.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.artemisProducers.title, TAB_CONFIG.artemisProducers.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.artemisAddresses.title, TAB_CONFIG.artemisAddresses.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.artemisQueues.title, TAB_CONFIG.artemisQueues.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.attributes.title, TAB_CONFIG.attributes.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.operations.title, TAB_CONFIG.operations.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.chart.title, TAB_CONFIG.chart.route));
|
||||
if (shouldShowCreateAddressTab()) {
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.createAddress.title, TAB_CONFIG.createAddress.route));
|
||||
}
|
||||
if (shouldShowDeleteAddressTab()) {
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.deleteAddress.title, TAB_CONFIG.deleteAddress.route));
|
||||
}
|
||||
if (shouldShowCreateQueueTab()) {
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.createQueue.title, TAB_CONFIG.createQueue.route));
|
||||
}
|
||||
if (shouldShowDeleteQueueTab()) {
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.deleteQueue.title, TAB_CONFIG.deleteQueue.route));
|
||||
}
|
||||
if (shouldShowSendMessageTab(workspace)) {
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.sendMessage.title, TAB_CONFIG.sendMessage.route));
|
||||
}
|
||||
if (shouldShowAddressSendMessageTab(workspace)) {
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.addressSendMessage.title, TAB_CONFIG.addressSendMessage.route));
|
||||
}
|
||||
if (shouldShowBrowseMessageTab(workspace)) {
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.browseQueue.title, TAB_CONFIG.browseQueue.route));
|
||||
}
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.brokerDiagram.title, TAB_CONFIG.brokerDiagram.route));
|
||||
}
|
||||
return tabs;
|
||||
}
|
||||
|
||||
function shouldShowCreateAddressTab() {
|
||||
return workspace.selectionHasDomainAndLastFolderName(artemisJmxDomain, 'addresses') && ctrl.showCreateAddress;
|
||||
}
|
||||
|
||||
function shouldShowDeleteAddressTab() {
|
||||
return workspace.hasDomainAndProperties(artemisJmxDomain, {'component': 'addresses'}) && !workspace.hasDomainAndProperties(artemisJmxDomain, {'subcomponent': 'queues'}) && !workspace.hasDomainAndProperties(artemisJmxDomain, {'subcomponent': 'diverts'}) && ctrl.showDeleteAddress;
|
||||
}
|
||||
|
||||
function shouldShowCreateQueueTab() {
|
||||
return workspace.hasDomainAndProperties(artemisJmxDomain, {'component': 'addresses'}) && !workspace.hasDomainAndProperties(artemisJmxDomain, {'subcomponent': 'queues'}) && !workspace.hasDomainAndProperties(artemisJmxDomain, {'subcomponent': 'diverts'}) && ctrl.showCreateQueue;
|
||||
}
|
||||
|
||||
function shouldShowDeleteQueueTab() {
|
||||
return workspace.hasDomainAndProperties(artemisJmxDomain, {'subcomponent': 'queues'}) && ctrl.showDeleteQueue;
|
||||
}
|
||||
|
||||
function shouldShowSendMessageTab(workspace) {
|
||||
return workspace.hasDomainAndProperties(artemisJmxDomain, {'subcomponent': 'queues'}) && hasQueueinvokeRights(workspace, "sendMessage");
|
||||
}
|
||||
|
||||
function shouldShowAddressSendMessageTab(workspace) {
|
||||
return workspace.hasDomainAndProperties(artemisJmxDomain, {'component': 'addresses'}) && !workspace.hasDomainAndProperties(artemisJmxDomain, {'subcomponent': 'queues'}) && hasQueueinvokeRights(workspace, "sendMessage");
|
||||
}
|
||||
|
||||
function shouldShowBrowseMessageTab(workspace) {
|
||||
return workspace.hasDomainAndProperties(artemisJmxDomain, {'subcomponent': 'queues'}) && hasQueueinvokeRights(workspace, "browse") && hasQueueinvokeRights(workspace, "countMessages");
|
||||
}
|
||||
|
||||
function hasInvokeRights(jolokia, mbean, operation) {
|
||||
var response = jolokia.request({
|
||||
type: 'exec',
|
||||
mbean: 'hawtio:type=security,area=jmx,name=ArtemisJMXSecurity',
|
||||
operation: 'canInvoke(java.lang.String, java.lang.String)',
|
||||
arguments: [mbean, operation] },
|
||||
Core.onSuccess(null));
|
||||
|
||||
Artemis.log.debug(operation + "=" + response.value);
|
||||
return response.value;
|
||||
}
|
||||
function hasQueueinvokeRights(workspace, operation) {
|
||||
var selection = workspace.selection;
|
||||
if (!selection)
|
||||
return false;
|
||||
var mbean = selection.objectName;
|
||||
if (!mbean)
|
||||
return false;
|
||||
return hasInvokeRights(jolokia, mbean, operation)
|
||||
}
|
||||
}
|
||||
ArtemisNavigationController.$inject = ['$scope', '$location', 'workspace', 'localStorage', 'jolokia']
|
||||
|
||||
function configureRoutes($routeProvider) {
|
||||
$routeProvider.
|
||||
when('/artemis/attributes', { templateUrl: 'plugins/jmx/html/attributes/attributes.html' }).
|
||||
when('/artemis/operations', { template: '<operations></operations>' }).
|
||||
when('/artemis/charts', { templateUrl: 'plugins/jmx/html/charts.html' }).
|
||||
when('/artemis/charts/edit', { templateUrl: 'plugins/jmx/html/chartEdit.html' }).
|
||||
when('/artemis/artemisCreateAddress', { template: '<artemis-create-address></artemis-create-address>'}).
|
||||
when('/artemis/artemisDeleteAddress', { template: '<artemis-delete-address></artemis-delete-address>'}).
|
||||
when('/artemis/artemisCreateQueue', { template: '<artemis-create-queue></artemis-create-queue>'}).
|
||||
when('/artemis/artemisDeleteQueue', { template: '<artemis-delete-queue></artemis-delete-queue>'}).
|
||||
when('/artemis/artemisSendMessage', { template: '<artemis-send-message></artemis-send-message>'}).
|
||||
when('/artemis/artemisAddressSendMessage', { template: '<artemis-address-send-message></artemis-address-send-message>'}).
|
||||
when('/artemis/artemisBrowseQueue', { template: '<artemis-browse-queue></artemis-browse-queue>'}).
|
||||
when('/artemis/artemisBrokerDiagram', { template: '<artemis-broker-diagram></artemis-broker-diagram>'}).
|
||||
when('/artemis/artemisStatus', { template: '<artemis-status></artemis-status>'}).
|
||||
when('/artemis/artemisConnections', { template: '<artemis-connections></artemis-connections>'}).
|
||||
when('/artemis/artemisSessions', { template: '<artemis-sessions></artemis-sessions>'}).
|
||||
when('/artemis/artemisConsumers', { template: '<artemis-consumers></artemis-consumers>'}).
|
||||
when('/artemis/artemisProducers', { template: '<artemis-producers></artemis-producers>'}).
|
||||
when('/artemis/artemisAddresses', { template: '<artemis-addresses></artemis-addresses>'}).
|
||||
when('/artemis/artemisQueues', { template: '<artemis-queues></artemis-queues>'});
|
||||
}
|
||||
configureRoutes.$inject = ['$routeProvider'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,132 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis._module
|
||||
.controller("Artemis.PreferencesController", ["$scope", "localStorage", "userDetails", "$rootScope", function ($scope, localStorage, userDetails, $rootScope) {
|
||||
Core.initPreferenceScope($scope, localStorage, {
|
||||
'artemisUserName': {
|
||||
'value': userDetails.username ? userDetails.username : ""
|
||||
},
|
||||
'artemisPassword': {
|
||||
'value': userDetails.password ? userDetails.password : ""
|
||||
},
|
||||
'artemisDLQ': {
|
||||
'value': "^DLQ$"
|
||||
},
|
||||
'artemisExpiryQueue': {
|
||||
'value': "^ExpiryQueue$"
|
||||
},
|
||||
'ArtemisBrowseBytesMessages': {
|
||||
'value': 99,
|
||||
'post': function (newValue) {
|
||||
$scope.$emit('ArtemisBrowseBytesMessages', newValue);
|
||||
}
|
||||
}
|
||||
})}])
|
||||
.run(configurePreferences)
|
||||
.name;
|
||||
|
||||
function configurePreferences(preferencesRegistry, $templateCache, workspace) {
|
||||
|
||||
var path = 'plugin/preferences.html';
|
||||
preferencesRegistry.addTab("Artemis", path, function () {
|
||||
return workspace.treeContainsDomainAndProperties("org.apache.activemq.artemis");
|
||||
});
|
||||
$templateCache.put(path,
|
||||
`<form class="form-horizontal artemis-preferences-form" ng-controller="Artemis.PreferencesController">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisUserName">
|
||||
Artemis user name
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="The user name to be used when connecting to the broker"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input id="artemisUserName" type="text" class="form-control" ng-model="artemisUserName"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisPassword">
|
||||
Artemis password
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="The user name to be used when connecting to the broker"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input id="artemisPassword" type="password" class="form-control" ng-model="artemisPassword"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisDLQ">
|
||||
Dead-letter address regex
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="A regular expression to match one or more dead-letter addresses"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" id="artemisDLQ" ng-model="artemisDLQ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisExpiryQueue">
|
||||
Expiry address regex
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="A regular expression to match one or more expiry addresses"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" id="artemisExpiryQueue" ng-model="artemisExpiryQueue">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="Browse Byte Messages">
|
||||
Browse Bytes Messages
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="Browsing byte messages should display the message body as this"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<select id="ArtemisBrowseBytesMessages" class="form-control" ng-model="ArtemisBrowseBytesMessages">
|
||||
<option value="99">Off</option>
|
||||
<option value="16">Text</option>
|
||||
<option value="8">Decimal</option>
|
||||
<option value="4">Hex</option>
|
||||
<option value="2">Decimal and Text</option>
|
||||
<option value="1">Hex and Text</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>`
|
||||
);
|
||||
}
|
||||
configurePreferences.$inject = ['preferencesRegistry', '$templateCache', 'workspace'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,251 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis.log.debug("loading producers");
|
||||
Artemis._module.component('artemisProducers', {
|
||||
template:
|
||||
`<h1>Browse Producers
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'producers-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
<div ng-include="'plugin/artemistoolbar.html'"></div>
|
||||
<pf-table-view config="$ctrl.tableConfig"
|
||||
dt-options="$ctrl.dtOptions"
|
||||
columns="$ctrl.tableColumns"
|
||||
items="$ctrl.producers">
|
||||
</pf-table-view>
|
||||
<div ng-include="'plugin/artemispagination.html'"></div>
|
||||
<script type="text/ng-template" id="producers-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to browse all producers currently open on the broker. These can be narrowed down
|
||||
by specifying a filter and also sorted using the sort function in the toolbar. To execute a query
|
||||
click on the <span class="fa fa-search"></span> button.
|
||||
</p>
|
||||
<p>
|
||||
You can navigate to the producers session by clicking on the <code>Session</code> field.
|
||||
</p>
|
||||
<p>
|
||||
Note that each page is loaded in from the broker when navigating to a new page or when a query is executed.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: ProducersController
|
||||
})
|
||||
.name;
|
||||
|
||||
|
||||
function ProducersController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisProducer, artemisAddress, artemisSession) {
|
||||
var ctrl = this;
|
||||
ctrl.pagination = pagination;
|
||||
ctrl.pagination.reset();
|
||||
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
ctrl.allProducers = [];
|
||||
ctrl.producers = [];
|
||||
ctrl.pageNumber = 1;
|
||||
ctrl.workspace = workspace;
|
||||
ctrl.refreshed = false;
|
||||
ctrl.dtOptions = {
|
||||
// turn of ordering as we do it ourselves
|
||||
ordering: false,
|
||||
columns: [
|
||||
{name: "ID", visible: true},
|
||||
{name: "Session", visible: true},
|
||||
{name: "Client ID", visible: true},
|
||||
{name: "Protocol", visible: true},
|
||||
{name: "User", visible: true},
|
||||
{name: "Address", visible: true},
|
||||
{name: "Remote Address", visible: true},
|
||||
{name: "Local Address", visible: true}
|
||||
]
|
||||
};
|
||||
|
||||
Artemis.log.debug('localStorage: producersColumnDefs =', localStorage.getItem('producersColumnDefs'));
|
||||
if (localStorage.getItem('producersColumnDefs')) {
|
||||
loadedDefs = JSON.parse(localStorage.getItem('producersColumnDefs'));
|
||||
//sanity check to make sure columns havent been added
|
||||
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
|
||||
ctrl.dtOptions.columns = loadedDefs;
|
||||
}
|
||||
}
|
||||
|
||||
ctrl.updateColumns = function () {
|
||||
var attributes = [];
|
||||
ctrl.dtOptions.columns.forEach(function (column) {
|
||||
attributes.push({name: column.name, visible: column.visible});
|
||||
});
|
||||
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
|
||||
localStorage.setItem('producersColumnDefs', JSON.stringify(attributes));
|
||||
}
|
||||
ctrl.filter = {
|
||||
fieldOptions: [
|
||||
{id: 'id', name: 'ID'},
|
||||
{id: 'session', name: 'Session'},
|
||||
{id: 'clientID', name: 'Client ID'},
|
||||
{id: 'user', name: 'User'},
|
||||
{id: 'address', name: 'Address'},
|
||||
{id: 'protocol', name: 'Protocol'},
|
||||
{id: 'localAddress', name: 'Local Address'},
|
||||
{id: 'remoteAddress', name: 'Remote Address'}
|
||||
],
|
||||
operationOptions: [
|
||||
{id: 'EQUALS', name: 'Equals'},
|
||||
{id: 'CONTAINS', name: 'Contains'}
|
||||
],
|
||||
sortOptions: [
|
||||
{id: 'asc', name: 'ascending'},
|
||||
{id: 'desc', name: 'descending'}
|
||||
],
|
||||
values: {
|
||||
field: "",
|
||||
operation: "",
|
||||
value: "",
|
||||
sortOrder: "asc",
|
||||
sortColumn: "id"
|
||||
},
|
||||
text: {
|
||||
fieldText: "Filter Field..",
|
||||
operationText: "Operation..",
|
||||
sortOrderText: "ascending",
|
||||
sortByText: "ID"
|
||||
}
|
||||
};
|
||||
ctrl.tableConfig = {
|
||||
selectionMatchProp: 'id',
|
||||
showCheckboxes: false
|
||||
};
|
||||
ctrl.tableColumns = [
|
||||
{ header: 'ID', itemField: 'id' },
|
||||
{ header: 'Session', itemField: 'session' , templateFn: function(value, item) { return '<a href="#" onclick="selectSession(' + item.idx + ')">' + $sanitize(value) + '</a>' }},
|
||||
{ header: 'Client ID', itemField: 'clientID' },
|
||||
{ header: 'Protocol', itemField: 'protocol' },
|
||||
{ header: 'User', itemField: 'user' },
|
||||
{ header: 'Address', itemField: 'address', templateFn: function(value, item) { return '<a href="#" onclick="selectAddress(' + item.idx + ')">' + $sanitize(value) + '</a>' }},
|
||||
{ header: 'Remote Address', itemField: 'remoteAddress' },
|
||||
{ header: 'Local Address', itemField: 'localAddress' }
|
||||
];
|
||||
|
||||
ctrl.refresh = function () {
|
||||
ctrl.refreshed = true;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
ctrl.reset = function () {
|
||||
ctrl.filter.values.field = "";
|
||||
ctrl.filter.values.operation = "";
|
||||
ctrl.filter.values.value = "";
|
||||
ctrl.filter.sortOrder = "asc";
|
||||
ctrl.filter.sortColumn = "id";
|
||||
ctrl.filter.text.fieldText = "Filter Field..";
|
||||
ctrl.filter.text.operationText = "Operation..";
|
||||
ctrl.filter.text.sortOrderText = "ascending";
|
||||
ctrl.filter.text.sortByText = "ID";
|
||||
ctrl.refreshed = true;
|
||||
artemisProducer.producer = null;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
|
||||
selectAddress = function (idx) {
|
||||
var address = ctrl.producers[idx].address;
|
||||
Artemis.log.debug("navigating to address:" + address)
|
||||
artemisAddress.address = { address: address };
|
||||
$location.path("artemis/artemisAddresses");
|
||||
};
|
||||
|
||||
selectSession = function (idx) {
|
||||
var session = ctrl.producers[idx].session;
|
||||
Artemis.log.debug("navigating to session:" + session)
|
||||
artemisSession.session = { session: session };
|
||||
$location.path("artemis/artemisSessions");
|
||||
};
|
||||
|
||||
if (artemisProducer.producer) {
|
||||
Artemis.log.debug("navigating to producer = " + artemisProducer.producer.session);
|
||||
ctrl.filter.values.field = ctrl.filter.fieldOptions[1].id;
|
||||
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
|
||||
ctrl.filter.values.value = artemisProducer.producer.session;
|
||||
artemisProducer.producer = null;
|
||||
}
|
||||
|
||||
ctrl.loadOperation = function () {
|
||||
if (mbean) {
|
||||
var method = 'listProducers(java.lang.String, int, int)';
|
||||
var producerFilter = {
|
||||
field: ctrl.filter.values.field,
|
||||
operation: ctrl.filter.values.operation,
|
||||
value: ctrl.filter.values.value,
|
||||
sortOrder: ctrl.filter.values.sortOrder,
|
||||
sortColumn: ctrl.filter.values.sortColumn
|
||||
};
|
||||
|
||||
if (ctrl.refreshed == true) {
|
||||
ctrl.pagination.reset();
|
||||
ctrl.refreshed = false;
|
||||
}
|
||||
jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [JSON.stringify(producerFilter), ctrl.pagination.pageNumber, ctrl.pagination.pageSize] }, Core.onSuccess(populateTable, { error: onError }));
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.pagination.setOperation(ctrl.loadOperation);
|
||||
|
||||
function onError(response) {
|
||||
Core.notification("error", "could not invoke list sessions" + response.error);
|
||||
$scope.workspace.selectParentNode();
|
||||
};
|
||||
|
||||
function populateTable(response) {
|
||||
var data = JSON.parse(response.value);
|
||||
ctrl.producers = [];
|
||||
angular.forEach(data["data"], function (value, idx) {
|
||||
value.idx = idx;
|
||||
ctrl.producers.push(value);
|
||||
});
|
||||
ctrl.pagination.page(data["count"]);
|
||||
allProducers = ctrl.producers;
|
||||
ctrl.producers = allProducers;
|
||||
Core.$apply($scope);
|
||||
}
|
||||
|
||||
ctrl.pagination.load();
|
||||
}
|
||||
ProducersController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage', 'artemisMessage', '$location', '$timeout', '$filter', '$sanitize', 'pagination', 'artemisProducer', 'artemisAddress', 'artemisSession'];
|
||||
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,381 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
//Artemis.log.debug("loading addresses");
|
||||
Artemis._module.component('artemisQueues', {
|
||||
template:
|
||||
`<h1>Browse Queues
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'queues-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
<div ng-include="'plugin/artemistoolbar.html'"></div>
|
||||
<pf-table-view config="$ctrl.tableConfig"
|
||||
dt-options="$ctrl.dtOptions"
|
||||
columns="$ctrl.tableColumns"
|
||||
action-buttons="$ctrl.tableActionButtons"
|
||||
items="$ctrl.queues">
|
||||
</pf-table-view>
|
||||
<div ng-include="'plugin/artemispagination.html'"></div>
|
||||
<script type="text/ng-template" id="queues-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to browse all queues on the broker. These can be narrowed down
|
||||
by specifying a filter and also sorted using the sort function in the toolbar. To execute a query
|
||||
click on the <span class="fa fa-search"></span> button.
|
||||
</p>
|
||||
<p>
|
||||
You can also navigate directly to the JMX attributes and operations tabs by using the <code>attributes</code>
|
||||
and <code>operations</code> button under the <code>Actions</code> column.You can navigate to the
|
||||
queues address by clicking on the <code>Address</code> field.
|
||||
</p>
|
||||
<p>
|
||||
Note that each page is loaded in from the broker when navigating to a new page or when a query is executed.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: QueuesController
|
||||
})
|
||||
.name;
|
||||
|
||||
|
||||
function QueuesController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisQueue, artemisAddress) {
|
||||
var ctrl = this;
|
||||
ctrl.pagination = pagination;
|
||||
ctrl.pagination.reset();
|
||||
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
ctrl.allAddresses = [];
|
||||
ctrl.queues = [];
|
||||
ctrl.workspace = workspace;
|
||||
ctrl.refreshed = false;
|
||||
ctrl.dtOptions = {
|
||||
// turn of ordering as we do it ourselves
|
||||
ordering: false,
|
||||
columns: [
|
||||
{name: "ID", visible: true},
|
||||
{name: "name", visible: true},
|
||||
{name: "Address", visible: true},
|
||||
{name: "Routing Type", visible: true},
|
||||
{name: "Filter", visible: true},
|
||||
{name: "Durable", visible: true},
|
||||
{name: "Max Consumers", visible: true},
|
||||
{name: "Purge On No Consumers", visible: true},
|
||||
{name: "Consumer Count", visible: true},
|
||||
{name: "Rate", visible: true},
|
||||
{name: "Message Count", visible: true},
|
||||
{name: "Paused", visible: false},
|
||||
{name: "Temporary", visible: false},
|
||||
{name: "Auto Created", visible: false},
|
||||
{name: "User", visible: false},
|
||||
{name: "Total Messages Added", visible: false},
|
||||
{name: "Total Messages Acked", visible: false},
|
||||
{name: "Delivering Count", visible: false},
|
||||
{name: "Messages Killed", visible: false},
|
||||
{name: "Direct Deliver", visible: false},
|
||||
{name: "Exclusive", visible: false},
|
||||
{name: "Last Value", visible: false},
|
||||
{name: "Last Value Key", visible: false},
|
||||
{name: "Scheduled Count", visible: false},
|
||||
{name: "Group Rebalance", visible: false},
|
||||
{name: "Group Rebalance Pause Dispatch", visible: false},
|
||||
{name: "Group Buckets", visible: false},
|
||||
{name: "Group First Key", visible: false},
|
||||
{name: "Queue Enabled", visible: false},
|
||||
{name: "Ring Size", visible: false},
|
||||
{name: "Consumers Before Dispatch", visible: false},
|
||||
{name: "Delay Before Dispatch", visible: false}
|
||||
]
|
||||
};
|
||||
|
||||
Artemis.log.debug('localStorage: queuesColumnDefs =', localStorage.getItem('queuesColumnDefs'));
|
||||
if (localStorage.getItem('queuesColumnDefs')) {
|
||||
Artemis.log.info("loading columns " + localStorage.getItem('queuesColumnDefs'))
|
||||
loadedDefs = JSON.parse(localStorage.getItem('queuesColumnDefs'));
|
||||
//sanity check to make sure columns havent been added
|
||||
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
|
||||
ctrl.dtOptions.columns = loadedDefs;
|
||||
}
|
||||
}
|
||||
|
||||
ctrl.updateColumns = function () {
|
||||
var attributes = [];
|
||||
ctrl.dtOptions.columns.forEach(function (column) {
|
||||
attributes.push({name: column.name, visible: column.visible});
|
||||
});
|
||||
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
|
||||
localStorage.setItem('queuesColumnDefs', JSON.stringify(attributes));
|
||||
}
|
||||
ctrl.filter = {
|
||||
fieldOptions: [
|
||||
{id: 'id', name: 'ID'},
|
||||
{id: 'name', name: 'Name'},
|
||||
{id: 'consumerCount', name: 'Consumer Count'},
|
||||
{id: 'address', name: 'Address'},
|
||||
{id: 'filter', name: 'Filter'},
|
||||
{id: 'maxConsumers', name: 'Max Consumers'},
|
||||
{id: 'routingType', name: 'Routing Type'},
|
||||
{id: 'purgeOnNoConsumers', name: 'Purge On No Consumers'},
|
||||
{id: 'user', name: 'User'},
|
||||
{id: 'messageCount', name: 'Message Count'},
|
||||
{id: 'deliveringCount', name: 'Delivering Count'},
|
||||
{id: 'paused', name: 'Paused'},
|
||||
{id: 'temporary', name: 'Temporary'},
|
||||
{id: 'autoCreated', name: 'Auto Created'},
|
||||
{id: 'rate', name: 'Rate'}
|
||||
],
|
||||
operationOptions: [
|
||||
{id: 'EQUALS', name: 'Equals'},
|
||||
{id: 'CONTAINS', name: 'Contains'},
|
||||
{id: 'NOT_CONTAINS', name: 'Does Not Contain'},
|
||||
{id: 'GREATER_THAN', name: 'Greater Than'},
|
||||
{id: 'LESS_THAN', name: 'Less Than'}
|
||||
],
|
||||
sortOptions: [
|
||||
{id: 'asc', name: 'ascending'},
|
||||
{id: 'desc', name: 'descending'}
|
||||
],
|
||||
values: {
|
||||
field: "",
|
||||
operation: "",
|
||||
value: "",
|
||||
sortOrder: "asc",
|
||||
sortColumn: "id"
|
||||
},
|
||||
text: {
|
||||
fieldText: "Filter Field..",
|
||||
operationText: "Operation..",
|
||||
sortOrderText: "ascending",
|
||||
sortByText: "ID"
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.tableActionButtons = [
|
||||
{
|
||||
name: 'attributes',
|
||||
title: 'Navigate to attributes',
|
||||
actionFn: navigateToQueuesAtts
|
||||
},
|
||||
{
|
||||
name: 'operations',
|
||||
title: 'navigate to operations',
|
||||
actionFn: navigateToQueuesOps
|
||||
}
|
||||
];
|
||||
ctrl.tableConfig = {
|
||||
selectionMatchProp: 'id',
|
||||
showCheckboxes: false
|
||||
};
|
||||
ctrl.tableColumns = [
|
||||
{ header: 'ID', itemField: 'id' },
|
||||
{ header: 'Name', itemField: 'name',
|
||||
templateFn: function(value, item) { return '<a href="#" onclick="selectQueue(' + item.idx + ')">' + $sanitize(value) + '</a>' }
|
||||
},
|
||||
{ header: 'Address', itemField: 'address',
|
||||
templateFn: function(value, item) { return '<a href="#" onclick="selectAddress(' + item.idx + ')">' + $sanitize(value) + '</a>' }
|
||||
},
|
||||
{ header: 'Routing Type', itemField: 'routingType'},
|
||||
{ header: 'Filter', itemField: 'filter' },
|
||||
{ header: 'Durable', itemField: 'durable' },
|
||||
{ header: 'Max Consumers', itemField: 'maxConsumers' },
|
||||
{ header: 'Purge On No Consumers', itemField: 'purgeOnNoConsumers' },
|
||||
{ header: 'Consumer Count', itemField: 'consumerCount' ,
|
||||
templateFn: function(value, item) { return '<a href="#" onclick="selectConsumers(' + item.idx + ')">' + $sanitize(value) + '</a>' }
|
||||
},
|
||||
{ header: 'Rate', itemField: 'rate' },
|
||||
{ header: 'Message Count', itemField: 'messageCount',
|
||||
templateFn: function(value, item) { return '<a href="#" onclick="browseQueue(' + item.idx + ')" title="Browse Messages">' + value + '</a>' }
|
||||
},
|
||||
{ header: 'Paused', itemField: 'paused' },
|
||||
{ header: 'Temporary', itemField: 'temporary' },
|
||||
{ header: 'Auto Created', itemField: 'autoCreated' },
|
||||
{ header: 'User', itemField: 'user' },
|
||||
{ header: 'Total Messages Added', itemField: 'messagesAdded' },
|
||||
{ header: 'Total Messages Acked', itemField: 'messagesAcked' },
|
||||
{ header: 'Delivering Count', itemField: 'deliveringCount' },
|
||||
{ header: 'Messages Killed', itemField: 'messagesKilled' },
|
||||
{ header: 'Direct Deliver', itemField: 'directDeliver' },
|
||||
{ header: 'exclusive', itemField: 'exclusive' },
|
||||
{ header: 'Last Value', itemField: 'lastValue' },
|
||||
{ header: 'Last Value Key', itemField: 'lastValueKey' },
|
||||
{ header: 'Scheduled Count', itemField: 'scheduledCount' },
|
||||
{ header: 'Group Rebalance', itemField: 'groupRebalance' },
|
||||
{ header: 'Group Rebalance Pause Dispatch', itemField: 'groupRebalancePauseDispatch' },
|
||||
{ header: 'Group Buckets', itemField: 'groupBuckets' },
|
||||
{ header: 'Group First Key', itemField: 'groupFirstKey' },
|
||||
{ header: 'Enabled', itemField: 'enabled'},
|
||||
{ header: 'Ring Size', itemField: 'ringSize'},
|
||||
{ header: 'Consumers Before Dispatch', itemField: 'consumersBeforeDispatch'},
|
||||
{ header: 'Delay Before Dispatch', itemField: 'delayBeforeDispatch'}
|
||||
];
|
||||
|
||||
ctrl.refresh = function () {
|
||||
ctrl.refreshed = true;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
ctrl.reset = function () {
|
||||
ctrl.filter.values.field = "";
|
||||
ctrl.filter.values.operation = "";
|
||||
ctrl.filter.values.value = "";
|
||||
ctrl.filter.sortOrder = "asc";
|
||||
ctrl.filter.sortColumn = "id";
|
||||
ctrl.filter.text.fieldText = "Filter Field..";
|
||||
ctrl.filter.text.operationText = "Operation..";
|
||||
ctrl.filter.text.sortOrderText = "ascending";
|
||||
ctrl.filter.text.sortByText = "ID";
|
||||
ctrl.refreshed = true;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
|
||||
if (artemisQueue.queue) {
|
||||
Artemis.log.debug("navigating to queue = " + artemisQueue.queue.queue);
|
||||
ctrl.filter.values.field = ctrl.filter.fieldOptions[1].id;
|
||||
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
|
||||
ctrl.filter.values.value = artemisQueue.queue.queue;
|
||||
artemisQueue.queue = null;
|
||||
}
|
||||
|
||||
if (artemisAddress.address) {
|
||||
Artemis.log.debug("navigating to address = " + artemisAddress.address.address);
|
||||
ctrl.filter.values.field = ctrl.filter.fieldOptions[3].id;
|
||||
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
|
||||
ctrl.filter.values.value = artemisAddress.address.address;
|
||||
artemisAddress.address = null;
|
||||
}
|
||||
|
||||
function navigateToQueuesAtts(action, item) {
|
||||
qnid = getQueuesNid(item, $location);
|
||||
Artemis.log.info(qnid);
|
||||
$location.path("artemis/attributes").search({"tab": "artemis", "nid": qnid });
|
||||
};
|
||||
function navigateToQueuesOps(action, item) {
|
||||
$location.path("artemis/operations").search({"tab": "artemis", "nid": getQueuesNid(item, $location)});
|
||||
};
|
||||
selectAddress = function (idx) {
|
||||
var item = ctrl.queues[idx]
|
||||
Artemis.log.debug("navigating to address:" + item.address);
|
||||
artemisAddress.address = { address: item.address };
|
||||
$location.path("artemis/artemisAddresses").search({"tab": "artemis", "nid": getAddressesNid(item, $location)});
|
||||
};
|
||||
selectQueue = function (idx) {
|
||||
var item = ctrl.queues[idx];
|
||||
var nid = getQueuesNid(item, $location);
|
||||
Artemis.log.debug("navigating to queue:" + nid);
|
||||
artemisQueue.queue = { queue: item.name };
|
||||
$location.path("artemis/artemisQueues").search({"tab": "artemis", "nid": nid});
|
||||
};
|
||||
selectConsumers = function (idx) {
|
||||
var item = ctrl.queues[idx];
|
||||
var nid = getQueuesNid(item, $location);
|
||||
artemisQueue.queue = { queue: item.name };
|
||||
$location.path("artemis/artemisConsumers").search({"tab": "artemis", "nid": nid});;
|
||||
};
|
||||
browseQueue = function (idx) {
|
||||
var item = ctrl.queues[idx];
|
||||
var nid = getQueuesNid(item, $location);
|
||||
Artemis.log.debug("navigating to queue browser:" + nid);
|
||||
$location.path("artemis/artemisBrowseQueue").search({"tab": "artemis", "nid": nid});
|
||||
};
|
||||
function getQueuesNid(item, $location) {
|
||||
var rootNID = getRootNid($location);
|
||||
var targetNID = rootNID + "addresses-" + item.address + "-queues-" + item.routingType.toLowerCase() + "-" + item.name;
|
||||
Artemis.log.debug("targetNID=" + targetNID);
|
||||
return targetNID;
|
||||
}
|
||||
function getAddressesNid(item, $location) {
|
||||
var rootNID = getRootNid($location);
|
||||
var targetNID = rootNID + "addresses-" + item.address;
|
||||
Artemis.log.debug("targetNID=" + targetNID);
|
||||
return targetNID;
|
||||
}
|
||||
function getRootNid($location) {
|
||||
var mBean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
var details = Core.parseMBean(mBean);
|
||||
var properties = details['attributes'];
|
||||
var brokerAddress = properties["broker"] || "unknown";
|
||||
var artemisJmxDomain = localStorage['artemisJmxDomain'] || "org.apache.activemq.artemis";
|
||||
//we have to remove the surrounding quotes
|
||||
return "root-" + artemisJmxDomain + "-" + brokerAddress.replace(/^"|"$/g, '') + "-";
|
||||
|
||||
}
|
||||
ctrl.loadOperation = function () {
|
||||
if (mbean) {
|
||||
var method = 'listQueues(java.lang.String, int, int)';
|
||||
var queuesFilter = {
|
||||
field: ctrl.filter.values.field,
|
||||
operation: ctrl.filter.values.operation,
|
||||
value: ctrl.filter.values.value,
|
||||
sortOrder: ctrl.filter.values.sortOrder,
|
||||
sortColumn: ctrl.filter.values.sortColumn
|
||||
};
|
||||
|
||||
if (ctrl.refreshed == true) {
|
||||
ctrl.pagination.reset();
|
||||
ctrl.refreshed = false;
|
||||
}
|
||||
jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [JSON.stringify(queuesFilter), ctrl.pagination.pageNumber, ctrl.pagination.pageSize] }, Core.onSuccess(populateTable, { error: onError }));
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.pagination.setOperation(ctrl.loadOperation);
|
||||
|
||||
function onError(response) {
|
||||
Core.notification("error", "could not invoke list queues" + response.error);
|
||||
$scope.workspace.selectParentNode();
|
||||
};
|
||||
|
||||
function populateTable(response) {
|
||||
var data = JSON.parse(response.value);
|
||||
ctrl.queues = [];
|
||||
angular.forEach(data["data"], function (value, idx) {
|
||||
value.idx = idx;
|
||||
ctrl.queues.push(value);
|
||||
});
|
||||
ctrl.pagination.page(data["count"]);
|
||||
allQueues = ctrl.queues;
|
||||
ctrl.queues = allQueues;
|
||||
Core.$apply($scope);
|
||||
}
|
||||
|
||||
ctrl.pagination.load();
|
||||
}
|
||||
QueuesController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage', 'artemisMessage', '$location', '$timeout', '$filter', '$sanitize', 'pagination', 'artemisQueue', 'artemisAddress'];
|
||||
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,174 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/// <reference path="tree.component.ts"/>
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis.log.debug("loading send message");
|
||||
Artemis._module.component('artemisSendMessage', {
|
||||
template:
|
||||
`<h1>Send Message
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'send-message-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
|
||||
<div class="alert alert-warning" ng-show="$ctrl.message.noCredentials">
|
||||
<span class="pficon pficon-warning-triangle-o"></span>
|
||||
<strong>No credentials set for endpoint!</strong>
|
||||
Please set your username and password in the
|
||||
<a href="#" class="alert-link" ng-click="$ctrl.message.openPrefs()">Preferences</a> page.
|
||||
</div>
|
||||
|
||||
<div class="row artemis-message-configuration">
|
||||
|
||||
<div class="col-sm-12">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label>Durable </label>
|
||||
<input id="durable" type="checkbox" ng-model="$ctrl.message.durable" value="true">
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'durable-info.html'" popover-placement="bottom-left"
|
||||
popover-title="Durable" popover-trigger="'mouseenter'">
|
||||
<span class="pficon pficon-info"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Create Message ID </label>
|
||||
<input id="messageID" type="checkbox" ng-model="$ctrl.message.messageID" value="true">
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'message-id-info.html'" popover-placement="bottom-left"
|
||||
popover-title="Message ID" popover-trigger="'mouseenter'">
|
||||
<span class="pficon pficon-info"></span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Headers</h3>
|
||||
|
||||
<div class="form-group" ng-if="$ctrl.message.headers.length > 0">
|
||||
<table class="scr-component-references-table table">
|
||||
<tbody>
|
||||
<tr class="input-group" ng-repeat="header in $ctrl.message.headers">
|
||||
<td><input type="text" class="form-control" ng-model="header.name" placeholder="Name" autocomplete="off" id="name"></td>
|
||||
<td><input type="text" class="form-control" ng-model="header.value" placeholder="Value" autocomplete="off" id="value"></td>
|
||||
<td><div class="input-group-prepend">
|
||||
<button type="button" class="btn btn-default" title="Delete" ng-click="$ctrl.removeHeader(header)">
|
||||
<span class="pficon pficon-delete"></span>
|
||||
</button>
|
||||
</div></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<button type="button" class="btn btn-primary artemis-add-message-button" ng-click="$ctrl.message.addHeader()">Add Header</button>
|
||||
</p>
|
||||
|
||||
<h3>Body</h3>
|
||||
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<div hawtio-editor="$ctrl.message.message" mode="codeMirrorOptions.mode.name"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select class="form-control artemis-send-message-format" ng-model="codeMirrorOptions.mode.name">
|
||||
<option value="javascript">JSON</option>
|
||||
<option value="xml">XML</option>
|
||||
</select>
|
||||
<button class="btn btn-default" ng-click="$ctrl.formatMessage()"
|
||||
title="Automatically pretty prints the message so its easier to read">Format
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<p>
|
||||
<button type="button" class="btn btn-primary artemis-send-message-button" ng-click="$ctrl.message.sendMessage($ctrl.message.durable, $ctrl.message.messageID)">Send message</button>
|
||||
</p>
|
||||
<script type="text/ng-template" id="send-message-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to send a message to the chosen queue. The message will be of type <code>text</code>
|
||||
message and it will be possible to add headers to the message. The sending of the message will be authenticated
|
||||
using the username and password set ion <code>preferences</code>, if this is not set then these will
|
||||
be null.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="message-id-info.html">
|
||||
<div>
|
||||
<p>
|
||||
The Message ID is an automatically generated UUID that is set on the Message by the broker before it is routed.
|
||||
If using a JMS client this would be the JMS Message ID on the JMS Message, this typically would not get
|
||||
set for non JMS clients. Historically and on some other tabs this is also referred to as the User ID.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="durable-info.html">
|
||||
<div>
|
||||
<p>
|
||||
If durable the message will be marked persistent and written to the brokers journal if the destination queue is durable.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: SendMessageController
|
||||
})
|
||||
.name;
|
||||
Artemis.log.debug("loaded queue " + Artemis.createQueueModule);
|
||||
|
||||
function SendMessageController($route, $scope, $element, $timeout, workspace, jolokia, localStorage, $location, artemisMessage, messageCreator) {
|
||||
Core.initPreferenceScope($scope, localStorage, {
|
||||
'durable': {
|
||||
'value': true,
|
||||
'converter': Core.parseBooleanValue
|
||||
},
|
||||
'messageID': {
|
||||
'value': true,
|
||||
'converter': Core.parseBooleanValue
|
||||
}
|
||||
});
|
||||
var ctrl = this;
|
||||
ctrl.messageCreator = messageCreator;
|
||||
ctrl.message = ctrl.messageCreator.createNewMessage($scope, $location, $route, localStorage, artemisMessage, workspace, $element, $timeout, jolokia);
|
||||
}
|
||||
SendMessageController.$inject = ['$route', '$scope', '$element', '$timeout', 'workspace', 'jolokia', 'localStorage', '$location', 'artemisMessage', 'messageCreator'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,309 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis.log.debug("loading sessions");
|
||||
Artemis._module.component('artemisSessions', {
|
||||
template:
|
||||
`<h1>Browse Sessions
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'sessions-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
<div ng-include="'plugin/artemistoolbar.html'"></div>
|
||||
<pf-table-view config="$ctrl.tableConfig"
|
||||
dt-options="$ctrl.dtOptions"
|
||||
columns="$ctrl.tableColumns"
|
||||
action-buttons="$ctrl.tableActionButtons"
|
||||
items="$ctrl.sessions">
|
||||
</pf-table-view>
|
||||
<div ng-include="'plugin/artemispagination.html'"></div>
|
||||
<div hawtio-confirm-dialog="$ctrl.closeDialog" title="Close Session?"
|
||||
ok-button-text="Close"
|
||||
cancel-button-text="Cancel"
|
||||
on-ok="$ctrl.closeSession()">
|
||||
<div class="dialog-body">
|
||||
<p class="alert alert-warning">
|
||||
<span class="pficon pficon-warning-triangle-o"></span>
|
||||
You are about to close the selected session: {{$ctrl.sessionToDelete}}
|
||||
<p>Are you sure you want to continue.</p>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/ng-template" id="sessions-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to browse all session currently open on the broker. These can be narrowed down
|
||||
by specifying a filter and also sorted using the sort function in the toolbar. To execute a query
|
||||
click on the <span class="fa fa-search"></span> button.
|
||||
</p>
|
||||
<p>
|
||||
Sessions can be closed by using the <code>close</code> button under the <code>Actions</code> column and you can
|
||||
navigate to the connection, consumers and producers by clicking on the appropriate field.
|
||||
</p>
|
||||
<p>
|
||||
Note that each page is loaded in from the broker when navigating to a new page or when a query is executed.
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: SessionsController
|
||||
})
|
||||
.name;
|
||||
|
||||
|
||||
function SessionsController($scope, workspace, jolokia, localStorage, artemisMessage, $location, $timeout, $filter, $sanitize, pagination, artemisConnection, artemisSession, artemisConsumer, artemisProducer) {
|
||||
var ctrl = this;
|
||||
ctrl.pagination = pagination;
|
||||
ctrl.pagination.reset();
|
||||
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
ctrl.allSessions = [];
|
||||
ctrl.sessions = [];
|
||||
ctrl.pageNumber = 1;
|
||||
ctrl.workspace = workspace;
|
||||
ctrl.refreshed = false;
|
||||
ctrl.sessionToDeletesConnection = '';
|
||||
ctrl.sessionToDelete = '';
|
||||
ctrl.closeDialog = false;
|
||||
ctrl.dtOptions = {
|
||||
// turn of ordering as we do it ourselves
|
||||
ordering: false,
|
||||
columns: [
|
||||
{name: "ID", visible: true},
|
||||
{name: "Connection", visible: true},
|
||||
{name: "User", visible: true},
|
||||
{name: "Consumer Count", visible: true},
|
||||
{name: "Producer Count", visible: true},
|
||||
{name: "Creation Time", visible: true}
|
||||
]
|
||||
};
|
||||
|
||||
Artemis.log.debug('localStorage: sessionsColumnDefs =', localStorage.getItem('sessionsColumnDefs'));
|
||||
if (localStorage.getItem('sessionsColumnDefs')) {
|
||||
loadedDefs = JSON.parse(localStorage.getItem('sessionsColumnDefs'));
|
||||
//sanity check to make sure columns havent been added
|
||||
if(loadedDefs.length === ctrl.dtOptions.columns.length) {
|
||||
ctrl.dtOptions.columns = loadedDefs;
|
||||
}
|
||||
}
|
||||
|
||||
ctrl.updateColumns = function () {
|
||||
var attributes = [];
|
||||
ctrl.dtOptions.columns.forEach(function (column) {
|
||||
attributes.push({name: column.name, visible: column.visible});
|
||||
});
|
||||
Artemis.log.debug("saving columns " + JSON.stringify(attributes));
|
||||
localStorage.setItem('sessionsColumnDefs', JSON.stringify(attributes));
|
||||
}
|
||||
ctrl.filter = {
|
||||
fieldOptions: [
|
||||
{id: 'id', name: 'ID'},
|
||||
{id: 'connectionID', name: 'Connection ID'},
|
||||
{id: 'consumerCount', name: 'Consumer Count'},
|
||||
{id: 'user', name: 'User'},
|
||||
{id: 'protocol', name: 'Protocol'},
|
||||
{id: 'clientID', name: 'Client ID'},
|
||||
{id: 'localAddress', name: 'Local Address'},
|
||||
{id: 'remoteAddress', name: 'Remote Address'}
|
||||
],
|
||||
operationOptions: [
|
||||
{id: 'EQUALS', name: 'Equals'},
|
||||
{id: 'CONTAINS', name: 'Contains'},
|
||||
{id: 'NOT_CONTAINS', name: 'Does Not Contain'},
|
||||
{id: 'GREATER_THAN', name: 'Greater Than'},
|
||||
{id: 'LESS_THAN', name: 'Less Than'}
|
||||
],
|
||||
sortOptions: [
|
||||
{id: 'asc', name: 'ascending'},
|
||||
{id: 'desc', name: 'descending'}
|
||||
],
|
||||
values: {
|
||||
field: "",
|
||||
operation: "",
|
||||
value: "",
|
||||
sortOrder: "asc",
|
||||
sortColumn: "id"
|
||||
},
|
||||
text: {
|
||||
fieldText: "Filter Field..",
|
||||
operationText: "Operation..",
|
||||
sortOrderText: "ascending",
|
||||
sortByText: "ID"
|
||||
}
|
||||
};
|
||||
ctrl.tableActionButtons = [
|
||||
{
|
||||
name: 'Close',
|
||||
title: 'Close the Session',
|
||||
actionFn: openCloseDialog
|
||||
}
|
||||
];
|
||||
ctrl.tableConfig = {
|
||||
selectionMatchProp: 'id',
|
||||
showCheckboxes: false
|
||||
};
|
||||
ctrl.tableColumns = [
|
||||
{ header: 'ID', itemField: 'id' },
|
||||
{ header: 'Connection', itemField: 'connectionID', templateFn: function(value, item) { return '<a href="#" onclick="selectConnection(' + item.idx + ')">' + $sanitize(value) + '</a>' }},
|
||||
{ header: 'User', itemField: 'user' },
|
||||
{ header: 'Consumer Count', itemField: 'consumerCount', templateFn: function(value, item) { return '<a href="#" onclick="selectConsumers(' + item.idx + ')">' + $sanitize(value) + '</a>' }},
|
||||
{ header: 'Producer Count', itemField: 'producerCount', templateFn: function(value, item) { return '<a href="#" onclick="selectProducers(' + item.idx + ')">' + $sanitize(value) + '</a>' }},
|
||||
{ header: 'Creation Time', itemField: 'creationTime' }
|
||||
];
|
||||
|
||||
ctrl.refresh = function () {
|
||||
ctrl.refreshed = true;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
ctrl.reset = function () {
|
||||
ctrl.filter.values.field = "";
|
||||
ctrl.filter.values.operation = "";
|
||||
ctrl.filter.values.value = "";
|
||||
ctrl.filter.sortOrder = "asc";
|
||||
ctrl.filter.sortColumn = "id";
|
||||
ctrl.filter.text.fieldText = "Filter Field..";
|
||||
ctrl.filter.text.operationText = "Operation..";
|
||||
ctrl.filter.text.sortOrderText = "ascending";
|
||||
ctrl.filter.text.sortByText = "ID";
|
||||
ctrl.refreshed = true;
|
||||
artemisConnection.connection = null;
|
||||
artemisSession.session = null;
|
||||
artemisConsumer.consumer = null;
|
||||
ctrl.pagination.load();
|
||||
};
|
||||
|
||||
selectConnection = function (idx) {
|
||||
var connection = ctrl.sessions[idx].connectionID;
|
||||
Artemis.log.debug("navigating to connection:" + connection)
|
||||
artemisSession.session = { connectionID: connection };
|
||||
$location.path("artemis/artemisConnections");
|
||||
};
|
||||
|
||||
selectConsumers = function (idx) {
|
||||
var session = ctrl.sessions[idx].id;
|
||||
Artemis.log.debug("navigating to consumers:" + session)
|
||||
artemisConsumer.consumer = { sessionID: session };
|
||||
$location.path("artemis/artemisConsumers");
|
||||
};
|
||||
|
||||
selectProducers = function (idx) {
|
||||
var session = ctrl.sessions[idx].id;
|
||||
Artemis.log.debug("navigating to producers:" + session)
|
||||
artemisProducer.producer = { sessionID: session };
|
||||
$location.path("artemis/artemisProducers");
|
||||
};
|
||||
|
||||
if (artemisConnection.connection) {
|
||||
Artemis.log.debug("navigating to connection = " + artemisConnection.connection.connectionID);
|
||||
ctrl.filter.values.field = ctrl.filter.fieldOptions[1].id;
|
||||
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
|
||||
ctrl.filter.values.value = artemisConnection.connection.connectionID;
|
||||
artemisConnection.connection = null;
|
||||
}
|
||||
|
||||
if (artemisSession.session) {
|
||||
Artemis.log.debug("navigating to session = " + artemisSession.session.session);
|
||||
ctrl.filter.values.field = ctrl.filter.fieldOptions[0].id;
|
||||
ctrl.filter.values.operation = ctrl.filter.operationOptions[0].id;
|
||||
ctrl.filter.values.value = artemisSession.session.session;
|
||||
artemisSession.session = null;
|
||||
}
|
||||
|
||||
function openCloseDialog(action, item) {
|
||||
ctrl.sessionToDelete = item.id;
|
||||
ctrl.sessionToDeletesConnection = item.connectionID;
|
||||
ctrl.closeDialog = true;
|
||||
}
|
||||
|
||||
ctrl.closeSession = function () {
|
||||
Artemis.log.debug("closing session: " + ctrl.sessionToDelete);
|
||||
if (mbean) {
|
||||
jolokia.request({ type: 'exec',
|
||||
mbean: mbean,
|
||||
operation: 'closeSessionWithID(java.lang.String,java.lang.String)',
|
||||
arguments: [ctrl.sessionToDeletesConnection, ctrl.sessionToDelete] },
|
||||
Core.onSuccess(ctrl.pagination.load(), { error: function (response) {
|
||||
Core.defaultJolokiaErrorHandler("Could not close session: " + response);
|
||||
}}));
|
||||
}
|
||||
};
|
||||
ctrl.loadOperation = function () {
|
||||
if (mbean) {
|
||||
var method = 'listSessions(java.lang.String, int, int)';
|
||||
var sessionsFilter = {
|
||||
field: ctrl.filter.values.field,
|
||||
operation: ctrl.filter.values.operation,
|
||||
value: ctrl.filter.values.value,
|
||||
sortOrder: ctrl.filter.values.sortOrder,
|
||||
sortColumn: ctrl.filter.values.sortColumn
|
||||
};
|
||||
|
||||
if (ctrl.refreshed == true) {
|
||||
ctrl.pagination.reset();
|
||||
ctrl.refreshed = false;
|
||||
}
|
||||
jolokia.request({ type: 'exec', mbean: mbean, operation: method, arguments: [JSON.stringify(sessionsFilter), ctrl.pagination.pageNumber, ctrl.pagination.pageSize] }, Core.onSuccess(populateTable, { error: onError }));
|
||||
}
|
||||
};
|
||||
|
||||
ctrl.pagination.setOperation(ctrl.loadOperation);
|
||||
|
||||
function onError(response) {
|
||||
Core.notification("error", "could not invoke list sessions" + response.error);
|
||||
$scope.workspace.selectParentNode();
|
||||
};
|
||||
|
||||
function populateTable(response) {
|
||||
var data = JSON.parse(response.value);
|
||||
ctrl.sessions = [];
|
||||
angular.forEach(data["data"], function (value, idx) {
|
||||
value.idx = idx;
|
||||
ctrl.sessions.push(value);
|
||||
});
|
||||
ctrl.pagination.page(data["count"]);
|
||||
allSessions = ctrl.sessions;
|
||||
ctrl.sessions = allSessions;
|
||||
Core.$apply($scope);
|
||||
}
|
||||
|
||||
ctrl.pagination.load();
|
||||
}
|
||||
SessionsController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage', 'artemisMessage', '$location', '$timeout', '$filter', '$sanitize', 'pagination', 'artemisConnection', 'artemisSession', 'artemisConsumer', 'artemisProducer'];
|
||||
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,179 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/// <reference path="tree.component.ts"/>
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis.log.debug("loading status");
|
||||
Artemis._module.component('artemisStatus', {
|
||||
template:
|
||||
`<h1>Current Status
|
||||
<button type="button" class="btn btn-link jvm-title-popover"
|
||||
uib-popover-template="'status-instructions.html'" popover-placement="bottom-left"
|
||||
popover-title="Instructions" popover-trigger="'outsideClick'">
|
||||
<span class="pficon pficon-help"></span>
|
||||
</button>
|
||||
</h1>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-3 text-center">
|
||||
<label>Address Memory Used</label>
|
||||
<p class="text-left">
|
||||
<pf-donut-pct-chart config="$ctrl.addressMemoryConfig" data="$ctrl.addressMemoryData" center-label="$ctrl.addressMemoryLabel"></pf-donut-pct-chart>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4">
|
||||
<pf-info-status-card status="$ctrl.infoStatus" show-top-border="true"></pf-info-status-card>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4">
|
||||
<pf-info-status-card status="$ctrl.clusterInfoStatus" show-top-border="true"></pf-info-status-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/ng-template" id="status-instructions.html">
|
||||
<div>
|
||||
<p>
|
||||
This page allows you to view the current status of the broker as well as the status of the cluster it belongs to.
|
||||
</p>
|
||||
<p>
|
||||
It also shows the current address memory usage in relationship to the <code>global-max-size</code>
|
||||
</p>
|
||||
<p>Note these metrics update every 5 seconds</p>
|
||||
</div>
|
||||
</script>
|
||||
`,
|
||||
controller: StatusController
|
||||
})
|
||||
.name;
|
||||
Artemis.log.debug("loaded address " + Artemis.addressModule);
|
||||
|
||||
function StatusController($scope, workspace, jolokia, localStorage, $interval) {
|
||||
var ctrl = this;
|
||||
var mbean = Artemis.getBrokerMBean(workspace, jolokia);
|
||||
|
||||
StatusController.prototype.$onInit = function () {
|
||||
jolokia.request({ type: 'read', mbean: mbean, attribute: 'Version'}, Core.onSuccess(function(response) {
|
||||
ctrl.infoStatus.info[0] = "version: " + response.value;
|
||||
}));
|
||||
jolokia.request({ type: 'read', mbean: mbean, attribute: 'HAPolicy'}, Core.onSuccess(function(response) {
|
||||
ctrl.clusterInfoStatus.info[2] = "HA Policy: " + response.value;
|
||||
}));
|
||||
loadStatus();
|
||||
ctrl.promise = $interval(function () { return loadStatus(); }, 5000);
|
||||
};
|
||||
StatusController.prototype.$onDestroy = function () {
|
||||
$interval.cancel(this.promise);
|
||||
};
|
||||
|
||||
ctrl.infoStatus = {
|
||||
"title":"Broker Info",
|
||||
"href":"#",
|
||||
"iconClass": "pficon pficon-ok",
|
||||
"info":[
|
||||
"version",
|
||||
"uptime:",
|
||||
"started:"
|
||||
]
|
||||
};
|
||||
ctrl.clusterInfoStatus = {
|
||||
"title":"Cluster Info",
|
||||
"href":"#",
|
||||
"iconClass": "pficon pficon-ok",
|
||||
"info":[
|
||||
"Lives:",
|
||||
"Backups:",
|
||||
"HA Policy: :"
|
||||
]
|
||||
};
|
||||
ctrl.addressMemoryConfig = {
|
||||
'chartId': 'addressMemoryChart',
|
||||
'units': 'MB',
|
||||
'thresholds':{'warning':'75','error':'90'}
|
||||
};
|
||||
|
||||
ctrl.addressMemoryData = {
|
||||
'used': '0',
|
||||
'total': '1000'
|
||||
};
|
||||
ctrl.addressMemoryLabel = "used";
|
||||
|
||||
function loadStatus() {
|
||||
jolokia.request({ type: 'read', mbean: mbean, attribute: 'GlobalMaxSize'}, Core.onSuccess(function(response) { ctrl.addressMemoryData.total = (response.value / 1048576).toFixed(2); }));
|
||||
jolokia.request({ type: 'read', mbean: mbean, attribute: 'AddressMemoryUsage'}, Core.onSuccess(function(response) { ctrl.addressMemoryData.used = (response.value / 1048576).toFixed(2); }));
|
||||
jolokia.request({ type: 'read', mbean: mbean, attribute: 'Uptime'}, Core.onSuccess(function(response) {
|
||||
ctrl.infoStatus.info[1] = "uptime: " + response.value;
|
||||
}));
|
||||
jolokia.request({ type: 'read', mbean: mbean, attribute: 'Started'}, Core.onSuccess(function(response) {
|
||||
ctrl.infoStatus.info[2] = "started: " + response.value;
|
||||
if(response.value == false) {
|
||||
ctrl.infoStatus.iconClass = "pficon pficon-error-circle-o";
|
||||
} else {
|
||||
ctrl.infoStatus.iconClass = "pficon pficon-ok";
|
||||
}
|
||||
}));
|
||||
var lives = 0;
|
||||
var backups = 0;
|
||||
var response = jolokia.request({ type: 'exec', mbean: mbean, operation: 'listNetworkTopology()' }, Core.onSuccess(null));
|
||||
var responseValue = response.value;
|
||||
var brokers = angular.fromJson(responseValue);
|
||||
angular.forEach(brokers, function (broker) {
|
||||
if (broker.live) {
|
||||
lives++;
|
||||
}
|
||||
if (broker.backup) {
|
||||
backups++;
|
||||
}
|
||||
})
|
||||
ctrl.clusterInfoStatus.info[0] = "Lives: " + lives;
|
||||
ctrl.clusterInfoStatus.info[1] = "Backups: " + backups;
|
||||
if (ctrl.clusterInfoStatus.info[2] == "HA Policy: Replicated") {
|
||||
jolokia.request({ type: 'read', mbean: mbean, attribute: 'ReplicaSync'}, Core.onSuccess(function(response) {
|
||||
ctrl.clusterInfoStatus.info[3] = "replicating: " + response.value;
|
||||
if (response.value == false) {
|
||||
ctrl.clusterInfoStatus.iconClass = "pficon pficon-error-circle-o";
|
||||
} else {
|
||||
ctrl.clusterInfoStatus.iconClass = "pficon pficon-ok";
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
StatusController.$inject = ['$scope', 'workspace', 'jolokia', 'localStorage', '$interval'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,210 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
/// <reference path="tree.component.ts"/>
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis._module.component('artemisTreeHeader', {
|
||||
template:
|
||||
`<div class="tree-nav-sidebar-header">
|
||||
<form role="form" class="search-pf has-button">
|
||||
<div class="form-group has-clear">
|
||||
<div class="search-pf-input-group">
|
||||
<label for="input-search" class="sr-only">Search Tree:</label>
|
||||
<input id="input-search" type="search" class="form-control" placeholder="Search tree:"
|
||||
ng-model="$ctrl.filter">
|
||||
<button type="button" class="clear" aria-hidden="true"
|
||||
ng-hide="$ctrl.filter.length === 0"
|
||||
ng-click="$ctrl.filter = ''">
|
||||
<span class="pficon pficon-close"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group tree-nav-buttons">
|
||||
<span class="badge" ng-class="{positive: $ctrl.result.length > 0}"
|
||||
ng-show="$ctrl.filter.length > 0">
|
||||
{{$ctrl.result.length}}
|
||||
</span>
|
||||
<i class="fa fa-plus-square-o" title="Expand All" ng-click="$ctrl.expandAll()"></i>
|
||||
<i class="fa fa-minus-square-o" title="Collapse All" ng-click="$ctrl.contractAll()"></i>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
`,
|
||||
controller: TreeHeaderController
|
||||
})
|
||||
.component('artemisTree', {
|
||||
template:
|
||||
`<div class="tree-nav-sidebar-content">
|
||||
<div id="artemistree" class="treeview-pf-hover treeview-pf-select"></div>
|
||||
</div>
|
||||
`,
|
||||
controller: TreeController
|
||||
})
|
||||
.name;
|
||||
treeElementId = '#artemistree';
|
||||
Artemis.log.debug("loaded tree" + Artemis.treeModule);
|
||||
|
||||
|
||||
function TreeHeaderController($scope, $element) {
|
||||
'ngInject';
|
||||
Artemis.log.debug("TreeHeaderController ");
|
||||
this.$scope = $scope;
|
||||
this.$element = $element;
|
||||
this.filter = '';
|
||||
this.result = [];
|
||||
// it's not possible to declare classes to the component host tag in AngularJS
|
||||
$element.addClass('tree-nav-sidebar-header');
|
||||
|
||||
TreeHeaderController.prototype.$onInit = function () {
|
||||
Artemis.log.debug("TreeHeaderController init");
|
||||
var _this = this;
|
||||
this.$scope.$watch(angular.bind(this, function () { return _this.filter; }), function (filter, previous) {
|
||||
if (filter !== previous) {
|
||||
_this.search(filter);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
TreeHeaderController.prototype.search = function (filter) {
|
||||
Artemis.log.debug("TreeHeaderController search");
|
||||
var _this = this;
|
||||
var doSearch = function (filter) {
|
||||
var result = _this.tree().search(filter, {
|
||||
ignoreCase: true,
|
||||
exactMatch: false,
|
||||
revealResults: true
|
||||
});
|
||||
_this.result.length = 0;
|
||||
(_a = _this.result).push.apply(_a, result);
|
||||
Core.$apply(_this.$scope);
|
||||
var _a;
|
||||
};
|
||||
_.debounce(doSearch, 300, { leading: false, trailing: true })(filter);
|
||||
};
|
||||
|
||||
TreeHeaderController.prototype.tree = function () {
|
||||
Artemis.log.debug("TreeHeaderController tree");
|
||||
return $(treeElementId).treeview(true);
|
||||
};
|
||||
|
||||
TreeHeaderController.prototype.expandAll = function () {
|
||||
Artemis.log.debug("TreeHeaderController expand");
|
||||
return this.tree()
|
||||
.expandNode(this.tree().getNodes(), { levels: HawtioTree.getMaxTreeLevel(this.tree()), silent: true });
|
||||
};
|
||||
|
||||
TreeHeaderController.prototype.contractAll = function () {
|
||||
Artemis.log.debug("TreeHeaderController contract");
|
||||
return this.tree()
|
||||
.collapseNode(this.tree().getNodes(), { ignoreChildren: true, silent: true });
|
||||
};
|
||||
}
|
||||
TreeHeaderController.$inject = ['$scope', '$element'];
|
||||
|
||||
function TreeController($scope, $location, workspace, $element) {
|
||||
'ngInject';
|
||||
this.$scope = $scope;
|
||||
this.$location = $location;
|
||||
this.workspace = workspace;
|
||||
this.$element = $element;
|
||||
// it's not possible to declare classes to the component host tag in AngularJS
|
||||
$element.addClass('tree-nav-sidebar-content');
|
||||
Artemis.log.debug("TreeController ");
|
||||
var artemisJmxDomain = localStorage['artemisJmxDomain'] || "org.apache.activemq.artemis";
|
||||
TreeController.prototype.$onInit = function () {
|
||||
Artemis.log.debug("TreeController onInit");
|
||||
var _this = this;
|
||||
this.$scope.$on('$destroy', function () { return _this.removeTree(); });
|
||||
this.$scope.$on('$routeChangeStart', function () { return Jmx.updateTreeSelectionFromURL(_this.$location, $(treeElementId)); });
|
||||
this.$scope.$on('jmxTreeUpdated', function () { return _this.populateTree(); });
|
||||
this.populateTree();
|
||||
};
|
||||
TreeController.prototype.updateSelectionFromURL = function () {
|
||||
Jmx.updateTreeSelectionFromURLAndAutoSelect(this.$location, $(treeElementId), function (first) {
|
||||
if (first.children == null) {
|
||||
return null;
|
||||
}
|
||||
// use function to auto select the queue folder on the 1st broker
|
||||
var queues = first.children[0];
|
||||
if (queues && queues.text === 'Queue') {
|
||||
return queues;
|
||||
}
|
||||
return null;
|
||||
}, true);
|
||||
};
|
||||
TreeController.prototype.populateTree = function () {
|
||||
var _this = this;
|
||||
var children = [];
|
||||
var tree = this.workspace.tree;
|
||||
Artemis.log.debug("tree= "+tree);
|
||||
if (tree) {
|
||||
var domainName = artemisJmxDomain;
|
||||
var folder = tree.get(domainName);
|
||||
|
||||
if (folder) {
|
||||
children = folder.children;
|
||||
}
|
||||
angular.forEach(children, function(child) {
|
||||
Artemis.log.debug("child=" + child.text + " " + child.id);
|
||||
});
|
||||
var treeElement = $("#artemistree");
|
||||
this.removeTree();
|
||||
Jmx.enableTree(this.$scope, this.$location, this.workspace, $(treeElementId), children);
|
||||
this.updateSelectionFromURL();
|
||||
}
|
||||
};
|
||||
TreeController.prototype.removeTree = function () {
|
||||
var tree = $(treeElementId).treeview(true);
|
||||
// There is no exposed API to check whether the tree has already been initialized,
|
||||
// so let's just check if the methods are presents
|
||||
if (tree.clearSearch) {
|
||||
tree.clearSearch();
|
||||
// Bootstrap tree view leaks the node elements into the data structure
|
||||
// so let's clean this up when the user leaves the view
|
||||
var cleanTreeFolder_1 = function (node) {
|
||||
delete node['$el'];
|
||||
if (node.nodes)
|
||||
node.nodes.forEach(cleanTreeFolder_1);
|
||||
};
|
||||
cleanTreeFolder_1(this.workspace.tree);
|
||||
// Then call the tree clean-up method
|
||||
tree.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
TreeController.$inject = ['$scope', '$location', 'workspace', '$element'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,116 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
|
||||
Artemis._module.factory('pagination',
|
||||
function () {
|
||||
return {
|
||||
pageSizeOptions: [10,20,50,100],
|
||||
pageSize: 10,
|
||||
pageNumber: 1,
|
||||
totalItems: 1,
|
||||
firstItem: 1,
|
||||
lastItem: 1,
|
||||
pages: 1,
|
||||
page: function (resultsSize) {
|
||||
this.totalItems = resultsSize;
|
||||
this.firstItem = this.pageNumber * this.pageSize - this.pageSize + 1;
|
||||
this.lastItem = this.firstItem + this.pageSize - 1;
|
||||
if (this.lastItem > this.totalItems) {
|
||||
this.lastItem = this.totalItems;
|
||||
}
|
||||
this.pages = Math.ceil(this.totalItems/this.pageSize);
|
||||
},
|
||||
nextPage: function () {
|
||||
this.pageNumber++;
|
||||
this.load();
|
||||
},
|
||||
previousPage: function () {
|
||||
this.pageNumber--;
|
||||
this.load();
|
||||
},
|
||||
lastPage: function () {
|
||||
this.pageNumber = this.pages;
|
||||
this.load();
|
||||
},
|
||||
firstPage: function () {
|
||||
this.pageNumber = 1;
|
||||
this.load();
|
||||
},
|
||||
reset: function () {
|
||||
this.pageNumber = 1;
|
||||
},
|
||||
load: function () {},
|
||||
setOperation: function (operation) {
|
||||
this.load = operation;
|
||||
}
|
||||
}
|
||||
|
||||
}).run(configurePagination);
|
||||
|
||||
function configurePagination($templateCache) {
|
||||
$templateCache.put('plugin/artemispagination.html',
|
||||
`
|
||||
<div ng_show="$ctrl.pagination.totalItems > 0">
|
||||
<form class="content-view-pf-pagination table-view-pf-pagination clearfix" id="pagination1">
|
||||
<div class="form-group">
|
||||
<select ng-model="$ctrl.pagination.pageSize" ng-options="qn for qn in $ctrl.pagination.pageSizeOptions" id="pagination.values.pageSize">
|
||||
</select>
|
||||
<span>per page</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<span><span class="pagination-pf-items-current">{{$ctrl.pagination.firstItem}}-{{$ctrl.pagination.lastItem}}</span> of <span class="pagination-pf-items-total">{{$ctrl.pagination.totalItems}}</span></span>
|
||||
<ul class="pagination pagination-pf-back">
|
||||
<li class="{{$ctrl.pagination.pageNumber == 1 ? 'disabled' : ''}}"><a href="#" title="First Page" ng-click="$ctrl.pagination.pageNumber != 1 && $ctrl.pagination.firstPage()"><span class="i fa fa-angle-double-left"></span></a></li>
|
||||
<li class="{{$ctrl.pagination.pageNumber == 1 ? 'disabled' : ''}}"><a href="#" title="Previous Page" ng-click="$ctrl.pagination.pageNumber != 1 && $ctrl.pagination.previousPage()"><span class="i fa fa-angle-left"></span></a></li>
|
||||
</ul>
|
||||
<label for="pagination1-page" class="sr-only">Current Page</label>
|
||||
<input class="pagination-pf-page" type="text" value="{{$ctrl.pagination.pageNumber}}" id="pagination1-page" on-change="$ctrl.firstPage()"/>
|
||||
<span>of <span class="pagination-pf-pages">{{$ctrl.pagination.pages}}</span></span>
|
||||
<ul class="pagination pagination-pf-forward">
|
||||
<li class="{{$ctrl.pagination.pageNumber == $ctrl.pagination.pages ? 'disabled' : ''}}"><a href="#" title="Next Page" ng-click="$ctrl.pagination.pageNumber != $ctrl.pagination.pages && $ctrl.pagination.nextPage()"><span class="i fa fa-angle-right"></span></a></li>
|
||||
<li class="{{$ctrl.pagination.pageNumber == $ctrl.pagination.pages ? 'disabled' : ''}}"><a href="#" title="Last Page" ng-click="$ctrl.pagination.pageNumber != $ctrl.pagination.pages && $ctrl.pagination.lastPage()"><span class="i fa fa-angle-double-right"></span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
`
|
||||
)
|
||||
}
|
||||
configurePagination.$inject = ['$templateCache'];
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,61 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
|
||||
Artemis._module.factory('artemisMessage', function () {
|
||||
return { 'message': null };
|
||||
})
|
||||
.factory('artemisConnection', function () {
|
||||
return { 'connection': null };
|
||||
})
|
||||
.factory('artemisSession', function () {
|
||||
return { 'session': null };
|
||||
})
|
||||
.factory('artemisConsumer', function () {
|
||||
return { 'consumer': null };
|
||||
})
|
||||
.factory('artemisProducer', function () {
|
||||
return { 'producer': null };
|
||||
})
|
||||
.factory('artemisQueue', function () {
|
||||
return { 'queue': null };
|
||||
})
|
||||
.factory('artemisAddress', function () {
|
||||
return { 'address': null };
|
||||
});
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
@ -0,0 +1,202 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
|
||||
Artemis._module.factory('messageCreator',
|
||||
function () {
|
||||
return {
|
||||
createNewMessage: function (scope, location, route, localStorage, artemisMessage, workspace, element, timeout, jolokia) {
|
||||
return new message(scope, location, route, localStorage, artemisMessage, workspace, element, timeout, jolokia);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function message(scope, location, route, localStorage, artemisMessage, workspace, element, timeout, jolokia) {
|
||||
this.noCredentials = false,
|
||||
this.durable = true,
|
||||
this.messageID = false;
|
||||
this.message = "",
|
||||
this.headers = [],
|
||||
this.scope = scope;
|
||||
this.element = element;
|
||||
this.timeout = timeout;
|
||||
this.workspace = workspace;
|
||||
this.jolokia = jolokia;
|
||||
this.artemisMessage = artemisMessage;
|
||||
// bind model values to search params...
|
||||
Core.bindModelToSearchParam(scope, location, "tab", "subtab", "compose");
|
||||
Core.bindModelToSearchParam(scope, location, "searchText", "q", "");
|
||||
// only reload the page if certain search parameters change
|
||||
Core.reloadWhenParametersChange(route, scope, location, localStorage);
|
||||
if (location.path().indexOf('artemis') > -1) {
|
||||
this.localStorage = localStorage;
|
||||
scope.$watch('localStorage.artemisUserName', this.checkCredentials);
|
||||
scope.$watch('localStorage.artemisPassword', this.checkCredentials);
|
||||
//prefill if it's a resend
|
||||
if (artemisMessage.message !== null) {
|
||||
this.message = artemisMessage.message.bodyText;
|
||||
if (artemisMessage.message.PropertiesText !== null) {
|
||||
for (var p in artemisMessage.message.StringProperties) {
|
||||
this.headers.push({name: p, value: artemisMessage.message.StringProperties[p]});
|
||||
}
|
||||
}
|
||||
}
|
||||
// always reset at the end
|
||||
|
||||
artemisMessage.message = null;
|
||||
}
|
||||
var LANGUAGE_FORMAT_PREFERENCE = "defaultLanguageFormat";
|
||||
var sourceFormat = workspace.getLocalStorage(LANGUAGE_FORMAT_PREFERENCE) || "javascript";
|
||||
|
||||
scope.codeMirrorOptions = CodeEditor.createEditorSettings({
|
||||
mode: {
|
||||
name: sourceFormat
|
||||
}
|
||||
});
|
||||
|
||||
scope.$on('hawtioEditor_default_instance', function (event, codeMirror) {
|
||||
scope.codeMirror = codeMirror;
|
||||
});
|
||||
|
||||
checkCredentials = function () {
|
||||
this.noCredentials = (Core.isBlank(localStorage['artemisUserName']) || Core.isBlank(localStorage['artemisPassword']));
|
||||
};
|
||||
this.openPrefs = function (location) {
|
||||
Artemis.log.debug("opening prefs");
|
||||
location.path('/preferences').search({'pref': 'Artemis'});
|
||||
};
|
||||
this.addHeader = function () {
|
||||
this.headers.push({name: "", value: ""});
|
||||
// lets set the focus to the last header
|
||||
var element = this.element;
|
||||
if (element) {
|
||||
this.timeout(function () {
|
||||
var lastHeader = element.find("input.headerName").last();
|
||||
lastHeader.focus();
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
this.removeHeader = function (header) {
|
||||
var index = this.headers.indexOf(header);
|
||||
this.headers.splice(index, 1);
|
||||
};
|
||||
this.defaultHeaderNames = function () {
|
||||
var answer = [];
|
||||
|
||||
function addHeaderSchema(schema) {
|
||||
angular.forEach(schema.definitions.headers.properties, function (value, name) {
|
||||
answer.push(name);
|
||||
});
|
||||
}
|
||||
|
||||
addHeaderSchema(Artemis.jmsHeaderSchema);
|
||||
return answer;
|
||||
};
|
||||
this.operationSuccess = function () {
|
||||
Core.notification("success", "Message sent!");
|
||||
this.headers = [];
|
||||
this.message = "";
|
||||
};
|
||||
this.onError = function (response) {
|
||||
Core.notification("error", "Could not send message: " + response.error);
|
||||
};
|
||||
this.formatMessage = function () {
|
||||
CodeEditor.autoFormatEditor(this.scope.codeMirror);
|
||||
};
|
||||
this.sendMessage = function (durable, createMessageId) {
|
||||
var body = this.message;
|
||||
Artemis.log.debug(body);
|
||||
this.doSendMessage(this.durable, createMessageId, body);
|
||||
};
|
||||
this.doSendMessage = function(durable, createMessageId, body) {
|
||||
var selection = this.workspace.selection;
|
||||
if (selection) {
|
||||
var mbean = selection.objectName;
|
||||
if (mbean) {
|
||||
var headers = null;
|
||||
if (this.headers.length) {
|
||||
headers = {};
|
||||
angular.forEach(this.headers, function (object) {
|
||||
var key = object.name;
|
||||
if (key) {
|
||||
headers[key] = object.value;
|
||||
}
|
||||
});
|
||||
Artemis.log.debug("About to send headers: " + JSON.stringify(headers));
|
||||
}
|
||||
|
||||
var user = this.localStorage["artemisUserName"];
|
||||
var pwd = this.localStorage["artemisPassword"];
|
||||
|
||||
if (!headers) {
|
||||
headers = {};
|
||||
}
|
||||
var type = 3;
|
||||
Artemis.log.debug(headers);
|
||||
Artemis.log.debug(type);
|
||||
Artemis.log.debug(body);
|
||||
Artemis.log.debug(durable);
|
||||
this.jolokia.execute(mbean, "sendMessage(java.util.Map, int, java.lang.String, boolean, java.lang.String, java.lang.String, boolean)", headers, type, body, durable, user, pwd, createMessageId, Core.onSuccess(this.operationSuccess(), { error: this.onError }));
|
||||
Core.$apply(this.scope);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
})(Artemis || (Artemis = {}));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,157 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* artemis-plugin-entaxy
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var Artemis;
|
||||
(function (Artemis) {
|
||||
Artemis._module.run(configureToolbar);
|
||||
|
||||
function configureToolbar($templateCache) {
|
||||
$templateCache.put('plugin/artemistoolbar.html',
|
||||
`
|
||||
<div class="row toolbar-pf table-view-pf-toolbar" id="toolbar1">
|
||||
<form class="toolbar-pf-actions">
|
||||
<div class="form-group toolbar-pf-filter">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn" style="padding-left: 10px">
|
||||
<button id="filter.values.field" type="button" class="btn btn-default dropdown-toggle" id="filter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{$ctrl.filter.text.fieldText}} <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li ng-repeat="option in $ctrl.filter.fieldOptions"
|
||||
id="option.id" ng-click="$ctrl.filter.values.field = option.id;$ctrl.filter.text.fieldText = option.name">{{ option.name }}</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" id="filter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{$ctrl.filter.text.operationText}}<span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li ng-repeat="option in $ctrl.filter.operationOptions"
|
||||
id="option.id" ng-click="$ctrl.filter.values.operation = option.id;$ctrl.filter.text.operationText = option.name">{{ option.name }}</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="text" class="form-control" ng-model="$ctrl.filter.values.value" placeholder="Value" autocomplete="off" id="filterInput">
|
||||
<div class="input-group-btn" style="padding-left: 10px">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" id="filter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{$ctrl.filter.text.sortOrderText}}<span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li ng-repeat="option in $ctrl.filter.sortOptions"
|
||||
id="option.id" ng-click="$ctrl.filter.values.sortOrder = option.id;$ctrl.filter.text.sortOrderText = option.name">{{ option.name }}</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" id="filter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{$ctrl.filter.text.sortByText}}<span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li ng-repeat="option in $ctrl.filter.fieldOptions"
|
||||
id="option.id" ng-click="$ctrl.filter.values.sortColumn = option.id;$ctrl.filter.text.sortByText = option.name">{{ option.name }}</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-link btn-find" ng-click="$ctrl.refresh()" type="button">
|
||||
<span class="fa fa-search"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default primary-action ng-binding ng-scope"
|
||||
type="button"
|
||||
title=""
|
||||
ng-click="$ctrl.reset()">Reset
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-btn" style="padding-left: 10px">
|
||||
<button class="btn btn-default primary-action ng-binding ng-scope"
|
||||
type="button"
|
||||
title=""
|
||||
ng-click="$ctrl.showColumns = true">Columns
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div hawtio-confirm-dialog="$ctrl.showColumns"
|
||||
title="Column Selector"
|
||||
cancel-button-text="Close"
|
||||
on-cancel="$ctrl.updateColumns()"
|
||||
show-ok-button="false">
|
||||
<div class="dialog-body ng-non-bindable" >
|
||||
<table class="table-view-container table table-striped table-bordered table-hover dataTable no-footer">
|
||||
<tr ng-repeat="col in $ctrl.dtOptions.columns">
|
||||
<td>{{ col.name }}</td>
|
||||
<td><input type="checkbox" ng-model="col.visible" placeholder="Name" autocomplete="off" id="name"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
`
|
||||
)
|
||||
$templateCache.put('plugin/artemismessagetoolbar.html',
|
||||
`
|
||||
<div class="row toolbar-pf table-view-pf-toolbar" id="toolbar1">
|
||||
<div class="col-sm-20">
|
||||
<form class="toolbar-pf-actions">
|
||||
<div class="form-group toolbar-pf-filter">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" ng-model="$ctrl.filter.values.value" placeholder="Filter..." autocomplete="off" id="filterInput">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-link btn-find" ng-click="$ctrl.refresh()" type="button">
|
||||
<span class="fa fa-search"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-default primary-action ng-binding ng-scope"
|
||||
type="button"
|
||||
title=""
|
||||
ng-click="$ctrl.reset()">Reset
|
||||
</button>
|
||||
<button ng-show="$ctrl.dlq" class="btn btn-default primary-action ng-binding ng-scope"
|
||||
type="button"
|
||||
title=""
|
||||
ng-click="$ctrl.retry()">Retry Messages
|
||||
</button>
|
||||
<button ng-show="$ctrl.dlq" class="btn btn-default primary-action ng-binding ng-scope"
|
||||
type="button"
|
||||
title=""
|
||||
ng-click="$ctrl.retry()">Move Messages
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
)
|
||||
}
|
||||
configureToolbar.$inject = ['$templateCache'];
|
||||
|
||||
|
||||
|
||||
})(Artemis || (Artemis = {}));
|
201
ui/entaxy-hawtio/entaxy-branding-plugin/LICENSE.txt
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed 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.
|
244
ui/entaxy-hawtio/entaxy-branding-plugin/pom.xml
Normal file
@ -0,0 +1,244 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.ui</groupId>
|
||||
<artifactId>entaxy-hawtio</artifactId>
|
||||
<version>1.8.1</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.ui.hawtio</groupId>
|
||||
<artifactId>entaxy-branding-plugin</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>ENTAXY :: UI :: HAWTIO :: BRANDING</name>
|
||||
<description>ENTAXY :: UI :: HAWTIO :: BRANDING</description>
|
||||
|
||||
<properties>
|
||||
<!-- filtered plugin properties, we don't define plugin-scripts here
|
||||
as we build that dynamically using maven-antrun-plugin below. -->
|
||||
<!-- plugin-context is what context this plugin will handle requests on
|
||||
in the application server -->
|
||||
<plugin-context>/entaxy-branding</plugin-context>
|
||||
|
||||
<!-- plugin-name is the name of our plugin, affects the name used for
|
||||
the plugin's mbean -->
|
||||
<plugin-name>entaxy-branding</plugin-name>
|
||||
|
||||
<!-- plugin-domain is currently unused, we just define it to an empty
|
||||
string -->
|
||||
<plugin-domain />
|
||||
|
||||
<!-- this lets this plugin deploy nicely into karaf, these get used
|
||||
for the ImportPackage directive for maven-bundle-plugin -->
|
||||
<osgi.import>
|
||||
javax.servlet,
|
||||
*;resolution:=optional
|
||||
</osgi.import>
|
||||
|
||||
<webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
|
||||
<webapp-outdir>${basedir}/target/${webapp-dir}</webapp-outdir>
|
||||
<schema-outdir>${basedir}/src/main/webapp/lib</schema-outdir>
|
||||
<appjs-outfile>${webapp-outdir}/app/app.js</appjs-outfile>
|
||||
|
||||
<bundle.osgi.remove.headers>Karaf-Commands,Private-Package,Include-Resource</bundle.osgi.remove.headers>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.hawt</groupId>
|
||||
<artifactId>hawtio-plugin-mbean</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- dependency>
|
||||
<groupId>com.google.errorprone</groupId>
|
||||
<artifactId>error_prone_core</artifactId>
|
||||
</dependency -->
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
<!-- we want to ensure src/main/resources/WEB-INF/web.xml is being filtered
|
||||
so that it picks up all of our javascript files -->
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
|
||||
<!-- We use maven-antrun-plugin to build up a list of
|
||||
javascript files for our plugin mbean, this means
|
||||
it needs to run before the maven-resources-plugin
|
||||
copies and filters the web.xml, since for this
|
||||
example we use contextParam settings to configure
|
||||
our plugin mbean -->
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>${maven-antrun-plugin.version}</version>
|
||||
<executions>
|
||||
|
||||
<execution>
|
||||
<!-- we run this early in the build process before
|
||||
maven-resources-plugin is run. We're exporting the
|
||||
plugin-scripts property from here, so we need to
|
||||
use maven-antrun-plugin 1.6 or up -->
|
||||
<id>generate-sources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<echo>Building plugin javascript file list</echo>
|
||||
<!-- javascript-files will contain all of the javascript in
|
||||
our project -->
|
||||
<fileset id="javascript-files" dir="${basedir}/src/main/webapp">
|
||||
<include name="**/*.js" />
|
||||
</fileset>
|
||||
<!-- we need to strip out the top level path which is
|
||||
our source directory and be sure to change the directory
|
||||
separators to forward slashes -->
|
||||
<pathconvert pathsep="," dirsep="/" property="plugin-scripts" refid="javascript-files">
|
||||
<map from="${basedir}/src/main/webapp/" to="" />
|
||||
</pathconvert>
|
||||
<echo>Files: ${plugin-scripts}</echo>
|
||||
<!--<replace file="${webapp-outdir}/plugin/js/brandingPlugin.js">
|
||||
<replacefilter token="@artemis.version@" value="${project.version}" />
|
||||
</replace>-->
|
||||
|
||||
</target>
|
||||
<!-- this exports plugin-scripts to the maven build, without
|
||||
this line ${plugin-scripts} in the web.xml file won't be
|
||||
replaced -->
|
||||
<exportAntProperties>true</exportAntProperties>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>${maven-resources-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- defining this maven plugin in the same phase as the
|
||||
maven-antrun-plugin but *after* we've configured the
|
||||
maven-antrun-plugin ensures we filter resources *after*
|
||||
we've discovered the plugin .js files. -->
|
||||
<id>copy-resources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>resources</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- maven-bundle-plugin config, needed to make this war
|
||||
deployable in karaf, defines the context that this bundle
|
||||
should handle requests on -->
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-manifest</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<manifestLocation>${webapp-outdir}/META-INF</manifestLocation>
|
||||
<supportedProjectTypes>
|
||||
<supportedProjectType>jar</supportedProjectType>
|
||||
<supportedProjectType>bundle</supportedProjectType>
|
||||
<supportedProjectType>war</supportedProjectType>
|
||||
</supportedProjectTypes>
|
||||
<instructions>
|
||||
<Webapp-Context>${plugin-context}</Webapp-Context>
|
||||
<Web-ContextPath>${plugin-context}</Web-ContextPath>
|
||||
|
||||
<Embed-Directory>WEB-INF/lib</Embed-Directory>
|
||||
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
|
||||
<Embed-Transitive>true</Embed-Transitive>
|
||||
|
||||
<!-- Export-Package>${osgi.export}</Export-Package -->
|
||||
<Import-Package>
|
||||
javax.management;resolution:=optional,
|
||||
org.slf4j;resolution:=optional;version="[1.7,2)",
|
||||
javax.servlet;version="[3.1,4)"
|
||||
</Import-Package>
|
||||
<!-- DynamicImport-Package>${osgi.dynamic}</DynamicImport-Package -->
|
||||
<!-- Private-Package></Private-Package -->
|
||||
|
||||
<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
|
||||
|
||||
<Bundle-Name>${project.name}</Bundle-Name>
|
||||
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
|
||||
<Implementation-Title>Entaxy</Implementation-Title>
|
||||
<Implementation-Version>${project.version}</Implementation-Version>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- We define the maven-war-plugin here and make sure it uses
|
||||
the manifest file generated by the maven-bundle-plugin. We
|
||||
also ensure it picks up our filtered web.xml and not the one
|
||||
in src/main/resources -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
|
||||
<packagingExcludes>**/classes/OSGI-INF/**</packagingExcludes>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<archive>
|
||||
<manifestFile>${webapp-outdir}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
<webResources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>log4j.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/webapp</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>log4j.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</webResources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,74 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-branding-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.ui.hawtio.branding;
|
||||
|
||||
import io.hawt.web.plugin.HawtioPlugin;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
/**
|
||||
* The Plugin Context Listener used to load in the plugin
|
||||
**/
|
||||
public class PluginContextListener implements ServletContextListener {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(PluginContextListener.class);
|
||||
|
||||
HawtioPlugin plugin = null;
|
||||
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent servletContextEvent) {
|
||||
|
||||
ServletContext context = servletContextEvent.getServletContext();
|
||||
|
||||
plugin = new HawtioPlugin();
|
||||
plugin.setContext(context.getContextPath());
|
||||
plugin.setName(context.getInitParameter("plugin-name"));
|
||||
plugin.setScripts(context.getInitParameter("plugin-scripts"));
|
||||
plugin.setDomain(null);
|
||||
|
||||
try {
|
||||
plugin.init();
|
||||
} catch (Exception e) {
|
||||
throw createServletException(e);
|
||||
}
|
||||
|
||||
LOG.info("Initialized {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent servletContextEvent) {
|
||||
try {
|
||||
plugin.destroy();
|
||||
} catch (Exception e) {
|
||||
throw createServletException(e);
|
||||
}
|
||||
|
||||
LOG.info("Destroyed {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
protected RuntimeException createServletException(Exception e) {
|
||||
return new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-branding-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
|
||||
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
|
||||
<description>Entaxy HawtIO branding plugin</description>
|
||||
<display-name>entaxy hawt.io branding plugin</display-name>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-context</param-name>
|
||||
<param-value>${plugin-context}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-name</param-name>
|
||||
<param-value>${plugin-name}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-domain</param-name>
|
||||
<param-value>${plugin-domain}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-scripts</param-name>
|
||||
<param-value>${plugin-scripts}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Disable listing of directories and files</description>
|
||||
<param-name>org.eclipse.jetty.servlet.Default.dirAllowed</param-name>
|
||||
<param-value>false</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
<listener-class>ru.entaxy.ui.hawtio.branding.PluginContextListener</listener-class>
|
||||
</listener>
|
||||
|
||||
|
||||
</web-app>
|
||||
|
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-branding-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
|
||||
<!--
|
||||
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.
|
||||
Architecture
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>hawtio-entaxy-branding</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>hawtio :: Entaxy Branding</h1>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 355 B |
After Width: | Height: | Size: 244 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 149 B |
After Width: | Height: | Size: 403 KiB |
After Width: | Height: | Size: 27 KiB |
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-branding-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
|
||||
<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="256px" height="256px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
|
||||
<path fill="#9E5E09" d="M21.582,56.528c3.029-4.958,6.561-4.238,6.561-4.238l11.102-0.202c2.018,0,5.854,0.404,7.469-1.211
|
||||
c2.928-2.927,9.487-1.615,9.487-1.615c5.249-6.662,4.744,4.845,4.744,4.845c4.356,3.456,5.582,6.017,5.924,7.1
|
||||
c0.118,0.372,0.135,0.844,0.141,0.987c0.319,7.876,9.297,30.266,21.489,30.266c13.625,0,26.14-26.136,40.371-26.136
|
||||
c18.339,0,22.507-22.177,39.251-22.177c19.771,0,32.811,27.623,43.812,27.623c5.617,0,22.948,13.935,24.321,30.291
|
||||
c0.871,1.993,5.341,12.671,3.237,17.643c-2.325,5.497,2.114,3.805,2.537,8.245s-1.269,7.61-4.229,12.261
|
||||
c-2.684,4.217-6.403,2.676-8.336-5.211c-0.091,0.321-0.181,0.637-0.271,0.962c-3.432,12.313-1.312,26.14,0.101,31.085
|
||||
s0.201,6.863,0.201,6.863c-12.717,19.983-12.515,28.865-13.726,33.307c-1.218,4.467,1.614,8.074-6.561,9.184
|
||||
c-8.175,1.11-11.809-2.119-8.579-4.138s4.945-2.019,6.965-4.744c2.019-2.725,7.064-18.269,7.064-18.269s-7.671,12.314-7.469,14.029
|
||||
s1.918,5.35-8.781,3.735c-10.698-1.615,1.111-5.249,3.028-6.662c1.918-1.413,7.267-10.496,10.093-20.186
|
||||
c2.825-9.689,1.211-24.828,1.11-28.36c-0.101-3.533,0.101-6.056-3.836-10.396c-3.936-4.341-6.257-18.873-6.862-22.506
|
||||
c-0.605-3.634-9.892,3.633-18.167,8.477s-30.985,3.532-37.344,2.726c-6.358-0.808-7.771,1.211-7.771,1.211
|
||||
c-0.101,6.358,4.944,30.783,5.348,34.518c0.404,3.735,1.312,29.672,1.312,29.672c0.404,1.918-0.202,9.79,2.422,13.626
|
||||
s-4.037,6.358-7.166,6.358c-6.258,0-15.521-2.704-8.051-6.094c5.563-2.525,4.456-3.578,4.456-3.578
|
||||
c-8.85,0.188-5.589-4.356-5.589-4.356c2.624-2.726,6.358-0.707,5.854-10.599c-0.793-15.543-3.229-22.104-4.743-27.149
|
||||
c-1.514-5.047-7.672-24.93-10.902-31.39c-3.229-6.459-9.891-9.587-11.102-10.799c-1.211-1.21-0.605-0.302-22.405-2.018
|
||||
c-21.8-1.716-31.794-25.635-32.602-31.389c-0.807-5.753-3.936-15.542-13.221-17.258s-8.175-5.551-14.433-5.248
|
||||
c-6.257,0.303-8.074-1.01-8.074-1.01l-1.009-1.514C18.251,60.364,20.472,58.345,21.582,56.528z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 355 B |
After Width: | Height: | Size: 244 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 149 B |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 27 KiB |
@ -0,0 +1,119 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-branding-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/**
|
||||
* The main entry point for the Branding module
|
||||
*/
|
||||
var Branding = (function (Branding) {
|
||||
|
||||
/**
|
||||
* The name of this plugin
|
||||
*/
|
||||
Branding.pluginName = 'entaxy-branding';
|
||||
|
||||
/**
|
||||
* This plugin's logger instance
|
||||
*/
|
||||
Branding.log = Logger.get('entaxy-branding');
|
||||
|
||||
/**
|
||||
* The top level path of this plugin on the server
|
||||
*/
|
||||
Branding.contextPath = '/entaxy-branding';
|
||||
if (hawtioPluginLoader.getPlugins().hasOwnProperty(Branding.pluginName)) {
|
||||
Branding.contextPath = hawtioPluginLoader.getPlugins()[Branding.pluginName]['Context'];
|
||||
}
|
||||
|
||||
/**
|
||||
* This plugin's AngularJS module instance.
|
||||
*/
|
||||
Branding.module = angular.module(Branding.pluginName, [])
|
||||
.run(initPlugin);
|
||||
|
||||
/**
|
||||
* Here you can overwrite hawtconfig.json by putting the JSON
|
||||
* data directly to configManager.config property.
|
||||
*/
|
||||
function initPlugin(configManager, aboutService, $templateCache) {
|
||||
configManager.config = {
|
||||
"branding": {
|
||||
"appName": "Entaxy Management Console",
|
||||
"appLogoUrl": `${Branding.contextPath}/plugin/img/entaxy-white.png`,
|
||||
"companyLogoUrl": `${Branding.contextPath}/plugin/img/entaxy.png`,
|
||||
"css": `${Branding.contextPath}/plugin/css/entaxy.css`,
|
||||
"favicon": `${Branding.contextPath}/plugin/img/favicon.png`
|
||||
},
|
||||
"login": {
|
||||
"description": "Entaxy Management Console",
|
||||
"links": [
|
||||
{
|
||||
"url": "/entaxy-docs/index.html",
|
||||
"target": "_blank",
|
||||
"text": "User Manual"
|
||||
},
|
||||
{
|
||||
"url": "https://entaxy.ru/",
|
||||
"text": "Website"
|
||||
}
|
||||
]
|
||||
},
|
||||
"about": {
|
||||
"title": "Entaxy Management Console",
|
||||
"productInfo": [],
|
||||
"additionalInfo": "",
|
||||
"imgSrc": `${Branding.contextPath}/plugin/img/entaxy.png`
|
||||
},
|
||||
"disabledRoutes": []
|
||||
};
|
||||
|
||||
entaxyTemplateCache = $templateCache;
|
||||
|
||||
aboutService.addProductInfo('Entaxy', '${project.version}');
|
||||
// Calling this function is required to apply the custom css and
|
||||
// favicon settings
|
||||
Core.applyBranding(configManager);
|
||||
|
||||
Branding.log.info(Branding.pluginName, "loaded");
|
||||
|
||||
}
|
||||
initPlugin.$inject = ['configManager', 'aboutService', '$templateCache'];
|
||||
|
||||
return Branding;
|
||||
|
||||
})(Branding || {});
|
||||
|
||||
// !! that's absolutely awful !!
|
||||
// but there's no other way to make those links open in new window
|
||||
window.linkModifier = window.setInterval(function(){
|
||||
if (document.readyState == "complete") {
|
||||
var collection = document.getElementsByTagName("footer").item(0).getElementsByTagName("a");
|
||||
for (var i=0; i<collection.length; i++)
|
||||
collection.item(i).setAttribute("target", "_blank");
|
||||
window.clearInterval(window.linkModifier);
|
||||
}
|
||||
}, 500);
|
||||
|
||||
// tell the Hawtio plugin loader about our plugin so it can be
|
||||
// bootstrapped with the rest of AngularJS
|
||||
hawtioPluginLoader.addModule(Branding.pluginName);
|
||||
|
||||
// entaxyTemplateCache.get("app/src/login/login.component.html")
|
||||
// .replace('<a href="{{link.url}}">', '<a href="{{link.url}}" target="_blank">');
|
||||
|
||||
|
201
ui/entaxy-hawtio/entaxy-h2-plugin/LICENSE.txt
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed 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.
|
256
ui/entaxy-hawtio/entaxy-h2-plugin/pom.xml
Normal file
@ -0,0 +1,256 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.ui</groupId>
|
||||
<artifactId>entaxy-hawtio</artifactId>
|
||||
<version>1.8.1</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.ui.hawtio</groupId>
|
||||
<artifactId>entaxy-h2-plugin</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>ENTAXY :: UI :: HAWTIO :: H2</name>
|
||||
<description>ENTAXY :: UI :: HAWTIO :: H2</description>
|
||||
|
||||
<properties>
|
||||
<!-- filtered plugin properties, we don't define plugin-scripts here
|
||||
as we build that dynamically using maven-antrun-plugin below. -->
|
||||
<!-- plugin-context is what context this plugin will handle requests on
|
||||
in the application server -->
|
||||
<plugin-context>/entaxy-h2</plugin-context>
|
||||
|
||||
<!-- plugin-name is the name of our plugin, affects the name used for
|
||||
the plugin's mbean -->
|
||||
<plugin-name>entaxy-h2</plugin-name>
|
||||
|
||||
<!-- plugin-domain is currently unused, we just define it to an empty
|
||||
string -->
|
||||
<plugin-domain />
|
||||
|
||||
<!-- this lets this plugin deploy nicely into karaf, these get used
|
||||
for the ImportPackage directive for maven-bundle-plugin -->
|
||||
<bundle.osgi.import.pkg>
|
||||
javax.management;resolution:=optional,
|
||||
org.slf4j;resolution:=optional;version="[1.7,2)",
|
||||
javax.servlet;version="[3.1,4)"
|
||||
</bundle.osgi.import.pkg>
|
||||
|
||||
<webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
|
||||
<webapp-outdir>${basedir}/target/${webapp-dir}</webapp-outdir>
|
||||
<schema-outdir>${basedir}/src/main/webapp/lib</schema-outdir>
|
||||
<appjs-outfile>${webapp-outdir}/app/app.js</appjs-outfile>
|
||||
|
||||
<bundle.osgi.remove.headers>Karaf-Commands,Private-Package,Include-Resource</bundle.osgi.remove.headers>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.hawt</groupId>
|
||||
<artifactId>hawtio-plugin-mbean</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- dependency>
|
||||
<groupId>com.google.errorprone</groupId>
|
||||
<artifactId>error_prone_core</artifactId>
|
||||
</dependency -->
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
<!-- we want to ensure src/main/resources/WEB-INF/web.xml is being filtered
|
||||
so that it picks up all of our javascript files -->
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
|
||||
<!-- We use maven-antrun-plugin to build up a list of
|
||||
javascript files for our plugin mbean, this means
|
||||
it needs to run before the maven-resources-plugin
|
||||
copies and filters the web.xml, since for this
|
||||
example we use contextParam settings to configure
|
||||
our plugin mbean -->
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>${maven-antrun-plugin.version}</version>
|
||||
<executions>
|
||||
|
||||
<execution>
|
||||
<!-- we run this early in the build process before
|
||||
maven-resources-plugin is run. We're exporting the
|
||||
plugin-scripts property from here, so we need to
|
||||
use maven-antrun-plugin 1.6 or up -->
|
||||
<id>generate-sources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<echo>Building plugin javascript file list</echo>
|
||||
<!-- javascript-files will contain all of the javascript in
|
||||
our project -->
|
||||
<fileset id="javascript-files-main" dir="${basedir}/src/main/webapp">
|
||||
<include name="**/entaxyH2Plugin.js" />
|
||||
</fileset>
|
||||
<fileset id="javascript-files-others" dir="${basedir}/src/main/webapp">
|
||||
<include name="**/*.js" />
|
||||
<exclude name="**/entaxyH2Plugin.js" />
|
||||
</fileset>
|
||||
<!-- we need to strip out the top level path which is
|
||||
our source directory and be sure to change the directory
|
||||
separators to forward slashes -->
|
||||
<pathconvert pathsep="," dirsep="/" property="plugin-scripts-main" refid="javascript-files-main">
|
||||
<map from="${basedir}/src/main/webapp/" to="" />
|
||||
</pathconvert>
|
||||
<pathconvert pathsep="," dirsep="/" property="plugin-scripts-others" refid="javascript-files-others">
|
||||
<map from="${basedir}/src/main/webapp/" to="" />
|
||||
</pathconvert>
|
||||
|
||||
<property name="plugin-scripts" value="${plugin-scripts-main},${plugin-scripts-others}" />
|
||||
|
||||
<echo>Files: ${plugin-scripts}</echo>
|
||||
<!--<replace file="${webapp-outdir}/plugin/js/brandingPlugin.js">
|
||||
<replacefilter token="@artemis.version@" value="${project.version}" />
|
||||
</replace>-->
|
||||
|
||||
</target>
|
||||
<!-- this exports plugin-scripts to the maven build, without
|
||||
this line ${plugin-scripts} in the web.xml file won't be
|
||||
replaced -->
|
||||
<exportAntProperties>true</exportAntProperties>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>${maven-resources-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- defining this maven plugin in the same phase as the
|
||||
maven-antrun-plugin but *after* we've configured the
|
||||
maven-antrun-plugin ensures we filter resources *after*
|
||||
we've discovered the plugin .js files. -->
|
||||
<id>copy-resources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>resources</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- maven-bundle-plugin config, needed to make this war
|
||||
deployable in karaf, defines the context that this bundle
|
||||
should handle requests on -->
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-manifest</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<manifestLocation>${webapp-outdir}/META-INF</manifestLocation>
|
||||
<supportedProjectTypes>
|
||||
<supportedProjectType>jar</supportedProjectType>
|
||||
<supportedProjectType>bundle</supportedProjectType>
|
||||
<supportedProjectType>war</supportedProjectType>
|
||||
</supportedProjectTypes>
|
||||
<instructions>
|
||||
<Webapp-Context>${plugin-context}</Webapp-Context>
|
||||
<Web-ContextPath>${plugin-context}</Web-ContextPath>
|
||||
|
||||
<Embed-Directory>WEB-INF/lib</Embed-Directory>
|
||||
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
|
||||
<Embed-Transitive>true</Embed-Transitive>
|
||||
|
||||
<!-- Export-Package>${osgi.export}</Export-Package -->
|
||||
<!-- Import-Package>
|
||||
javax.management;resolution:=optional,
|
||||
org.slf4j;resolution:=optional;version="[1.7,2)",
|
||||
javax.servlet;version="[3.1,4)"
|
||||
</Import-Package -->
|
||||
<!-- DynamicImport-Package>${osgi.dynamic}</DynamicImport-Package -->
|
||||
<!-- Private-Package></Private-Package -->
|
||||
|
||||
<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
|
||||
|
||||
<Bundle-Name>${project.name}</Bundle-Name>
|
||||
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
|
||||
<Implementation-Title>Entaxy</Implementation-Title>
|
||||
<Implementation-Version>${project.version}</Implementation-Version>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- We define the maven-war-plugin here and make sure it uses
|
||||
the manifest file generated by the maven-bundle-plugin. We
|
||||
also ensure it picks up our filtered web.xml and not the one
|
||||
in src/main/resources -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
|
||||
<packagingExcludes>**/classes/OSGI-INF/**</packagingExcludes>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<archive>
|
||||
<manifestFile>${webapp-outdir}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
<webResources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>log4j.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/webapp</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>log4j.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</webResources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,72 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-management-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.ui.hawtio.h2;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import io.hawt.web.plugin.HawtioPlugin;
|
||||
|
||||
public class PluginContextListener implements ServletContextListener {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PluginContextListener.class);
|
||||
|
||||
HawtioPlugin plugin = null;
|
||||
|
||||
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent sce) {
|
||||
ServletContext context = sce.getServletContext();
|
||||
|
||||
plugin = new HawtioPlugin();
|
||||
plugin.setContext(context.getContextPath());
|
||||
plugin.setName(context.getInitParameter("plugin-name"));
|
||||
plugin.setScripts(context.getInitParameter("plugin-scripts"));
|
||||
plugin.setDomain(null);
|
||||
|
||||
try {
|
||||
plugin.init();
|
||||
} catch (Exception e) {
|
||||
throw createServletException(e);
|
||||
}
|
||||
|
||||
log.info("Initialized {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent sce) {
|
||||
try {
|
||||
plugin.destroy();
|
||||
} catch (Exception e) {
|
||||
throw createServletException(e);
|
||||
}
|
||||
|
||||
log.info("Destroyed {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
protected RuntimeException createServletException(Exception e) {
|
||||
return new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-management-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
|
||||
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
|
||||
<description>Entaxy HawtIO management plugin</description>
|
||||
<display-name>entaxy hawt.io management plugin</display-name>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-context</param-name>
|
||||
<param-value>${plugin-context}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-name</param-name>
|
||||
<param-value>${plugin-name}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-domain</param-name>
|
||||
<param-value>${plugin-domain}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-scripts</param-name>
|
||||
<param-value>${plugin-scripts}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Disable listing of directories and files</description>
|
||||
<param-name>org.eclipse.jetty.servlet.Default.dirAllowed</param-name>
|
||||
<param-value>false</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
<listener-class>ru.entaxy.ui.hawtio.h2.PluginContextListener</listener-class>
|
||||
</listener>
|
||||
|
||||
|
||||
</web-app>
|
||||
|
31
ui/entaxy-hawtio/entaxy-h2-plugin/src/main/webapp/index.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-management-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Entaxy H2 plugin</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hawtio :: Entaxy H2 plugin</h1>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,76 @@
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-management-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
<form class="form-horizontal artemis-preferences-form" ng-controller="Artemis.PreferencesController">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisUserName">
|
||||
Artemis user name
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="The user name to be used when connecting to the broker"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input id="artemisUserName" type="text" class="form-control" ng-model="artemisUserName"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisPassword">
|
||||
Artemis password
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="The user name to be used when connecting to the broker"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input id="artemisPassword" type="password" class="form-control" ng-model="artemisPassword"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisDLQ">
|
||||
Dead-letter address regex
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="A regular expression to match one or more dead-letter addresses"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" id="artemisDLQ" ng-model="artemisDLQ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisExpiryQueue">
|
||||
Expiry address regex
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="A regular expression to match one or more expiry addresses"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" id="artemisExpiryQueue" ng-model="artemisExpiryQueue">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisBrowseBytesMessages">
|
||||
Display message body as
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="Browsing byte messages should display the message body as"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<select id="artemisBrowseBytesMessages"
|
||||
ng-model="artemisBrowseBytesMessages"
|
||||
ng-options="key for (key, value) in messageBodyDisplayOptions"
|
||||
ng-selected="artemisBrowseBytesMessages === value">
|
||||
</select>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
</form>
|
@ -0,0 +1,22 @@
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-management-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
<div class="tree-nav-sidebar-content">
|
||||
<div id="entaxyh2tree" class="treeview-pf-hover treeview-pf-select"></div>
|
||||
</div>
|
@ -0,0 +1,43 @@
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-management-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
<div class="tree-nav-sidebar-header">
|
||||
<form role="form" class="search-pf has-button">
|
||||
<div class="form-group has-clear">
|
||||
<div class="search-pf-input-group">
|
||||
<label for="input-search" class="sr-only">Search Tree:</label>
|
||||
<input id="input-search" type="search" class="form-control" placeholder="Search tree:"
|
||||
ng-model="$ctrl.filter">
|
||||
<button type="button" class="clear" aria-hidden="true"
|
||||
ng-hide="$ctrl.filter.length === 0"
|
||||
ng-click="$ctrl.filter = ''">
|
||||
<span class="pficon pficon-close"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group tree-nav-buttons">
|
||||
<span class="badge" ng-class="{positive: $ctrl.result.length > 0}"
|
||||
ng-show="$ctrl.filter.length > 0">
|
||||
{{$ctrl.result.length}}
|
||||
</span>
|
||||
<i class="fa fa-plus-square-o" title="Expand All" ng-click="$ctrl.expandAll()"></i>
|
||||
<i class="fa fa-minus-square-o" title="Collapse All" ng-click="$ctrl.contractAll()"></i>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
@ -0,0 +1,74 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-h2-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
var EntaxyH2;
|
||||
(function (EntaxyH2) {
|
||||
EntaxyH2.log.debug("loading console");
|
||||
|
||||
EntaxyH2._module
|
||||
.component('entaxyH2Console', {
|
||||
template: `<iframe id="h2consoleFrame" src='/h2console/h2console/' style="width: 100%; height: 100%; overflow: scroll; border: none"></iframe>`,
|
||||
controller: EntaxyH2ConsoleController
|
||||
})
|
||||
.name;
|
||||
|
||||
function EntaxyH2ConsoleController($scope, $element, $location, workspace, localStorage, jolokia) {
|
||||
'ngInject';
|
||||
var ctrl = this;
|
||||
this.$location = $location;
|
||||
entaxyH2location = this.$location;
|
||||
entaxyH2ctrl = ctrl;
|
||||
entaxyH2scope = $scope;
|
||||
entaxyH2element = $element;
|
||||
|
||||
var iFrame = $element.context.childNodes[0];
|
||||
|
||||
this.prepareUrl = (function (){
|
||||
var path = workspace.selection.entries.path;
|
||||
var resultPath = path;
|
||||
if ((path.at(1)=="_") && (path.at(2)=="/")) {
|
||||
resultPath = path.substring(0,1) + ":" + path.substring(2);
|
||||
}
|
||||
return "jdbc:h2:" + resultPath;
|
||||
}).bind(this);
|
||||
|
||||
this.onLoad = (function() {
|
||||
if (iFrame.contentDocument.getElementById('login')){
|
||||
var form = iFrame.contentDocument.getElementById('login');
|
||||
|
||||
// set correct connection url
|
||||
form.getElementsByTagName('input')
|
||||
.namedItem("url").value = this.prepareUrl();
|
||||
|
||||
// add href for opening in new window
|
||||
var p = form.getElementsByTagName("p").item(0);
|
||||
var space = angular.element('<span> </span>');
|
||||
var link = angular.element('<a href="/h2console/h2console" target="_blank">[Open in new window]</a>');
|
||||
angular.element(p).append(space);
|
||||
angular.element(p).append(link);
|
||||
}
|
||||
}).bind(this);
|
||||
|
||||
|
||||
iFrame.onload = this.onLoad;
|
||||
|
||||
}
|
||||
EntaxyH2ConsoleController.$inject = ['$scope', '$element', '$location', 'workspace', 'localStorage', 'jolokia']
|
||||
|
||||
})(EntaxyH2 || (EntaxyH2 = {}));
|
@ -0,0 +1,113 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-management-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
var EntaxyH2;
|
||||
(function (EntaxyH2) {
|
||||
EntaxyH2.log.debug("loading navigation");
|
||||
var TAB_CONFIG = {
|
||||
attributes: {
|
||||
title: 'Attributes',
|
||||
route: '/h2/attributes'
|
||||
},
|
||||
operations: {
|
||||
title: 'Operations',
|
||||
route: '/h2/operations'
|
||||
},
|
||||
chart: {
|
||||
title: 'Chart',
|
||||
route: '/h2/charts'
|
||||
},
|
||||
console: {
|
||||
title: 'H2 Console',
|
||||
route: '/h2/console'
|
||||
}
|
||||
};
|
||||
EntaxyH2._module
|
||||
.config(configureRoutes)
|
||||
.component('entaxyH2Navigation', {
|
||||
template: `<hawtio-tabs tabs="$ctrl.tabs" on-change="$ctrl.goto(tab)"></hawtio-tabs>`,
|
||||
controller: EntaxyH2NavigationController
|
||||
})
|
||||
.name;
|
||||
EntaxyH2.log.debug("loaded navigation " + EntaxyH2.navigationModule);
|
||||
|
||||
function EntaxyH2NavigationController($scope, $location, workspace, localStorage, jolokia) {
|
||||
'ngInject';
|
||||
var ctrl = this;
|
||||
this.$location = $location;
|
||||
entaxyH2JmxDomain = localStorage['entaxyH2JmxDomain'] || "org.h2";
|
||||
|
||||
entaxyH2workspace = workspace;
|
||||
|
||||
$scope.$on('jmxTreeClicked', function () {
|
||||
ctrl.tabs = getTabs();
|
||||
var tab = _.find(ctrl.tabs, { path: ctrl.$location.path() });
|
||||
if (!tab) {
|
||||
tab = ctrl.tabs[0];
|
||||
}
|
||||
ctrl.$location.path(tab.path);
|
||||
});
|
||||
|
||||
EntaxyH2NavigationController.prototype.$onInit = function () {
|
||||
this.tabs = getTabs();
|
||||
};
|
||||
|
||||
EntaxyH2NavigationController.prototype.goto = function (tab) {
|
||||
this.$location.path(tab.path);
|
||||
};
|
||||
|
||||
function getTabs() {
|
||||
|
||||
var tabs = [];
|
||||
var enabledRoutes = Object.keys(TAB_CONFIG)
|
||||
.map(function (config) { return TAB_CONFIG[config].route; })
|
||||
.filter(function (route) { return _.startsWith(route, '/h2'); });
|
||||
if (enabledRoutes.length > 0) {
|
||||
|
||||
if (shouldShowConsole(workspace)) {
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.console.title, TAB_CONFIG.console.route));
|
||||
}
|
||||
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.attributes.title, TAB_CONFIG.attributes.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.operations.title, TAB_CONFIG.operations.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.chart.title, TAB_CONFIG.chart.route));
|
||||
}
|
||||
return tabs;
|
||||
}
|
||||
|
||||
function shouldShowConsole(workspace) {
|
||||
return workspace.selectionHasDomain(entaxyH2JmxDomain)
|
||||
&& workspace.selection
|
||||
&& workspace.selection.entries.path;
|
||||
}
|
||||
|
||||
}
|
||||
EntaxyH2NavigationController.$inject = ['$scope', '$location', 'workspace', 'localStorage', 'jolokia']
|
||||
|
||||
function configureRoutes($routeProvider) {
|
||||
$routeProvider.
|
||||
when('/h2/attributes', { templateUrl: 'plugins/jmx/html/attributes/attributes.html' }).
|
||||
when('/h2/operations', { template: '<operations></operations>' }).
|
||||
when('/h2/charts', { templateUrl: 'plugins/jmx/html/charts.html' }).
|
||||
when('/h2/console', { template: '<entaxy-h2-console></entaxy-h2-console>' });
|
||||
}
|
||||
configureRoutes.$inject = ['$routeProvider'];
|
||||
|
||||
})(EntaxyH2 || (EntaxyH2 = {}));
|
||||
|
@ -0,0 +1,193 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-management-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
var EntaxyH2;
|
||||
(function (EntaxyH2) {
|
||||
EntaxyH2._module.component('entaxyH2TreeHeader', {
|
||||
template:
|
||||
`<div class="tree-nav-sidebar-header">
|
||||
<form role="form" class="search-pf has-button">
|
||||
<div class="form-group has-clear">
|
||||
<div class="search-pf-input-group">
|
||||
<label for="input-search" class="sr-only">Search Tree:</label>
|
||||
<input id="input-search" type="search" class="form-control" placeholder="Search tree:"
|
||||
ng-model="$ctrl.filter">
|
||||
<button type="button" class="clear" aria-hidden="true"
|
||||
ng-hide="$ctrl.filter.length === 0"
|
||||
ng-click="$ctrl.filter = ''">
|
||||
<span class="pficon pficon-close"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group tree-nav-buttons">
|
||||
<span class="badge" ng-class="{positive: $ctrl.result.length > 0}"
|
||||
ng-show="$ctrl.filter.length > 0">
|
||||
{{$ctrl.result.length}}
|
||||
</span>
|
||||
<i class="fa fa-plus-square-o" title="Expand All" ng-click="$ctrl.expandAll()"></i>
|
||||
<i class="fa fa-minus-square-o" title="Collapse All" ng-click="$ctrl.contractAll()"></i>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
`,
|
||||
controller: EntaxyH2TreeHeaderController
|
||||
})
|
||||
.component('entaxyH2Tree', {
|
||||
template:
|
||||
`<div class="tree-nav-sidebar-content">
|
||||
<div id="entaxyh2tree" class="treeview-pf-hover treeview-pf-select"></div>
|
||||
</div>
|
||||
`,
|
||||
controller: EntaxyH2TreeController
|
||||
})
|
||||
.name;
|
||||
entaxyH2TreeElementId = '#entaxyh2tree';
|
||||
EntaxyH2.log.debug("loaded tree" + EntaxyH2.treeModule);
|
||||
|
||||
|
||||
function EntaxyH2TreeHeaderController($scope, $element) {
|
||||
'ngInject';
|
||||
EntaxyH2.log.debug("EntaxyH2TreeHeaderController ");
|
||||
this.$scope = $scope;
|
||||
this.$element = $element;
|
||||
this.filter = '';
|
||||
this.result = [];
|
||||
// it's not possible to declare classes to the component host tag in AngularJS
|
||||
$element.addClass('tree-nav-sidebar-header');
|
||||
|
||||
EntaxyH2TreeHeaderController.prototype.$onInit = function () {
|
||||
EntaxyH2.log.debug("EntaxyH2TreeHeaderController init");
|
||||
var _this = this;
|
||||
this.$scope.$watch(angular.bind(this, function () { return _this.filter; }), function (filter, previous) {
|
||||
if (filter !== previous) {
|
||||
_this.search(filter);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
EntaxyH2TreeHeaderController.prototype.search = function (filter) {
|
||||
EntaxyH2.log.debug("EntaxyH2TreeHeaderController search");
|
||||
var _this = this;
|
||||
var doSearch = function (filter) {
|
||||
var result = _this.tree().search(filter, {
|
||||
ignoreCase: true,
|
||||
exactMatch: false,
|
||||
revealResults: true
|
||||
});
|
||||
_this.result.length = 0;
|
||||
(_a = _this.result).push.apply(_a, result);
|
||||
Core.$apply(_this.$scope);
|
||||
var _a;
|
||||
};
|
||||
_.debounce(doSearch, 300, { leading: false, trailing: true })(filter);
|
||||
};
|
||||
|
||||
EntaxyH2TreeHeaderController.prototype.tree = function () {
|
||||
EntaxyH2.log.debug("EntaxyH2TreeHeaderController tree");
|
||||
return $(entaxyH2TreeElementId).treeview(true);
|
||||
};
|
||||
|
||||
EntaxyH2TreeHeaderController.prototype.expandAll = function () {
|
||||
EntaxyH2.log.debug("EntaxyH2TreeHeaderController expand");
|
||||
return this.tree()
|
||||
.expandNode(this.tree().getNodes(), { levels: HawtioTree.getMaxTreeLevel(this.tree()), silent: true });
|
||||
};
|
||||
|
||||
EntaxyH2TreeHeaderController.prototype.contractAll = function () {
|
||||
EntaxyH2.log.debug("EntaxyH2TreeHeaderController contract");
|
||||
return this.tree()
|
||||
.collapseNode(this.tree().getNodes(), { ignoreChildren: true, silent: true });
|
||||
};
|
||||
}
|
||||
EntaxyH2TreeHeaderController.$inject = ['$scope', '$element'];
|
||||
|
||||
function EntaxyH2TreeController($scope, $location, workspace, $element) {
|
||||
'ngInject';
|
||||
this.$scope = $scope;
|
||||
this.$location = $location;
|
||||
this.workspace = workspace;
|
||||
this.$element = $element;
|
||||
// it's not possible to declare classes to the component host tag in AngularJS
|
||||
$element.addClass('tree-nav-sidebar-content');
|
||||
EntaxyH2.log.debug("EntaxyH2TreeController ");
|
||||
var entaxyH2JmxDomain = localStorage['entaxyH2JmxDomain'] || "org.h2";
|
||||
EntaxyH2TreeController.prototype.$onInit = function () {
|
||||
EntaxyH2.log.debug("EntaxyH2TreeController onInit");
|
||||
var _this = this;
|
||||
this.$scope.$on('$destroy', function () { return _this.removeTree(); });
|
||||
this.$scope.$on('$routeChangeStart', function () { return Jmx.updateTreeSelectionFromURL(_this.$location, $(entaxyH2TreeElementId)); });
|
||||
this.$scope.$on('jmxTreeUpdated', function () { return _this.populateTree(); });
|
||||
this.populateTree();
|
||||
};
|
||||
EntaxyH2TreeController.prototype.updateSelectionFromURL = function () {
|
||||
Jmx.updateTreeSelectionFromURLAndAutoSelect(this.$location, $(entaxyH2TreeElementId), function (first) {
|
||||
if (first.children == null) {
|
||||
return null;
|
||||
}
|
||||
// use function to auto select the queue folder on the 1st broker
|
||||
var queues = first.children[0];
|
||||
if (queues && queues.text === 'Queue') {
|
||||
return queues;
|
||||
}
|
||||
return null;
|
||||
}, true);
|
||||
};
|
||||
EntaxyH2TreeController.prototype.populateTree = function () {
|
||||
var _this = this;
|
||||
var children = [];
|
||||
var tree = this.workspace.tree;
|
||||
EntaxyH2.log.debug("tree= "+tree);
|
||||
if (tree) {
|
||||
var domainName = entaxyH2JmxDomain;
|
||||
var folder = tree.get(domainName);
|
||||
|
||||
if (folder) {
|
||||
children = folder.children;
|
||||
}
|
||||
angular.forEach(children, function(child) {
|
||||
EntaxyH2.log.debug("child=" + child.text + " " + child.id);
|
||||
});
|
||||
var treeElement = $("#entaxyh2tree");
|
||||
this.removeTree();
|
||||
Jmx.enableTree(this.$scope, this.$location, this.workspace, $(entaxyH2TreeElementId), children);
|
||||
this.updateSelectionFromURL();
|
||||
}
|
||||
};
|
||||
EntaxyH2TreeController.prototype.removeTree = function () {
|
||||
var tree = $(entaxyH2TreeElementId).treeview(true);
|
||||
// There is no exposed API to check whether the tree has already been initialized,
|
||||
// so let's just check if the methods are presents
|
||||
if (tree.clearSearch) {
|
||||
tree.clearSearch();
|
||||
// Bootstrap tree view leaks the node elements into the data structure
|
||||
// so let's clean this up when the user leaves the view
|
||||
var cleanTreeFolder_1 = function (node) {
|
||||
delete node['$el'];
|
||||
if (node.nodes)
|
||||
node.nodes.forEach(cleanTreeFolder_1);
|
||||
};
|
||||
cleanTreeFolder_1(this.workspace.tree);
|
||||
// Then call the tree clean-up method
|
||||
tree.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
EntaxyH2TreeController.$inject = ['$scope', '$location', 'workspace', '$element'];
|
||||
|
||||
})(EntaxyH2 || (EntaxyH2 = {}));
|
@ -0,0 +1,84 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-management-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/**
|
||||
* The main entry point for the Simple module
|
||||
*/
|
||||
var EntaxyH2 = (function (EntaxyH2) {
|
||||
|
||||
/**
|
||||
* The name of this plugin
|
||||
*/
|
||||
EntaxyH2.pluginName = 'entaxy-h2';
|
||||
|
||||
/**
|
||||
* This plugin's logger instance
|
||||
*/
|
||||
EntaxyH2.log = Logger.get('entaxy-h2');
|
||||
|
||||
/**
|
||||
* The top level path of this plugin on the server
|
||||
*/
|
||||
EntaxyH2.contextPath = "/entaxy-h2/";
|
||||
|
||||
EntaxyH2.log.info("loading entaxy h2 plugin")
|
||||
EntaxyH2._module = angular.module(EntaxyH2.pluginName, [
|
||||
'angularResizable'
|
||||
])
|
||||
.component('entaxyH2', {
|
||||
template:
|
||||
`<div class="tree-nav-layout">
|
||||
<div class="sidebar-pf sidebar-pf-left" resizable r-directions="['right']">
|
||||
<entaxy-h2-tree-header></entaxy-h2-tree-header>
|
||||
<entaxy-h2-tree></entaxy-h2-tree>
|
||||
</div>
|
||||
<div class="tree-nav-main">
|
||||
<jmx-header></jmx-header>
|
||||
<entaxy-h2-navigation></entaxy-h2-navigation>
|
||||
<div class="contents" ng-view></div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
.run(configurePlugin);
|
||||
|
||||
function configurePlugin(mainNavService, workspace, helpRegistry, preferencesRegistry, localStorage, preLogoutTasks, documentBase, $templateCache) {
|
||||
var entaxyH2JmxDomain = localStorage['entaxyH2JmxDomain'] || "org.h2";
|
||||
mainNavService.addItem({
|
||||
title: 'H2',
|
||||
basePath: '/h2',
|
||||
template: '<entaxy-h2></entaxy-h2>',
|
||||
isValid: function () { return workspace.treeContainsDomainAndProperties(entaxyH2JmxDomain); }
|
||||
});
|
||||
// clean up local storage upon logout
|
||||
/* preLogoutTasks.addTask('CleanupArtemisCredentials', function () {
|
||||
Artemis.log.debug("Clean up Artemis credentials in local storage");
|
||||
localStorage.removeItem('artemisUserName');
|
||||
localStorage.removeItem('artemisPassword');
|
||||
}); */
|
||||
}
|
||||
configurePlugin.$inject = ['mainNavService', 'workspace', 'helpRegistry', 'preferencesRegistry', 'localStorage', 'preLogoutTasks', 'documentBase', '$templateCache'];
|
||||
|
||||
return EntaxyH2;
|
||||
|
||||
})(EntaxyH2 || {});
|
||||
|
||||
// tell the Hawtio plugin loader about our plugin so it can be
|
||||
// bootstrapped with the rest of AngularJS
|
||||
hawtioPluginLoader.addModule(EntaxyH2.pluginName);
|
201
ui/entaxy-hawtio/entaxy-management-plugin/LICENSE.txt
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed 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.
|
256
ui/entaxy-hawtio/entaxy-management-plugin/pom.xml
Normal file
@ -0,0 +1,256 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.ui</groupId>
|
||||
<artifactId>entaxy-hawtio</artifactId>
|
||||
<version>1.8.1</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.ui.hawtio</groupId>
|
||||
<artifactId>entaxy-management-plugin</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>ENTAXY :: UI :: HAWTIO :: ENTAXY MANAGEMENT</name>
|
||||
<description>ENTAXY :: UI :: HAWTIO :: ENTAXY MANAGEMENT</description>
|
||||
|
||||
<properties>
|
||||
<!-- filtered plugin properties, we don't define plugin-scripts here
|
||||
as we build that dynamically using maven-antrun-plugin below. -->
|
||||
<!-- plugin-context is what context this plugin will handle requests on
|
||||
in the application server -->
|
||||
<plugin-context>/entaxy-management</plugin-context>
|
||||
|
||||
<!-- plugin-name is the name of our plugin, affects the name used for
|
||||
the plugin's mbean -->
|
||||
<plugin-name>entaxy-management</plugin-name>
|
||||
|
||||
<!-- plugin-domain is currently unused, we just define it to an empty
|
||||
string -->
|
||||
<plugin-domain />
|
||||
|
||||
<!-- this lets this plugin deploy nicely into karaf, these get used
|
||||
for the ImportPackage directive for maven-bundle-plugin -->
|
||||
<bundle.osgi.import.pkg>
|
||||
javax.management;resolution:=optional,
|
||||
org.slf4j;resolution:=optional;version="[1.7,2)",
|
||||
javax.servlet;version="[3.1,4)"
|
||||
</bundle.osgi.import.pkg>
|
||||
|
||||
<webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
|
||||
<webapp-outdir>${basedir}/target/${webapp-dir}</webapp-outdir>
|
||||
<schema-outdir>${basedir}/src/main/webapp/lib</schema-outdir>
|
||||
<appjs-outfile>${webapp-outdir}/app/app.js</appjs-outfile>
|
||||
|
||||
<bundle.osgi.remove.headers>Karaf-Commands,Private-Package,Include-Resource</bundle.osgi.remove.headers>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.hawt</groupId>
|
||||
<artifactId>hawtio-plugin-mbean</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- dependency>
|
||||
<groupId>com.google.errorprone</groupId>
|
||||
<artifactId>error_prone_core</artifactId>
|
||||
</dependency -->
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
<!-- we want to ensure src/main/resources/WEB-INF/web.xml is being filtered
|
||||
so that it picks up all of our javascript files -->
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
|
||||
<!-- We use maven-antrun-plugin to build up a list of
|
||||
javascript files for our plugin mbean, this means
|
||||
it needs to run before the maven-resources-plugin
|
||||
copies and filters the web.xml, since for this
|
||||
example we use contextParam settings to configure
|
||||
our plugin mbean -->
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>${maven-antrun-plugin.version}</version>
|
||||
<executions>
|
||||
|
||||
<execution>
|
||||
<!-- we run this early in the build process before
|
||||
maven-resources-plugin is run. We're exporting the
|
||||
plugin-scripts property from here, so we need to
|
||||
use maven-antrun-plugin 1.6 or up -->
|
||||
<id>generate-sources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<echo>Building plugin javascript file list</echo>
|
||||
<!-- javascript-files will contain all of the javascript in
|
||||
our project -->
|
||||
<fileset id="javascript-files-main" dir="${basedir}/src/main/webapp">
|
||||
<include name="**/entaxyPlugin.js" />
|
||||
</fileset>
|
||||
<fileset id="javascript-files-others" dir="${basedir}/src/main/webapp">
|
||||
<include name="**/*.js" />
|
||||
<exclude name="**/entaxyPlugin.js" />
|
||||
</fileset>
|
||||
<!-- we need to strip out the top level path which is
|
||||
our source directory and be sure to change the directory
|
||||
separators to forward slashes -->
|
||||
<pathconvert pathsep="," dirsep="/" property="plugin-scripts-main" refid="javascript-files-main">
|
||||
<map from="${basedir}/src/main/webapp/" to="" />
|
||||
</pathconvert>
|
||||
<pathconvert pathsep="," dirsep="/" property="plugin-scripts-others" refid="javascript-files-others">
|
||||
<map from="${basedir}/src/main/webapp/" to="" />
|
||||
</pathconvert>
|
||||
|
||||
<property name="plugin-scripts" value="${plugin-scripts-main},${plugin-scripts-others}" />
|
||||
|
||||
<echo>Files: ${plugin-scripts}</echo>
|
||||
<!--<replace file="${webapp-outdir}/plugin/js/brandingPlugin.js">
|
||||
<replacefilter token="@artemis.version@" value="${project.version}" />
|
||||
</replace>-->
|
||||
|
||||
</target>
|
||||
<!-- this exports plugin-scripts to the maven build, without
|
||||
this line ${plugin-scripts} in the web.xml file won't be
|
||||
replaced -->
|
||||
<exportAntProperties>true</exportAntProperties>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>${maven-resources-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- defining this maven plugin in the same phase as the
|
||||
maven-antrun-plugin but *after* we've configured the
|
||||
maven-antrun-plugin ensures we filter resources *after*
|
||||
we've discovered the plugin .js files. -->
|
||||
<id>copy-resources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>resources</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- maven-bundle-plugin config, needed to make this war
|
||||
deployable in karaf, defines the context that this bundle
|
||||
should handle requests on -->
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-manifest</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<manifestLocation>${webapp-outdir}/META-INF</manifestLocation>
|
||||
<supportedProjectTypes>
|
||||
<supportedProjectType>jar</supportedProjectType>
|
||||
<supportedProjectType>bundle</supportedProjectType>
|
||||
<supportedProjectType>war</supportedProjectType>
|
||||
</supportedProjectTypes>
|
||||
<instructions>
|
||||
<Webapp-Context>${plugin-context}</Webapp-Context>
|
||||
<Web-ContextPath>${plugin-context}</Web-ContextPath>
|
||||
|
||||
<Embed-Directory>WEB-INF/lib</Embed-Directory>
|
||||
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
|
||||
<Embed-Transitive>true</Embed-Transitive>
|
||||
|
||||
<!-- Export-Package>${osgi.export}</Export-Package -->
|
||||
<!-- Import-Package>
|
||||
javax.management;resolution:=optional,
|
||||
org.slf4j;resolution:=optional;version="[1.7,2)",
|
||||
javax.servlet;version="[3.1,4)"
|
||||
</Import-Package -->
|
||||
<!-- DynamicImport-Package>${osgi.dynamic}</DynamicImport-Package -->
|
||||
<!-- Private-Package></Private-Package -->
|
||||
|
||||
<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
|
||||
|
||||
<Bundle-Name>${project.name}</Bundle-Name>
|
||||
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
|
||||
<Implementation-Title>Entaxy</Implementation-Title>
|
||||
<Implementation-Version>${project.version}</Implementation-Version>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- We define the maven-war-plugin here and make sure it uses
|
||||
the manifest file generated by the maven-bundle-plugin. We
|
||||
also ensure it picks up our filtered web.xml and not the one
|
||||
in src/main/resources -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
|
||||
<packagingExcludes>**/classes/OSGI-INF/**</packagingExcludes>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<archive>
|
||||
<manifestFile>${webapp-outdir}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
<webResources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>log4j.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/webapp</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>log4j.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</webResources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,72 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-management-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.ui.hawtio.management;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import io.hawt.web.plugin.HawtioPlugin;
|
||||
|
||||
public class PluginContextListener implements ServletContextListener {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PluginContextListener.class);
|
||||
|
||||
HawtioPlugin plugin = null;
|
||||
|
||||
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent sce) {
|
||||
ServletContext context = sce.getServletContext();
|
||||
|
||||
plugin = new HawtioPlugin();
|
||||
plugin.setContext(context.getContextPath());
|
||||
plugin.setName(context.getInitParameter("plugin-name"));
|
||||
plugin.setScripts(context.getInitParameter("plugin-scripts"));
|
||||
plugin.setDomain(null);
|
||||
|
||||
try {
|
||||
plugin.init();
|
||||
} catch (Exception e) {
|
||||
throw createServletException(e);
|
||||
}
|
||||
|
||||
log.info("Initialized {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent sce) {
|
||||
try {
|
||||
plugin.destroy();
|
||||
} catch (Exception e) {
|
||||
throw createServletException(e);
|
||||
}
|
||||
|
||||
log.info("Destroyed {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
protected RuntimeException createServletException(Exception e) {
|
||||
return new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-management-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
|
||||
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
|
||||
<description>Entaxy HawtIO management plugin</description>
|
||||
<display-name>entaxy hawt.io management plugin</display-name>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-context</param-name>
|
||||
<param-value>${plugin-context}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-name</param-name>
|
||||
<param-value>${plugin-name}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-domain</param-name>
|
||||
<param-value>${plugin-domain}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Plugin's path on the server</description>
|
||||
<param-name>plugin-scripts</param-name>
|
||||
<param-value>${plugin-scripts}</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<description>Disable listing of directories and files</description>
|
||||
<param-name>org.eclipse.jetty.servlet.Default.dirAllowed</param-name>
|
||||
<param-value>false</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
<listener-class>ru.entaxy.ui.hawtio.management.PluginContextListener</listener-class>
|
||||
</listener>
|
||||
|
||||
|
||||
</web-app>
|
||||
|
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-management-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Entaxy plugin</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hawtio :: Entaxy plugin</h1>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,76 @@
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-management-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
<form class="form-horizontal artemis-preferences-form" ng-controller="Artemis.PreferencesController">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisUserName">
|
||||
Artemis user name
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="The user name to be used when connecting to the broker"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input id="artemisUserName" type="text" class="form-control" ng-model="artemisUserName"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisPassword">
|
||||
Artemis password
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="The user name to be used when connecting to the broker"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input id="artemisPassword" type="password" class="form-control" ng-model="artemisPassword"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisDLQ">
|
||||
Dead-letter address regex
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="A regular expression to match one or more dead-letter addresses"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" id="artemisDLQ" ng-model="artemisDLQ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisExpiryQueue">
|
||||
Expiry address regex
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="A regular expression to match one or more expiry addresses"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" id="artemisExpiryQueue" ng-model="artemisExpiryQueue">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-md-2 control-label" for="artemisBrowseBytesMessages">
|
||||
Display message body as
|
||||
<span class="pficon pficon-info" data-toggle="tooltip" data-placement="top" title="Browsing byte messages should display the message body as"></span>
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<select id="artemisBrowseBytesMessages"
|
||||
ng-model="artemisBrowseBytesMessages"
|
||||
ng-options="key for (key, value) in messageBodyDisplayOptions"
|
||||
ng-selected="artemisBrowseBytesMessages === value">
|
||||
</select>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
</form>
|
@ -0,0 +1,22 @@
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-management-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
<div class="tree-nav-sidebar-content">
|
||||
<div id="entaxytree" class="treeview-pf-hover treeview-pf-select"></div>
|
||||
</div>
|
@ -0,0 +1,43 @@
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-management-plugin
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
<div class="tree-nav-sidebar-header">
|
||||
<form role="form" class="search-pf has-button">
|
||||
<div class="form-group has-clear">
|
||||
<div class="search-pf-input-group">
|
||||
<label for="input-search" class="sr-only">Search Tree:</label>
|
||||
<input id="input-search" type="search" class="form-control" placeholder="Search tree:"
|
||||
ng-model="$ctrl.filter">
|
||||
<button type="button" class="clear" aria-hidden="true"
|
||||
ng-hide="$ctrl.filter.length === 0"
|
||||
ng-click="$ctrl.filter = ''">
|
||||
<span class="pficon pficon-close"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group tree-nav-buttons">
|
||||
<span class="badge" ng-class="{positive: $ctrl.result.length > 0}"
|
||||
ng-show="$ctrl.filter.length > 0">
|
||||
{{$ctrl.result.length}}
|
||||
</span>
|
||||
<i class="fa fa-plus-square-o" title="Expand All" ng-click="$ctrl.expandAll()"></i>
|
||||
<i class="fa fa-minus-square-o" title="Collapse All" ng-click="$ctrl.contractAll()"></i>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
@ -0,0 +1,94 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-management-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
var Entaxy;
|
||||
(function (Entaxy) {
|
||||
Entaxy.log.debug("loading navigation");
|
||||
var TAB_CONFIG = {
|
||||
attributes: {
|
||||
title: 'Attributes',
|
||||
route: '/entaxy/attributes'
|
||||
},
|
||||
operations: {
|
||||
title: 'Operations',
|
||||
route: '/entaxy/operations'
|
||||
},
|
||||
chart: {
|
||||
title: 'Chart',
|
||||
route: '/entaxy/charts'
|
||||
}
|
||||
};
|
||||
Entaxy._module
|
||||
.config(configureRoutes)
|
||||
.component('entaxyNavigation', {
|
||||
template: `<hawtio-tabs tabs="$ctrl.tabs" on-change="$ctrl.goto(tab)"></hawtio-tabs>`,
|
||||
controller: EntaxyNavigationController
|
||||
})
|
||||
.name;
|
||||
Entaxy.log.debug("loaded navigation " + Entaxy.navigationModule);
|
||||
|
||||
function EntaxyNavigationController($scope, $location, workspace, localStorage, jolokia) {
|
||||
'ngInject';
|
||||
var ctrl = this;
|
||||
this.$location = $location;
|
||||
entaxyJmxDomain = localStorage['entaxyJmxDomain'] || "ru.entaxy.esb";
|
||||
|
||||
$scope.$on('jmxTreeClicked', function () {
|
||||
ctrl.tabs = getTabs();
|
||||
var tab = _.find(ctrl.tabs, { path: ctrl.$location.path() });
|
||||
if (!tab) {
|
||||
tab = ctrl.tabs[0];
|
||||
}
|
||||
ctrl.$location.path(tab.path);
|
||||
});
|
||||
|
||||
EntaxyNavigationController.prototype.$onInit = function () {
|
||||
this.tabs = getTabs();
|
||||
};
|
||||
|
||||
EntaxyNavigationController.prototype.goto = function (tab) {
|
||||
this.$location.path(tab.path);
|
||||
};
|
||||
|
||||
function getTabs() {
|
||||
|
||||
var tabs = [];
|
||||
var enabledRoutes = Object.keys(TAB_CONFIG)
|
||||
.map(function (config) { return TAB_CONFIG[config].route; })
|
||||
.filter(function (route) { return _.startsWith(route, '/entaxy'); });
|
||||
if (enabledRoutes.length > 0) {
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.attributes.title, TAB_CONFIG.attributes.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.operations.title, TAB_CONFIG.operations.route));
|
||||
tabs.push(new Nav.HawtioTab(TAB_CONFIG.chart.title, TAB_CONFIG.chart.route));
|
||||
}
|
||||
return tabs;
|
||||
}
|
||||
|
||||
}
|
||||
EntaxyNavigationController.$inject = ['$scope', '$location', 'workspace', 'localStorage', 'jolokia']
|
||||
|
||||
function configureRoutes($routeProvider) {
|
||||
$routeProvider.
|
||||
when('/entaxy/attributes', { templateUrl: 'plugins/jmx/html/attributes/attributes.html' }).
|
||||
when('/entaxy/operations', { template: '<operations></operations>' }).
|
||||
when('/entaxy/charts', { templateUrl: 'plugins/jmx/html/charts.html' });
|
||||
}
|
||||
configureRoutes.$inject = ['$routeProvider'];
|
||||
|
||||
})(Entaxy || (Entaxy = {}));
|
@ -0,0 +1,193 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-management-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
var Entaxy;
|
||||
(function (Entaxy) {
|
||||
Entaxy._module.component('entaxyTreeHeader', {
|
||||
template:
|
||||
`<div class="tree-nav-sidebar-header">
|
||||
<form role="form" class="search-pf has-button">
|
||||
<div class="form-group has-clear">
|
||||
<div class="search-pf-input-group">
|
||||
<label for="input-search" class="sr-only">Search Tree:</label>
|
||||
<input id="input-search" type="search" class="form-control" placeholder="Search tree:"
|
||||
ng-model="$ctrl.filter">
|
||||
<button type="button" class="clear" aria-hidden="true"
|
||||
ng-hide="$ctrl.filter.length === 0"
|
||||
ng-click="$ctrl.filter = ''">
|
||||
<span class="pficon pficon-close"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group tree-nav-buttons">
|
||||
<span class="badge" ng-class="{positive: $ctrl.result.length > 0}"
|
||||
ng-show="$ctrl.filter.length > 0">
|
||||
{{$ctrl.result.length}}
|
||||
</span>
|
||||
<i class="fa fa-plus-square-o" title="Expand All" ng-click="$ctrl.expandAll()"></i>
|
||||
<i class="fa fa-minus-square-o" title="Collapse All" ng-click="$ctrl.contractAll()"></i>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
`,
|
||||
controller: EntaxyTreeHeaderController
|
||||
})
|
||||
.component('entaxyTree', {
|
||||
template:
|
||||
`<div class="tree-nav-sidebar-content">
|
||||
<div id="entaxytree" class="treeview-pf-hover treeview-pf-select"></div>
|
||||
</div>
|
||||
`,
|
||||
controller: EntaxyTreeController
|
||||
})
|
||||
.name;
|
||||
entaxyTreeElementId = '#entaxytree';
|
||||
Entaxy.log.debug("loaded tree" + Entaxy.treeModule);
|
||||
|
||||
|
||||
function EntaxyTreeHeaderController($scope, $element) {
|
||||
'ngInject';
|
||||
Entaxy.log.debug("EntaxyTreeHeaderController ");
|
||||
this.$scope = $scope;
|
||||
this.$element = $element;
|
||||
this.filter = '';
|
||||
this.result = [];
|
||||
// it's not possible to declare classes to the component host tag in AngularJS
|
||||
$element.addClass('tree-nav-sidebar-header');
|
||||
|
||||
EntaxyTreeHeaderController.prototype.$onInit = function () {
|
||||
Entaxy.log.debug("EntaxyTreeHeaderController init");
|
||||
var _this = this;
|
||||
this.$scope.$watch(angular.bind(this, function () { return _this.filter; }), function (filter, previous) {
|
||||
if (filter !== previous) {
|
||||
_this.search(filter);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
EntaxyTreeHeaderController.prototype.search = function (filter) {
|
||||
Entaxy.log.debug("EntaxyTreeHeaderController search");
|
||||
var _this = this;
|
||||
var doSearch = function (filter) {
|
||||
var result = _this.tree().search(filter, {
|
||||
ignoreCase: true,
|
||||
exactMatch: false,
|
||||
revealResults: true
|
||||
});
|
||||
_this.result.length = 0;
|
||||
(_a = _this.result).push.apply(_a, result);
|
||||
Core.$apply(_this.$scope);
|
||||
var _a;
|
||||
};
|
||||
_.debounce(doSearch, 300, { leading: false, trailing: true })(filter);
|
||||
};
|
||||
|
||||
EntaxyTreeHeaderController.prototype.tree = function () {
|
||||
Entaxy.log.debug("EntaxyTreeHeaderController tree");
|
||||
return $(entaxyTreeElementId).treeview(true);
|
||||
};
|
||||
|
||||
EntaxyTreeHeaderController.prototype.expandAll = function () {
|
||||
Entaxy.log.debug("EntaxyTreeHeaderController expand");
|
||||
return this.tree()
|
||||
.expandNode(this.tree().getNodes(), { levels: HawtioTree.getMaxTreeLevel(this.tree()), silent: true });
|
||||
};
|
||||
|
||||
EntaxyTreeHeaderController.prototype.contractAll = function () {
|
||||
Entaxy.log.debug("EntaxyTreeHeaderController contract");
|
||||
return this.tree()
|
||||
.collapseNode(this.tree().getNodes(), { ignoreChildren: true, silent: true });
|
||||
};
|
||||
}
|
||||
EntaxyTreeHeaderController.$inject = ['$scope', '$element'];
|
||||
|
||||
function EntaxyTreeController($scope, $location, workspace, $element) {
|
||||
'ngInject';
|
||||
this.$scope = $scope;
|
||||
this.$location = $location;
|
||||
this.workspace = workspace;
|
||||
this.$element = $element;
|
||||
// it's not possible to declare classes to the component host tag in AngularJS
|
||||
$element.addClass('tree-nav-sidebar-content');
|
||||
Entaxy.log.debug("EntaxyTreeController ");
|
||||
var entaxyJmxDomain = localStorage['entaxyJmxDomain'] || "ru.entaxy.esb";
|
||||
EntaxyTreeController.prototype.$onInit = function () {
|
||||
Entaxy.log.debug("EntaxyTreeController onInit");
|
||||
var _this = this;
|
||||
this.$scope.$on('$destroy', function () { return _this.removeTree(); });
|
||||
this.$scope.$on('$routeChangeStart', function () { return Jmx.updateTreeSelectionFromURL(_this.$location, $(entaxyTreeElementId)); });
|
||||
this.$scope.$on('jmxTreeUpdated', function () { return _this.populateTree(); });
|
||||
this.populateTree();
|
||||
};
|
||||
EntaxyTreeController.prototype.updateSelectionFromURL = function () {
|
||||
Jmx.updateTreeSelectionFromURLAndAutoSelect(this.$location, $(entaxyTreeElementId), function (first) {
|
||||
if (first.children == null) {
|
||||
return null;
|
||||
}
|
||||
// use function to auto select the queue folder on the 1st broker
|
||||
var queues = first.children[0];
|
||||
if (queues && queues.text === 'Queue') {
|
||||
return queues;
|
||||
}
|
||||
return null;
|
||||
}, true);
|
||||
};
|
||||
EntaxyTreeController.prototype.populateTree = function () {
|
||||
var _this = this;
|
||||
var children = [];
|
||||
var tree = this.workspace.tree;
|
||||
Entaxy.log.debug("tree= "+tree);
|
||||
if (tree) {
|
||||
var domainName = entaxyJmxDomain;
|
||||
var folder = tree.get(domainName);
|
||||
|
||||
if (folder) {
|
||||
children = folder.children;
|
||||
}
|
||||
angular.forEach(children, function(child) {
|
||||
Entaxy.log.debug("child=" + child.text + " " + child.id);
|
||||
});
|
||||
var treeElement = $("#entaxytree");
|
||||
this.removeTree();
|
||||
Jmx.enableTree(this.$scope, this.$location, this.workspace, $(entaxyTreeElementId), children);
|
||||
this.updateSelectionFromURL();
|
||||
}
|
||||
};
|
||||
EntaxyTreeController.prototype.removeTree = function () {
|
||||
var tree = $(entaxyTreeElementId).treeview(true);
|
||||
// There is no exposed API to check whether the tree has already been initialized,
|
||||
// so let's just check if the methods are presents
|
||||
if (tree.clearSearch) {
|
||||
tree.clearSearch();
|
||||
// Bootstrap tree view leaks the node elements into the data structure
|
||||
// so let's clean this up when the user leaves the view
|
||||
var cleanTreeFolder_1 = function (node) {
|
||||
delete node['$el'];
|
||||
if (node.nodes)
|
||||
node.nodes.forEach(cleanTreeFolder_1);
|
||||
};
|
||||
cleanTreeFolder_1(this.workspace.tree);
|
||||
// Then call the tree clean-up method
|
||||
tree.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
EntaxyTreeController.$inject = ['$scope', '$location', 'workspace', '$element'];
|
||||
|
||||
})(Entaxy || (Entaxy = {}));
|
@ -0,0 +1,85 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* entaxy-management-plugin
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2021 EmDev LLC
|
||||
* ==========
|
||||
* Licensed 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.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
/**
|
||||
* The main entry point for the Simple module
|
||||
*/
|
||||
var Entaxy = (function (Entaxy) {
|
||||
|
||||
/**
|
||||
* The name of this plugin
|
||||
*/
|
||||
Entaxy.pluginName = 'entaxy-plugin';
|
||||
|
||||
/**
|
||||
* This plugin's logger instance
|
||||
*/
|
||||
Entaxy.log = Logger.get('entaxy-plugin');
|
||||
|
||||
/**
|
||||
* The top level path of this plugin on the server
|
||||
*/
|
||||
Entaxy.contextPath = "/entaxy-plugin/";
|
||||
|
||||
Entaxy.log.info("loading entaxy plugin")
|
||||
Entaxy._module = angular.module(Entaxy.pluginName, [
|
||||
'angularResizable'
|
||||
])
|
||||
.component('entaxy', {
|
||||
template:
|
||||
`<div class="tree-nav-layout">
|
||||
<div class="sidebar-pf sidebar-pf-left" resizable r-directions="['right']">
|
||||
<entaxy-tree-header></entaxy-tree-header>
|
||||
<entaxy-tree></entaxy-tree>
|
||||
</div>
|
||||
<div class="tree-nav-main">
|
||||
<jmx-header></jmx-header>
|
||||
<entaxy-navigation></entaxy-navigation>
|
||||
<div class="contents" ng-view></div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
.run(configurePlugin);
|
||||
|
||||
function configurePlugin(mainNavService, workspace, helpRegistry, preferencesRegistry, localStorage, preLogoutTasks, documentBase, $templateCache) {
|
||||
var entaxyJmxDomain = localStorage['entaxyJmxDomain'] || "ru.entaxy.esb";
|
||||
mainNavService.addItem({
|
||||
title: 'Entaxy',
|
||||
basePath: '/entaxy',
|
||||
template: '<entaxy></entaxy>',
|
||||
isValid: function () { return workspace.treeContainsDomainAndProperties(entaxyJmxDomain); }
|
||||
});
|
||||
|
||||
// clean up local storage upon logout
|
||||
/* preLogoutTasks.addTask('CleanupArtemisCredentials', function () {
|
||||
Artemis.log.debug("Clean up Artemis credentials in local storage");
|
||||
localStorage.removeItem('artemisUserName');
|
||||
localStorage.removeItem('artemisPassword');
|
||||
}); */
|
||||
}
|
||||
configurePlugin.$inject = ['mainNavService', 'workspace', 'helpRegistry', 'preferencesRegistry', 'localStorage', 'preLogoutTasks', 'documentBase', '$templateCache'];
|
||||
|
||||
return Entaxy;
|
||||
|
||||
})(Entaxy || {});
|
||||
|
||||
// tell the Hawtio plugin loader about our plugin so it can be
|
||||
// bootstrapped with the rest of AngularJS
|
||||
hawtioPluginLoader.addModule(Entaxy.pluginName);
|
206
ui/entaxy-hawtio/pom.xml
Normal file
@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb</groupId>
|
||||
<artifactId>ui</artifactId>
|
||||
<version>1.8.1</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.ui</groupId>
|
||||
<artifactId>entaxy-hawtio</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>ENTAXY :: UI :: HAWTIO</name>
|
||||
<description>ENTAXY :: UI :: HAWTIO</description>
|
||||
|
||||
<properties>
|
||||
<hawtio.version>2.14.1</hawtio.version>
|
||||
<entaxy.underlying.version>${project.version}</entaxy.underlying.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.hawt</groupId>
|
||||
<artifactId>hawtio-plugin-mbean</artifactId>
|
||||
<version>${hawtio.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.3.2</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>license-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>update-file-header</id>
|
||||
<goals>
|
||||
<goal>update-file-header</goal>
|
||||
</goals>
|
||||
<phase>process-sources</phase>
|
||||
<configuration>
|
||||
<excludes combine.self="override">
|
||||
<!--
|
||||
we exclude org.apache.karaf.features.repos.cfg
|
||||
for it will be used as a fragment
|
||||
-->
|
||||
<exclude>**/org.apache.karaf.features.repos.cfg</exclude>
|
||||
<exclude>**/*.cfg</exclude>
|
||||
<exclude>**/*.json1</exclude>
|
||||
<!-- *.ftl files will be processed by the next plugin -->
|
||||
<exclude>**/*.ftl</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>install-hawtio-script</id>
|
||||
<activation>
|
||||
<file>
|
||||
<exists>src/main/scripts/entaxy-hawtio.install</exists>
|
||||
</file>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>license-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>update-file-header-hawtio</id>
|
||||
<goals>
|
||||
<goal>update-file-header</goal>
|
||||
</goals>
|
||||
<phase>process-sources</phase>
|
||||
<configuration>
|
||||
<organizationName>${license.organizationName}</organizationName>
|
||||
<inceptionYear>${license.inceptionYear}</inceptionYear>
|
||||
<projectName>${license.projectName}</projectName>
|
||||
<copyrightOwners>${license.copyrightOwners}</copyrightOwners>
|
||||
<licenseName>${license.licenseName}</licenseName>
|
||||
|
||||
<!-- plugin documentation recommends "true"
|
||||
but we use "false" to look like Apache sources -->
|
||||
<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
|
||||
<emptyLineAfterHeader>false</emptyLineAfterHeader>
|
||||
|
||||
<!-- excludes>
|
||||
<exclude>**/*.json</exclude>
|
||||
</excludes-->
|
||||
<extraExtensions>
|
||||
<!-- treat *.install files as *.properties -->
|
||||
<install>properties</install>
|
||||
</extraExtensions>
|
||||
|
||||
<ignoreNoFileToScan>true</ignoreNoFileToScan>
|
||||
<keepBackup>true</keepBackup>
|
||||
|
||||
<processStartTag>${license.processStartTag}</processStartTag>
|
||||
<processEndTag>${license.processEndTag}</processEndTag>
|
||||
<sectionDelimiter>${license.sectionDelimiter}</sectionDelimiter>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources-hawtio</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/target/scripts</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/scripts</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-cfg-hawtio</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>attach-artifact</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<runOnlyAtExecutionRoot>false</runOnlyAtExecutionRoot>
|
||||
<artifacts>
|
||||
<artifact>
|
||||
<file>target/classes/etc/org.apache.karaf.features.repos.cfg</file>
|
||||
<type>cfg</type>
|
||||
<classifier>org.apache.karaf.features.repos</classifier>
|
||||
</artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>attach-script-hawtio</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>attach-artifact</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<runOnlyAtExecutionRoot>false</runOnlyAtExecutionRoot>
|
||||
<artifacts>
|
||||
<artifact>
|
||||
<file>target/scripts/entaxy-hawtio.install</file>
|
||||
<type>install</type>
|
||||
<classifier>entaxy-hawtio</classifier>
|
||||
</artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
|
||||
|
||||
<modules>
|
||||
<module>entaxy-branding-plugin</module>
|
||||
<module>artemis-plugin-entaxy</module>
|
||||
<module>entaxy-management-plugin</module>
|
||||
<module>entaxy-h2-plugin</module>
|
||||
</modules>
|
||||
</project>
|
45
ui/entaxy-hawtio/src/main/features/features.xml
Normal file
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
entaxy-hawtio
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed 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.
|
||||
~~~~~~/licensing~~~~~~
|
||||
-->
|
||||
|
||||
<features name="${project.artifactId}-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.6.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.6.0 http://karaf.apache.org/xmlns/features/v1.6.0">
|
||||
|
||||
<repository>mvn:ru.entaxy.esb.underlying/entaxy-underlying-features/${entaxy.underlying.version}/xml/features</repository>
|
||||
<repository>mvn:io.hawt/hawtio-karaf/${hawtio.version}/xml/features</repository>
|
||||
|
||||
<feature name="${project.artifactId}" version="${project.version}" start-level="90">
|
||||
<feature prerequisite="true">war</feature>
|
||||
<feature prerequisite="true" version="${hawtio.version}">hawtio</feature>
|
||||
<bundle>webbundle:mvn:ru.entaxy.esb.ui.hawtio/entaxy-branding-plugin/${project.version}/war</bundle>
|
||||
<bundle>webbundle:mvn:ru.entaxy.esb.ui.hawtio/entaxy-management-plugin/${project.version}/war</bundle>
|
||||
<bundle>webbundle:mvn:ru.entaxy.esb.ui.hawtio/entaxy-h2-plugin/${project.version}/war</bundle>
|
||||
</feature>
|
||||
|
||||
<feature name="${project.artifactId}-artemis-support" version="${project.version}" start-level="90">
|
||||
<feature prerequisite="true">war</feature>
|
||||
<feature prerequisite="true" version="${hawtio.version}">hawtio</feature>
|
||||
<feature prerequisite="true" version="${project.version}">${project.artifactId}</feature>
|
||||
<bundle>webbundle:mvn:ru.entaxy.esb.ui.hawtio/artemis-plugin-entaxy/${project.version}/war</bundle>
|
||||
</feature>
|
||||
|
||||
|
||||
</features>
|
@ -0,0 +1,6 @@
|
||||
#
|
||||
# This file describes the features repository URL
|
||||
# for Entaxy Hawtio-based UI
|
||||
#
|
||||
|
||||
hawtio=mvn:io.hawt/hawtio-karaf/${hawtio.version}/xml/features
|
96
ui/entaxy-hawtio/src/main/scripts/entaxy-hawtio.install
Normal file
@ -0,0 +1,96 @@
|
||||
###
|
||||
# ~~~~~~licensing~~~~~~
|
||||
# entaxy-hawtio
|
||||
# ==========
|
||||
# Copyright (C) 2020 - 2021 EmDev LLC
|
||||
# ==========
|
||||
# Licensed 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.
|
||||
# ~~~~~~/licensing~~~~~~
|
||||
###
|
||||
echo
|
||||
echo
|
||||
echo "************"
|
||||
echo "Welcome to Entaxy Hawtio installation script"
|
||||
echo "************"
|
||||
|
||||
echo
|
||||
echo "** Checking feature repository: ru.entaxy.esb.ui/entaxy-hawtio/${project.version}/xml/features ..."
|
||||
|
||||
_repo = (feature:repo-list | grep ru.entaxy.esb.ui/entaxy-hawtio)
|
||||
_repo_length = ($_repo length)
|
||||
if { $_repo_length'' equals "0" } {
|
||||
echo "\>\> Installing Entaxy Hawtio repository..."
|
||||
feature:repo-add mvn:ru.entaxy.esb.ui/entaxy-hawtio/${project.version}/xml/features
|
||||
echo "\>\> ... installed"
|
||||
} else {
|
||||
echo "\>\> Entaxy Hawtio repository is already installed"
|
||||
}
|
||||
|
||||
echo
|
||||
echo "** Checking entaxy-underlying-configuration feature ..."
|
||||
|
||||
_config = [((feature:list | grep entaxy-underlying-configuration) split '\|')]
|
||||
_status = (($_config get 3) trim)
|
||||
|
||||
_in_shutdown = "0"
|
||||
|
||||
if { $_status equals "Uninstalled" } {
|
||||
echo "\>\> Installing feature..."
|
||||
feature:install entaxy-underlying-configuration
|
||||
echo "\>\> ... installed"
|
||||
echo
|
||||
if { $1'' equals "skipReboot" } {
|
||||
echo "** the system will skip reboot for applying JRE exports"
|
||||
echo " \( see etc/jre.properties \)"
|
||||
echo " due to 'skipReboot argument'"
|
||||
echo "** If further installation will fail with errors please reboot"
|
||||
} else {
|
||||
echo "** the system will reboot now to apply JRE exports"
|
||||
echo " \( see etc/jre.properties \)"
|
||||
echo
|
||||
echo "** PLEASE RUN THE SCRIPT AGAIN AFTER RESTART **"
|
||||
_in_shutdown = "1"
|
||||
shutdown -r -f
|
||||
}
|
||||
} else {
|
||||
echo "\>\> Entaxy configuration is already installed"
|
||||
}
|
||||
|
||||
# shutdown goes async so karaf can begin next installation while rebooting
|
||||
# so we use marker to prevent it
|
||||
if { $_in_shutdown equals "0" } {
|
||||
|
||||
echo
|
||||
_config = [((feature:list | grep entaxy-underlying-configuration) split '\|')]
|
||||
_status = (($_config get 3) trim)
|
||||
if { NOT { $_status equals "Started" } } {
|
||||
echo "** Current configuration feature status is " $_status
|
||||
echo "** Please clean the container and run installation again "
|
||||
} else {
|
||||
echo
|
||||
echo "** Installing Entaxy Hawtio components in verbose mode..."
|
||||
_hawtio = [((feature:list | grep entaxy-hawtio) split '\|')]
|
||||
_status = (($_hawtio get 3) trim)
|
||||
if { $_status equals "Uninstalled" } {
|
||||
feature:install -v -r entaxy-hawtio
|
||||
echo
|
||||
echo "\>\> ... installed"
|
||||
} else {
|
||||
echo "\>\> Entaxy Hawtio is already installed"
|
||||
}
|
||||
}
|
||||
|
||||
echo
|
||||
echo "** Thank you!"
|
||||
|
||||
}
|