Azure devops widget based on json - azure

I am creating a custom widget and having some stastics which is coming from jason data. i am able to create widget and fine. Now i want to automate this process so that as soon as jason file arrives in folder it refreshes the graph in widget. Is there any way to do it.

Is there any way to do it.
As far as I know , the Dashboards widget uses the load and reload function to load the widgets.
You can add conditions according to your needs, and then use the load or reload method in the return function to refresh the widget.
Here is an example, you could refer to it.
In addition,the dashboard also has automatic refresh function.
You could select the Automatically refresh the dashboard every 5 minutes option in Dashboards settings. Then the widgets will refresh every 5 minutes.
Hope this helps.

Related

Chrome Extension Disappears while clicking outside of its resolution

Is there anyway that I can make Chrome Extension's window stick in window even while clicking outside of its resolution?
I'm trying to make it Sticky on the window for one simple google login so that I don't need to go back again to click extension to open it.
By using tabs API you could retrieve windowId of the window you want to focus on. You could do it only if needed e.g. by using query method from that API. You could pass url for example.
If you created a window that you want to be still focused then you have its id already in the hand.
After that, you could use window API update method in order to draw attention or focus. Take a look at updateInfo params - focus and drawAttention.
The same could be done by using tabs API. You could pass tabId and the URL you want to redirect someone.
Now in order to make it work you have a couple of options:
You can use setInterval which would be used to check if the tabId and windowId you want are active and focus the window/tab you want in another case.
Because in the MV3 extensions using setInterval is not recommended you could use alarms. Please take a look at AlarmCreateInfo, when param should help you instead of triggering the alarm periodically.
You could also use event listeners from both windows and tabs API to listen on tab / window focus change. Then you will be able block the change (from user perspective) by methods I described before.
You should play with all approaches and pick on that suits you, because all of them have some drawback. But don't want to make that comment very long.

Application Insights tiles (table) are not automatically refreshed on Azure Dashboard

I've created a simple query using Kusto language in Application Insights. This query has been pinned to Azure Dashboard.
I've noticed that there is no any automatic update applied for the table, moreover refresh button on the tile work only first time when you click on it.
Here is the query pinned to Azure Dashboard:
traces
| order by timestamp desc nulls last
| take 10
Based on information specified here I expected that table should be refreshed every 5 minutes. But seems that the table is never refreshed.
Is there are automatic refresh exist for AI queries on Azure Dashboard? Actually I didn't find any mentioning about automatic refresh apart provided above link.
Metrics refresh depends on time range with minimum of five minutes. Logs refresh at one minute.
Related documentation reference
Regarding the refresh button on the tile, thanks for sharing the feedback on that. We have reached out to concerned team to look further into it. Will keep you updated on it.
If you're up for it, you can create a Chrome Extension which hunts the Dashboard DOM and selectively clicks each refresh DIV. Here's the pertinent jquery code:
function doRefresh(){
$( "div.azc-toolbarButton-container" ).each(
function() {
if ($( this ).attr( "title" ).indexOf("Refresh") >= 0)
$( this ).trigger('click');
});
}
I was able to do this. Added a 1 minute setInterval() and it appears to work well.
Those are AnalyticsPart tiles,
they refresh automatically every hour.
Of course, you can initiate a refresh by clicking the refresh button.
Azure dashboard is planning to expose an automatic refresh pile that will enable the user to customize the refresh rate of the dashboard parts. One could then chose to customize the rate to 1 hour, 30 min, etc. AnalyticsPart may onboard to this new pile.
It's still in the designing stages of the azure team.

Customize Generic Inquiry and Dashboard page

I want to customize the Inquiry page and dashboard so that they would reload automatically in certain time, say 5 minutes interval. I was thinking if I could add custom javascript where I could set timeout for the period. How do I do that?
Thank you.
if this is for a basic dashboard purpose I would look at a browser extension to automatically refresh a page.
For example: https://www.guidingtech.com/12491/auto-refresh-pages-chrome-firefox-opera/

How can I get a notification when a chart is removed from a hawtio dashboard

I need to know when one of my charts have been deleted from a hawtio dashboard. Is that possible?
I have a plugin that adds charts to a hawtio dashboard. Once added, the charts can be customized. However, since I can't change the charts' search params once they have been added, I'm adding them with a short chart id. That id is then used to lookup the full options from localStorage when rendering the chart.
This all works fine. However, when a chart is deleted from the dashboard, I'd like to clean up my localStorage.
For now I'm running a customized build of hawtio.war. I've added a
scope.$broadcast("removedFromDashboard");
to gridsterDirective.ts just before the scope gets destroyed in the removeWidget() function. I then listen for that event and clean up my localStorage. This works but I don't want to distribute my custom hawtio.war file with my plugin.
Is there an existing way to know when my dashboard chart is removed? I've looked in the event.targetScope that gets passed in my $scope.on('$destroy') event, but it appears identical to a normal destroy that I get when I navigate off of the dashboard page.

How can I refresh the XPages File Download Control and have it display updated attachments without full page refresh?

When I create file download control on a document I can display the attached files from a Rich Text Field.
In a separate process I am attaching more documents to the same document. I want to periodically refresh the download control container to see if there are new attachments. I do not want to do a full refresh of the page.
I have discovered that the partialRefresh of the file download control container either programmatically or manually does not result in the contents (downloadable files) being accurately updated.
XSP.partialRefreshGet('view:_id1:fileDownload1')
A full refresh of the screen shows the newly attached documents but I want to be able to partial refresh the panel container and see the new documents without full page refresh.
I have added a Random() computed text value into the panel and I can see that it is being refreshing correctly. I have even looked at the xhr response from the server and I can see that there is an update being made - but not with the new attachments in it - the "attached files" are not refreshing without full page refresh.
I can only assume this is a feature of the filedownload control in that it does not know that new files are attached at any other time other than page load.
Suggestions?
When partially refreshing a XPage, the datasources are not reloaded, only their last state (stored in memory or hdd ) is restored. If you change the scope of your datasource to request, the XPages engine is forced to recreate the datasource instead of using the cached one on each request (which includes partial refreshs).
This should allow you to refresh your fileDownload control without a full refresh.
Marky,
Yes, I have run into this before. You must do a full refresh with attachments.
http://xpagesblog.com/XPagesHome.nsf/Entry.xsp?documentId=FBAC0D921B677EA0852578CB006678D7
The link is fairly old, but I believe it still applies.
Matt White says in the article comments: "...Basically it is not currently possible to post a file attachment over AJAX, you either have to use Flash or a virtual iFrame solution if you don't want the entire page to refresh. As far as I know there is nothing that IBM can do about this at the moment.
Matt"

Resources