You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2017/04/06 20:41:51 UTC
[07/15] incubator-trafficcontrol git commit: adds cdn and type to
profiles
adds cdn and type to profiles
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/7cd0e4d6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/7cd0e4d6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/7cd0e4d6
Branch: refs/heads/master
Commit: 7cd0e4d61f1a06e5cd39f557c8535fd7a94e7fdd
Parents: 61fa6c0
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Fri Mar 10 13:57:08 2017 -0700
Committer: Dewayne Richardson <de...@apache.org>
Committed: Thu Apr 6 14:41:34 2017 -0600
----------------------------------------------------------------------
.../form/profile/FormProfileController.js | 35 ++++++++++++++++----
.../modules/form/profile/form.profile.tpl.html | 30 +++++++++++++----
.../table/profiles/table.profiles.tpl.html | 4 +++
3 files changed, 57 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/7cd0e4d6/traffic_ops/experimental/ui/app/src/common/modules/form/profile/FormProfileController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/form/profile/FormProfileController.js b/traffic_ops/experimental/ui/app/src/common/modules/form/profile/FormProfileController.js
index 14822d8..67755fd 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/form/profile/FormProfileController.js
+++ b/traffic_ops/experimental/ui/app/src/common/modules/form/profile/FormProfileController.js
@@ -17,16 +17,34 @@
* under the License.
*/
-var FormProfileController = function(profile, $scope, $location, formUtils, stringUtils, locationUtils) {
+var FormProfileController = function(profile, $scope, $location, formUtils, locationUtils, cdnService) {
+
+ var getCDNs = function() {
+ cdnService.getCDNs()
+ .then(function(result) {
+ $scope.cdns = result;
+ });
+ };
$scope.profile = profile;
- $scope.props = [
- { name: 'name', type: 'text', required: true, maxLength: 45 }
+ $scope.types = [
+ { value: 'ATS_PROFILE' },
+ { value: 'TR_PROFILE' },
+ { value: 'TM_PROFILE' },
+ { value: 'TS_PROFILE' },
+ { value: 'TP_PROFILE' },
+ { value: 'INFLUXDB_PROFILE' },
+ { value: 'RIAK_PROFILE' },
+ { value: 'SPLUNK_PROFILE' },
+ { value: 'DS_PROFILE' },
+ { value: 'ORG_PROFILE' },
+ { value: 'KAFKA_PROFILE' },
+ { value: 'LOGSTASH_PROFILE' },
+ { value: 'ES_PROFILE' },
+ { value: 'UNK_PROFILE' }
];
- $scope.labelize = stringUtils.labelize;
-
$scope.viewParams = function() {
$location.path($location.path() + '/parameters');
};
@@ -49,7 +67,12 @@ var FormProfileController = function(profile, $scope, $location, formUtils, stri
$scope.hasPropertyError = formUtils.hasPropertyError;
+ var init = function () {
+ getCDNs();
+ };
+ init();
+
};
-FormProfileController.$inject = ['profile', '$scope', '$location', 'formUtils', 'stringUtils', 'locationUtils'];
+FormProfileController.$inject = ['profile', '$scope', '$location', 'formUtils', 'locationUtils', 'cdnService'];
module.exports = FormProfileController;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/7cd0e4d6/traffic_ops/experimental/ui/app/src/common/modules/form/profile/form.profile.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/form/profile/form.profile.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/form/profile/form.profile.tpl.html
index 06473c9..820659e 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/form/profile/form.profile.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/common/modules/form/profile/form.profile.tpl.html
@@ -43,13 +43,31 @@ under the License.
<div class="x_content">
<br>
<form name="profileForm" class="form-horizontal form-label-left" novalidate>
- <div class="form-group" ng-class="{'has-error': hasError(profileForm[prop.name]), 'has-feedback': hasError(profileForm[prop.name])}" ng-repeat="prop in props">
- <label class="control-label col-md-2 col-sm-2 col-xs-12">{{labelize(prop.name)}} <span ng-show="prop.required">*</span></label>
+ <div class="form-group" ng-class="{'has-error': hasError(profileForm.name), 'has-feedback': hasError(profileForm.name)}">
+ <label class="control-label col-md-2 col-sm-2 col-xs-12">Name *</label>
<div class="col-md-10 col-sm-10 col-xs-12">
- <input id="{{prop.name}}" name="{{prop.name}}" type="{{prop.type}}" class="form-control" ng-model="profile[prop.name]" ng-readonly="prop.readonly" ng-required="prop.required" ng-maxlength="prop.maxLength" autofocus>
- <small class="input-error" ng-show="hasPropertyError(profileForm[prop.name], 'required')">Required</small>
- <small class="input-error" ng-show="hasPropertyError(profileForm[prop.name], 'maxlength')">Too Long</small>
- <span ng-show="hasError(profileForm[prop.name])" class="form-control-feedback"><i class="fa fa-times"></i></span>
+ <input id="name" name="name" type="text" class="form-control" ng-model="profile.name" ng-required="true" ng-maxlength="45" autofocus>
+ <small class="input-error" ng-show="hasPropertyError(profileForm.name, 'required')">Required</small>
+ <small class="input-error" ng-show="hasPropertyError(profileForm.name, 'maxlength')">Too Long</small>
+ <span ng-show="hasError(profileForm.name)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+ </div>
+ </div>
+ <div class="form-group" ng-class="{'has-error': hasError(profileForm.cdn), 'has-feedback': hasError(profileForm.cdn)}">
+ <label class="control-label col-md-2 col-sm-2 col-xs-12">CDN *</label>
+ <div class="col-md-10 col-sm-10 col-xs-12">
+ <select id="cdn" name="cdn" class="form-control" ng-model="profile.cdn" ng-options="cdn.id as cdn.name for cdn in cdns" required>
+ <option value="">Select...</option>
+ </select>
+ <small class="input-error" ng-show="hasPropertyError(profileForm.cdn, 'required')">Required</small>
+ </div>
+ </div>
+ <div class="form-group" ng-class="{'has-error': hasError(profileForm.type), 'has-feedback': hasError(profileForm.type)}">
+ <label class="control-label col-md-2 col-sm-2 col-xs-12">Type *</label>
+ <div class="col-md-10 col-sm-10 col-xs-12">
+ <select id="type" name="type" class="form-control" ng-model="profile.type" ng-options="type.value as type.value for type in types" required>
+ <option value="">Select...</option>
+ </select>
+ <small class="input-error" ng-show="hasPropertyError(profileForm.cdn, 'required')">Required</small>
</div>
</div>
<div class="form-group">
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/7cd0e4d6/traffic_ops/experimental/ui/app/src/common/modules/table/profiles/table.profiles.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/profiles/table.profiles.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/table/profiles/table.profiles.tpl.html
index 9d7b497..3d9ea8e 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/table/profiles/table.profiles.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/profiles/table.profiles.tpl.html
@@ -44,13 +44,17 @@ under the License.
<thead>
<tr class="headings">
<th>name</th>
+ <th>type</th>
<th>description</th>
+ <th>cdn</th>
</tr>
</thead>
<tbody>
<tr ng-click="editProfile(profile.id)" ng-repeat="profile in profiles">
<td>{{profile.name}}</td>
+ <td>{{profile.type}}</td>
<td>{{profile.description}}</td>
+ <td>{{profile.cdnName}}</td>
</tr>
</tbody>
</table>