<commit_before><link rel="import" href="polymer/polymer.html">
<link rel="import" href="paper-dialog/paper-dialog.html">
<link rel="import" href="paper-toolbar/paper-toolbar.html">
<link rel="import" href="paper-dialog-scrollable/paper-dialog-scrollable.html">
<link rel="import" href="paper-button/paper-button.html">
<link rel="import" href="iron-list/iron-list.html">
<link rel="import" href="iron-ajax/iron-ajax.html">
<link rel="import" href="iron-icon/iron-icon.html">

<dom-module id="sig-ipdr-log-files">
	<style is="custom-style">
		paper-dialog {
			width: 60%;
			height: 60%;
			padding: 10px;
		}
		paper-toolbar{
			color: white;
			background-color: #bc5100;
		}
		.cancel-button {
			color: black;
		}
		iron-list {
			height: 40vh;
		}
		.item {
			cursor: pointer;
			padding: 5px;
		}
	</style>
	<template>
		<paper-dialog id="selectLogFileModal" modal>
			<paper-toolbar>
				<h2>Select Log File</h2>
			</paper-toolbar>
			<paper-dialog-scrollable>
				<iron-list id="logFiles"
						as="item" grid>
					<template>
						<div class="item" on-click="getLogContent">
							<iron-icon icon="assignment"></iron-icon>
							[[item]]
						</div>
					</template>
				</iron-list>
			</paper-dialog-scrollable>
			<div class="cancel-button">
				<paper-button dialog-dismiss>Cancel</paper-button>
			</div>
		</paper-dialog>
		<iron-ajax id="getLogsAjax"
				url="/usageManagement/v1/usage"
				method = "GET"
				headers='{"Accept": "application/json"}'
				on-response="getLogsResponse">
		</iron-ajax>
		<iron-ajax id="getIpdr"
				headers='{"Accept": "application/json"}'
				on-loading-changed="_onLoadingChanged"
				on-response="getLogContentResponse">
		</iron-ajax>
	</template>
	<script>
		Polymer (
			{
				is: 'sig-ipdr-log-files',
				listeners: {
				},
				getLogContent: function (event) {
					var searchAjax = this.$.getIpdr;
					searchAjax,method = "GET";
					searchAjax.url = "/usageManagement/v1/usage/" + event.model.item;
					searchAjax.generateRequest();
				},
				getLogsResponse: function(event){
					this.$.logFiles.items = event.detail.response;
				},
				_onLoadingChanged: function(event) {
					if (document.getElementById("getIpdr").loading) {
						document.getElementById("progress").disabled = false;
					} else {
						document.getElementById("progress").disabled = true;
					}
				},
				getLogContentResponse: function(event) {
					this.$.selectLogFileModal.close();
					var grid = document.getElementById("ipdrGrid");
					var results = event.detail.response;
					vaadinItems = new Array();
					for(var index in results) {
							var newRecord = new Object();
							newRecord.date = results[index].date;
							newRecord.type = results[index].type;
							newRecord.usageSpecificationName = results[index].usageSpecification.name;
							results[index].usageCharacteristic.forEach(
								function(attrObj) {
									newRecord[attrObj.key] = attrObj.value;
								}
							);
							vaadinItems[index] = newRecord;
					}
					grid.frozenColumns = 1;
					grid.items = vaadinItems;
					grid.columns = [
						{
							"name": "ipdrCreationTime"
						},
						{
							"name": "seqNum"
						},
						{
							"name": "username"
						},
//							{
//								"name": "scIdType"
//							},
//							{
//								"name": "scId"
//							},
//							{
//								"name": "homeServiceProviderType"
//							},
//							{
//								"name": "homeServiceProvider"
//							},
						{
							"name": "acctSessionId"
						},
//							{
//								"name": "userIpAddress"
//							},
						{
							"name": "callingStationId"
						},
						{
							"name": "calledStationId"
						},
						{
							"name": "nasIpAddress"
						},
						{
							"name": "nasId"
						},
//							{
//								"name": "accessProviderType"
//							},
//							{
//								"name": "accessServiceProvider"
//							},
//							{
//								"name": "locationName"
//							},
//							{
//								"name": "locationId"
//							},
//							{
//								"name": "locationType"
//							},
//							{
//								"name": "locationCountryCode"
//							},
//							{
//								"name": "locationStateProvince"
//							},
//							{
//								"name": "locationCity"
//							},
//							{
//								"name": "locationGeocode"
//							},
//							{
//								"name": "locationGeocodeType"
//							},
//							{
//								"name": "nasPortType"
//							},
//							{
//								"name": "paymentType"
//							},
//							{
//								"name": "networkConnectionType"
//							},
						{
							"name": "sessionDuration"
						},
						{
							"name": "inputOctets"
						},
						{
							"name": "outputOctets"
						},
//							{
//								"name": "class"},
//							},
						{
							"name": "gmtSessionStartDateTime"
						},
						{
							"name": "gmtSessionEndDateTime"
						},
						{
							"name": "sessionTerminateCause"
						}
//							{
//								"name": "billingClassOfService"
//							},
//							{
//								"name": "unitOfMeasure"
//							},
//							{
//								"name": "chargeableUnit"
//							},
//							{
//								"name": "chargeableQuantity"
//							},
//							{
//								"name": "chargeAmount"
//							},
//							{
//								"name": "chargeCurrencyType"
//							},
//							{
//								"name": "otherParty"
//							},
//							{
//								"name": "taxPercentage"
//							},
//							{
//								"name": "taxAmount"
//							},
//							{
//								"name": "taxType"
//							},
//							{
//								"name": "intermediaryName"
//							},
//							{
//								"name": "serviceName"
//							},
//							{
//								"name": "relatedIpdrIdList"
//							},
//							{
//								"name": "tempUserId"
//							}
					];
				}
			}
		);
	</script>
