You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/12/17 23:24:20 UTC

[GitHub] [trafficcontrol] mattjackson220 commented on a change in pull request #6339: Cert expirations tp

mattjackson220 commented on a change in pull request #6339:
URL: https://github.com/apache/trafficcontrol/pull/6339#discussion_r771740984



##########
File path: traffic_portal/app/src/common/modules/table/certExpirations/TableCertExpirationsController.js
##########
@@ -0,0 +1,317 @@
+/*
+ * 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 TableCertExpirationsController = function(tableName, certExpirations, filter, $document, $scope, $state, $filter, locationUtils, certExpirationsService) {
+
+    let table;
+
+	$scope.certExpirations = certExpirations;
+	$scope.days;
+
+	$scope.editCertExpirations = function(dsId) {
+		locationUtils.navigateToPath('/delivery-services/' + dsId + '/ssl-keys');
+	}
+
+	/**
+	 * Formats the contents of a 'expiration' column cell as just the date.
+	 */
+	function dateCellFormatter(params) {
+		return params.value ? $filter('date')(params.value, 'MM/dd/yyyy') : params.value;
+	}
+
+	/**
+	 * Formats the contents of a 'expiration' column cell as just the date.
+	 */
+	function federatedCellFormatter(params) {
+		if (!params.value) {
+			return '';
+		} else {
+			return params.value;
+		}
+	}
+
+    $scope.refresh = function() {
+        $state.reload(); // reloads all the resolves for the view
+    };
+
+	/** Toggles the visibility of a column that has the ID provided as 'col'. */
+	$scope.toggleVisibility = function(col) {
+		const visible = $scope.gridOptions.columnApi.getColumn(col).isVisible();
+		$scope.gridOptions.columnApi.setColumnVisible(col, !visible);
+	};
+
+	/** The columns of the ag-grid table */
+	const columns = [
+		{
+			headerName: "Delivery Service",
+			field: "deliveryservice",
+			hide: false
+		},
+		{
+			headerName: "CDN",
+			field: "cdn",
+			hide: false
+		},
+		{
+			headerName: "Provider",
+			field: "provider",
+			hide: false
+		},
+		{
+			headerName: "Expiration",
+			field: "expiration",
+			hide: false,
+			valueFormatter: dateCellFormatter
+		},
+		{
+			headerName: "Federated",
+			field: "federated",
+			hide: false,
+			valueFormatter: federatedCellFormatter
+		},
+	];
+
+	$scope.pageSize = 100;
+
+	/** Options, configuration, data and callbacks for the ag-grid table. */
+	$scope.gridOptions = {

Review comment:
       i tried that route originally but i couldnt get the `Days` input to be with the other inputs or to get it to update the table correctly with the new information. i can try again next week on that but i got the other updates in there




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org