Explorar el Código

Add rprun command

= hace 10 meses
padre
commit
f98e59fa44
Se han modificado 3 ficheros con 45 adiciones y 12 borrados
  1. 5 1
      reports/index.html
  2. 24 10
      reports/main.js
  3. 16 1
      reports/styles.css

+ 5 - 1
reports/index.html

@@ -27,10 +27,14 @@
 		<div class="permalinkContainer" id="permalinkContainer" style="display: none">
 				<div class="permalinkCaret"></div>
 				<div class="permalinkInner">
-					<div style="margin-bottom: 6px">
+					<div style="margin-bottom: 8px">
 						<input class="permalink" id="permalink"></input>
 						<button id="permalinkCopyButton">🔗</button>
 					</div>
+					<div style="margin-bottom: 6px">
+						<input class="permalink" id="permalink-rprun"></input>
+						<button id="permalinkCopyButton-rprun">🔗</button>
+					</div>
 					<div>
 						<input type="checkbox" id="hideOptions"></input>
 						<div>Hide Options?</div>

+ 24 - 10
reports/main.js

@@ -19,6 +19,7 @@ window.onload = function() {
 	const permalinkContainer = document.getElementById("permalinkContainer");
 	const permalinkButton = document.getElementById("permalinkButton");
 	const permalinkCopyButton = document.getElementById("permalinkCopyButton");
+	const rprunCopyButton = document.getElementById("permalinkCopyButton-rprun");
 	const permalinkOptionsButton = document.getElementById("hideOptions");
 	const permalinkLatestMonth = document.getElementById("latestMonth");
 	
@@ -49,6 +50,14 @@ window.onload = function() {
 			navigator.clipboard.writeText(permalinkElem.value);
 		}
 	});
+	
+	rprunCopyButton.addEventListener("click", function() {
+		const permalinkElem = document.getElementById("permalink-rprun");
+		if(permalinkElem.value && permalinkElem.value != "")
+		{
+			navigator.clipboard.writeText(permalinkElem.value);
+		}
+	});
 
 	permalinkOptionsButton.addEventListener("change", function() {
 		updatePermalink(graphTypeSelector);
@@ -108,7 +117,7 @@ function updateSelectors(graphTypeSelector, selectorSubtypes, useURLParams)
 		selectorSubtypes.appendChild(addInput('select', 'month', 'Month: ', [monthsPretty, months], useURLParams && urlParams.has('month') ? urlParams.get('month') : currentMonth));
 		
 		// Username input and query button
-		const usernameInput = addInput('input', 'username', 'Username: ', undefined, useURLParams && urlParams.get('username'));
+		const usernameInput = addInput('input', 'username', 'Username: ', undefined, useURLParams && urlParams.get('companyName'));
 		
 		const submitButton = document.createElement("button");
 		submitButton.textContent = "Query";
@@ -139,7 +148,7 @@ function updateSelectors(graphTypeSelector, selectorSubtypes, useURLParams)
 		selectorSubtypes.appendChild(addInput('select', 'metric', 'Metric: ', [['Volume', 'Profit'], ['volume', 'profit']], useURLParams && urlParams.get('metric')));
 		
 		// Username input and query button
-		const usernameInput = addInput('input', 'username', 'Username: ', undefined, useURLParams && urlParams.get('username'));
+		const usernameInput = addInput('input', 'username', 'Username: ', undefined, useURLParams && urlParams.get('companyName'));
 		
 		const submitButton = document.createElement("button");
 		submitButton.textContent = "Query";
@@ -169,7 +178,7 @@ function updateSelectors(graphTypeSelector, selectorSubtypes, useURLParams)
 		selectorSubtypes.appendChild(addInput('select', 'month', 'Month: ', [monthsPretty, months], useURLParams && urlParams.has('month') ? urlParams.get('month') : currentMonth));
 		
 		// Username input and query button
-		const usernameInput = addInput('input', 'username', 'Username: ', undefined, useURLParams && urlParams.get('username'));
+		const usernameInput = addInput('input', 'username', 'Username: ', undefined, useURLParams && urlParams.get('companyName'));
 		
 		const submitButton = document.createElement("button");
 		submitButton.textContent = "Query";
@@ -260,19 +269,21 @@ function switchPlot()
 
 function updatePermalink(typeElem)
 {
-	const permalinkInput = document.getElementById("permalink")
+	const permalinkInput = document.getElementById("permalink");
+	const rprunInput = document.getElementById("permalink-rprun");
 	const hideOptionsButton = document.getElementById("hideOptions");
 	const latestMonthButton = document.getElementById("latestMonth");
 	
-	var permalink = "https://pmmg-products.github.io/reports/?type=" + typeElem.value
+	var permalink = "https://pmmg-products.github.io/reports/?type=" + typeElem.value;
+	var rprunLink = "XIT FINREPORT type-" + typeElem.value;
 	
 	const relevantSubtypes = {
 		"topProduction": ["metric", "month"],
 		"topCompanies": ["metric", "month"],
 		"matHistory": ["metric", "ticker"],
-		"compTotals": ["chartType", "metric", "month", "username", "companyName", "companyID"],
-		"compHistory": ["metric", "username", "companyName", "companyID"],
-		"compRank": ["month", "username", "companyName", "companyID"]
+		"compTotals": ["chartType", "metric", "month", "companyName", "companyID"],
+		"compHistory": ["metric", "companyName", "companyID"],
+		"compRank": ["month", "companyName", "companyID"]
 	}
 	
 	relevantSubtypes[typeElem.value].forEach(subtype => {
@@ -281,16 +292,19 @@ function updatePermalink(typeElem)
 		const inputElem = document.getElementById(subtype);
 		if(inputElem.value && inputElem.value != "")
 		{
-			permalink += "&" + subtype + "=" + inputElem.value
+			permalink += "&" + subtype + "=" + inputElem.value;
+			rprunLink += " " + subtype + "-" + inputElem.value;
 		}
 	});
 
 	if(hideOptionsButton.checked)
 	{
-		permalink += "&hideOptions"
+		permalink += "&hideOptions";
+		rprunLink += " hideOptions";
 	}
 
 	permalinkInput.value = permalink;
+	rprunInput.value = rprunLink;
 	return;
 }
 

+ 16 - 1
reports/styles.css

@@ -5,6 +5,21 @@ body {
 	margin: 0px;
 	color: rgb(153, 153, 153);
 }
+
+/* For Chrome, Safari */
+body::-webkit-scrollbar,
+html::-webkit-scrollbar {
+  width: 0;
+  height: 0;
+}
+
+/* For Firefox */
+body,
+html {
+  scrollbar-width: none;
+  overflow: auto;
+}
+
 .topTabContainer {
 	display: flex;
 	margin: 1px;
@@ -47,7 +62,7 @@ body {
 	z-index: 1000;
 	background: rgb(38, 38, 38);
 	width: 300px;
-	height: 62px;
+	height: 84px;
 	top: 33px;
 	border-color: rgb(196, 132, 0);
 	border-width: 3px;