NIFI-12260: Remove templates from frontend (#7924)

* remove templates from frontend

* remove more references to removed files

* removing more template references

* remove unused css template styles
This commit is contained in:
Shane Ardell 2023-10-26 15:16:14 -04:00 committed by GitHub
parent 361e31fb19
commit c4ff8de412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 6 additions and 1925 deletions

View File

@ -31,7 +31,6 @@
<summary.filter>summary.properties</summary.filter>
<counters.filter>counters.properties</counters.filter>
<cluster.filter>cluster.properties</cluster.filter>
<templates.filter>templates.properties</templates.filter>
<users.filter>users.properties</users.filter>
<bulletin.board.filter>bulletin-board.properties</bulletin.board.filter>
<login.filter>login.properties</login.filter>
@ -58,7 +57,6 @@
<filter>src/main/resources/filters/${summary.filter}</filter>
<filter>src/main/resources/filters/${counters.filter}</filter>
<filter>src/main/resources/filters/${cluster.filter}</filter>
<filter>src/main/resources/filters/${templates.filter}</filter>
<filter>src/main/resources/filters/${users.filter}</filter>
<filter>src/main/resources/filters/${bulletin.board.filter}</filter>
<filter>src/main/resources/filters/${login.filter}</filter>
@ -95,7 +93,6 @@
**/provenance.jsp,
**/counters.jsp,
**/cluster.jsp,
**/templates.jsp,
**/users.jsp,
**/bulletin-board.jsp,
**/login.jsp,
@ -328,14 +325,6 @@
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/webapp/WEB-INF/pages</directory>
<targetPath>WEB-INF/pages</targetPath>
<includes>
<include>templates.jsp</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/webapp/WEB-INF/pages</directory>
<targetPath>WEB-INF/pages</targetPath>
@ -449,7 +438,6 @@
<summary.filter>summary-min.properties</summary.filter>
<counters.filter>counters-min.properties</counters.filter>
<cluster.filter>cluster-min.properties</cluster.filter>
<templates.filter>templates-min.properties</templates.filter>
<users.filter>users-min.properties</users.filter>
<bulletin.board.filter>bulletin-board-min.properties</bulletin.board.filter>
<login.filter>login-min.properties</login.filter>
@ -558,7 +546,6 @@
<include>${staging.dir}/js/nf/canvas/header/components/nf-ng-group-component.js</include>
<include>${staging.dir}/js/nf/canvas/header/components/nf-ng-remote-process-group-component.js</include>
<include>${staging.dir}/js/nf/canvas/header/components/nf-ng-funnel-component.js</include>
<include>${staging.dir}/js/nf/canvas/header/components/nf-ng-template-component.js</include>
<include>${staging.dir}/js/nf/canvas/header/components/nf-ng-registry-import-component.js</include>
<include>${staging.dir}/js/nf/canvas/header/components/nf-ng-label-component.js</include>
<include>${staging.dir}/js/nf/canvas/directives/nf-ng-breadcrumbs-directive.js</include>
@ -663,21 +650,6 @@
<include>${staging.dir}/js/nf/users/nf-users.js</include>
</includes>
</aggregation>
<aggregation>
<insertNewLine>true</insertNewLine>
<output>${project.build.directory}/${project.build.finalName}/js/nf/templates/nf-templates-all.js</output>
<includes>
<include>${staging.dir}/js/nf/nf-dialog.js</include>
<include>${staging.dir}/js/nf/nf-authorization-storage.js</include>
<include>${staging.dir}/js/nf/nf-storage.js</include>
<include>${staging.dir}/js/nf/nf-common.js</include>
<include>${staging.dir}/js/nf/nf-error-handler.js</include>
<include>${staging.dir}/js/nf/nf-universal-capture.js</include>
<include>${staging.dir}/js/nf/nf-ajax-setup.js</include>
<include>${staging.dir}/js/nf/templates/nf-templates-table.js</include>
<include>${staging.dir}/js/nf/templates/nf-templates.js</include>
</includes>
</aggregation>
<aggregation>
<insertNewLine>true</insertNewLine>
<output>${project.build.directory}/${project.build.finalName}/js/nf/cluster/nf-cluster-all.js</output>
@ -843,16 +815,6 @@
<include>${staging.dir}/css/users.css</include>
</includes>
</aggregation>
<aggregation>
<insertNewLine>true</insertNewLine>
<output>${project.build.directory}/${project.build.finalName}/css/nf-templates-all.css</output>
<includes>
<include>${staging.dir}/css/main.css</include>
<include>${staging.dir}/css/banner.css</include>
<include>${staging.dir}/css/dialog.css</include>
<include>${staging.dir}/css/templates.css</include>
</includes>
</aggregation>
<aggregation>
<insertNewLine>true</insertNewLine>
<output>${project.build.directory}/${project.build.finalName}/css/nf-bulletin-board-all.css</output>
@ -911,7 +873,6 @@
css/nf-counters-all.css,
css/nf-cluster-all.css,
css/nf-users-all.css,
css/nf-templates-all.css,
css/nf-bulletin-board-all.css,
css/nf-login-all.css,
css/nf-logout-all.css,
@ -935,7 +896,6 @@
js/nf/counters/nf-counters-all.js,
js/nf/cluster/nf-cluster-all.js,
js/nf/users/nf-users-all.js,
js/nf/templates/nf-templates-all.js,
js/nf/bulletin-board/nf-bulletin-board-all.js,
js/nf/login/nf-login-all.js,
js/nf/logout/nf-logout-all.js,

View File

@ -88,7 +88,6 @@ nf.canvas.script.tags=<script type="text/javascript" src="js/nf/nf-ng-bridge.js?
<script type="text/javascript" src="js/nf/canvas/header/components/nf-ng-group-component.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/header/components/nf-ng-remote-process-group-component.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/header/components/nf-ng-funnel-component.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/header/components/nf-ng-template-component.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/header/components/nf-ng-registry-import-component.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/header/components/nf-ng-label-component.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/canvas/directives/nf-ng-breadcrumbs-directive.js?${project.version}"></script>\n\

View File

@ -1,19 +0,0 @@
# 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.
nf.templates.script.tags=<script type="text/javascript" src="js/nf/templates/nf-templates-all.js?${project.version}"></script>
nf.templates.style.tags=<link rel="stylesheet" href="css/nf-templates-all.css?${project.version}" type="text/css" />\n\
<link rel="stylesheet" href="css/message-pane.css?${project.version}" type="text/css" />\n\
<link rel="stylesheet" href="css/nf-common-ui.css?${project.version}" type="text/css" />

View File

@ -1,30 +0,0 @@
# 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.
nf.templates.script.tags=<script type="text/javascript" src="js/nf/nf-dialog.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/nf-authorization-storage.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/nf-storage.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/nf-common.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/nf-error-handler.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/nf-universal-capture.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/nf-ajax-setup.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/templates/nf-templates-table.js?${project.version}"></script>\n\
<script type="text/javascript" src="js/nf/templates/nf-templates.js?${project.version}"></script>
nf.templates.style.tags=<link rel="stylesheet" href="css/main.css?${project.version}" type="text/css" />\n\
<link rel="stylesheet" href="css/common-ui.css?${project.version}" type="text/css" />\n\
<link rel="stylesheet" href="css/banner.css?${project.version}" type="text/css" />\n\
<link rel="stylesheet" href="css/dialog.css?${project.version}" type="text/css" />\n\
<link rel="stylesheet" href="css/message-pane.css?${project.version}" type="text/css" />\n\
<link rel="stylesheet" href="css/templates.css?${project.version}" type="text/css" />

View File

@ -119,9 +119,6 @@
<jsp:include page="/WEB-INF/partials/canvas/new-port-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/new-process-group-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/new-remote-process-group-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/new-template-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/upload-template-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/instantiate-template-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/fill-color-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/connections-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/canvas/save-flow-version-dialog.jsp"/>

View File

@ -1,66 +0,0 @@
<%--
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.
--%>
<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
<title>NiFi Templates</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="images/nifi16.ico"/>
<link rel="stylesheet" href="assets/reset.css/reset.css" type="text/css" />
${nf.templates.style.tags}
<link rel="stylesheet" href="js/jquery/combo/jquery.combo.css?${project.version}" type="text/css" />
<link rel="stylesheet" href="js/jquery/modal/jquery.modal.css?${project.version}" type="text/css" />
<link rel="stylesheet" href="assets/qtip2/dist/jquery.qtip.min.css?" type="text/css" />
<link rel="stylesheet" href="assets/jquery-ui-dist/jquery-ui.min.css" type="text/css" />
<link rel="stylesheet" href="assets/slickgrid/slick.grid.css" type="text/css" />
<link rel="stylesheet" href="css/slick-nifi-theme.css" type="text/css" />
<link rel="stylesheet" href="fonts/flowfont/flowfont.css" type="text/css" />
<link rel="stylesheet" href="assets/angular-material/angular-material.min.css" type="text/css" />
<link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css" type="text/css" />
<script type="text/javascript" src="assets/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery.base64.js"></script>
<script type="text/javascript" src="js/jquery/jquery.center.js"></script>
<script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script>
<script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script>
<script type="text/javascript" src="js/jquery/jquery.ellipsis.js"></script>
<script type="text/javascript" src="js/jquery/jquery.each.js"></script>
<script type="text/javascript" src="assets/jquery-ui-dist/jquery-ui.min.js"></script>
<script type="text/javascript" src="assets/lodash/lodash.min.js"></script>
<script type="text/javascript" src="assets/moment/min/moment.min.js"></script>
<script type="text/javascript" src="assets/qtip2/dist/jquery.qtip.min.js"></script>
<script type="text/javascript" src="assets/slickgrid/lib/jquery.event.drag-2.3.0.js"></script>
<script type="text/javascript" src="assets/slickgrid/plugins/slick.cellrangeselector.js"></script>
<script type="text/javascript" src="assets/slickgrid/plugins/slick.cellselectionmodel.js"></script>
<script type="text/javascript" src="assets/slickgrid/plugins/slick.rowselectionmodel.js"></script>
<script type="text/javascript" src="assets/slickgrid/plugins/slick.autotooltips.js"></script>
<script type="text/javascript" src="assets/slickgrid/slick.formatters.js"></script>
<script type="text/javascript" src="assets/slickgrid/slick.editors.js"></script>
<script type="text/javascript" src="assets/slickgrid/slick.dataview.js"></script>
<script type="text/javascript" src="assets/slickgrid/slick.core.js"></script>
<script type="text/javascript" src="assets/slickgrid/slick.grid.js"></script>
<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>
${nf.templates.script.tags}
</head>
<body>
<jsp:include page="/WEB-INF/partials/message-pane.jsp"/>
<jsp:include page="/WEB-INF/partials/banners-utility.jsp"/>
<jsp:include page="/WEB-INF/partials/ok-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/yes-no-dialog.jsp"/>
<jsp:include page="/WEB-INF/partials/templates/templates-content.jsp"/>
</body>
</html>

View File

@ -17,7 +17,7 @@
<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<div id="bulletin-board">
<div id="bulletin-board-header-and-filter">
<div id="bulletin-board-header-text">NiFi Templates</div>
<div id="bulletin-board-header-text"></div>
<div id="bulletin-board-filter-controls">
<div id="bulletin-board-filter-container" class="filter-container">
<input type="text" placeholder="Filter" id="bulletin-board-filter" class="filter"/>

View File

@ -174,13 +174,6 @@
</a>
</md-menu-item>
<md-menu-divider></md-menu-divider>
<md-menu-item layout-align="space-around center">
<a id="templates-link"
ng-click="appCtrl.serviceProvider.headerCtrl.globalMenuCtrl.templates.shell.launch();">
<i class="icon icon-template"></i>Templates
</a>
</md-menu-item>
<md-menu-divider></md-menu-divider>
<md-menu-item layout-align="space-around center">
<a id="help-link"
ng-click="appCtrl.serviceProvider.headerCtrl.globalMenuCtrl.help.shell.launch();">

View File

@ -1,25 +0,0 @@
<%--
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.
--%>
<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<div id="instantiate-template-dialog" class="hidden small-dialog">
<div class="dialog-content">
<div class="setting">
<div class="setting-name">Choose Template:</div>
<div id="available-templates" name="available-templates"></div>
</div>
</div>
</div>

View File

@ -1,33 +0,0 @@
<%--
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.
--%>
<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<div id="new-template-dialog" class="hidden medium-dialog">
<div class="dialog-content">
<div class="setting">
<div class="setting-name">Name</div>
<div class="setting-field">
<input id="new-template-name" class="new-template-field" type="text"/>
</div>
</div>
<div class="setting">
<div class="setting-name">Description</div>
<div class="setting-field">
<textarea cols="30" rows="8" id="new-template-description" class="new-template-field"></textarea>
</div>
</div>
</div>
</div>

View File

@ -44,16 +44,6 @@
</div>
<div class="clear"></div>
</div>
<div id="policy-selected-template-container" class="hidden policy-selected-component-container">
<div class="policy-selected-component-type-icon">
<i class="icon icon-template"></i>
</div>
<div class="policy-selected-component-details-container">
<div class="policy-selected-component-name"></div>
<div class="policy-selected-component-type">Template</div>
</div>
<div class="clear"></div>
</div>
<div id="policy-selected-controller-service-container" class="hidden policy-selected-component-container">
<div class="policy-selected-component-type-icon">
<i class="icon icon-drop"></i>

View File

@ -1,36 +0,0 @@
<%--
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.
--%>
<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<div id="upload-template-dialog" class="hidden small-dialog">
<div class="dialog-content">
<div id="select-template-container">
<div id="template-browse-container">
<span id="select-template-label">Select Template</span>
<div id="select-template-button">
<button class="fa fa-search" id="template-file-field-button" title="Browse"></button>
<form id="template-upload-form" enctype="multipart/form-data" method="post">
<input type="file" name="template" id="template-file-field"/>
</form>
</div>
</div>
</div>
<div id="submit-template-container">
<div id="selected-template-name"></div>
</div>
<div id="upload-template-status" class="import-status"></div>
</div>
</div>

View File

@ -1,41 +0,0 @@
<%--
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.
--%>
<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div id="templates">
<span id="template-group-id" class="hidden"><c:out value="${param.groupId}"/></span>
<div id="templates-header-and-filter">
<div id="templates-header-text">NiFi Templates</div>
<div id="templates-filter-controls">
<div id="templates-filter-stats" class="filter-status">
Displaying&nbsp;<span id="displayed-templates"></span>&nbsp;of&nbsp;<span id="total-templates"></span>
</div>
<div id="templates-filter-container" class="filter-container">
<input type="text" id="templates-filter" class="filter" placeholder="Filter"/>
<div id="templates-filter-type" class="filter-type"></div>
</div>
</div>
</div>
<div id="templates-table"></div>
</div>
<div id="templates-refresh-container">
<button id="refresh-button" class="refresh-button pointer fa fa-refresh" title="Refresh"></button>
<div id="templates-last-refreshed-container" class="last-refreshed-container">
Last updated:&nbsp;<span id="templates-last-refreshed" class="value-color"></span>
</div>
<div id="templates-loading-container" class="loading-container"></div>
</div>

View File

@ -66,16 +66,6 @@
<url-pattern>/counters</url-pattern>
</servlet-mapping>
<!-- servlet to map to templates page -->
<servlet>
<servlet-name>NiFiTemplates</servlet-name>
<jsp-file>/WEB-INF/pages/templates.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>NiFiTemplates</servlet-name>
<url-pattern>/templates</url-pattern>
</servlet-mapping>
<!-- servlet to map to users page -->
<servlet>
<servlet-name>NiFiUsers</servlet-name>

View File

@ -88,14 +88,6 @@ div.context-menu-provenance {
float: left;
}
#new-template-description {
position: absolute;
top: 81px;
bottom: 0px;
height: inherit;
min-height: 32px;
}
/* processor status styles */
.disabled {
@ -271,39 +263,25 @@ span.details-title {
font-size: 13px;
}
/* new template */
/* new file */
#new-template-description,
#new-file-description {
height: 210px;
}
/* upload */
#select-template-container,
#select-file-container {
}
#template-browse-container,
#file-browse-container {
display: block;
height: 20px;
}
#select-template-label,
#select-file-label {
font-weight: bold;
font-size: 14px;
line-height: 28px;
}
#select-template-button {
position: absolute;
top: 0px;
left: 135px;
height: 28px;
}
#select-file-button button {
position: absolute;
float: right;
@ -323,27 +301,16 @@ span.details-title {
color: #004849;
}
#template-file-field,
#upload-file-field {
display: none;
}
#submit-template-container {
margin-top: 20px;
}
#submit-file-container {
position: absolute;
float: left;
max-width: 90%;
}
#selected-template-name {
font-weight: bold;
font-family: Roboto;
font-size: 13px;
}
#selected-file-name {
font-weight: bold;
font-family: Roboto;
@ -352,7 +319,6 @@ span.details-title {
word-break: break-all;
}
#upload-template-status,
#upload-file-status {
margin-top: 10px;
font-weight: bold;
@ -361,7 +327,6 @@ span.details-title {
color: #ba554a;
}
#upload-template-container button,
#upload-file-container button {
float: right;
font-size: 16px;
@ -369,14 +334,12 @@ span.details-title {
margin-left: 1px;
}
#upload-template-button,
#upload-file-button {
color: #004849;
font-size: 16px;
cursor: pointer;
}
#template-file-upload,
#file-upload {
position: absolute;
top: 0;

