未加星标

Creating a Quick Dashboard Widget

字体大小 | |
[前端(javascript) 所属分类 前端(javascript) | 发布者 店小二05 | 时间 2018 | 作者 红领巾 ] 0人收藏点击收藏

I read Carlos Robles blog on creating an Azure Data Studio (ADS) insight widget and decided to try this for myself. I decided to try and get a list of object types and a count of each. Following instructions, here’s what I did.

First, I wrote a query that would gather the types of objects and counts from sys.objects.


Creating a Quick Dashboard Widget

I saved this as a file under my Documents folder. Once I had this, I ran the query and in the results, I clicked on the Chart item to the right of the results.


Creating a Quick Dashboard Widget

This displays a bar chart, which is useful at times, but that’s not what I want.


Creating a Quick Dashboard Widget

Instead of this, I’ll expand the Chart Type drop down. This gives me a list of a number of items I can choose. For this insight, I’ll use the table type.


Creating a Quick Dashboard Widget

Once this is done, I’ll see the results I want. There is a “Create Insight” button above the chart. I’ll click this to get the JSON code that creates this.


Creating a Quick Dashboard Widget

A new editor tab opens with the JSON code in it. This is just one long line of code, which isn’t as helpful or easy to work with.


Creating a Quick Dashboard Widget

CTRL+Shift+P opens the command palette. Type “format” and you’ll see the Format Document command. Once you format the code, it will be easier to read.


Creating a Quick Dashboard Widget

The next step is to open the user settings. This is also in the command palette.


Creating a Quick Dashboard Widget

In my ADS, I get the settings list. I can search for dashboard and I’ll find the one I want.


Creating a Quick Dashboard Widget

If I put the cursor in the upper left, I’ll get an edit item. I can pick this and I’ll get one of two items. If I’ve never customized anything, I’ll get the “copy to user settings” option. If I have, I get the “Replace in settings” item.


Creating a Quick Dashboard Widget

Once I’ve done this, I want to modify some code. I don’t love the search box, so I’ll delete that json widget. Then I paste in my widget code. Be sure you put this in the right place, with a comma between the widgets braces. I changed the name from “my-widget” to “User Object Count”.


Creating a Quick Dashboard Widget

Once I do this, I save it and close it. Then I double click one of my server connections and I see my widget on the dashboard.


Creating a Quick Dashboard Widget

Pretty easy to get a query to appear on your dashboard as a chart if you want to get some insights. Any query could be used, with the results returned when you open the server connection. You can also leave the dashboard open and refresh it when convenient.

本文前端(javascript)相关术语:javascript是什么意思 javascript下载 javascript权威指南 javascript基础教程 javascript 正则表达式 javascript设计模式 javascript高级程序设计 精通javascript javascript教程

代码区博客精选文章
分页:12
转载请注明
本文标题:Creating a Quick Dashboard Widget
本站链接:https://www.codesec.net/view/611418.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 前端(javascript) | 评论(0) | 阅读(53)