-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello-world.html
48 lines (43 loc) · 2.07 KB
/
hello-world.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<head>
<script src="node_modules\vss-web-extension-sdk\lib\VSS.SDK.min.js"></script>
<script type="text/javascript">
VSS.init({
explicitNotifyLoaded: true,
usePlatformStyles: true
});
VSS.require("TFS/Dashboards/WidgetHelpers", function (WidgetHelpers) {
WidgetHelpers.IncludeWidgetStyles();
VSS.register("HelloWorldWidget", function () {
return {
load: function (widgetSettings) {
//Connecting to the ZEISS API with an Security Token
var myPAT = "PLACEHOLDER"; //Key is Ending March 2021
var myOrg = "ZEISSgroup";
var base64Pat = btoa(":" + myPAT);
var request = new XMLHttpRequest;
request.open("GET", "https://dev.azure.com/" + myOrg + "/ZEISS%20IQS%20Smart%20Services%20Dashboard/_environments/44?view=resources&__rt=fps&__ver=2$filter=stageName%20eq%20'deploy_production'", true);
var b = "Basic " + base64Pat;
request.setRequestHeader("Authorization", b);
//Function that goes through the API
request.onload = function () {
var data = JSON.parse(this.response);
console.log(data);
var version = (data.fps.dataProviders.data["ms.vss-environments-web.environment-deployment-history-data-provider"].deploymentExecutionRecords[0].owner.name)
document.getElementById("versionProd").innerHTML = version
}
request.send();
return WidgetHelpers.WidgetStatusHelper.Success();
}
}
});
VSS.notifyLoadSucceeded();
});
</script>
</head>
<body>
<h2>Version on Deployment Production</h2>
<div id="versionProd"></div>
</body>
</html>