</dom-module>
<commit_msg>implicitly load ipdr file chooser api<commit_after><link rel="import" href="polymer/polymer.html">
<link rel="import" href="paper-dialog/paper-dialog.html">
<link rel="import" href="paper-toolbar/paper-toolbar.html">
<link rel="import" href="paper-dialog-scrollable/paper-dialog-scrollable.html">
<link rel="import" href="paper-button/paper-button.html">
<link rel="import" href="iron-list/iron-list.html">
<link rel="import" href="iron-ajax/iron-ajax.html">
<link rel="import" href="iron-icon/iron-icon.html">

<dom-module id="sig-ipdr-log-files">
	<style is="custom-style">
		paper-dialog {
			width: 60%;
			height: 60%;
			padding: 10px;
		}
		paper-toolbar{
			color: white;
			background-color: #bc5100;
		}
		.cancel-button {
			color: black;
		}
		iron-list {
			height: 40vh;
		}
		.item {
			cursor: pointer;
			padding: 5px;
		}
	</style>
	<template>
		<paper-dialog id="selectLogFileModal" modal>
			<paper-toolbar>
				<h2>Select Log File</h2>
			</paper-toolbar>
			<paper-dialog-scrollable>
				<iron-list id="logFiles"
						as="item" grid>
					<template>
						<div class="item" on-click="getLogContent">
							<iron-icon icon="assignment"></iron-icon>
							[[item]]
						</div>
					</template>
				</iron-list>
			</paper-dialog-scrollable>
			<div class="cancel-button">
				<paper-button dialog-dismiss>Cancel</paper-button>
			</div>
		</paper-dialog>
		<iron-ajax id="getLogsAjax"
				auto
				url="/ocs/v1/log/ipdr"
				method = "GET"
				headers='{"Accept": "application/json"}'
				on-response="getLogsResponse">
		</iron-ajax>
		<iron-ajax id="getIpdr"
				headers='{"Accept": "application/json"}'
				on-loading-changed="_onLoadingChanged"
				on-response="getLogContentResponse">
		</iron-ajax>
	</template>
	<script>
		Polymer (
			{
				is: 'sig-ipdr-log-files',
				listeners: {
				},
				getLogContent: function (event) {
					var searchAjax = this.$.getIpdr;
					searchAjax,method = "GET";
					searchAjax.url = "/usageManagement/v1/usage/" + event.model.item;
					searchAjax.generateRequest();
				},
				getLogsResponse: function(event){
					this.$.logFiles.items = event.detail.response;
				},
				_onLoadingChanged: function(event) {
					if (document.getElementById("getIpdr").loading) {
						document.getElementById("progress").disabled = false;
					} else {
						document.getElementById("progress").disabled = true;
					}
				},
				getLogContentResponse: function(event) {
					this.$.selectLogFileModal.close();
					var grid = document.getElementById("ipdrGrid");
					var results = event.detail.response;
					vaadinItems = new Array();
					for(var index in results) {
							var newRecord = new Object();
							newRecord.date = results[index].date;
							newRecord.type = results[index].type;
							newRecord.usageSpecificationName = results[index].usageSpecification.name;
							results[index].usageCharacteristic.forEach(
								function(attrObj) {
									newRecord[attrObj.key] = attrObj.value;
								}
							);
							vaadinItems[index] = newRecord;
					}
					grid.frozenColumns = 1;
					grid.items = vaadinItems;
					grid.columns = [
						{
							"name": "ipdrCreationTime"
						},
						{
							"name": "seqNum"
						},
						{
							"name": "username"
						},
//							{
//								"name": "scIdType"
//							},
//							{
//								"name": "scId"
//							},
//							{
//								"name": "homeServiceProviderType"
//							},
//							{
//								"name": "homeServiceProvider"
//							},
						{
							"name": "acctSessionId"
						},
//							{
//								"name": "userIpAddress"
//							},
						{
							"name": "callingStationId"
						},
						{
							"name": "calledStationId"
						},
						{
							"name": "nasIpAddress"
						},
						{
							"name": "nasId"
						},
//							{
//								"name": "accessProviderType"
//							},
//							{
//								"name": "accessServiceProvider"
//							},
//							{
//								"name": "locationName"
//							},
//							{
//								"name": "locationId"
//							},
//							{
//								"name": "locationType"
//							},
//							{
//								"name": "locationCountryCode"
//							},
//							{
//								"name": "locationStateProvince"
//							},
//							{
//								"name": "locationCity"
//							},
//							{
//								"name": "locationGeocode"
//							},
//							{
//								"name": "locationGeocodeType"
//							},
//							{
//								"name": "nasPortType"
//							},
//							{
//								"name": "paymentType"
//							},
//							{
//								"name": "networkConnectionType"
//							},
						{
							"name": "sessionDuration"
						},
						{
							"name": "inputOctets"
						},
						{
							"name": "outputOctets"
						},
//							{
//								"name": "class"},
//							},
						{
							"name": "gmtSessionStartDateTime"
						},
						{
							"name": "gmtSessionEndDateTime"
						},
						{
							"name": "sessionTerminateCause"
						}
//							{
//								"name": "billingClassOfService"
//							},
//							{
//								"name": "unitOfMeasure"
//							},
//							{
//								"name": "chargeableUnit"
//							},
//							{
//								"name": "chargeableQuantity"
//							},
//							{
//								"name": "chargeAmount"
//							},
//							{
//								"name": "chargeCurrencyType"
//							},
//							{
//								"name": "otherParty"
//							},
//							{
//								"name": "taxPercentage"
//							},
//							{
//								"name": "taxAmount"
//							},
//							{
//								"name": "taxType"
//							},
//							{
//								"name": "intermediaryName"
//							},
//							{
//								"name": "serviceName"
//							},
//							{
//								"name": "relatedIpdrIdList"
//							},
//							{
//								"name": "tempUserId"
//							}
					];
				}
			}
		);
	</script>
</dom-module>

{'fraction_non_alphanumeric': 0.18808695652173912, 'fraction_numerical': 0.003130434782608696, 'mean_word_length': 1.685894441849603, 'pattern_counts': {'":': 98, '<': 83, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5915473', 'n_tokens_mistral': 6135, 'n_tokens_neox': 4052, 'n_words': 532}