View File

@ -1,97 +0,0 @@
/*
* 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.
*/
/*
Templates Styles
*/
#templates {
position: absolute;
top: 0px;
bottom: 0px;
left: 20px;
right: 20px;
height: 100%;
overflow: auto;
}
#templates-header-and-filter {
height: 108px;
}
#templates-header-text {
font-size: 18px;
font-weight: bold;
color: #728E9B;
font-family: Roboto Slab;
margin-bottom: 30px;
}
#templates-refresh-container {
position: absolute;
bottom: 0px;
left: 20px;
right: 20px;
}
#templates-loading-container {
float: left;
width: 16px;
height: 16px;
background-color: transparent;
margin-top: 4px;
margin-left: 3px;
}
#templates-last-refreshed {
font-weight: 500;
}
#templates-header {
padding-top: 10px;
}
/* filter controls */
#templates-filter-container {
height: 32px;
width: 100%;
}
#templates-filter {
width: 173px;
margin-right: 3px;
float: left;
}
#templates-filter-type {
float: left;
}
/* templates table */
#templates-table {
position: absolute;
top: 98px;
left: 0px;
bottom: 47px;
right: 0px;
min-height: 150px;
}
#templates-table div.slick-viewport {
overflow-x: hidden !important;
}

View File

@ -303,27 +303,6 @@
}
};
/**
* The templates menu item controller.
*/
this.templates = {
/**
* The templates menu item's shell controller.
*/
shell: {
/**
* Launch the templates shell.
*/
launch: function () {
nfShell.showPage('templates?' + $.param({
groupId: nfCanvasUtils.getGroupId()
}));
}
}
};
/**
* The help menu item controller.
*/

