TFS Dashboard Light

by Administrator 6. April 2015 04:01

I put some minutes into checking, what what be the easiest way to make a dashboard for Team Foundation Server 2013 (should work with 2012 as well). I had to find out that this is easier, than one might think.

Here you see the result of it (pointing to an on premise TFS Express on a VM).

The first question was, how to get to the data.

  • I know from previous projects that TFS offers a full blown .NET API. This would require a backend for the dashboard, which would definitely be an option.
  • There is an OData API available for TFS 2013. This provides easy REST access to everything you need, however it's not available for on premise installations by default.

As a third idea, i wondered, how the TFS administration website get's to it's data and monitored server communication with Fiddler.  The goods news is, that the calls to get the list of available builds are pretty straightforward. Since this is not an official API, it might break with future product releases.

Here are the API calls used for the dashboard:

/tfs/DefaultCollection/_apis/build/Definitions?projectName={projectName}

This call gets additional information about a build definition. I use this one to resolve a build name to it's url. The url is needed when querying the status.

/tfs/DefaultCollection/_apis/build/Builds?projectName={projectName}&definition={buildUrl}

Both calls return pretty self explanatory JSON structures that can be parsed in JavaScript. The next interesting part is, how to call these services. It would be possible to have some backend make those API calls, however, it would be even nicer to go without a backend.

Unfortunately, using a plain JavaScript powered application will run into cross domain policy issues. The good news here is, that Windows offers the concepts of HTML Applications. These offer a way to hast a web application locally with privileges of a regular desktop application. This includes making web requests at your discretion. One drawback here was, that the standard way to do Ajax still bounces against the cross domain policy, using the deprecated  Msxml2.XMLHTTP component however does the job.

The dashboard included with this article has a minimal configuration file:

window.CONFIGURATION = {
    tfsUrl: "http://192.168.136.128:8080/tfs/DefaultCollection",
    project: "testproject",
    authentication: {
        userName: "TFSUser",
        password: "TFSPassword"
    },
    updateInterval: 60000,
    builds: [
        "New Build Definition 1",
        "New Build Definition 2"
    ]
};

Feel free to play around with the code. You will find out that the HTA engine is running an ancient version of IE (I think it's around 7), so you probably don't want to spent too much time here.

HTA applications can be debugged using regular techniques like using the debugger statement or attaching to IE.

TFSDashboard.zip (53,06 kb)

Tags:

Go

by Administrator 5. April 2015 07:35

Tags:

Music | My Stuff

More than 50000 Listeners on Jamendo

by Administrator 23. März 2015 14:23

When I started uploading my music to Jamendo in 2010 I never expected to see this much interest.

Absolutely amazing!

Tags:

FASTFind

by Administrator 8. März 2015 08:05

Tooltime again ;P

This time I made a small tool to search in source files for specific search terms. Go to this post for more information.

 

Tags:

My Stuff | Projects | Tools

The Good Omen

by Administrator 27. Februar 2015 13:20

I finally got my new alum "The Good Omen" up on Jamendo. The uploader was broken for about a week and no stuff member felt the urge to post into the support forum - great job guys ;P

 

Tags:

Music | My Stuff

Beyond Reach

by Administrator 22. Februar 2015 10:15

Tags:

Music | My Stuff

Link

by Administrator 15. Februar 2015 04:50

Tags:

Music | My Stuff

The Good Omen

by Administrator 5. Februar 2015 17:05

Tags:

Music | My Stuff

The Infinite Road

by Administrator 1. Februar 2015 14:07

Tags:

Music | My Stuff

Nomad

by Administrator 24. Dezember 2014 06:09

My new album Nomad is available on Jamendo.

Enjoy.

 

Tags:

Music | My Stuff

About the author

for comments and suggestions contact:

 

Month List