View File

@ -72,227 +72,6 @@
function OperateCtrl() {
/**
* The canvas operator's create template component.
*/
this.template = {
/**
* The canvas operator's create template component's modal.
*/
modal: {
/**
* Gets the modal element.
*
* @returns {*|jQuery|HTMLElement}
*/
getElement: function () {
return $('#new-template-dialog');
},
/**
* Initialize the modal.
*/
init: function () {
// configure the create template dialog
this.getElement().modal({
scrollableContentStyle: 'scrollable',
headerText: 'Create Template'
});
},
/**
* Updates the modal config.
*
* @param {string} name The name of the property to update.
* @param {object|array} config The config for the `name`.
*/
update: function (name, config) {
this.getElement().modal(name, config);
},
/**
* Show the modal.
*/
show: function () {
this.getElement().modal('show');
},
/**
* Hide the modal.
*/
hide: function () {
this.getElement().modal('hide');
}
}
};
/**
* The canvas operator's create template component.
*/
this.templateUpload = {
/**
* The canvas operator's create template component's modal.
*/
modal: {
/**
* Gets the modal element.
*
* @returns {*|jQuery|HTMLElement}
*/
getElement: function () {
return $('#upload-template-dialog');
},
/**
* Initialize the modal.
*/
init: function () {
// initialize the form
var templateForm = $('#template-upload-form').ajaxForm({
url: '../nifi-api/process-groups/',
dataType: 'xml',
beforeSubmit: function (formData, $form, options) {
// indicate if a disconnected node is acknowledged
formData.push({
name: 'disconnectedNodeAcknowledged',
value: nfStorage.isDisconnectionAcknowledged()
});
// ensure uploading to the current process group
options.url += (encodeURIComponent(nfCanvasUtils.getGroupId()) + '/templates/upload');
},
success: function (response, statusText, xhr, form) {
// see if the import was successful and inform the user
if (response.documentElement.tagName === 'templateEntity') {
nfDialog.showOkDialog({
headerText: 'Success',
dialogContent: 'Template successfully imported.'
});
} else {
// import failed
var statusText = 'Unable to import template. Please check the log for errors.';
if (response.documentElement.tagName === 'errorResponse') {
// if a more specific error was given, use it
var errorMessage = response.documentElement.getAttribute('statusText');
if (!nfCommon.isBlank(errorMessage)) {
statusText = errorMessage;
}
}
// show reason
nfDialog.showOkDialog({
headerText: 'Unable to Upload',
dialogContent: nfCommon.escapeHtml(statusText)
});
}
},
error: function (xhr, statusText, error) {
// request failed
nfDialog.showOkDialog({
headerText: 'Unable to Upload',
dialogContent: nfCommon.escapeHtml(xhr.responseText)
});
}
});
// configure the upload template dialog
this.getElement().modal({
headerText: 'Upload Template',
buttons: [{
buttonText: 'Upload',
color: {
base: '#728E9B',
hover: '#004849',
text: '#ffffff'
},
handler: {
click: function () {
var selectedTemplate = $('#selected-template-name').text();
// submit the template if necessary
if (nfCommon.isBlank(selectedTemplate)) {
$('#upload-template-status').text('No template selected. Please browse to select a template.');
} else {
templateForm.submit();
// hide the dialog
$('#upload-template-dialog').modal('hide');
}
}
}
}, {
buttonText: 'Cancel',
color: {
base: '#E3E8EB',
hover: '#C7D2D7',
text: '#004849'
},
handler: {
click: function () {
// hide the dialog
$('#upload-template-dialog').modal('hide');
}
}
}],
handler: {
close: function () {
// set the filename
$('#selected-template-name').text('');
$('#upload-template-status').text('');
// reset the form to ensure that the change fire will fire
templateForm.resetForm();
}
}
});
$('#template-file-field-button').on('click', function (e) {
$('#template-file-field').click();
});
// add a handler for the change file input chain event
$('#template-file-field').on('change', function (e) {
var filename = $(this).val();
if (!nfCommon.isBlank(filename)) {
filename = filename.replace(/^.*[\\\/]/, '');
}
// set the filename and clear any status
$('#selected-template-name').text(filename);
$('#upload-template-status').text('');
});
},
/**
* Updates the modal config.
*
* @param {string} name The name of the property to update.
* @param {object|array} config The config for the `name`.
*/
update: function (name, config) {
this.getElement().modal(name, config);
},
/**
* Show the modal.
*/
show: function () {
this.getElement().modal('show');
},
/**
* Hide the modal.
*/
hide: function () {
this.getElement().modal('hide');
}
}
};
/**
* The canvas operator's fillcolor component.
*/
@ -507,8 +286,6 @@
* Initializes the canvas operate controller.
*/
init: function () {
this.template.modal.init();
this.templateUpload.modal.init();
this.fillcolor.modal.init();
this.fillcolor.modal.minicolors.init();
}

View File

@ -41,7 +41,6 @@
groupComponent,
remoteGroupComponent,
funnelComponent,
templateComponent,
registryImportComponent,
labelComponent) {
'use strict';
@ -52,7 +51,6 @@
groupComponent,
remoteGroupComponent,
funnelComponent,
templateComponent,
registryImportComponent,
labelComponent) {
this.processorComponent = processorComponent;
@ -61,7 +59,6 @@
this.groupComponent = groupComponent;
this.remoteGroupComponent = remoteGroupComponent;
this.funnelComponent = funnelComponent;
this.templateComponent = templateComponent;
this.registryImportComponent = registryImportComponent;
this.labelComponent = labelComponent;
@ -77,7 +74,6 @@
remoteProcessGroup: 'Remote Process Group',
connection: 'Connection',
funnel: 'Funnel',
template: 'Template',
importFromRegistry: 'Import from Registry',
label: 'Label'
},
@ -102,7 +98,6 @@
outputPortComponent.modal.init();
groupComponent.modal.init();
remoteGroupComponent.modal.init();
templateComponent.modal.init();
},
/**
@ -165,7 +160,6 @@
groupComponent,
remoteGroupComponent,
funnelComponent,
templateComponent,
registryImportComponent,
labelComponent);
return toolboxCtrl;

View File

@ -1,291 +0,0 @@
/*
* 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.
*/
/* global define, module, require, exports */
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery',
'nf.Client',
'nf.Birdseye',
'nf.Storage',
'nf.Graph',
'nf.CanvasUtils',
'nf.ErrorHandler',
'nf.Dialog',
'nf.Common'],
function ($, nfClient, nfBirdseye, nfStorage, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) {
return (nf.ng.TemplateComponent = factory($, nfClient, nfBirdseye, nfStorage, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.TemplateComponent =
factory(require('jquery'),
require('nf.Client'),
require('nf.Birdseye'),
require('nf.Storage'),
require('nf.Graph'),
require('nf.CanvasUtils'),
require('nf.ErrorHandler'),
require('nf.Dialog'),
require('nf.Common')));
} else {
nf.ng.TemplateComponent = factory(root.$,
root.nf.Client,
root.nf.Birdseye,
root.nf.Storage,
root.nf.Graph,
root.nf.CanvasUtils,
root.nf.ErrorHandler,
root.nf.Dialog,
root.nf.Common);
}
}(this, function ($, nfClient, nfBirdseye, nfStorage, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) {
'use strict';
return function (serviceProvider) {
'use strict';
/**
* Instantiates the specified template.
*
* @argument {string} templateId The template id.
* @argument {object} pt The point that the template was dropped.
*/
var createTemplate = function (templateId, pt) {
var instantiateTemplateInstance = {
'templateId': templateId,
'originX': pt.x,
'originY': pt.y,
'disconnectedNodeAcknowledged': nfStorage.isDisconnectionAcknowledged()
};
// create a new instance of the new template
$.ajax({
type: 'POST',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/template-instance',
data: JSON.stringify(instantiateTemplateInstance),
dataType: 'json',
contentType: 'application/json'
}).done(function (response) {
// populate the graph accordingly
nfGraph.add(response.flow, {
'selectAll': true
});
// update component visibility
nfGraph.updateVisibility();
// update the birdseye
nfBirdseye.refresh();
}).fail(nfErrorHandler.handleAjaxError);
};
function TemplateComponent() {
this.icon = 'icon icon-template';
this.hoverIcon = 'icon icon-template-add';
/**
* The template component's modal.
*/
this.modal = {
/**
* Gets the modal element.
*
* @returns {*|jQuery|HTMLElement}
*/
getElement: function () {
return $('#instantiate-template-dialog');
},
/**
* Initialize the modal.
*/
init: function () {
// configure the instantiate template dialog
this.getElement().modal({
scrollableContentStyle: 'scrollable',
headerText: 'Add Template'
});
},
/**
* Updates the modal config.
*
* @param {string} name The name of the property to update.
* @param {object|array} config The config for the `name`.
*/
update: function (name, config) {
this.getElement().modal(name, config);
},
/**
* Show the modal.
*/
show: function () {
this.getElement().modal('show');
},
/**
* Hide the modal.
*/
hide: function () {
this.getElement().modal('hide');
}
};
}
TemplateComponent.prototype = {
constructor: TemplateComponent,
/**
* Gets the component.
*
* @returns {*|jQuery|HTMLElement}
*/
getElement: function () {
return $('#template-component');
},
/**
* Enable the component.
*/
enabled: function () {
this.getElement().attr('disabled', false);
},
/**
* Disable the component.
*/
disabled: function () {
this.getElement().attr('disabled', true);
},
/**
* Handler function for when component is dropped on the canvas.
*
* @argument {object} pt The point that the component was dropped.
*/
dropHandler: function (pt) {
this.promptForTemplate(pt);
},
/**
* The drag icon for the toolbox component.
*
* @param event
* @returns {*|jQuery|HTMLElement}
*/
dragIcon: function (event) {
return $('<div class="icon icon-template-add"></div>');
},
/**
* Prompts the user to select a template.
*
* @argument {object} pt The point that the template was dropped.
*/
promptForTemplate: function (pt) {
var templateComponent = this;
$.ajax({
type: 'GET',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/flow/templates',
dataType: 'json'
}).done(function (response) {
var templates = response.templates;
if (nfCommon.isDefinedAndNotNull(templates) && templates.length > 0) {
// sort the templates
templates = templates.sort(function (one, two) {
var oneDate = nfCommon.parseDateTime(one.template.timestamp);
var twoDate = nfCommon.parseDateTime(two.template.timestamp);
// newest templates first
return twoDate.getTime() - oneDate.getTime();
});
var options = [];
$.each(templates, function (_, templateEntity) {
if (templateEntity.permissions.canRead === true) {
options.push({
text: templateEntity.template.name,
value: templateEntity.id,
description: nfCommon.escapeHtml(templateEntity.template.description)
});
}
});
// configure the templates combo
$('#available-templates').combo({
maxHeight: 300,
options: options
});
// update the button model
templateComponent.modal.update('setButtonModel', [{
buttonText: 'Add',
color: {
base: '#728E9B',
hover: '#004849',
text: '#ffffff'
},
handler: {
click: function () {
// get the type of processor currently selected
var selectedOption = $('#available-templates').combo('getSelectedOption');
var templateId = selectedOption.value;
// hide the dialog
templateComponent.modal.hide();
// instantiate the specified template
createTemplate(templateId, pt);
}
}
},
{
buttonText: 'Cancel',
color: {
base: '#E3E8EB',
hover: '#C7D2D7',
text: '#004849'
},
handler: {
click: function () {
templateComponent.modal.hide();
}
}
}]);
// show the dialog
templateComponent.modal.show();
} else {
nfDialog.showOkDialog({
headerText: 'Instantiate Template',
dialogContent: 'No templates have been loaded into this NiFi.'
});
}
}).fail(nfErrorHandler.handleAjaxError);
}
}
var templateComponent = new TemplateComponent();
return templateComponent;
};
}));

View File

@ -2114,130 +2114,6 @@
nfCanvasUtils.moveComponentsToParent(selection);
},
/**
* Uploads a new template.
*/
uploadTemplate: function () {
$('#upload-template-dialog').modal('show');
},
/**
* Creates a new template based off the currently selected components. If no components
* are selected, a template of the entire canvas is made.
*/
template: function () {
var selection = nfCanvasUtils.getSelection();
// if no components are selected, use the entire graph
if (selection.empty()) {
selection = d3.selectAll('g.component, g.connection');
}
// ensure that components have been specified
if (selection.empty()) {
nfDialog.showOkDialog({
headerText: 'Create Template',
dialogContent: "The current selection is not valid to create a template."
});
return;
}
// remove dangling edges (where only the source or destination is also selected)
selection = nfCanvasUtils.trimDanglingEdges(selection);
// ensure that components specified are valid
if (selection.empty()) {
nfDialog.showOkDialog({
headerText: 'Create Template',
dialogContent: "The current selection is not valid to create a template."
});
return;
}
// prompt for the template name
$('#new-template-dialog').modal('setButtonModel', [{
buttonText: 'Create',
color: {
base: '#728E9B',
hover: '#004849',
text: '#ffffff'
},
handler: {
click: function () {
// get the template details
var templateName = $('#new-template-name').val();
// ensure the template name is not blank
if (nfCommon.isBlank(templateName)) {
nfDialog.showOkDialog({
headerText: 'Configuration Error',
dialogContent: "The name of the template must be specified."
});
return;
}
// hide the dialog
$('#new-template-dialog').modal('hide');
// get the description
var templateDescription = $('#new-template-description').val();
// create a snippet
var parentGroupId = nfCanvasUtils.getGroupId();
var snippet = nfSnippet.marshal(selection, parentGroupId);
// create the snippet
nfSnippet.create(snippet).done(function (response) {
var createSnippetEntity = {
'name': templateName,
'description': templateDescription,
'snippetId': response.snippet.id,
'disconnectedNodeAcknowledged': nfStorage.isDisconnectionAcknowledged()
};
// create the template
$.ajax({
type: 'POST',
url: config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/templates',
data: JSON.stringify(createSnippetEntity),
dataType: 'json',
contentType: 'application/json'
}).done(function () {
// show the confirmation dialog
nfDialog.showOkDialog({
headerText: 'Create Template',
dialogContent: "Template '" + nfCommon.escapeHtml(templateName) + "' was successfully created."
});
}).always(function () {
// clear the template dialog fields
$('#new-template-name').val('');
$('#new-template-description').val('');
}).fail(nfErrorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
}
}, {
buttonText: 'Cancel',
color: {
base: '#E3E8EB',
hover: '#C7D2D7',
text: '#004849'
},
handler: {
click: function () {
// clear the template dialog fields
$('#new-template-name').val('');
$('#new-template-description').val('');
$('#new-template-dialog').modal('hide');
}
}
}]).modal('show');
// auto focus on the template name
$('#new-template-name').focus();
},
/**
* Copies the component in the specified selection.
*

View File

@ -78,7 +78,6 @@
'nf.ng.GroupComponent',
'nf.ng.RemoteProcessGroupComponent',
'nf.ng.FunnelComponent',
'nf.ng.TemplateComponent',
'nf.ng.RegistryImportComponent',
'nf.ng.LabelComponent',
'nf.ng.Canvas.GraphControlsCtrl',
@ -86,8 +85,8 @@
'nf.ng.Canvas.OperateCtrl',
'nf.ng.BreadcrumbsDirective',
'nf.ng.DraggableDirective'],
function ($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfParameterContexts, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVerify, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfFlowAnalysisRule, nfParameterProvider, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, registryImportComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
return factory($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfParameterContexts, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVerify, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfFlowAnalysisRule, nfParameterProvider, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, registryImportComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective);
function ($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfParameterContexts, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVerify, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfFlowAnalysisRule, nfParameterProvider, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, registryImportComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
return factory($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfParameterContexts, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVerify, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfFlowAnalysisRule, nfParameterProvider, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, registryImportComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective);
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = factory(require('jquery'),
@ -149,7 +148,6 @@
require('nf.ng.GroupComponent'),
require('nf.ng.RemoteProcessGroupComponent'),
require('nf.ng.FunnelComponent'),
require('nf.ng.TemplateComponent'),
require('nf.ng.RegistryImportComponent'),
require('nf.ng.LabelComponent'),
require('nf.ng.Canvas.GraphControlsCtrl'),
@ -217,7 +215,6 @@
root.nf.ng.GroupComponent,
root.nf.ng.RemoteProcessGroupComponent,
root.nf.ng.FunnelComponent,
root.nf.ng.TemplateComponent,
root.nf.ng.RegistryImportComponent,
root.nf.ng.LabelComponent,
root.nf.ng.Canvas.GraphControlsCtrl,
@ -226,7 +223,7 @@
root.nf.ng.BreadcrumbsDirective,
root.nf.ng.DraggableDirective);
}
}(this, function ($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfParameterContexts, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVerify, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfFlowAnalysisRule, nfParameterProvider, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, registryImportComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
}(this, function ($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfQuickSelect, nfShell, nfParameterContexts, nfSettings, nfActions, nfSnippet, nfQueueListing, nfVerify, nfComponentState, nfFlowVersion, nfComponentVersion, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfFlowAnalysisRule, nfParameterProvider, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, registryImportComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
var config = {
urls: {
@ -257,7 +254,6 @@
'groupComponent',
'remoteGroupComponent',
'funnelComponent',
'templateComponent',
'registryImportComponent',
'labelComponent'];
processorComponent.$inject = ['serviceProvider'];
@ -266,7 +262,6 @@
processGroupComponent.$inject = ['serviceProvider'];
remoteProcessGroupComponent.$inject = ['serviceProvider'];
funnelComponent.$inject = ['serviceProvider'];
templateComponent.$inject = ['serviceProvider'];
registryImportComponent.$inject = ['serviceProvider'];
labelComponent.$inject = ['serviceProvider'];
graphControlsCtrl.$inject = ['serviceProvider', 'navigateCtrl', 'operateCtrl'];
@ -294,7 +289,6 @@
app.service('groupComponent', processGroupComponent);
app.service('remoteGroupComponent', remoteProcessGroupComponent);
app.service('funnelComponent', funnelComponent);
app.service('templateComponent', templateComponent);
app.service('registryImportComponent', registryImportComponent);
app.service('labelComponent', labelComponent);
app.service('graphControlsCtrl', graphControlsCtrl);

View File

@ -118,24 +118,6 @@
return nfCanvasUtils.areDeletable(selection);
};
/**
* Determines whether user can create a template from the components in the specified selection.
*
* @param {selection} selection The selection of currently selected components
*/
var canCreateTemplate = function (selection) {
return nfCanvasUtils.canWriteCurrentGroup() && (selection.empty() || nfCanvasUtils.canRead(selection));
};
/**
* Determines whether user can upload a template.
*
* @param {selection} selection The selection of currently selected components
*/
var canUploadTemplate = function (selection) {
return nfCanvasUtils.canWriteCurrentGroup() && selection.empty();
};
/**
* Determines whether components in the specified selection are group-able.
*
@ -875,9 +857,6 @@
{id: 'download-menu-item-with', condition: supportsDownloadFlow, menuItem: {clazz: 'fa', text: 'With external services', action: 'downloadFlowWithExternalServices'}}
]},
{separator: true},
{id: 'upload-template-menu-item', condition: canUploadTemplate, menuItem: {clazz: 'icon icon-template-import', text: 'Upload template', action: 'uploadTemplate'}},
{id: 'template-menu-item', condition: canCreateTemplate, menuItem: {clazz: 'icon icon-template-save', text: 'Create template', action: 'template'}},
{separator: true},
{id: 'copy-menu-item', condition: isCopyable, menuItem: {clazz: 'fa fa-copy', text: 'Copy', action: 'copy'}},
{id: 'paste-menu-item', condition: isPastable, menuItem: {clazz: 'fa fa-paste', text: 'Paste', action: 'paste'}},
{separator: true},

View File

@ -1611,60 +1611,6 @@
return loadPolicy().always(showPolicy);
},
/**
* Shows the template policy.
*
* @param d
*/
showTemplatePolicy: function (d) {
initializingComponentPolicy = true;
// reset the policy message
resetPolicyMessage();
// update the policy controls visibility
$('#component-policy-controls').show();
$('#global-policy-controls').hide();
// update the visibility
if (d.permissions.canRead === true) {
$('#policy-selected-template-container div.policy-selected-component-name').text(d.template.name);
} else {
$('#policy-selected-template-container div.policy-selected-component-name').text(d.id);
}
$('#policy-selected-template-container').show();
// populate the initial resource
$('#selected-policy-component-id').text(d.id);
$('#selected-policy-component-type').text('templates');
$('#component-policy-target')
.combo('setOptionEnabled', {
value: 'operate-component'
}, false)
.combo('setOptionEnabled', {
value: 'write-receive-data'
}, false)
.combo('setOptionEnabled', {
value: 'write-send-data'
}, false)
.combo('setOptionEnabled', {
value: 'read-data'
}, false)
.combo('setOptionEnabled', {
value: 'read-provenance'
}, false)
.combo('setOptionEnabled', {
value: 'write-data'
}, false)
.combo('setSelectedOption', {
value: 'read-component'
});
initializingComponentPolicy = false;
return loadPolicy().always(showPolicy);
},
/**
* Shows the parameter context policy.
*

View File

@ -52,7 +52,6 @@
remoteProcessGroup: 'Remote Process Group',
connection: 'Connection',
funnel: 'Funnel',
template: 'Template',
label: 'Label',
node: 'Node'
},

View File

@ -1,450 +0,0 @@
/*
* 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.
*/
/* global define, module, require, exports */
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery',
'Slick',
'nf.Common',
'nf.Dialog',
'nf.ErrorHandler'],
function ($, Slick, nfCommon, nfDialog, nfErrorHandler) {
return (nf.TemplatesTable = factory($, Slick, nfCommon, nfDialog, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.TemplatesTable =
factory(require('jquery'),
require('Slick'),
require('nf.Common'),
require('nf.Dialog'),
require('nf.ErrorHandler')));
} else {
nf.TemplatesTable = factory(root.$,
root.Slick,
root.nf.Common,
root.nf.Dialog,
root.nf.ErrorHandler);
}
}(this, function ($, Slick, nfCommon, nfDialog, nfErrorHandler) {
'use strict';
var isDisconnectionAcknowledged = false;
/**
* Configuration object used to hold a number of configuration items.
*/
var config = {
urls: {
templates: '../nifi-api/flow/templates'
}
};
/**
* Sorts the specified data using the specified sort details.
*
* @param {object} sortDetails
* @param {object} data
*/
var sort = function (sortDetails, data) {
// defines a function for sorting
var comparer = function (a, b) {
if (a.permissions.canRead && b.permissions.canRead) {
if (sortDetails.columnId === 'timestamp') {
var aDate = nfCommon.parseDateTime(a.template[sortDetails.columnId]);
var bDate = nfCommon.parseDateTime(b.template[sortDetails.columnId]);
return aDate.getTime() - bDate.getTime();
} else {
var aString = nfCommon.isDefinedAndNotNull(a.template[sortDetails.columnId]) ? a.template[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b.template[sortDetails.columnId]) ? b.template[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
}
} else {
if (!a.permissions.canRead && !b.permissions.canRead) {
return 0;
}
if (a.permissions.canRead) {
return 1;
} else {
return -1;
}
}
};
// perform the sort
data.sort(comparer, sortDetails.sortAsc);
};
/**
* Prompts the user before attempting to delete the specified template.
*
* @argument {object} templateEntity The template
*/
var promptToDeleteTemplate = function (templateEntity) {
// prompt for deletion
nfDialog.showYesNoDialog({
headerText: 'Delete Template',
dialogContent: 'Delete template \'' + nfCommon.escapeHtml(templateEntity.template.name) + '\'?',
yesHandler: function () {
deleteTemplate(templateEntity);
}
});
};
/**
* Opens the access policies for the specified template.
*
* @param templateEntity
*/
var openAccessPolicies = function (templateEntity) {
// only attempt this if we're within a frame
if (top !== window) {
// and our parent has canvas utils and shell defined
if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.PolicyManagement) && nfCommon.isDefinedAndNotNull(parent.nf.Shell)) {
parent.nf.PolicyManagement.showTemplatePolicy(templateEntity);
parent.$('#shell-close-button').click();
}
}
};
/**
* Deletes the template with the specified id.
*
* @argument {string} templateEntity The template
*/
var deleteTemplate = function (templateEntity) {
$.ajax({
type: 'DELETE',
url: templateEntity.template.uri + '?' + $.param({
'disconnectedNodeAcknowledged': isDisconnectionAcknowledged
}),
dataType: 'json'
}).done(function () {
var templatesGrid = $('#templates-table').data('gridInstance');
var templatesData = templatesGrid.getData();
templatesData.deleteItem(templateEntity.id);
// update the total number of templates
$('#total-templates').text(templatesData.getItems().length);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
* Get the text out of the filter field. If the filter field doesn't
* have any text it will contain the text 'filter list' so this method
* accounts for that.
*/
var getFilterText = function () {
return $('#templates-filter').val();
};
/**
* Applies the filter found in the filter expression text field.
*/
var applyFilter = function () {
// get the dataview
var templatesGrid = $('#templates-table').data('gridInstance');
// ensure the grid has been initialized
if (nfCommon.isDefinedAndNotNull(templatesGrid)) {
var templatesData = templatesGrid.getData();
// update the search criteria
templatesData.setFilterArgs({
searchString: getFilterText(),
property: $('#templates-filter-type').combo('getSelectedOption').value
});
templatesData.refresh();
}
};
/**
* Performs the filtering.
*
* @param {object} item The item subject to filtering
* @param {object} args Filter arguments
* @returns {Boolean} Whether or not to include the item
*/
var filter = function (item, args) {
if (args.searchString === '') {
return true;
}
try {
// perform the row filtering
var filterExp = new RegExp(args.searchString, 'i');
} catch (e) {
// invalid regex
return false;
}
// perform the filter
return item.template[args.property].search(filterExp) >= 0;
};
/**
* Downloads the specified template.
*
* @param {object} templateEntity The template
*/
var downloadTemplate = function (templateEntity) {
window.open(templateEntity.template.uri + '/download');
};
return {
/**
* Initializes the templates list.
*/
init: function (disconnectionAcknowledged) {
isDisconnectionAcknowledged = disconnectionAcknowledged;
// define the function for filtering the list
$('#templates-filter').keyup(function () {
applyFilter();
});
// filter type
$('#templates-filter-type').combo({
options: [{
text: 'by name',
value: 'name'
}, {
text: 'by description',
value: 'description'
}],
select: function (option) {
applyFilter();
}
});
var timestampFormatter = function (row, cell, value, columnDef, dataContext) {
if (!dataContext.permissions.canRead) {
return '';
}
return nfCommon.escapeHtml(dataContext.template.timestamp);
};
var nameFormatter = function (row, cell, value, columnDef, dataContext) {
if (!dataContext.permissions.canRead) {
return '<span class="blank">' + nfCommon.escapeHtml(dataContext.id) + '</span>';
}
return nfCommon.escapeHtml(dataContext.template.name);
};
var descriptionFormatter = function (row, cell, value, columnDef, dataContext) {
if (!dataContext.permissions.canRead) {
return '';
}
return nfCommon.formatValue(dataContext.template.description);
};
var groupIdFormatter = function (row, cell, value, columnDef, dataContext) {
if (!dataContext.permissions.canRead) {
return '';
}
return nfCommon.escapeHtml(dataContext.template.groupId);
};
// function for formatting the actions column
var actionFormatter = function (row, cell, value, columnDef, dataContext) {
var markup = '';
if (dataContext.permissions.canRead === true) {
markup += '<div title="Download" class="pointer export-template icon icon-template-save"></div>';
}
if (dataContext.permissions.canWrite === true) {
markup += '<div title="Remove Template" class="pointer prompt-to-delete-template fa fa-trash"></div>';
}
// allow policy configuration conditionally if framed
if (top !== window && nfCommon.canAccessTenants()) {
if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.CanvasUtils) && parent.nf.CanvasUtils.isManagedAuthorizer()) {
markup += '<div title="Access Policies" class="pointer edit-access-policies fa fa-key"></div>';
}
}
return markup;
};
// initialize the templates table
var templatesColumns = [
{
id: 'timestamp',
name: 'Date/Time',
sortable: true,
defaultSortAsc: false,
resizable: false,
formatter: timestampFormatter,
width: 225,
maxWidth: 225
},
{
id: 'name',
name: 'Name',
sortable: true,
resizable: true,
formatter: nameFormatter
},
{
id: 'description',
name: 'Description',
sortable: true,
resizable: true,
formatter: descriptionFormatter
},
{
id: 'groupId',
name: 'Process Group Id',
sortable: true,
resizable: true,
formatter: groupIdFormatter
},
{
id: 'actions',
name: '&nbsp;',
sortable: false,
resizable: false,
formatter: actionFormatter,
width: 100,
maxWidth: 100
}
];
var templatesOptions = {
autosizeColsMode: Slick.GridAutosizeColsMode.LegacyForceFit,
enableTextSelectionOnCells: true,
enableCellNavigation: false,
enableColumnReorder: false,
autoEdit: false,
rowHeight: 24
};
// initialize the dataview
var templatesData = new Slick.Data.DataView({
inlineFilters: false
});
templatesData.setItems([]);
templatesData.setFilterArgs({
searchString: getFilterText(),
property: $('#templates-filter-type').combo('getSelectedOption').value
});
templatesData.setFilter(filter);
// initialize the sort
sort({
columnId: 'timestamp',
sortAsc: false
}, templatesData);
// initialize the grid
var templatesGrid = new Slick.Grid('#templates-table', templatesData, templatesColumns, templatesOptions);
templatesGrid.setSelectionModel(new Slick.RowSelectionModel());
templatesGrid.registerPlugin(new Slick.AutoTooltips());
templatesGrid.setSortColumn('timestamp', false);
templatesGrid.onSort.subscribe(function (e, args) {
sort({
columnId: args.sortCol.id,
sortAsc: args.sortAsc
}, templatesData);
});
// configure a click listener
templatesGrid.onClick.subscribe(function (e, args) {
var target = $(e.target);
// get the node at this row
var item = templatesData.getItem(args.row);
// determine the desired action
if (templatesGrid.getColumns()[args.cell].id === 'actions') {
if (target.hasClass('export-template')) {
downloadTemplate(item);
} else if (target.hasClass('prompt-to-delete-template')) {
promptToDeleteTemplate(item);
} else if (target.hasClass('edit-access-policies')) {
openAccessPolicies(item);
}
}
});
// wire up the dataview to the grid
templatesData.onRowCountChanged.subscribe(function (e, args) {
templatesGrid.updateRowCount();
templatesGrid.render();
// update the total number of displayed processors
$('#displayed-templates').text(args.current);
});
templatesData.onRowsChanged.subscribe(function (e, args) {
templatesGrid.invalidateRows(args.rows);
templatesGrid.render();
});
// hold onto an instance of the grid
$('#templates-table').data('gridInstance', templatesGrid);
// initialize the number of displayed items
$('#displayed-templates').text('0');
},
/**
* Update the size of the grid based on its container's current size.
*/
resetTableSize: function () {
var templateGrid = $('#templates-table').data('gridInstance');
if (nfCommon.isDefinedAndNotNull(templateGrid)) {
templateGrid.resizeCanvas();
}
},
/**
* Load the processor templates table.
*/
loadTemplatesTable: function () {
return $.ajax({
type: 'GET',
url: config.urls.templates,
dataType: 'json'
}).done(function (response) {
// ensure there are groups specified
if (nfCommon.isDefinedAndNotNull(response.templates)) {
var templatesGrid = $('#templates-table').data('gridInstance');
var templatesData = templatesGrid.getData();
// set the items
templatesData.setItems(response.templates);
templatesData.reSort();
templatesGrid.invalidate();
// update the stats last refreshed timestamp
$('#templates-last-refreshed').text(response.generated);
// update the total number of processors
$('#total-templates').text(response.templates.length);
} else {
$('#total-templates').text('0');
}
}).fail(nfErrorHandler.handleAjaxError);
}
};
}));

View File

@ -1,263 +0,0 @@
/*
* 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.
*/
/* global top, define, module, require, exports */
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery',
'nf.Common',
'nf.Dialog',
'nf.TemplatesTable',
'nf.ErrorHandler',
'nf.Storage'],
function ($, nfCommon, nfDialog, nfTemplatesTable, nfErrorHandler, nfStorage) {
return (nf.Templates = factory($, nfCommon, nfDialog, nfTemplatesTable, nfErrorHandler, nfStorage));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Templates =
factory(require('jquery'),
require('nf.Common'),
require('nf.Dialog'),
require('nf.TemplatesTable'),
require('nf.ErrorHandler'),
require('nf.Storage')));
} else {
nf.Templates = factory(root.$,
root.nf.Common,
root.nf.Dialog,
root.nf.TemplatesTable,
root.nf.ErrorHandler,
root.nf.Storage);
}
}(this, function ($, nfCommon, nfDialog, nfTemplatesTable, nfErrorHandler, nfStorage) {
'use strict';
$(document).ready(function () {
// initialize the templates page
nfTemplates.init();
});
/**
* Configuration object used to hold a number of configuration items.
*/
var config = {
urls: {
banners: '../nifi-api/flow/banners',
about: '../nifi-api/flow/about',
currentUser: '../nifi-api/flow/current-user'
}
};
/**
* Loads the current users.
*/
var loadCurrentUser = function () {
return $.ajax({
type: 'GET',
url: config.urls.currentUser,
dataType: 'json'
}).done(function (currentUser) {
nfCommon.setCurrentUser(currentUser);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
* Verifies if the current node is disconnected from the cluster.
*/
var verifyDisconnectedCluster = function () {
return $.Deferred(function (deferred) {
if (top !== window && nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.Storage)) {
deferred.resolve(parent.nf.Storage.isDisconnectionAcknowledged());
} else {
$.ajax({
type: 'GET',
url: '../nifi-api/flow/cluster/summary',
dataType: 'json'
}).done(function (clusterSummaryResult) {
var clusterSummaryResponse = clusterSummaryResult;
var clusterSummary = clusterSummaryResponse.clusterSummary;
if (clusterSummary.connectedToCluster) {
deferred.resolve(false);
} else {
if (clusterSummary.clustered) {
nfDialog.showDisconnectedFromClusterMessage(function () {
deferred.resolve(true);
});
} else {
deferred.resolve(false);
}
}
}).fail(nfErrorHandler.handleAjaxError).fail(function () {
deferred.reject();
});
}
}).promise();
};
/**
* Initializes the templates table.
*/
var initializeTemplatesPage = function () {
// define mouse over event for the refresh button
$('#refresh-button').click(function () {
nfTemplatesTable.loadTemplatesTable();
});
// get the banners if we're not in the shell
return $.Deferred(function (deferred) {
if (top === window) {
$.ajax({
type: 'GET',
url: config.urls.banners,
dataType: 'json'
}).done(function (response) {
// ensure the banners response is specified
if (nfCommon.isDefinedAndNotNull(response.banners)) {
if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
// update the header text
var bannerHeader = $('#banner-header').text(response.banners.headerText).show();
// show the banner
var updateTop = function (elementId) {
var element = $('#' + elementId);
element.css('top', (parseInt(bannerHeader.css('height'), 10) + parseInt(element.css('top'), 10)) + 'px');
};
// update the position of elements affected by top banners
updateTop('templates');
}
if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
// update the footer text and show it
var bannerFooter = $('#banner-footer').text(response.banners.footerText).show();
var updateBottom = function (elementId) {
var element = $('#' + elementId);
element.css('bottom', parseInt(bannerFooter.css('height'), 10) + 'px');
};
// update the position of elements affected by bottom banners
updateBottom('templates');
}
}
deferred.resolve();
}).fail(function (xhr, status, error) {
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
} else {
deferred.resolve();
}
}).promise();
};
var nfTemplates = {
/**
* Initializes the templates page.
*/
init: function () {
nfStorage.init();
// load the current user
$.when(verifyDisconnectedCluster(), loadCurrentUser()).done(function (verifyDisconnectedClusterResult) {
// create the templates table
nfTemplatesTable.init(verifyDisconnectedClusterResult);
// load the table
nfTemplatesTable.loadTemplatesTable().done(function () {
// once the table is initialized, finish initializing the page
initializeTemplatesPage().done(function () {
var setBodySize = function () {
//alter styles if we're not in the shell
if (top === window) {
$('body').css({
'height': $(window).height() + 'px',
'width': $(window).width() + 'px'
});
$('#templates').css('margin', 40);
$('#templates-table').css('bottom', 127);
$('#templates-refresh-container').css('margin', 40);
}
// configure the initial grid height
nfTemplatesTable.resetTableSize();
};
// get the about details
$.ajax({
type: 'GET',
url: config.urls.about,
dataType: 'json'
}).done(function (response) {
var aboutDetails = response.about;
var templatesTitle = aboutDetails.title + ' Templates';
// set the document title and the about title
document.title = templatesTitle;
$('#templates-header-text').text(templatesTitle);
// set the initial size
setBodySize();
}).fail(nfErrorHandler.handleAjaxError);
$(window).on('resize', function (e) {
setBodySize();
// resize dialogs when appropriate
var dialogs = $('.dialog');
for (var i = 0, len = dialogs.length; i < len; i++) {
if ($(dialogs[i]).is(':visible')) {
setTimeout(function (dialog) {
dialog.modal('resize');
}, 50, $(dialogs[i]));
}
}
// resize grids when appropriate
var gridElements = $('*[class*="slickgrid_"]');
for (var j = 0, len = gridElements.length; j < len; j++) {
if ($(gridElements[j]).is(':visible')) {
setTimeout(function (gridElement) {
gridElement.data('gridInstance').resizeCanvas();
}, 50, $(gridElements[j]));
}
}
// toggle tabs .scrollable when appropriate
var tabsContainers = $('.tab-container');
var tabsContents = [];
for (var k = 0, len = tabsContainers.length; k < len; k++) {
if ($(tabsContainers[k]).is(':visible')) {
tabsContents.push($('#' + $(tabsContainers[k]).attr('id') + '-content'));
}
}
$.each(tabsContents, function (index, tabsContent) {
nfCommon.toggleScrollable(tabsContent.get(0));
});
});
});
});
});
}
};
return nfTemplates;
}));

View File

@ -639,8 +639,6 @@
policyLabel += 'remote process group ';
} else if (resource.startsWith('/reporting-tasks')) {
policyLabel += 'reporting task ';
} else if (resource.startsWith('/templates')) {
policyLabel += 'template ';
} else if (resource.startsWith('/parameter-contexts')) {
policyLabel += 'parameter context '
}
@ -693,8 +691,6 @@
markup += '<div title="Go To" class="pointer go-to-component fa fa-long-arrow-right" style="float: left;"></div>';
} else if (dataContext.component.resource.indexOf('/reporting-tasks') >= 0) {
//TODO: implement go to for RT
} else if (dataContext.component.resource.indexOf('/templates') >= 0) {
//TODO: implement go to for Templates
} else if (dataContext.component.resource.indexOf('/parameter-contexts') >= 0) {
markup += '<div title="Go To" class="pointer go-to-parameter-context fa fa-long-arrow-right" style="float: left;"></div>';
}
@ -883,7 +879,7 @@
return markup;
};
// initialize the templates table
// initialize the users table
var usersColumns = [
{
id: 'identity',