├── EmbedSample ├── Views │ ├── _ViewStart.cshtml │ ├── Shared │ │ ├── Reports.cshtml │ │ └── _Layout.cshtml │ ├── Web.config │ └── Dashboard │ │ ├── Report.cshtml │ │ └── Index.cshtml ├── Content │ ├── site.css │ └── powerbi.css ├── Global.asax ├── Cloud.config ├── img │ ├── profile │ │ ├── profile-1.jpg │ │ └── picjumbo.com_HNCK4153_resize.jpg │ ├── backdrop │ │ ├── micro_carbon.png │ │ └── tactile_noise.png │ └── thumbnails │ │ ├── picjumbo.com_HNCK4737.jpg │ │ ├── picjumbo.com_IMG_3241.jpg │ │ └── picjumbo.com_IMG_4566.jpg ├── lib │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── fontawesome-webfont.woff2 │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── js │ │ ├── dataTables.bootstrap.min.js │ │ ├── ace │ │ │ └── theme-github.js │ │ ├── jquery.matchHeight-min.js │ │ ├── es6-promise.auto.min.js │ │ └── bootstrap-switch.min.js │ └── css │ │ ├── dataTables.bootstrap.css │ │ ├── bootstrap-switch.min.css │ │ ├── checkbox3.min.css │ │ ├── jquery.dataTables.min.css │ │ └── select2.min.css ├── js │ ├── alert.js │ ├── list.js │ ├── modal.js │ ├── button.js │ ├── card.js │ ├── app.js │ └── theming.js ├── Models │ ├── ReportsViewModel.cs │ └── ReportViewModel.cs ├── Startup.cs ├── App_Start │ ├── FilterConfig.cs │ └── RouteConfig.cs ├── Global.asax.cs ├── Scripts │ └── typings │ │ └── powerbi.d.ts ├── Web.Debug.config ├── Web.Release.config ├── Properties │ └── AssemblyInfo.cs ├── packages.config ├── Controllers │ └── DashboardController.cs ├── Web.config └── EmbedSample.csproj ├── Cloud Config for Embed ├── Power BI Global │ └── Cloud.config └── Power BI operated by 21Vianet in China │ └── Cloud.config ├── ProvisionSample ├── Models │ ├── BillingUsage.cs │ ├── WorkspaceCollectionKeys.cs │ ├── WorkspaceCollection.cs │ └── PBIExceptionBody.cs ├── packages.config ├── Cloud.config ├── App.config ├── Properties │ └── AssemblyInfo.cs ├── Dataset.cs ├── AsyncPump.cs ├── ProgramExtensions.cs ├── ProvisionSample.csproj ├── JsonConvertor.cs └── ConsoleHelper.cs ├── README.md ├── CONTRIBUTING.md ├── Cloud Config for Prov ├── Power BI Global │ └── Cloud.config └── Power BI operated by 21Vianet in China │ └── Cloud.config ├── LICENSE ├── PowerBI-embedded.sln ├── ThirdPartyNotices.txt └── .gitignore /EmbedSample/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /EmbedSample/Content/site.css: -------------------------------------------------------------------------------- 1 | [powerbi-type="report"] iframe { 2 | border: 1px solid #ccc; 3 | } -------------------------------------------------------------------------------- /EmbedSample/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="paas_demo.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /EmbedSample/Cloud.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /EmbedSample/img/profile/profile-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/img/profile/profile-1.jpg -------------------------------------------------------------------------------- /EmbedSample/lib/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/lib/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /Cloud Config for Embed/Power BI Global/Cloud.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /EmbedSample/img/backdrop/micro_carbon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/img/backdrop/micro_carbon.png -------------------------------------------------------------------------------- /EmbedSample/img/backdrop/tactile_noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/img/backdrop/tactile_noise.png -------------------------------------------------------------------------------- /EmbedSample/lib/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/lib/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /EmbedSample/lib/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/lib/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /EmbedSample/lib/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/lib/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /EmbedSample/lib/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/lib/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /Cloud Config for Embed/Power BI operated by 21Vianet in China/Cloud.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /EmbedSample/img/thumbnails/picjumbo.com_HNCK4737.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/img/thumbnails/picjumbo.com_HNCK4737.jpg -------------------------------------------------------------------------------- /EmbedSample/img/thumbnails/picjumbo.com_IMG_3241.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/img/thumbnails/picjumbo.com_IMG_3241.jpg -------------------------------------------------------------------------------- /EmbedSample/img/thumbnails/picjumbo.com_IMG_4566.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/img/thumbnails/picjumbo.com_IMG_4566.jpg -------------------------------------------------------------------------------- /EmbedSample/lib/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/lib/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /EmbedSample/lib/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/lib/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /EmbedSample/lib/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/lib/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /EmbedSample/img/profile/picjumbo.com_HNCK4153_resize.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/img/profile/picjumbo.com_HNCK4153_resize.jpg -------------------------------------------------------------------------------- /EmbedSample/lib/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/HEAD/EmbedSample/lib/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /EmbedSample/Content/powerbi.css: -------------------------------------------------------------------------------- 1 | [powerbi-tile] { 2 | min-width: 300px; 3 | min-height: 300px; 4 | } 5 | 6 | [powerbi-type="report"] { 7 | min-width: 800px; 8 | min-height: 600px; 9 | } 10 | -------------------------------------------------------------------------------- /EmbedSample/js/alert.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | var HtmlMode, editor; 3 | HtmlMode = ace.require("ace/mode/html").Mode; 4 | editor = ace.edit("code-preview-alert"); 5 | editor.getSession().setMode(new HtmlMode()); 6 | return editor.setTheme("ace/theme/github"); 7 | }); 8 | -------------------------------------------------------------------------------- /ProvisionSample/Models/BillingUsage.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ProvisionSample.Models 4 | { 5 | public class BillingUsage 6 | { 7 | [JsonProperty(PropertyName = "renders")] 8 | public int Renders { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /EmbedSample/Models/ReportsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.PowerBI.Api.V1.Models; 3 | 4 | namespace paas_demo.Models 5 | { 6 | public class ReportsViewModel 7 | { 8 | public List Reports { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /EmbedSample/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin; 2 | using Owin; 3 | 4 | [assembly: OwinStartupAttribute(typeof(paas_demo.Startup))] 5 | namespace paas_demo 6 | { 7 | public partial class Startup 8 | { 9 | public void Configuration(IAppBuilder app) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /EmbedSample/js/list.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | $(function() { 3 | var HtmlMode, editor; 4 | HtmlMode = ace.require("ace/mode/html").Mode; 5 | editor = ace.edit("code-preview-list"); 6 | editor.getSession().setMode(new HtmlMode()); 7 | editor.setTheme("ace/theme/github"); 8 | }); 9 | 10 | }).call(this); 11 | -------------------------------------------------------------------------------- /EmbedSample/js/modal.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | $(function() { 3 | var HtmlMode, editor; 4 | HtmlMode = ace.require("ace/mode/html").Mode; 5 | editor = ace.edit("code-preview-modal"); 6 | editor.getSession().setMode(new HtmlMode()); 7 | editor.setTheme("ace/theme/github"); 8 | }); 9 | 10 | }).call(this); 11 | -------------------------------------------------------------------------------- /EmbedSample/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace paas_demo 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /EmbedSample/Models/ReportViewModel.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.PowerBI.Api; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | using Microsoft.PowerBI.Api.V1.Models; 7 | 8 | namespace paas_demo.Models 9 | { 10 | public class ReportViewModel 11 | { 12 | public Report Report { get; set; } 13 | 14 | public string AccessToken { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | --- 2 | services: power-bi-embedded 3 | platforms: dotnet 4 | author: dvana 5 | --- 6 | # Power BI Embedded - Integrate a report into a web app 7 | 8 | This sample MVC web app shows you how to use the Power BI Embedded API to integrate a report into a web app. 9 | 10 | ## Power BI CLI 11 | If you are looking for a feature rich cross platform CLI tool to help manage your Power BI Workspace Collections on Azure please take a look @ https://github.com/Microsoft/PowerBI-Cli. 12 | -------------------------------------------------------------------------------- /ProvisionSample/Models/WorkspaceCollectionKeys.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ApiHost.Models 9 | { 10 | public class WorkspaceCollectionKeys 11 | { 12 | [JsonProperty(PropertyName = "key1")] 13 | public string Key1 { get; set; } 14 | 15 | [JsonProperty(PropertyName = "key2")] 16 | public string Key2 { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ProvisionSample/Models/WorkspaceCollection.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ApiHost.Models 9 | { 10 | public class WorkspaceCollection 11 | { 12 | [JsonProperty(PropertyName = "name")] 13 | public string Name { get; set; } 14 | } 15 | 16 | public class WorkspaceCollectionList 17 | { 18 | public List value; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /EmbedSample/js/button.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | var HtmlMode, editor; 3 | HtmlMode = ace.require("ace/mode/html").Mode; 4 | editor = ace.edit("code-preview-button"); 5 | editor.getSession().setMode(new HtmlMode()); 6 | editor.setTheme("ace/theme/github"); 7 | editor = ace.edit("code-preview-button-group"); 8 | editor.getSession().setMode(new HtmlMode()); 9 | editor.setTheme("ace/theme/github"); 10 | editor = ace.edit("code-preview-button-dropdown"); 11 | editor.getSession().setMode(new HtmlMode()); 12 | return editor.setTheme("ace/theme/github"); 13 | }); 14 | -------------------------------------------------------------------------------- /EmbedSample/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace paas_demo 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 16 | RouteConfig.RegisterRoutes(RouteTable.Routes); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /EmbedSample/Scripts/typings/powerbi.d.ts: -------------------------------------------------------------------------------- 1 | /*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */ 2 | import * as service from './service'; 3 | import * as factories from './factories'; 4 | import * as models from 'powerbi-models'; 5 | import { IFilterable } from './ifilterable'; 6 | export { IFilterable, service, factories, models }; 7 | export { Report } from './report'; 8 | export { Tile } from './tile'; 9 | export { IEmbedConfiguration, Embed } from './embed'; 10 | export { Page } from './page'; 11 | declare global { 12 | interface Window { 13 | powerbi: service.Service; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ProvisionSample/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /EmbedSample/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace paas_demo 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Dashboard", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /EmbedSample/js/card.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | var HtmlMode, editor; 3 | HtmlMode = ace.require("ace/mode/html").Mode; 4 | editor = ace.edit("code-preview-card"); 5 | editor.getSession().setMode(new HtmlMode()); 6 | editor.setTheme("ace/theme/github"); 7 | editor = ace.edit("code-preview-card-profile"); 8 | editor.getSession().setMode(new HtmlMode()); 9 | editor.setTheme("ace/theme/github"); 10 | editor = ace.edit("code-preview-card-banner"); 11 | editor.getSession().setMode(new HtmlMode()); 12 | editor.setTheme("ace/theme/github"); 13 | editor = ace.edit("code-preview-card-jumbotron"); 14 | editor.getSession().setMode(new HtmlMode()); 15 | return editor.setTheme("ace/theme/github"); 16 | }); 17 | -------------------------------------------------------------------------------- /ProvisionSample/Models/PBIExceptionBody.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.Collections.Generic; 3 | 4 | namespace ProvisionSample.Models 5 | { 6 | public class PBIExceptionBody 7 | { 8 | [JsonProperty(PropertyName = "error")] 9 | public PBIError Error { get; set; } 10 | } 11 | 12 | public class PBIError 13 | { 14 | [JsonProperty(PropertyName = "code")] 15 | public string Code { get; set; } 16 | 17 | [JsonProperty(PropertyName = "details")] 18 | public IEnumerable Details { get; set; } 19 | 20 | [JsonProperty(PropertyName = "message")] 21 | public string Message { get; set; } 22 | } 23 | 24 | public class ExceptionDetails 25 | { 26 | [JsonProperty(PropertyName = "message")] 27 | public string Message { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Azure samples 2 | 3 | Thank you for your interest in contributing to Azure samples! 4 | 5 | ## Ways to contribute 6 | 7 | You can contribute to [Azure samples](https://azure.microsoft.com/documentation/samples/) in a few different ways: 8 | 9 | - Submit feedback on [this sample page](https://azure.microsoft.com/documentation/samples/power-bi-embedded-integrate-report-into-web-app/) whether it was helpful or not. 10 | - Submit issues through [issue tracker](https://github.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/issues) on GitHub. We are actively monitoring the issues and improving our samples. 11 | - If you wish to make code changes to samples, or contribute something new, please follow the [GitHub Forks / Pull requests model](https://help.github.com/articles/fork-a-repo/): Fork the sample repo, make the change and propose it back by submitting a pull request. -------------------------------------------------------------------------------- /EmbedSample/js/app.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | $(".navbar-expand-toggle").click(function() { 3 | $(".app-container").toggleClass("expanded"); 4 | return $(".navbar-expand-toggle").toggleClass("fa-rotate-90"); 5 | }); 6 | return $(".navbar-right-expand-toggle").click(function() { 7 | $(".navbar-right").toggleClass("expanded"); 8 | return $(".navbar-right-expand-toggle").toggleClass("fa-rotate-90"); 9 | }); 10 | }); 11 | 12 | $(function() { 13 | return $('select').select2(); 14 | }); 15 | 16 | $(function() { 17 | return $('.toggle-checkbox').bootstrapSwitch({ 18 | size: "small" 19 | }); 20 | }); 21 | 22 | $(function() { 23 | return $('.match-height').matchHeight(); 24 | }); 25 | 26 | $(function() { 27 | return $('.datatable').DataTable({ 28 | "dom": '<"top"fl<"clear">>rt<"bottom"ip<"clear">>' 29 | }); 30 | }); 31 | 32 | $(function() { 33 | return $(".side-menu .nav .dropdown").on('show.bs.collapse', function() { 34 | return $(".side-menu .nav .dropdown .collapse").collapse('hide'); 35 | }); 36 | }); 37 | -------------------------------------------------------------------------------- /ProvisionSample/Cloud.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /EmbedSample/js/theming.js: -------------------------------------------------------------------------------- 1 | $("input:radio[name=radio-navbar]").bind("click", function() { 2 | var value; 3 | value = $(this).val(); 4 | if (value === "default") { 5 | return $("#navbar").addClass("navbar-default").removeClass("navbar-inverse"); 6 | } else if (value === "inverse") { 7 | return $("#navbar").removeClass("navbar-default").addClass("navbar-inverse"); 8 | } 9 | }); 10 | 11 | $("input:radio[name=radio-sidebar]").bind("click", function() { 12 | var value; 13 | value = $(this).val(); 14 | if (value === "default") { 15 | return $("#sidebar").removeClass("sidebar-inverse"); 16 | } else if (value === "inverse") { 17 | return $("#sidebar").addClass("sidebar-inverse"); 18 | } 19 | }); 20 | 21 | $("input:radio[name=radio-color]").bind("click", function() { 22 | var value; 23 | value = $(this).val(); 24 | if (value === "blue") { 25 | return $("body").removeClass("flat-green").addClass("flat-blue"); 26 | } else if (value === "green") { 27 | return $("body").removeClass("flat-blue").addClass("flat-green"); 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /Cloud Config for Prov/Power BI Global/Cloud.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /EmbedSample/Views/Shared/Reports.cshtml: -------------------------------------------------------------------------------- 1 | @model ReportsViewModel 2 | @{ 3 | Layout = null; 4 | 5 | var classNames = "panel panel-default dropdown"; 6 | 7 | if (this.Request.Path.IndexOf("Report") > -1) 8 | { 9 | classNames += " active"; 10 | } 11 | } 12 | 13 |
  • 14 | 15 | Reports 16 | 17 | 18 |
    19 |
    20 | 29 |
    30 |
    31 |
  • -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Cloud Config for Prov/Power BI operated by 21Vianet in China/Cloud.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ProvisionSample/App.config: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /EmbedSample/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /EmbedSample/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /EmbedSample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("paas_demo")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("paas_demo")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ab04a4b2-0ae2-4278-aad8-4727c1d04677")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /ProvisionSample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ProvisionSample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ProvisionSample")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("32cea21a-2e37-48e3-9d16-cb134a2beb24")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /PowerBI-embedded.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProvisionSample", "ProvisionSample\ProvisionSample.csproj", "{32CEA21A-2E37-48E3-9D16-CB134A2BEB24}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmbedSample", "EmbedSample\EmbedSample.csproj", "{AB04A4B2-0AE2-4278-AAD8-4727C1D04677}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {32CEA21A-2E37-48E3-9D16-CB134A2BEB24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {32CEA21A-2E37-48E3-9D16-CB134A2BEB24}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {32CEA21A-2E37-48E3-9D16-CB134A2BEB24}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {32CEA21A-2E37-48E3-9D16-CB134A2BEB24}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {AB04A4B2-0AE2-4278-AAD8-4727C1D04677}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {AB04A4B2-0AE2-4278-AAD8-4727C1D04677}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {AB04A4B2-0AE2-4278-AAD8-4727C1D04677}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {AB04A4B2-0AE2-4278-AAD8-4727C1D04677}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /EmbedSample/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ProvisionSample/Dataset.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using Newtonsoft.Json; 4 | using Newtonsoft.Json.Linq; 5 | 6 | namespace ProvisionSample 7 | { 8 | internal class Column 9 | { 10 | public string name { get; set; } 11 | public string dataType { get; set; } 12 | public string formatString { get; set; } 13 | public string sortByColumn { get; set; } 14 | public string dataCategory { get; set; } 15 | public bool isHidden { get; set; } 16 | public string summarizeBy { get; set; } 17 | public string type { get; set; } 18 | 19 | // This function makes JsonConvert.SerializeObject ignore type property 20 | public bool ShouldSerializetype() 21 | { 22 | return false; 23 | } 24 | } 25 | 26 | internal class Measure 27 | { 28 | public string name { get; set; } 29 | public string expression { get; set; } 30 | public string formatString { get; set; } 31 | public string isHidden { get; set; } 32 | } 33 | 34 | internal class Table 35 | { 36 | public string name { get; set; } 37 | public IList columns { get; set; } 38 | public bool isHidden { get; set; } 39 | public IList measures { get; set; } 40 | } 41 | 42 | internal class Relationship 43 | { 44 | public string name { get; set; } 45 | public string crossFilteringBehavior { get; set; } 46 | public string fromTable { get; set; } 47 | public string fromColumn { get; set; } 48 | public string toTable { get; set; } 49 | public string toColumn { get; set; } 50 | public string isActive { get; set; } 51 | 52 | // This function makes JsonConvert.SerializeObject ignore isActive property 53 | public bool ShouldSerializeisActive() 54 | { 55 | return false; 56 | } 57 | } 58 | 59 | class DataSet 60 | { 61 | public string name { get; set; } 62 | public IList tables { get; set; } 63 | public IList relationships { get; set; } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /EmbedSample/Views/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 |
    10 |
    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 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /EmbedSample/lib/js/dataTables.bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | DataTables Bootstrap 3 integration 3 | ©2011-2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,e){a||(a=window);if(!e||!e.fn.dataTable)e=require("datatables.net")(a,e).$;return b(e,a,a.document)}:b(jQuery,window,document)})(function(b,a,e){var d=b.fn.dataTable;b.extend(!0,d.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(d.ext.classes, 6 | {sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});d.ext.renderer.pageButton.bootstrap=function(a,h,r,m,j,n){var o=new d.Api(a),s=a.oClasses,k=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},f,g,p=0,q=function(d,e){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")}; 7 | l=0;for(h=e.length;l",{"class":s.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("",{href:"#", 8 | "aria-controls":a.sTableId,"aria-label":t[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(f)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(e.activeElement).data("dt-idx")}catch(u){}q(b(h).empty().html('
      ').children("ul"),m);i&&b(h).find("[data-dt-idx="+i+"]").focus()};d.TableTools&&(b.extend(!0,d.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},collection:{container:"DTTT_dropdown dropdown-menu", 9 | buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,d.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}));return d}); 10 | -------------------------------------------------------------------------------- /EmbedSample/Controllers/DashboardController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Web.Mvc; 6 | using Microsoft.PowerBI.Api.V1; 7 | using Microsoft.PowerBI.Security; 8 | using Microsoft.Rest; 9 | using paas_demo.Models; 10 | 11 | namespace paas_demo.Controllers 12 | { 13 | public class DashboardController : Controller 14 | { 15 | private readonly string workspaceCollection; 16 | private readonly string workspaceId; 17 | private readonly string accessKey; 18 | private readonly string apiUrl; 19 | 20 | public DashboardController() 21 | { 22 | this.workspaceCollection = ConfigurationManager.AppSettings["powerbi:WorkspaceCollection"]; 23 | this.workspaceId = ConfigurationManager.AppSettings["powerbi:WorkspaceId"]; 24 | this.accessKey = ConfigurationManager.AppSettings["powerbi:AccessKey"]; 25 | this.apiUrl = ConfigurationManager.AppSettings["powerbi:ApiUrl"]; 26 | } 27 | 28 | public ActionResult Index() 29 | { 30 | return View(); 31 | } 32 | 33 | [ChildActionOnly] 34 | public ActionResult Reports() 35 | { 36 | using (var client = this.CreatePowerBIClient()) 37 | { 38 | var reportsResponse = client.Reports.GetReports(this.workspaceCollection, this.workspaceId); 39 | 40 | var viewModel = new ReportsViewModel 41 | { 42 | Reports = reportsResponse.Value.ToList() 43 | }; 44 | 45 | return PartialView(viewModel); 46 | } 47 | } 48 | 49 | public async Task Report(string reportId) 50 | { 51 | using (var client = this.CreatePowerBIClient()) 52 | { 53 | var reportsResponse = await client.Reports.GetReportsAsync(this.workspaceCollection, this.workspaceId); 54 | var report = reportsResponse.Value.FirstOrDefault(r => r.Id == reportId); 55 | var embedToken = PowerBIToken.CreateReportEmbedToken(this.workspaceCollection, this.workspaceId, report.Id); 56 | 57 | var viewModel = new ReportViewModel 58 | { 59 | Report = report, 60 | AccessToken = embedToken.Generate(this.accessKey) 61 | }; 62 | 63 | return View(viewModel); 64 | } 65 | } 66 | 67 | private IPowerBIClient CreatePowerBIClient() 68 | { 69 | var credentials = new TokenCredentials(accessKey, "AppKey"); 70 | var client = new PowerBIClient(credentials) 71 | { 72 | BaseUri = new Uri(apiUrl) 73 | }; 74 | 75 | return client; 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /EmbedSample/lib/js/ace/theme-github.js: -------------------------------------------------------------------------------- 1 | define("ace/theme/github",["require","exports","module","ace/lib/dom"], function(require, exports, module) { 2 | 3 | exports.isDark = false; 4 | exports.cssClass = "ace-github"; 5 | exports.cssText = "\ 6 | .ace-github .ace_gutter {\ 7 | background: #e8e8e8;\ 8 | color: #AAA;\ 9 | }\ 10 | .ace-github {\ 11 | background: #fff;\ 12 | color: #000;\ 13 | }\ 14 | .ace-github .ace_keyword {\ 15 | font-weight: bold;\ 16 | }\ 17 | .ace-github .ace_string {\ 18 | color: #D14;\ 19 | }\ 20 | .ace-github .ace_variable.ace_class {\ 21 | color: teal;\ 22 | }\ 23 | .ace-github .ace_constant.ace_numeric {\ 24 | color: #099;\ 25 | }\ 26 | .ace-github .ace_constant.ace_buildin {\ 27 | color: #0086B3;\ 28 | }\ 29 | .ace-github .ace_support.ace_function {\ 30 | color: #0086B3;\ 31 | }\ 32 | .ace-github .ace_comment {\ 33 | color: #998;\ 34 | font-style: italic;\ 35 | }\ 36 | .ace-github .ace_variable.ace_language {\ 37 | color: #0086B3;\ 38 | }\ 39 | .ace-github .ace_paren {\ 40 | font-weight: bold;\ 41 | }\ 42 | .ace-github .ace_boolean {\ 43 | font-weight: bold;\ 44 | }\ 45 | .ace-github .ace_string.ace_regexp {\ 46 | color: #009926;\ 47 | font-weight: normal;\ 48 | }\ 49 | .ace-github .ace_variable.ace_instance {\ 50 | color: teal;\ 51 | }\ 52 | .ace-github .ace_constant.ace_language {\ 53 | font-weight: bold;\ 54 | }\ 55 | .ace-github .ace_cursor {\ 56 | color: black;\ 57 | }\ 58 | .ace-github.ace_focus .ace_marker-layer .ace_active-line {\ 59 | background: rgb(255, 255, 204);\ 60 | }\ 61 | .ace-github .ace_marker-layer .ace_active-line {\ 62 | background: rgb(245, 245, 245);\ 63 | }\ 64 | .ace-github .ace_marker-layer .ace_selection {\ 65 | background: rgb(181, 213, 255);\ 66 | }\ 67 | .ace-github.ace_multiselect .ace_selection.ace_start {\ 68 | box-shadow: 0 0 3px 0px white;\ 69 | }\ 70 | .ace-github.ace_nobold .ace_line > span {\ 71 | font-weight: normal !important;\ 72 | }\ 73 | .ace-github .ace_marker-layer .ace_step {\ 74 | background: rgb(252, 255, 0);\ 75 | }\ 76 | .ace-github .ace_marker-layer .ace_stack {\ 77 | background: rgb(164, 229, 101);\ 78 | }\ 79 | .ace-github .ace_marker-layer .ace_bracket {\ 80 | margin: -1px 0 0 -1px;\ 81 | border: 1px solid rgb(192, 192, 192);\ 82 | }\ 83 | .ace-github .ace_gutter-active-line {\ 84 | background-color : rgba(0, 0, 0, 0.07);\ 85 | }\ 86 | .ace-github .ace_marker-layer .ace_selected-word {\ 87 | background: rgb(250, 250, 255);\ 88 | border: 1px solid rgb(200, 200, 250);\ 89 | }\ 90 | .ace-github .ace_invisible {\ 91 | color: #BFBFBF\ 92 | }\ 93 | .ace-github .ace_print-margin {\ 94 | width: 1px;\ 95 | background: #e8e8e8;\ 96 | }\ 97 | .ace-github .ace_indent-guide {\ 98 | background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ 99 | }"; 100 | 101 | var dom = require("../lib/dom"); 102 | dom.importCssString(exports.cssText, exports.cssClass); 103 | }); 104 | -------------------------------------------------------------------------------- /EmbedSample/lib/js/jquery.matchHeight-min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jquery.matchHeight-min.js master 3 | * http://brm.io/jquery-match-height/ 4 | * License: MIT 5 | */ 6 | (function(c){var n=-1,f=-1,g=function(a){return parseFloat(a)||0},r=function(a){var b=null,d=[];c(a).each(function(){var a=c(this),k=a.offset().top-g(a.css("margin-top")),l=0=Math.floor(Math.abs(b-k))?d[d.length-1]=l.add(a):d.push(a);b=k});return d},p=function(a){var b={byRow:!0,property:"height",target:null,remove:!1};if("object"===typeof a)return c.extend(b,a);"boolean"===typeof a?b.byRow=a:"remove"===a&&(b.remove=!0);return b},b=c.fn.matchHeight= 7 | function(a){a=p(a);if(a.remove){var e=this;this.css(a.property,"");c.each(b._groups,function(a,b){b.elements=b.elements.not(e)});return this}if(1>=this.length&&!a.target)return this;b._groups.push({elements:this,options:a});b._apply(this,a);return this};b._groups=[];b._throttle=80;b._maintainScroll=!1;b._beforeUpdate=null;b._afterUpdate=null;b._apply=function(a,e){var d=p(e),h=c(a),k=[h],l=c(window).scrollTop(),f=c("html").outerHeight(!0),m=h.parents().filter(":hidden");m.each(function(){var a=c(this); 8 | a.data("style-cache",a.attr("style"))});m.css("display","block");d.byRow&&!d.target&&(h.each(function(){var a=c(this),b="inline-block"===a.css("display")?"inline-block":"block";a.data("style-cache",a.attr("style"));a.css({display:b,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px"})}),k=r(h),h.each(function(){var a=c(this);a.attr("style",a.data("style-cache")||"")}));c.each(k,function(a,b){var e=c(b),f=0;if(d.target)f= 9 | d.target.outerHeight(!1);else{if(d.byRow&&1>=e.length){e.css(d.property,"");return}e.each(function(){var a=c(this),b={display:"inline-block"===a.css("display")?"inline-block":"block"};b[d.property]="";a.css(b);a.outerHeight(!1)>f&&(f=a.outerHeight(!1));a.css("display","")})}e.each(function(){var a=c(this),b=0;d.target&&a.is(d.target)||("border-box"!==a.css("box-sizing")&&(b+=g(a.css("border-top-width"))+g(a.css("border-bottom-width")),b+=g(a.css("padding-top"))+g(a.css("padding-bottom"))),a.css(d.property, 10 | f-b))})});m.each(function(){var a=c(this);a.attr("style",a.data("style-cache")||null)});b._maintainScroll&&c(window).scrollTop(l/f*c("html").outerHeight(!0));return this};b._applyDataApi=function(){var a={};c("[data-match-height], [data-mh]").each(function(){var b=c(this),d=b.attr("data-mh")||b.attr("data-match-height");a[d]=d in a?a[d].add(b):b});c.each(a,function(){this.matchHeight(!0)})};var q=function(a){b._beforeUpdate&&b._beforeUpdate(a,b._groups);c.each(b._groups,function(){b._apply(this.elements, 11 | this.options)});b._afterUpdate&&b._afterUpdate(a,b._groups)};b._update=function(a,e){if(e&&"resize"===e.type){var d=c(window).width();if(d===n)return;n=d}a?-1===f&&(f=setTimeout(function(){q(e);f=-1},b._throttle)):q(e)};c(b._applyDataApi);c(window).bind("load",function(a){b._update(!1,a)});c(window).bind("resize orientationchange",function(a){b._update(!0,a)})})(jQuery); -------------------------------------------------------------------------------- /ThirdPartyNotices.txt: -------------------------------------------------------------------------------- 1 | THIRD-PARTY SOFTWARE NOTICES AND INFORMATION 2 | 3 | For Power BI Embedded - Integrate a report into a web app 4 | 5 | This project incorporates material from the projects listed below. The original copyright notice and the license under which Microsoft received such material are set out below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. 6 | 1. flat-admin-bootstrap-templates (https://github.com/tui2tone/flat-admin-bootstrap-templates) 7 | 8 | By downloading/using Flat Admin Bootstrap Templates 9 | you agree to the following user license terms: 10 | 11 | Allow: 12 | - Personal and Commercial Use. 13 | - Modification. 14 | 15 | ====================== 16 | 17 | The MIT License (MIT) 18 | 19 | Copyright (c) [2015] [Flat Admin Bootstrap Templates] 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | 2. es6-promise (https://github.com/stefanpenner/es6-promise) 40 | 41 | The MIT License (MIT) 42 | 43 | Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors 44 | 45 | Permission is hereby granted, free of charge, to any person obtaining a copy of 46 | this software and associated documentation files (the "Software"), to deal in 47 | the Software without restriction, including without limitation the rights to 48 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 49 | of the Software, and to permit persons to whom the Software is furnished to do 50 | so, subject to the following conditions: 51 | 52 | The above copyright notice and this permission notice shall be included in all 53 | copies or substantial portions of the Software. 54 | 55 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 56 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 57 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 58 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 59 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 60 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 61 | SOFTWARE. 62 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | *.dat 9 | 10 | # Build results 11 | 12 | [Dd]ebug/ 13 | [Rr]elease/ 14 | x64/ 15 | build/ 16 | [Bb]in/ 17 | [Oo]bj/ 18 | .vs/ 19 | 20 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 21 | !packages/*/build/ 22 | 23 | # MSTest test Results 24 | [Tt]est[Rr]esult*/ 25 | [Bb]uild[Ll]og.* 26 | 27 | *_i.c 28 | *_p.c 29 | *.ilk 30 | *.meta 31 | *.obj 32 | *.pch 33 | *.pdb 34 | *.pgc 35 | *.pgd 36 | *.rsp 37 | *.sbr 38 | *.tlb 39 | *.tli 40 | *.tlh 41 | *.tmp 42 | *.tmp_proj 43 | *.log 44 | *.vspscc 45 | *.vssscc 46 | .builds 47 | *.pidb 48 | *.log 49 | *.scc 50 | 51 | # Visual C++ cache files 52 | ipch/ 53 | *.aps 54 | *.ncb 55 | *.opensdf 56 | *.sdf 57 | *.cachefile 58 | 59 | # Visual Studio profiler 60 | *.psess 61 | *.vsp 62 | *.vspx 63 | 64 | # Guidance Automation Toolkit 65 | *.gpState 66 | 67 | # ReSharper is a .NET coding add-in 68 | _ReSharper*/ 69 | *.[Rr]e[Ss]harper 70 | 71 | # TeamCity is a build add-in 72 | _TeamCity* 73 | 74 | # DotCover is a Code Coverage Tool 75 | *.dotCover 76 | 77 | # NCrunch 78 | *.ncrunch* 79 | .*crunch*.local.xml 80 | 81 | # Installshield output folder 82 | [Ee]xpress/ 83 | 84 | # DocProject is a documentation generator add-in 85 | DocProject/buildhelp/ 86 | DocProject/Help/*.HxT 87 | DocProject/Help/*.HxC 88 | DocProject/Help/*.hhc 89 | DocProject/Help/*.hhk 90 | DocProject/Help/*.hhp 91 | DocProject/Help/Html2 92 | DocProject/Help/html 93 | 94 | # Click-Once directory 95 | publish/ 96 | 97 | # Publish Web Output 98 | *.Publish.xml 99 | 100 | # NuGet Packages Directory 101 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 102 | [Pp]ackages/ 103 | 104 | # Windows Azure Build Output 105 | csx 106 | *.build.csdef 107 | 108 | # Windows Store app package directory 109 | AppPackages/ 110 | 111 | # Others 112 | sql/ 113 | *.Cache 114 | ClientBin/ 115 | [Ss]tyle[Cc]op.* 116 | ~$* 117 | *~ 118 | *.dbmdl 119 | *.[Pp]ublish.xml 120 | *.pfx 121 | *.publishsettings 122 | 123 | # RIA/Silverlight projects 124 | Generated_Code/ 125 | 126 | # Backup & report files from converting an old project file to a newer 127 | # Visual Studio version. Backup files are not needed, because we have git ;-) 128 | _UpgradeReport_Files/ 129 | Backup*/ 130 | UpgradeLog*.XML 131 | UpgradeLog*.htm 132 | 133 | # SQL Server files 134 | [Aa]pp_[Dd]ata/*.mdf 135 | [Aa]pp_[Dd]ata/*.ldf 136 | 137 | 138 | #LightSwitch generated files 139 | GeneratedArtifacts/ 140 | _Pvt_Extensions/ 141 | ModelManifest.xml 142 | 143 | # ========================= 144 | # Windows detritus 145 | # ========================= 146 | 147 | # Windows image file caches 148 | Thumbs.db 149 | ehthumbs.db 150 | 151 | # Folder config file 152 | Desktop.ini 153 | 154 | # Recycle Bin used on file shares 155 | $RECYCLE.BIN/ 156 | 157 | # Mac desktop service store files 158 | .DS_Store 159 | 160 | # Node Modules Directory 161 | ## TODO: If you don't want to store node modules, uncomment the next line 162 | node_modules/ 163 | 164 | # Bower components 165 | bower_components/ -------------------------------------------------------------------------------- /ProvisionSample/AsyncPump.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Collections.Generic; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.Threading 8 | { 9 | /// Provides a pump that supports running asynchronous methods on the current thread. 10 | public static class AsyncPump 11 | { 12 | /// Runs the specified asynchronous function. 13 | /// The asynchronous function to execute. 14 | public static void Run(Func func) 15 | { 16 | if (func == null) throw new ArgumentNullException("func"); 17 | 18 | var prevCtx = SynchronizationContext.Current; 19 | try 20 | { 21 | // Establish the new context 22 | var syncCtx = new SingleThreadSynchronizationContext(); 23 | SynchronizationContext.SetSynchronizationContext(syncCtx); 24 | 25 | // Invoke the function and alert the context to when it completes 26 | var t = func(); 27 | if (t == null) throw new InvalidOperationException("No task provided."); 28 | t.ContinueWith(delegate { syncCtx.Complete(); }, TaskScheduler.Default); 29 | 30 | // Pump continuations and propagate any exceptions 31 | syncCtx.RunOnCurrentThread(); 32 | t.GetAwaiter().GetResult(); 33 | } 34 | finally { SynchronizationContext.SetSynchronizationContext(prevCtx); } 35 | } 36 | 37 | /// Provides a SynchronizationContext that's single-threaded. 38 | private sealed class SingleThreadSynchronizationContext : SynchronizationContext 39 | { 40 | /// The queue of work items. 41 | private readonly BlockingCollection> m_queue = 42 | new BlockingCollection>(); 43 | /// The processing thread. 44 | private readonly Thread m_thread = Thread.CurrentThread; 45 | 46 | /// Dispatches an asynchronous message to the synchronization context. 47 | /// The System.Threading.SendOrPostCallback delegate to call. 48 | /// The object passed to the delegate. 49 | public override void Post(SendOrPostCallback d, object state) 50 | { 51 | if (d == null) throw new ArgumentNullException("d"); 52 | m_queue.Add(new KeyValuePair(d, state)); 53 | } 54 | 55 | /// Not supported. 56 | public override void Send(SendOrPostCallback d, object state) 57 | { 58 | throw new NotSupportedException("Synchronously sending is not supported."); 59 | } 60 | 61 | /// Runs an loop to process all queued work items. 62 | public void RunOnCurrentThread() 63 | { 64 | foreach (var workItem in m_queue.GetConsumingEnumerable()) 65 | workItem.Key(workItem.Value); 66 | } 67 | 68 | /// Notifies the context that no more work will arrive. 69 | public void Complete() { m_queue.CompleteAdding(); } 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /EmbedSample/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 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 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /ProvisionSample/ProgramExtensions.cs: -------------------------------------------------------------------------------- 1 | using ApiHost.Models; 2 | using Microsoft.IdentityModel.Clients.ActiveDirectory; 3 | using Microsoft.PowerBI.Api.V1; 4 | using Microsoft.Rest; 5 | using Newtonsoft.Json; 6 | using Newtonsoft.Json.Linq; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Net.Http; 11 | using System.Net.Http.Headers; 12 | using System.Threading.Tasks; 13 | using System.Configuration; 14 | 15 | 16 | namespace ProvisionSample 17 | { 18 | partial class Program 19 | { 20 | static string clientId = ConfigurationManager.AppSettings["clientId"]; 21 | static Uri redirectUri = new Uri("urn:ietf:wg:oauth:2.0:oob"); 22 | static string azureToken = null; 23 | static string tenantsUrl = ConfigurationManager.AppSettings["tenantsUrl"]; 24 | static string authUrl = ConfigurationManager.AppSettings["AuthenticationUrl"]; 25 | 26 | private static HttpClient CreateHttpClient() 27 | { 28 | return new HttpClient(); 29 | } 30 | private static async Task SetAuthorizationHeaderIfNeeded(HttpRequestMessage request) 31 | { 32 | request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", await GetAzureAccessTokenAsync()); 33 | } 34 | 35 | /// 36 | /// Creates a new instance of the PowerBIClient with the specified token 37 | /// 38 | /// 39 | static async Task CreateClient() 40 | { 41 | if (accessKeys == null) 42 | { 43 | var enteredKey = userInput.EnterOptionalParam("Access Key", "Auto select"); 44 | if (!string.IsNullOrWhiteSpace(enteredKey)) 45 | { 46 | accessKey = enteredKey; 47 | accessKeys = new WorkspaceCollectionKeys() 48 | { 49 | Key1 = accessKey 50 | }; 51 | } 52 | } 53 | 54 | if (accessKeys == null) 55 | { 56 | // get the current collection's keys 57 | accessKeys = await ListWorkspaceCollectionKeys(subscriptionId, resourceGroup, workspaceCollectionName); 58 | } 59 | 60 | // Create a token credentials with "AppKey" type 61 | var credentials = new TokenCredentials(accessKeys.Key1, "AppKey"); 62 | 63 | // Instantiate your Power BI client passing in the required credentials 64 | var client = new PowerBIClient(credentials); 65 | 66 | // Override the api endpoint base URL. Default value is https://api.powerbi.com 67 | client.BaseUri = new Uri(apiEndpointUri); 68 | 69 | return client; 70 | } 71 | 72 | static async Task> GetTenantIdsAsync(string commonToken) 73 | { 74 | using (var httpClient = CreateHttpClient()) 75 | { 76 | httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + commonToken); 77 | var response = await httpClient.GetStringAsync(tenantsUrl); 78 | var tenantsJson = JsonConvert.DeserializeObject(response); 79 | var tenants = tenantsJson["value"] as JArray; 80 | 81 | return tenants.Select(t => t["tenantId"].Value()); 82 | } 83 | } 84 | 85 | /// 86 | /// Gets an Azure access token that can be used to call into the Azure ARM apis. 87 | /// 88 | /// A user token to access Azure ARM 89 | static async Task GetAzureAccessTokenAsync() 90 | { 91 | if (!string.IsNullOrWhiteSpace(azureToken)) 92 | { 93 | return azureToken; 94 | } 95 | 96 | var commonToken = GetCommonAzureAccessToken(); 97 | var tenantId = (await GetTenantIdsAsync(commonToken.AccessToken)).FirstOrDefault(); 98 | 99 | if (string.IsNullOrWhiteSpace(tenantId)) 100 | { 101 | throw new InvalidOperationException("Unable to get tenant id for user accout"); 102 | } 103 | 104 | var authority = string.Format("{0}/{1}/oauth2/authorize", authUrl, tenantId); 105 | var authContext = new AuthenticationContext(authority); 106 | var result = await authContext.AcquireTokenByRefreshTokenAsync(commonToken.RefreshToken, clientId, armResource); 107 | 108 | return (azureToken = result.AccessToken); 109 | 110 | } 111 | 112 | /// 113 | /// Gets a user common access token to access ARM apis 114 | /// 115 | /// 116 | static AuthenticationResult GetCommonAzureAccessToken() 117 | { 118 | var authContext = new AuthenticationContext(string.Format("{0}/common/oauth2/authorize", authUrl)); 119 | var result = authContext.AcquireToken( 120 | resource: armResource, 121 | clientId: clientId, 122 | redirectUri: redirectUri, 123 | promptBehavior: PromptBehavior.Auto); 124 | 125 | if (result == null) 126 | { 127 | throw new InvalidOperationException("Failed to obtain the JWT token"); 128 | } 129 | 130 | return result; 131 | } 132 | } 133 | } 134 | 135 | -------------------------------------------------------------------------------- /EmbedSample/lib/css/dataTables.bootstrap.css: -------------------------------------------------------------------------------- 1 | table.dataTable { 2 | clear: both; 3 | margin-top: 6px !important; 4 | margin-bottom: 6px !important; 5 | max-width: none !important; 6 | } 7 | table.dataTable td, 8 | table.dataTable th { 9 | -webkit-box-sizing: content-box; 10 | -moz-box-sizing: content-box; 11 | box-sizing: content-box; 12 | } 13 | table.dataTable td.dataTables_empty, 14 | table.dataTable th.dataTables_empty { 15 | text-align: center; 16 | } 17 | table.dataTable.nowrap th, 18 | table.dataTable.nowrap td { 19 | white-space: nowrap; 20 | } 21 | 22 | div.dataTables_wrapper div.dataTables_length label { 23 | font-weight: normal; 24 | text-align: left; 25 | white-space: nowrap; 26 | } 27 | div.dataTables_wrapper div.dataTables_length select { 28 | width: 75px; 29 | display: inline-block; 30 | } 31 | div.dataTables_wrapper div.dataTables_filter { 32 | text-align: right; 33 | } 34 | div.dataTables_wrapper div.dataTables_filter label { 35 | font-weight: normal; 36 | white-space: nowrap; 37 | text-align: left; 38 | } 39 | div.dataTables_wrapper div.dataTables_filter input { 40 | margin-left: 0.5em; 41 | display: inline-block; 42 | width: auto; 43 | } 44 | div.dataTables_wrapper div.dataTables_info { 45 | padding-top: 8px; 46 | white-space: nowrap; 47 | } 48 | div.dataTables_wrapper div.dataTables_paginate { 49 | margin: 0; 50 | white-space: nowrap; 51 | text-align: right; 52 | } 53 | div.dataTables_wrapper div.dataTables_paginate ul.pagination { 54 | margin: 2px 0; 55 | white-space: nowrap; 56 | } 57 | div.dataTables_wrapper div.dataTables_processing { 58 | position: absolute; 59 | top: 50%; 60 | left: 50%; 61 | width: 200px; 62 | margin-left: -100px; 63 | margin-top: -26px; 64 | text-align: center; 65 | padding: 1em 0; 66 | } 67 | 68 | table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting, 69 | table.dataTable thead > tr > td.sorting_asc, 70 | table.dataTable thead > tr > td.sorting_desc, 71 | table.dataTable thead > tr > td.sorting { 72 | padding-right: 30px; 73 | } 74 | table.dataTable thead > tr > th:active, 75 | table.dataTable thead > tr > td:active { 76 | outline: none; 77 | } 78 | table.dataTable thead .sorting, 79 | table.dataTable thead .sorting_asc, 80 | table.dataTable thead .sorting_desc, 81 | table.dataTable thead .sorting_asc_disabled, 82 | table.dataTable thead .sorting_desc_disabled { 83 | cursor: pointer; 84 | position: relative; 85 | } 86 | table.dataTable thead .sorting:after, 87 | table.dataTable thead .sorting_asc:after, 88 | table.dataTable thead .sorting_desc:after, 89 | table.dataTable thead .sorting_asc_disabled:after, 90 | table.dataTable thead .sorting_desc_disabled:after { 91 | position: absolute; 92 | bottom: 8px; 93 | right: 8px; 94 | display: block; 95 | font-family: 'Glyphicons Halflings'; 96 | opacity: 0.5; 97 | } 98 | table.dataTable thead .sorting:after { 99 | opacity: 0.2; 100 | content: "\e150"; 101 | /* sort */ 102 | } 103 | table.dataTable thead .sorting_asc:after { 104 | content: "\e155"; 105 | /* sort-by-attributes */ 106 | } 107 | table.dataTable thead .sorting_desc:after { 108 | content: "\e156"; 109 | /* sort-by-attributes-alt */ 110 | } 111 | table.dataTable thead .sorting_asc_disabled:after, 112 | table.dataTable thead .sorting_desc_disabled:after { 113 | color: #eee; 114 | } 115 | 116 | div.dataTables_scrollHead table.dataTable { 117 | margin-bottom: 0 !important; 118 | } 119 | 120 | div.dataTables_scrollBody table { 121 | border-top: none; 122 | margin-top: 0 !important; 123 | margin-bottom: 0 !important; 124 | } 125 | div.dataTables_scrollBody table thead .sorting:after, 126 | div.dataTables_scrollBody table thead .sorting_asc:after, 127 | div.dataTables_scrollBody table thead .sorting_desc:after { 128 | display: none; 129 | } 130 | div.dataTables_scrollBody table tbody tr:first-child th, 131 | div.dataTables_scrollBody table tbody tr:first-child td { 132 | border-top: none; 133 | } 134 | 135 | div.dataTables_scrollFoot table { 136 | margin-top: 0 !important; 137 | border-top: none; 138 | } 139 | 140 | @media screen and (max-width: 767px) { 141 | div.dataTables_wrapper div.dataTables_length, 142 | div.dataTables_wrapper div.dataTables_filter, 143 | div.dataTables_wrapper div.dataTables_info, 144 | div.dataTables_wrapper div.dataTables_paginate { 145 | text-align: center; 146 | } 147 | } 148 | table.dataTable.table-condensed > thead > tr > th { 149 | padding-right: 20px; 150 | } 151 | table.dataTable.table-condensed .sorting:after, 152 | table.dataTable.table-condensed .sorting_asc:after, 153 | table.dataTable.table-condensed .sorting_desc:after { 154 | top: 6px; 155 | right: 6px; 156 | } 157 | 158 | table.table-bordered.dataTable { 159 | border-collapse: separate !important; 160 | } 161 | table.table-bordered.dataTable th, 162 | table.table-bordered.dataTable td { 163 | border-left-width: 0; 164 | } 165 | table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child, 166 | table.table-bordered.dataTable td:last-child, 167 | table.table-bordered.dataTable td:last-child { 168 | border-right-width: 0; 169 | } 170 | table.table-bordered.dataTable tbody th, 171 | table.table-bordered.dataTable tbody td { 172 | border-bottom-width: 0; 173 | } 174 | 175 | div.dataTables_scrollHead table.table-bordered { 176 | border-bottom-width: 0; 177 | } 178 | 179 | div.table-responsive > div.dataTables_wrapper > div.row { 180 | margin: 0; 181 | } 182 | div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:first-child { 183 | padding-left: 0; 184 | } 185 | div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:last-child { 186 | padding-right: 0; 187 | } 188 | -------------------------------------------------------------------------------- /EmbedSample/lib/css/bootstrap-switch.min.css: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * bootstrap-switch - v3.3.2 3 | * http://www.bootstrap-switch.org 4 | * ======================================================================== 5 | * Copyright 2012-2013 Mattia Larentis 6 | * 7 | * ======================================================================== 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * ======================================================================== 20 | */ 21 | 22 | .bootstrap-switch{display:inline-block;direction:ltr;cursor:pointer;border-radius:4px;border:1px solid;border-color:#ccc;position:relative;text-align:left;overflow:hidden;line-height:8px;z-index:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.bootstrap-switch .bootstrap-switch-container{display:inline-block;top:0;border-radius:4px;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-label{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:inline-block !important;height:100%;padding:6px 12px;font-size:14px;line-height:20px}.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-handle-off{text-align:center;z-index:1}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary{color:#fff;background:#428bca}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info{color:#fff;background:#5bc0de}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success{color:#fff;background:#5cb85c}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning{background:#f0ad4e;color:#fff}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger{color:#fff;background:#d9534f}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default{color:#000;background:#eee}.bootstrap-switch .bootstrap-switch-label{text-align:center;margin-top:-1px;margin-bottom:-1px;z-index:100;color:#333;background:#fff}.bootstrap-switch .bootstrap-switch-handle-on{border-bottom-left-radius:3px;border-top-left-radius:3px}.bootstrap-switch .bootstrap-switch-handle-off{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch input[type='radio'],.bootstrap-switch input[type='checkbox']{position:absolute !important;top:0;left:0;opacity:0;filter:alpha(opacity=0);z-index:-1}.bootstrap-switch input[type='radio'].form-control,.bootstrap-switch input[type='checkbox'].form-control{height:auto}.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label{padding:1px 5px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label{padding:5px 10px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label{padding:6px 16px;font-size:18px;line-height:1.33}.bootstrap-switch.bootstrap-switch-disabled,.bootstrap-switch.bootstrap-switch-readonly,.bootstrap-switch.bootstrap-switch-indeterminate{cursor:default !important}.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label{opacity:.5;filter:alpha(opacity=50);cursor:default !important}.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container{-webkit-transition:margin-left .5s;transition:margin-left .5s}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on{border-bottom-left-radius:0;border-top-left-radius:0;border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off{border-bottom-right-radius:0;border-top-right-radius:0;border-bottom-left-radius:3px;border-top-left-radius:3px}.bootstrap-switch.bootstrap-switch-focused{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label{border-bottom-left-radius:3px;border-top-left-radius:3px} -------------------------------------------------------------------------------- /ProvisionSample/ProvisionSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {32CEA21A-2E37-48E3-9D16-CB134A2BEB24} 8 | Exe 9 | Properties 10 | ProvisionSample 11 | ProvisionSample 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.22.302111727\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll 37 | True 38 | 39 | 40 | ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.22.302111727\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll 41 | True 42 | 43 | 44 | ..\packages\Microsoft.PowerBI.Api.1.1.9\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\Microsoft.PowerBI.Api.dll 45 | True 46 | 47 | 48 | ..\packages\Microsoft.PowerBI.Core.1.1.9\lib\net45\Microsoft.PowerBI.Core.dll 49 | True 50 | 51 | 52 | ..\packages\Microsoft.Rest.ClientRuntime.2.0.1\lib\net45\Microsoft.Rest.ClientRuntime.dll 53 | True 54 | 55 | 56 | ..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll 57 | True 58 | 59 | 60 | 61 | 62 | 63 | 64 | ..\packages\System.IdentityModel.Tokens.Jwt.4.0.2.206221351\lib\net45\System.IdentityModel.Tokens.Jwt.dll 65 | True 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | Designer 95 | 96 | 97 | Always 98 | Designer 99 | 100 | 101 | Designer 102 | 103 | 104 | 105 | 112 | -------------------------------------------------------------------------------- /ProvisionSample/JsonConvertor.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.IO; 9 | using System.IO.Compression; 10 | 11 | namespace ProvisionSample 12 | { 13 | class JsonConvertor 14 | { 15 | private const string ModelSchema = "DataModelSchema"; 16 | const int ModelSizeLimit = 75; 17 | 18 | public static async Task Convert(string datasetName, string pathToPbit) 19 | { 20 | Unzip(@pathToPbit); 21 | 22 | try 23 | { 24 | using (var sr = new StreamReader(ModelSchema, Encoding.Unicode)) 25 | { 26 | var parsedJson = JObject.Parse(await @sr.ReadToEndAsync()); 27 | var ds = JsonConvert.DeserializeObject(parsedJson["model"].ToString()); 28 | ds.name = datasetName; 29 | RemoveDateTable(ds); 30 | RemoveFirstColumn(ds.tables); 31 | CheckIfLegal(ds); 32 | UpdateMeasure(ds.tables); 33 | UpdateRel(ds); 34 | FilterInactiveRel(ds); 35 | var output = JsonConvert.SerializeObject(ds); 36 | Console.WriteLine("The new json is:"); 37 | Console.WriteLine(output); 38 | } 39 | } 40 | finally 41 | { 42 | File.Delete(ModelSchema); 43 | } 44 | } 45 | 46 | // This function porpuse is to extract "DataModelSchema" from the pbit file. 47 | static void Unzip(string pbitPath) 48 | { 49 | using (var archive = ZipFile.OpenRead(pbitPath)) 50 | { 51 | foreach (var entry in archive.Entries) 52 | { 53 | if (entry.ToString().Equals(ModelSchema, StringComparison.InvariantCultureIgnoreCase)) 54 | { 55 | entry.ExtractToFile(entry.ToString()); 56 | } 57 | } 58 | } 59 | } 60 | 61 | // When a user creates a table in powerBi desktop, powerBi automatically adds to the table a column of type "rowNumber". 62 | // This column is redundant in a pushable dataSet, so we remove it from each table in the dataSet. 63 | static void RemoveFirstColumn(IList
    tables) 64 | { 65 | foreach (var t in tables) 66 | { 67 | t.columns = t.columns.Skip(1).ToList(); 68 | } 69 | } 70 | 71 | // Measure property can't be null 72 | static void UpdateMeasure(IList
    tables) 73 | { 74 | foreach (Table t in tables) 75 | { 76 | t.measures = (t.measures) ?? new List(); 77 | } 78 | } 79 | 80 | // Checks if the dataset has unsupported dataTypes, contains any calculated tables/columns or if the dataset size exceeds the allowable limit. 81 | static void CheckIfLegal(DataSet ds) 82 | { 83 | int numOfTables = 0; 84 | foreach (var t in ds.tables) 85 | { 86 | numOfTables++; 87 | // (1) Check number of tables doesn't exceed maximum limit. 88 | if (numOfTables > ModelSizeLimit) 89 | { 90 | throw new InvalidOperationException(string.Format("Dataset contains more then {0} tables which is not supported.", ModelSizeLimit)); 91 | } 92 | 93 | int numOfColumns = 0; 94 | foreach (var c in t.columns) 95 | { 96 | numOfColumns++; 97 | // (2) Check number of columns doesn't exceed maximum limit. 98 | if (numOfColumns > ModelSizeLimit) 99 | { 100 | throw new InvalidOperationException(string.Format("Dataset in table {0} contains more then {1} columns which is not supported.", t.name, ModelSizeLimit)); 101 | } 102 | 103 | // (3) Check if model includes calculated column/table . 104 | switch (c.type) 105 | { 106 | case "calculated": 107 | throw new InvalidOperationException(string.Format("Dataset in table {0} includes an unsupported calculated column: {1}", t.name, c.type)); 108 | case "calculatedTableColumn": 109 | throw new InvalidOperationException(string.Format("Dataset includes an unsupported calculated table: {0}", t.name)); 110 | } 111 | 112 | // (4) Check that all dataTypes in the model are supported. 113 | switch (c.dataType.ToLower()) 114 | { 115 | case "int64": 116 | continue; 117 | case "double": 118 | continue; 119 | case "boolean": 120 | continue; 121 | case "datetime": 122 | continue; 123 | case "string": 124 | continue; 125 | case "decimal": 126 | continue; 127 | default: 128 | throw new InvalidOperationException(string.Format("Dataset in column {0} of table {1} includes an unsupported dataType:{2}", t.name, c.name, c.dataType.ToLower())); 129 | } 130 | 131 | } 132 | } 133 | } 134 | 135 | // Relatioship property can't be null 136 | static void UpdateRel(DataSet ds) 137 | { 138 | ds.relationships = (ds.relationships) ?? new List(); 139 | } 140 | 141 | // In some cases When a pbix file i created, a calculated table with the name "DateTableTemplate" is added automatically to the dataSet as the first table. 142 | // Pushable dataset can't include calculated tables, so we remove this table from the dataSet 143 | static void RemoveDateTable(DataSet ds) 144 | { 145 | var t = ds.tables.FirstOrDefault(); 146 | if (t == null) 147 | { 148 | return; 149 | } 150 | 151 | if (t.name.StartsWith("DateTableTemplate")) 152 | { 153 | ds.tables = ds.tables.Skip(1).ToList(); 154 | } 155 | } 156 | 157 | // In powerBi desktop you can create inactive relatioships. 158 | // Pushable dataset don't support this option, so we remove every inactive relatioship. 159 | static void FilterInactiveRel(DataSet ds) 160 | { 161 | ds.relationships = ds.relationships.Where((r) => ((string.IsNullOrEmpty(r.isActive)) || (!r.isActive.Equals("False")))).ToList(); 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /EmbedSample/lib/css/checkbox3.min.css: -------------------------------------------------------------------------------- 1 | .checkbox3 label::before,.radio3 label::before{overflow:hidden;vertical-align:middle;text-align:center}.checkbox3 label,.radio3 label{white-space:nowrap;cursor:pointer}.checkbox3{position:relative}.checkbox3 input{position:absolute;left:-9999px}.checkbox3 label::after,.checkbox3 label::before{content:'';top:10px;bottom:10px;left:0;display:block}.checkbox3 label{display:block;position:relative;padding:11px 0 11px 30px;font-size:12px;margin-bottom:0;margin-top:-4px}.checkbox3 label::before{position:absolute;width:21px;height:21px;border:1px solid #CCC;-moz-border-radius:1px;border-radius:1px;-webkit-transition:background-color .2s;-moz-transition:background-color .2s;transition:background-color .2s}.checkbox3 label::after{position:absolute;width:19px;height:19px;border:12px solid #FFF;margin:1px;-webkit-transition:all 50ms;-moz-transition:all 50ms;transition:all 50ms;opacity:0}.checkbox3 input:checked+label::before{border-width:1px;border-style:solid;background-color:#444;border-color:#444;color:#fff}.checkbox3 input:checked+label::after{border:3px solid #FFF;opacity:1}.checkbox3.checkbox-sm label{padding:8px 0 8px 22px}.checkbox3.checkbox-sm label::before{width:14px;height:14px;line-height:14px}.checkbox3.checkbox-sm label::after{width:12px;height:12px}.checkbox3.checkbox-lg label{padding:15px 0 15px 40px}.checkbox3.checkbox-lg label::before{width:28px;height:27px;line-height:24px}.checkbox3.checkbox-lg label::after{width:26px;height:25px}.checkbox3.checkbox-inline,.radio3.radio-inline{padding-top:0;padding-left:0;padding-right:0;margin-left:0;margin-right:20px}.checkbox3.checkbox-inline input[type=checkbox],.checkbox3.checkbox-inline input[type=radio],.radio3.radio-inline input[type=checkbox],.radio3.radio-inline input[type=radio]{position:absolute}.checkbox3.checkbox-check input:checked+label::after,.checkbox3.checkbox-check label::after{border:0}.checkbox3.checkbox-check label::after{content:"\f00c";font-family:FontAwesome;font-size:12px;color:#FFF;width:19px;height:20px;line-height:20px;vertical-align:middle;text-align:center;border-width:0}.checkbox3.checkbox-check.checkbox-sm label::after{font-size:9px;line-height:12px;width:12px}.checkbox3.checkbox-check.checkbox-lg label::after{font-size:16px;line-height:26px;width:26px}.checkbox3.checkbox-check.checkbox-light label::after{color:#444}.checkbox3.checkbox-circle label::after,.checkbox3.checkbox-circle label::before{-moz-border-radius:20px;border-radius:20px}.checkbox3.checkbox-round label::after,.checkbox3.checkbox-round label::before,.checkbox3.checkbox-s1 label::after,.checkbox3.checkbox-s1 label::before{-moz-border-radius:4px;border-radius:4px}.checkbox3.checkbox-light label::before{background-color:transparent}.checkbox3.checkbox-light input:checked+label::before{background-color:transparent;border-color:#444}.checkbox3.checkbox-info input:checked+label::before{background-color:#2caef5;border-color:#2caef5}.checkbox3.checkbox-primary input:checked+label::before{background-color:#4183d7;border-color:#4183d7}.checkbox3.checkbox-success input:checked+label::before{background-color:#36b846;border-color:#36b846}.checkbox3.checkbox-warning input:checked+label::before{background-color:#ff9c00;border-color:#ff9c00}.checkbox3.checkbox-danger input:checked+label::before{background-color:#e50011;border-color:#e50011}.checkbox3.checkbox-primary.checkbox-light input:checked+label::before{background-color:transparent;border-color:#4183d7}.checkbox3.checkbox-primary.checkbox-light input:checked+label::after{color:#4183d7}.checkbox3.checkbox-info.checkbox-light input:checked+label::before{background-color:transparent;border-color:#2caef5}.checkbox3.checkbox-info.checkbox-light input:checked+label::after{color:#2caef5}.checkbox3.checkbox-success.checkbox-light input:checked+label::before{background-color:transparent;border-color:#36b846}.checkbox3.checkbox-success.checkbox-light input:checked+label::after{color:#36b846}.checkbox3.checkbox-warning.checkbox-light input:checked+label::before{background-color:transparent;border-color:#ff9c00}.checkbox3.checkbox-warning.checkbox-light input:checked+label::after{color:#ff9c00}.checkbox3.checkbox-danger.checkbox-light input:checked+label::before{background-color:transparent;border-color:#e50011}.checkbox3.checkbox-danger.checkbox-light input:checked+label::after{color:#e50011}.radio3{position:relative}.radio3 input{position:absolute;left:-9999px}.radio3 label{display:block;position:relative;padding:11px 0 11px 30px;font-size:12px;margin-bottom:0;margin-top:-4px}.radio3 label::after,.radio3 label::before{content:'';display:block;position:absolute;top:10px;bottom:10px;left:0}.radio3 label::before{width:21px;height:21px;border:1px solid #CCC;-webkit-transition:background-color .2s;-moz-transition:background-color .2s;transition:background-color .2s}.radio3 label::after{width:19px;height:19px;border:12px solid #FFF;margin:1px;-webkit-transition:all 50ms;-moz-transition:all 50ms;transition:all 50ms;opacity:0}.radio3 input:checked+label::before{font-family:FontAwesome;border-width:1px;border-style:solid;background-color:#444;border-color:#444;color:#fff}.radio3 input:checked+label::after{border:3px solid #FFF;opacity:1}.radio3.radio-check label::after,.radio3.radio-check.radio-light label::after{content:"\f00c";font-family:FontAwesome;color:#FFF;width:19px;height:20px;line-height:20px;vertical-align:middle;text-align:center;border-width:0}.radio3 label::after,.radio3 label::before{-moz-border-radius:20px;border-radius:20px}.radio3.radio-check input:checked+label::after{border-width:0}.radio3.radio-check.radio-light input:checked+label::before{background-color:transparent}.radio3.radio-check.radio-light input:checked+label::after{border-width:0;color:#444}.radio3.radio-sm label{padding:8px 0 8px 22px}.radio3.radio-sm label::before{width:14px;height:14px;line-height:14px}.radio3.radio-sm label::after{width:12px;height:12px}.radio3.radio-lg label{padding:15px 0 15px 40px}.radio3.radio-lg label::before{width:28px;height:27px;line-height:24px}.radio3.radio-lg label::after{width:26px;height:25px}.radio3.radio-check.radio-sm label::after{font-size:9px;line-height:12px;width:12px}.radio3.radio-check.radio-lg label::after{font-size:16px;line-height:26px;width:26px}.radio3.radio-primary input:checked+label::before{background-color:#4183d7;border-color:#4183d7}.radio3.radio-info input:checked+label::before{background-color:#2caef5;border-color:#2caef5}.radio3.radio-success input:checked+label::before{background-color:#36b846;border-color:#36b846}.radio3.radio-warning input:checked+label::before{background-color:#ff9c00;border-color:#ff9c00}.radio3.radio-danger input:checked+label::before{background-color:#e50011;border-color:#e50011}.radio3.radio-primary.radio-light input:checked+label::before{background-color:transparent}.radio3.radio-primary.radio-light input:checked+label::after{color:#4183d7}.radio3.radio-info.radio-light input:checked+label::before{background-color:transparent}.radio3.radio-info.radio-light input:checked+label::after{color:#2caef5}.radio3.radio-success.radio-light input:checked+label::before{background-color:transparent}.radio3.radio-success.radio-light input:checked+label::after{color:#36b846}.radio3.radio-warning.radio-light input:checked+label::before{background-color:transparent}.radio3.radio-warning.radio-light input:checked+label::after{color:#ff9c00}.radio3.radio-danger.radio-light input:checked+label::before{background-color:transparent}.radio3.radio-danger.radio-light input:checked+label::after{color:#e50011} -------------------------------------------------------------------------------- /EmbedSample/lib/js/es6-promise.auto.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * es6-promise.auto.js 3 | * Version: 4.0.5 4 | * 5 | * Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors 6 | * Released under the MIT license 7 | * https://github.com/stefanpenner/es6-promise/blob/master/LICENSE 8 | */ 9 | !function (t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : t.ES6Promise = e() }(this, function () { "use strict"; function t(t) { return "function" == typeof t || "object" == typeof t && null !== t } function e(t) { return "function" == typeof t } function n(t) { I = t } function r(t) { J = t } function o() { return function () { return process.nextTick(a) } } function i() { return "undefined" != typeof H ? function () { H(a) } : c() } function s() { var t = 0, e = new V(a), n = document.createTextNode(""); return e.observe(n, { characterData: !0 }), function () { n.data = t = ++t % 2 } } function u() { var t = new MessageChannel; return t.port1.onmessage = a, function () { return t.port2.postMessage(0) } } function c() { var t = setTimeout; return function () { return t(a, 1) } } function a() { for (var t = 0; t < G; t += 2) { var e = $[t], n = $[t + 1]; e(n), $[t] = void 0, $[t + 1] = void 0 } G = 0 } function f() { try { var t = require, e = t("vertx"); return H = e.runOnLoop || e.runOnContext, i() } catch (n) { return c() } } function l(t, e) { var n = arguments, r = this, o = new this.constructor(p); void 0 === o[et] && k(o); var i = r._state; return i ? !function () { var t = n[i - 1]; J(function () { return x(i, o, t, r._result) }) }() : E(r, o, t, e), o } function h(t) { var e = this; if (t && "object" == typeof t && t.constructor === e) return t; var n = new e(p); return g(n, t), n } function p() { } function v() { return new TypeError("You cannot resolve a promise with itself") } function d() { return new TypeError("A promises callback cannot return that same promise.") } function _(t) { try { return t.then } catch (e) { return it.error = e, it } } function y(t, e, n, r) { try { t.call(e, n, r) } catch (o) { return o } } function m(t, e, n) { J(function (t) { var r = !1, o = y(n, e, function (n) { r || (r = !0, e !== n ? g(t, n) : S(t, n)) }, function (e) { r || (r = !0, j(t, e)) }, "Settle: " + (t._label || " unknown promise")); !r && o && (r = !0, j(t, o)) }, t) } function b(t, e) { e._state === rt ? S(t, e._result) : e._state === ot ? j(t, e._result) : E(e, void 0, function (e) { return g(t, e) }, function (e) { return j(t, e) }) } function w(t, n, r) { n.constructor === t.constructor && r === l && n.constructor.resolve === h ? b(t, n) : r === it ? j(t, it.error) : void 0 === r ? S(t, n) : e(r) ? m(t, n, r) : S(t, n) } function g(e, n) { e === n ? j(e, v()) : t(n) ? w(e, n, _(n)) : S(e, n) } function A(t) { t._onerror && t._onerror(t._result), P(t) } function S(t, e) { t._state === nt && (t._result = e, t._state = rt, 0 !== t._subscribers.length && J(P, t)) } function j(t, e) { t._state === nt && (t._state = ot, t._result = e, J(A, t)) } function E(t, e, n, r) { var o = t._subscribers, i = o.length; t._onerror = null, o[i] = e, o[i + rt] = n, o[i + ot] = r, 0 === i && t._state && J(P, t) } function P(t) { var e = t._subscribers, n = t._state; if (0 !== e.length) { for (var r = void 0, o = void 0, i = t._result, s = 0; s < e.length; s += 3) r = e[s], o = e[s + n], r ? x(n, r, o, i) : o(i); t._subscribers.length = 0 } } function T() { this.error = null } function M(t, e) { try { return t(e) } catch (n) { return st.error = n, st } } function x(t, n, r, o) { var i = e(r), s = void 0, u = void 0, c = void 0, a = void 0; if (i) { if (s = M(r, o), s === st ? (a = !0, u = s.error, s = null) : c = !0, n === s) return void j(n, d()) } else s = o, c = !0; n._state !== nt || (i && c ? g(n, s) : a ? j(n, u) : t === rt ? S(n, s) : t === ot && j(n, s)) } function C(t, e) { try { e(function (e) { g(t, e) }, function (e) { j(t, e) }) } catch (n) { j(t, n) } } function O() { return ut++ } function k(t) { t[et] = ut++, t._state = void 0, t._result = void 0, t._subscribers = [] } function Y(t, e) { this._instanceConstructor = t, this.promise = new t(p), this.promise[et] || k(this.promise), B(e) ? (this._input = e, this.length = e.length, this._remaining = e.length, this._result = new Array(this.length), 0 === this.length ? S(this.promise, this._result) : (this.length = this.length || 0, this._enumerate(), 0 === this._remaining && S(this.promise, this._result))) : j(this.promise, q()) } function q() { return new Error("Array Methods must be provided an Array") } function F(t) { return new Y(this, t).promise } function D(t) { var e = this; return new e(B(t) ? function (n, r) { for (var o = t.length, i = 0; i < o; i++) e.resolve(t[i]).then(n, r) } : function (t, e) { return e(new TypeError("You must pass an array to race.")) }) } function K(t) { var e = this, n = new e(p); return j(n, t), n } function L() { throw new TypeError("You must pass a resolver function as the first argument to the promise constructor") } function N() { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.") } function U(t) { this[et] = O(), this._result = this._state = void 0, this._subscribers = [], p !== t && ("function" != typeof t && L(), this instanceof U ? C(this, t) : N()) } function W() { var t = void 0; if ("undefined" != typeof global) t = global; else if ("undefined" != typeof self) t = self; else try { t = Function("return this")() } catch (e) { throw new Error("polyfill failed because global object is unavailable in this environment") } var n = t.Promise; if (n) { var r = null; try { r = Object.prototype.toString.call(n.resolve()) } catch (e) { } if ("[object Promise]" === r && !n.cast) return } t.Promise = U } var z = void 0; z = Array.isArray ? Array.isArray : function (t) { return "[object Array]" === Object.prototype.toString.call(t) }; var B = z, G = 0, H = void 0, I = void 0, J = function (t, e) { $[G] = t, $[G + 1] = e, G += 2, 2 === G && (I ? I(a) : tt()) }, Q = "undefined" != typeof window ? window : void 0, R = Q || {}, V = R.MutationObserver || R.WebKitMutationObserver, X = "undefined" == typeof self && "undefined" != typeof process && "[object process]" === {}.toString.call(process), Z = "undefined" != typeof Uint8ClampedArray && "undefined" != typeof importScripts && "undefined" != typeof MessageChannel, $ = new Array(1e3), tt = void 0; tt = X ? o() : V ? s() : Z ? u() : void 0 === Q && "function" == typeof require ? f() : c(); var et = Math.random().toString(36).substring(16), nt = void 0, rt = 1, ot = 2, it = new T, st = new T, ut = 0; return Y.prototype._enumerate = function () { for (var t = this.length, e = this._input, n = 0; this._state === nt && n < t; n++) this._eachEntry(e[n], n) }, Y.prototype._eachEntry = function (t, e) { var n = this._instanceConstructor, r = n.resolve; if (r === h) { var o = _(t); if (o === l && t._state !== nt) this._settledAt(t._state, e, t._result); else if ("function" != typeof o) this._remaining--, this._result[e] = t; else if (n === U) { var i = new n(p); w(i, t, o), this._willSettleAt(i, e) } else this._willSettleAt(new n(function (e) { return e(t) }), e) } else this._willSettleAt(r(t), e) }, Y.prototype._settledAt = function (t, e, n) { var r = this.promise; r._state === nt && (this._remaining--, t === ot ? j(r, n) : this._result[e] = n), 0 === this._remaining && S(r, this._result) }, Y.prototype._willSettleAt = function (t, e) { var n = this; E(t, void 0, function (t) { return n._settledAt(rt, e, t) }, function (t) { return n._settledAt(ot, e, t) }) }, U.all = F, U.race = D, U.resolve = h, U.reject = K, U._setScheduler = n, U._setAsap = r, U._asap = J, U.prototype = { constructor: U, then: l, "catch": function (t) { return this.then(null, t) } }, U.polyfill = W, U.Promise = U, U }), ES6Promise.polyfill(); -------------------------------------------------------------------------------- /EmbedSample/Views/Dashboard/Report.cshtml: -------------------------------------------------------------------------------- 1 | @model ReportViewModel 2 | 3 | @section Breadcrumbs { 4 | 9 | } 10 | 71 | 72 | @section PageScripts { 73 | 193 | } -------------------------------------------------------------------------------- /EmbedSample/Views/Dashboard/Index.cshtml: -------------------------------------------------------------------------------- 1 | @section Breadcrumbs{ 2 | 5 | } 6 | 7 |
    8 | @Html.PowerBIAccessToken() 9 | 67 |
    68 |
    69 |
    70 |
    71 |
    72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 | 79 |
    80 |

    Thumbnail label

    81 |

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    82 |

    Button Button

    83 |
    84 |
    85 |
    86 |
    87 |
    88 | 89 |
    90 |

    Thumbnail label

    91 |

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    92 |

    Button Button

    93 |
    94 |
    95 |
    96 |
    97 |
    98 | 171 |
    172 |
    -------------------------------------------------------------------------------- /EmbedSample/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Contoso 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
    26 |
    27 | 106 | 133 | 134 |
    135 | @RenderBody() 136 |
    137 |
    138 |
    139 |
    140 | 2.1 © 2015 Copyright. 141 |
    142 |
    143 |
    144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | @RenderSection("PageScripts", false) 161 | 162 | 163 | -------------------------------------------------------------------------------- /EmbedSample/lib/css/jquery.dataTables.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc{cursor:pointer;*cursor:hand}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("../images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("../images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("../images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("../images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("../images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table,.dataTables_wrapper.no-footer div.dataTables_scrollBody table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}} 2 | -------------------------------------------------------------------------------- /ProvisionSample/ConsoleHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace ProvisionSample 6 | { 7 | public class Groups 8 | { 9 | //public Commands commands { get; private set; } 10 | 11 | public Tuple CurrentGroup { get; private set; } 12 | 13 | public Commands TopLevelCommands { get; private set; } 14 | 15 | private List> m_commandGroups { get; set; } 16 | 17 | public Groups() 18 | { 19 | m_commandGroups = new List>(); 20 | TopLevelCommands = new Commands(); 21 | } 22 | public void AddGroup(string name, Commands commands) 23 | { 24 | commands.RegisterCommand("Exit group", ExitGroup); 25 | m_commandGroups.Add(new Tuple(name, commands)); 26 | var groupNum = m_commandGroups.Count - 1; 27 | TopLevelCommands.RegisterCommand(name, () => SetGroup(groupNum)); 28 | } 29 | 30 | public Func GetCommand(bool switchGroup, int index) 31 | { 32 | if (!switchGroup && CurrentGroup != null) 33 | return CurrentGroup.Item2.GetCommand(index); 34 | 35 | return TopLevelCommands.GetCommand(index); 36 | } 37 | 38 | public Commands ToFlatCommands() 39 | { 40 | var commands = new Commands(); 41 | foreach (var commandGroup in m_commandGroups) 42 | { 43 | commands.Append(commandGroup.Item2, includeLast: false); 44 | } 45 | return commands; 46 | } 47 | 48 | private Task ExitGroup() 49 | { 50 | return Task.Run(() => { 51 | CurrentGroup = null; 52 | }); 53 | } 54 | 55 | private Task SetGroup(int group) 56 | { 57 | return Task.Run(() => { 58 | if (m_commandGroups.Count > group) 59 | { 60 | CurrentGroup = m_commandGroups[group]; 61 | } 62 | }); 63 | } 64 | } 65 | 66 | public class Commands 67 | { 68 | private readonly List>> m_commands = new List>>(); 69 | 70 | public void RegisterCommand(string description, Func operation) 71 | { 72 | m_commands.Add(Tuple.Create(description, operation)); 73 | } 74 | 75 | public void Append(Commands other, bool includeLast) 76 | { 77 | m_commands.AddRange(other.m_commands); 78 | if (!includeLast) 79 | { 80 | m_commands.RemoveAt(m_commands.Count - 1); 81 | } 82 | 83 | } 84 | 85 | public Func GetCommand(int commandNumber) 86 | { 87 | if (commandNumber >= m_commands.Count) 88 | { 89 | return null; 90 | } 91 | return m_commands[commandNumber].Item2; 92 | } 93 | 94 | public string GetCommandDescription(int commandNumber) 95 | { 96 | if (commandNumber >= m_commands.Count) 97 | { 98 | throw new Exception("Unknown command " + commandNumber); 99 | } 100 | return m_commands[commandNumber].Item1; 101 | } 102 | 103 | public int Count { get { return m_commands.Count; } } 104 | } 105 | 106 | /// 107 | /// Utilities for getting user insertion. To be overritten for processing scripts 108 | /// 109 | public class UserInput 110 | { 111 | public virtual int? EnsureIntParam(int? param, string desc, bool onlyFillIfEmpty = false, bool forceReEnter = false) 112 | { 113 | bool available = param.HasValue; 114 | if (onlyFillIfEmpty && available) 115 | { 116 | return param; 117 | } 118 | 119 | if (available) 120 | { 121 | ConsoleHelper.WriteColoredValue(desc, param.Value.ToString(), ConsoleColor.Magenta, forceReEnter ? ". Re-Enter same, or new int value:" : ". Press enter to use, or give new int value:"); 122 | } 123 | else 124 | { 125 | Console.Write(desc + " is required. Enter int value:"); 126 | } 127 | 128 | var entered = Console.ReadLine(); 129 | int val; 130 | if (!string.IsNullOrWhiteSpace(entered)) 131 | { 132 | if (!Int32.TryParse(entered, out val)) 133 | { 134 | Console.WriteLine("illegal int value:[" + entered + "]"); 135 | return null; 136 | } 137 | param = val; 138 | } 139 | return param; 140 | } 141 | 142 | public virtual string EnsureParam(string param, string desc, bool onlyFillIfEmpty = false, bool forceReEnter = false, bool isPassword = false) 143 | { 144 | bool available = !string.IsNullOrWhiteSpace(param); 145 | if (onlyFillIfEmpty && available) 146 | { 147 | return param; 148 | } 149 | 150 | if (available) 151 | { 152 | ConsoleHelper.WriteColoredValue(desc, param, ConsoleColor.Magenta, forceReEnter ? ". Re-Enter same, or new value:" : ". Press enter to use, or give new value:"); 153 | } 154 | else 155 | { 156 | Console.Write(desc + " is required. Enter value:"); 157 | } 158 | 159 | var entered = isPassword ? ConsoleHelper.ReadPassword() : Console.ReadLine(); 160 | 161 | if (!string.IsNullOrWhiteSpace(entered)) 162 | { 163 | param = entered; 164 | } 165 | 166 | return param; 167 | } 168 | 169 | public virtual string EnterOptionalParam(string desc, string skipResultDescription) 170 | { 171 | ConsoleHelper.WriteColoredValue(desc + " (optional). Enter value (or press Enter to ", skipResultDescription, ConsoleColor.Magenta, "):"); 172 | 173 | var entered = Console.ReadLine(); 174 | Console.WriteLine(); 175 | if (!string.IsNullOrWhiteSpace(entered)) 176 | { 177 | return entered; 178 | } 179 | 180 | return null; 181 | } 182 | public virtual string ManageCachedParam(string param, string desc, bool forceReset = false) 183 | { 184 | if (forceReset) 185 | { 186 | return null; 187 | } 188 | 189 | if (!string.IsNullOrWhiteSpace(param)) 190 | { 191 | ConsoleHelper.WriteColoredValue(desc, param, ConsoleColor.Magenta, ". Enter 'Y': to Reset, 'A': to assign, Q: to Quit, Any another key to skip:"); 192 | } 193 | else 194 | { 195 | ConsoleHelper.WriteColoredValue(desc, param, ConsoleColor.Magenta, ". Enter 'A': to assign, Q: to Quit, Any another key to skip:"); 196 | } 197 | var ch = Char.ToUpper(Console.ReadKey().KeyChar); 198 | Console.WriteLine(); 199 | switch (ch) 200 | { 201 | case 'Y': 202 | return null; 203 | case 'A': 204 | param = EnsureParam(null, desc); 205 | break; 206 | case 'Q': 207 | throw new Exception(string.Format("Quit managing cache when on '{0}', value ={1}", desc, param)); 208 | default: 209 | break; 210 | } 211 | return param; 212 | } 213 | 214 | public virtual void GetUserCommandSelection(out bool switchGroup, out int? numericCommand) 215 | { 216 | numericCommand = null; 217 | while (true) 218 | { 219 | var command = Console.ReadLine(); 220 | if (string.IsNullOrEmpty(command)) 221 | { 222 | Console.WriteLine("No input. Try again"); 223 | continue; 224 | } 225 | 226 | int val; 227 | if(command[0] == '#') 228 | { 229 | switchGroup = true; 230 | command = command.TrimStart('#'); 231 | } 232 | else 233 | { 234 | switchGroup = false; 235 | } 236 | 237 | if (int.TryParse(command, out val)) 238 | { 239 | numericCommand = val; 240 | return; 241 | } 242 | 243 | Console.WriteLine("Illegal input. Try again"); 244 | } 245 | } 246 | } 247 | 248 | /// 249 | /// 250 | /// 251 | public static class ConsoleHelper 252 | { 253 | public static void PrintCommands(Groups group) 254 | { 255 | Console.WriteLine(); 256 | WriteColoredValue("What do you want to do (select ", "numeric", ConsoleColor.Green, " value)?", showEquals:false, newLine:true); 257 | Commands commands; 258 | if (group.CurrentGroup != null) 259 | { 260 | WriteColoredValue("Current group", group.CurrentGroup.Item1, ConsoleColor.Magenta, newLine:true); 261 | WriteColoredValue("You can use ", "#1, #2 ... ", ConsoleColor.Green, "to quickly switch to another group", showEquals:false, newLine:true); 262 | commands = group.CurrentGroup.Item2; 263 | } 264 | else 265 | { 266 | Console.WriteLine("Select command group:"); 267 | commands = group.TopLevelCommands; 268 | } 269 | Console.WriteLine("================================================================="); 270 | PrintCommandsImpl(commands); 271 | } 272 | 273 | public static void PrintCommands(Commands commands) 274 | { 275 | Console.WriteLine(); 276 | WriteColoredValue("What do you want to do (select ", "numeric", ConsoleColor.Green, " value)?", showEquals: false, newLine: true); 277 | PrintCommandsImpl(commands); 278 | } 279 | 280 | public static void WriteColoredStringLine(string text, ConsoleColor color, int coloredChars) 281 | { 282 | Console.ForegroundColor = color; 283 | Console.Write(text.Substring(0, coloredChars)); 284 | Console.ResetColor(); 285 | Console.WriteLine(text.Substring(coloredChars)); 286 | } 287 | 288 | public static void WriteColoredValue(string desc, string param, ConsoleColor color, string restOfLine = null, bool showEquals = true, bool newLine = false) 289 | { 290 | Console.Write(desc); 291 | if (showEquals) 292 | { 293 | Console.Write(" = "); 294 | } 295 | 296 | Console.ForegroundColor = color; 297 | Console.Write(param); 298 | Console.ResetColor(); 299 | if (restOfLine != null) 300 | Console.Write(restOfLine); 301 | 302 | if(newLine) 303 | { 304 | Console.WriteLine(); 305 | } 306 | } 307 | 308 | public static string ReadPassword() 309 | { 310 | ConsoleKeyInfo key; 311 | var password = string.Empty; 312 | 313 | do 314 | { 315 | key = Console.ReadKey(true); 316 | if (key.Key != ConsoleKey.Backspace && key.Key != ConsoleKey.Enter) 317 | { 318 | password += key.KeyChar; 319 | Console.Write("*"); 320 | } 321 | else 322 | { 323 | if (key.Key == ConsoleKey.Backspace && password.Length > 0) 324 | { 325 | password = password.Substring(0, (password.Length - 1)); 326 | Console.Write("\b \b"); 327 | } 328 | } 329 | } 330 | // Stops Receving Keys Once Enter is Pressed 331 | while (key.Key != ConsoleKey.Enter); 332 | 333 | Console.WriteLine(); 334 | return password; 335 | } 336 | 337 | private static void PrintCommandsImpl(Commands commands) 338 | { 339 | for (int i = 0; i < commands.Count; i++) 340 | { 341 | var numericSize = i < 9 ? 1 : ((i < 99) ? 2 : 3); 342 | var align = i < 9 ? " " : ""; 343 | WriteColoredStringLine(string.Format("{0} {1} {2}", i + 1, align, commands.GetCommandDescription(i)), ConsoleColor.Green, numericSize); 344 | } 345 | Console.WriteLine(); 346 | } 347 | } 348 | 349 | public enum ExecutionLevel 350 | { 351 | OK, 352 | Warning, 353 | Error 354 | }; 355 | 356 | public class ExecutionReport 357 | { 358 | public ExecutionLevel m_level; 359 | public string m_message; 360 | 361 | public ExecutionReport(ExecutionLevel level, string message) 362 | { 363 | m_level = level; 364 | m_message = message; 365 | } 366 | 367 | public override string ToString() 368 | { 369 | return (m_level == ExecutionLevel.OK) ? m_message : string.Format("{0}: {1}", m_level.ToString(), m_message); 370 | } 371 | } 372 | } 373 | -------------------------------------------------------------------------------- /EmbedSample/lib/js/bootstrap-switch.min.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * bootstrap-switch - v3.3.2 3 | * http://www.bootstrap-switch.org 4 | * ======================================================================== 5 | * Copyright 2012-2013 Mattia Larentis 6 | * 7 | * ======================================================================== 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * ======================================================================== 20 | */ 21 | 22 | (function(){var t=[].slice;!function(e,i){"use strict";var n;return n=function(){function t(t,i){null==i&&(i={}),this.$element=e(t),this.options=e.extend({},e.fn.bootstrapSwitch.defaults,{state:this.$element.is(":checked"),size:this.$element.data("size"),animate:this.$element.data("animate"),disabled:this.$element.is(":disabled"),readonly:this.$element.is("[readonly]"),indeterminate:this.$element.data("indeterminate"),inverse:this.$element.data("inverse"),radioAllOff:this.$element.data("radio-all-off"),onColor:this.$element.data("on-color"),offColor:this.$element.data("off-color"),onText:this.$element.data("on-text"),offText:this.$element.data("off-text"),labelText:this.$element.data("label-text"),handleWidth:this.$element.data("handle-width"),labelWidth:this.$element.data("label-width"),baseClass:this.$element.data("base-class"),wrapperClass:this.$element.data("wrapper-class")},i),this.$wrapper=e("
    ",{"class":function(t){return function(){var e;return e=[""+t.options.baseClass].concat(t._getClasses(t.options.wrapperClass)),e.push(t.options.state?""+t.options.baseClass+"-on":""+t.options.baseClass+"-off"),null!=t.options.size&&e.push(""+t.options.baseClass+"-"+t.options.size),t.options.disabled&&e.push(""+t.options.baseClass+"-disabled"),t.options.readonly&&e.push(""+t.options.baseClass+"-readonly"),t.options.indeterminate&&e.push(""+t.options.baseClass+"-indeterminate"),t.options.inverse&&e.push(""+t.options.baseClass+"-inverse"),t.$element.attr("id")&&e.push(""+t.options.baseClass+"-id-"+t.$element.attr("id")),e.join(" ")}}(this)()}),this.$container=e("
    ",{"class":""+this.options.baseClass+"-container"}),this.$on=e("",{html:this.options.onText,"class":""+this.options.baseClass+"-handle-on "+this.options.baseClass+"-"+this.options.onColor}),this.$off=e("",{html:this.options.offText,"class":""+this.options.baseClass+"-handle-off "+this.options.baseClass+"-"+this.options.offColor}),this.$label=e("",{html:this.options.labelText,"class":""+this.options.baseClass+"-label"}),this.$element.on("init.bootstrapSwitch",function(e){return function(){return e.options.onInit.apply(t,arguments)}}(this)),this.$element.on("switchChange.bootstrapSwitch",function(e){return function(){return e.options.onSwitchChange.apply(t,arguments)}}(this)),this.$container=this.$element.wrap(this.$container).parent(),this.$wrapper=this.$container.wrap(this.$wrapper).parent(),this.$element.before(this.options.inverse?this.$off:this.$on).before(this.$label).before(this.options.inverse?this.$on:this.$off),this.options.indeterminate&&this.$element.prop("indeterminate",!0),this._init(),this._elementHandlers(),this._handleHandlers(),this._labelHandlers(),this._formHandler(),this._externalLabelHandler(),this.$element.trigger("init.bootstrapSwitch")}return t.prototype._constructor=t,t.prototype.state=function(t,e){return"undefined"==typeof t?this.options.state:this.options.disabled||this.options.readonly?this.$element:this.options.state&&!this.options.radioAllOff&&this.$element.is(":radio")?this.$element:(this.options.indeterminate&&this.indeterminate(!1),t=!!t,this.$element.prop("checked",t).trigger("change.bootstrapSwitch",e),this.$element)},t.prototype.toggleState=function(t){return this.options.disabled||this.options.readonly?this.$element:this.options.indeterminate?(this.indeterminate(!1),this.state(!0)):this.$element.prop("checked",!this.options.state).trigger("change.bootstrapSwitch",t)},t.prototype.size=function(t){return"undefined"==typeof t?this.options.size:(null!=this.options.size&&this.$wrapper.removeClass(""+this.options.baseClass+"-"+this.options.size),t&&this.$wrapper.addClass(""+this.options.baseClass+"-"+t),this._width(),this._containerPosition(),this.options.size=t,this.$element)},t.prototype.animate=function(t){return"undefined"==typeof t?this.options.animate:(t=!!t,t===this.options.animate?this.$element:this.toggleAnimate())},t.prototype.toggleAnimate=function(){return this.options.animate=!this.options.animate,this.$wrapper.toggleClass(""+this.options.baseClass+"-animate"),this.$element},t.prototype.disabled=function(t){return"undefined"==typeof t?this.options.disabled:(t=!!t,t===this.options.disabled?this.$element:this.toggleDisabled())},t.prototype.toggleDisabled=function(){return this.options.disabled=!this.options.disabled,this.$element.prop("disabled",this.options.disabled),this.$wrapper.toggleClass(""+this.options.baseClass+"-disabled"),this.$element},t.prototype.readonly=function(t){return"undefined"==typeof t?this.options.readonly:(t=!!t,t===this.options.readonly?this.$element:this.toggleReadonly())},t.prototype.toggleReadonly=function(){return this.options.readonly=!this.options.readonly,this.$element.prop("readonly",this.options.readonly),this.$wrapper.toggleClass(""+this.options.baseClass+"-readonly"),this.$element},t.prototype.indeterminate=function(t){return"undefined"==typeof t?this.options.indeterminate:(t=!!t,t===this.options.indeterminate?this.$element:this.toggleIndeterminate())},t.prototype.toggleIndeterminate=function(){return this.options.indeterminate=!this.options.indeterminate,this.$element.prop("indeterminate",this.options.indeterminate),this.$wrapper.toggleClass(""+this.options.baseClass+"-indeterminate"),this._containerPosition(),this.$element},t.prototype.inverse=function(t){return"undefined"==typeof t?this.options.inverse:(t=!!t,t===this.options.inverse?this.$element:this.toggleInverse())},t.prototype.toggleInverse=function(){var t,e;return this.$wrapper.toggleClass(""+this.options.baseClass+"-inverse"),e=this.$on.clone(!0),t=this.$off.clone(!0),this.$on.replaceWith(t),this.$off.replaceWith(e),this.$on=t,this.$off=e,this.options.inverse=!this.options.inverse,this.$element},t.prototype.onColor=function(t){var e;return e=this.options.onColor,"undefined"==typeof t?e:(null!=e&&this.$on.removeClass(""+this.options.baseClass+"-"+e),this.$on.addClass(""+this.options.baseClass+"-"+t),this.options.onColor=t,this.$element)},t.prototype.offColor=function(t){var e;return e=this.options.offColor,"undefined"==typeof t?e:(null!=e&&this.$off.removeClass(""+this.options.baseClass+"-"+e),this.$off.addClass(""+this.options.baseClass+"-"+t),this.options.offColor=t,this.$element)},t.prototype.onText=function(t){return"undefined"==typeof t?this.options.onText:(this.$on.html(t),this._width(),this._containerPosition(),this.options.onText=t,this.$element)},t.prototype.offText=function(t){return"undefined"==typeof t?this.options.offText:(this.$off.html(t),this._width(),this._containerPosition(),this.options.offText=t,this.$element)},t.prototype.labelText=function(t){return"undefined"==typeof t?this.options.labelText:(this.$label.html(t),this._width(),this.options.labelText=t,this.$element)},t.prototype.handleWidth=function(t){return"undefined"==typeof t?this.options.handleWidth:(this.options.handleWidth=t,this._width(),this._containerPosition(),this.$element)},t.prototype.labelWidth=function(t){return"undefined"==typeof t?this.options.labelWidth:(this.options.labelWidth=t,this._width(),this._containerPosition(),this.$element)},t.prototype.baseClass=function(){return this.options.baseClass},t.prototype.wrapperClass=function(t){return"undefined"==typeof t?this.options.wrapperClass:(t||(t=e.fn.bootstrapSwitch.defaults.wrapperClass),this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" ")),this.$wrapper.addClass(this._getClasses(t).join(" ")),this.options.wrapperClass=t,this.$element)},t.prototype.radioAllOff=function(t){return"undefined"==typeof t?this.options.radioAllOff:(t=!!t,t===this.options.radioAllOff?this.$element:(this.options.radioAllOff=t,this.$element))},t.prototype.onInit=function(t){return"undefined"==typeof t?this.options.onInit:(t||(t=e.fn.bootstrapSwitch.defaults.onInit),this.options.onInit=t,this.$element)},t.prototype.onSwitchChange=function(t){return"undefined"==typeof t?this.options.onSwitchChange:(t||(t=e.fn.bootstrapSwitch.defaults.onSwitchChange),this.options.onSwitchChange=t,this.$element)},t.prototype.destroy=function(){var t;return t=this.$element.closest("form"),t.length&&t.off("reset.bootstrapSwitch").removeData("bootstrap-switch"),this.$container.children().not(this.$element).remove(),this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch"),this.$element},t.prototype._width=function(){var t,e;return t=this.$on.add(this.$off),t.add(this.$label).css("width",""),e="auto"===this.options.handleWidth?Math.max(this.$on.width(),this.$off.width()):this.options.handleWidth,t.width(e),this.$label.width(function(t){return function(i,n){return"auto"!==t.options.labelWidth?t.options.labelWidth:e>n?e:n}}(this)),this._handleWidth=this.$on.outerWidth(),this._labelWidth=this.$label.outerWidth(),this.$container.width(2*this._handleWidth+this._labelWidth),this.$wrapper.width(this._handleWidth+this._labelWidth)},t.prototype._containerPosition=function(t,e){return null==t&&(t=this.options.state),this.$container.css("margin-left",function(e){return function(){var i;return i=[0,"-"+e._handleWidth+"px"],e.options.indeterminate?"-"+e._handleWidth/2+"px":t?e.options.inverse?i[1]:i[0]:e.options.inverse?i[0]:i[1]}}(this)),e?setTimeout(function(){return e()},50):void 0},t.prototype._init=function(){var t,e;return t=function(t){return function(){return t._width(),t._containerPosition(null,function(){return t.options.animate?t.$wrapper.addClass(""+t.options.baseClass+"-animate"):void 0})}}(this),this.$wrapper.is(":visible")?t():e=i.setInterval(function(n){return function(){return n.$wrapper.is(":visible")?(t(),i.clearInterval(e)):void 0}}(this),50)},t.prototype._elementHandlers=function(){return this.$element.on({"change.bootstrapSwitch":function(t){return function(i,n){var o;return i.preventDefault(),i.stopImmediatePropagation(),o=t.$element.is(":checked"),t._containerPosition(o),o!==t.options.state?(t.options.state=o,t.$wrapper.toggleClass(""+t.options.baseClass+"-off").toggleClass(""+t.options.baseClass+"-on"),n?void 0:(t.$element.is(":radio")&&e("[name='"+t.$element.attr("name")+"']").not(t.$element).prop("checked",!1).trigger("change.bootstrapSwitch",!0),t.$element.trigger("switchChange.bootstrapSwitch",[o]))):void 0}}(this),"focus.bootstrapSwitch":function(t){return function(e){return e.preventDefault(),t.$wrapper.addClass(""+t.options.baseClass+"-focused")}}(this),"blur.bootstrapSwitch":function(t){return function(e){return e.preventDefault(),t.$wrapper.removeClass(""+t.options.baseClass+"-focused")}}(this),"keydown.bootstrapSwitch":function(t){return function(e){if(e.which&&!t.options.disabled&&!t.options.readonly)switch(e.which){case 37:return e.preventDefault(),e.stopImmediatePropagation(),t.state(!1);case 39:return e.preventDefault(),e.stopImmediatePropagation(),t.state(!0)}}}(this)})},t.prototype._handleHandlers=function(){return this.$on.on("click.bootstrapSwitch",function(t){return function(e){return e.preventDefault(),e.stopPropagation(),t.state(!1),t.$element.trigger("focus.bootstrapSwitch")}}(this)),this.$off.on("click.bootstrapSwitch",function(t){return function(e){return e.preventDefault(),e.stopPropagation(),t.state(!0),t.$element.trigger("focus.bootstrapSwitch")}}(this))},t.prototype._labelHandlers=function(){return this.$label.on({"mousedown.bootstrapSwitch touchstart.bootstrapSwitch":function(t){return function(e){return t._dragStart||t.options.disabled||t.options.readonly?void 0:(e.preventDefault(),e.stopPropagation(),t._dragStart=(e.pageX||e.originalEvent.touches[0].pageX)-parseInt(t.$container.css("margin-left"),10),t.options.animate&&t.$wrapper.removeClass(""+t.options.baseClass+"-animate"),t.$element.trigger("focus.bootstrapSwitch"))}}(this),"mousemove.bootstrapSwitch touchmove.bootstrapSwitch":function(t){return function(e){var i;if(null!=t._dragStart&&(e.preventDefault(),i=(e.pageX||e.originalEvent.touches[0].pageX)-t._dragStart,!(i<-t._handleWidth||i>0)))return t._dragEnd=i,t.$container.css("margin-left",""+t._dragEnd+"px")}}(this),"mouseup.bootstrapSwitch touchend.bootstrapSwitch":function(t){return function(e){var i;if(t._dragStart)return e.preventDefault(),t.options.animate&&t.$wrapper.addClass(""+t.options.baseClass+"-animate"),t._dragEnd?(i=t._dragEnd>-(t._handleWidth/2),t._dragEnd=!1,t.state(t.options.inverse?!i:i)):t.state(!t.options.state),t._dragStart=!1}}(this),"mouseleave.bootstrapSwitch":function(t){return function(){return t.$label.trigger("mouseup.bootstrapSwitch")}}(this)})},t.prototype._externalLabelHandler=function(){var t;return t=this.$element.closest("label"),t.on("click",function(e){return function(i){return i.preventDefault(),i.stopImmediatePropagation(),i.target===t[0]?e.toggleState():void 0}}(this))},t.prototype._formHandler=function(){var t;return t=this.$element.closest("form"),t.data("bootstrap-switch")?void 0:t.on("reset.bootstrapSwitch",function(){return i.setTimeout(function(){return t.find("input").filter(function(){return e(this).data("bootstrap-switch")}).each(function(){return e(this).bootstrapSwitch("state",this.checked)})},1)}).data("bootstrap-switch",!0)},t.prototype._getClasses=function(t){var i,n,o,s;if(!e.isArray(t))return[""+this.options.baseClass+"-"+t];for(n=[],o=0,s=t.length;s>o;o++)i=t[o],n.push(""+this.options.baseClass+"-"+i);return n},t}(),e.fn.bootstrapSwitch=function(){var i,o,s;return o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],s=this,this.each(function(){var t,a;return t=e(this),a=t.data("bootstrap-switch"),a||t.data("bootstrap-switch",a=new n(this,o)),"string"==typeof o?s=a[o].apply(a,i):void 0}),s},e.fn.bootstrapSwitch.Constructor=n,e.fn.bootstrapSwitch.defaults={state:!0,size:null,animate:!0,disabled:!1,readonly:!1,indeterminate:!1,inverse:!1,radioAllOff:!1,onColor:"primary",offColor:"default",onText:"ON",offText:"OFF",labelText:" ",handleWidth:"auto",labelWidth:"auto",baseClass:"bootstrap-switch",wrapperClass:"wrapper",onInit:function(){},onSwitchChange:function(){}}}(window.jQuery,window)}).call(this); -------------------------------------------------------------------------------- /EmbedSample/lib/css/select2.min.css: -------------------------------------------------------------------------------- 1 | .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid #000 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} 2 | -------------------------------------------------------------------------------- /EmbedSample/EmbedSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Debug 8 | AnyCPU 9 | 10 | 11 | 2.0 12 | {AB04A4B2-0AE2-4278-AAD8-4727C1D04677} 13 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 14 | Library 15 | Properties 16 | paas_demo 17 | paas-demo 18 | v4.5 19 | true 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | true 30 | full 31 | false 32 | bin\ 33 | DEBUG;TRACE 34 | prompt 35 | 4 36 | 37 | 38 | pdbonly 39 | true 40 | bin\ 41 | TRACE 42 | prompt 43 | 4 44 | 45 | 46 | 47 | ..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll 48 | True 49 | 50 | 51 | ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll 52 | True 53 | 54 | 55 | 56 | ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll 57 | True 58 | 59 | 60 | ..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll 61 | True 62 | 63 | 64 | ..\packages\Microsoft.PowerBI.Api.1.1.11\lib\portable-net45+win+wpa81+MonoAndroid10+MonoTouch10+xamarinios10+xamarinmac20\Microsoft.PowerBI.Api.dll 65 | 66 | 67 | ..\packages\Microsoft.PowerBI.AspNet.Mvc.1.1.11\lib\net45\Microsoft.PowerBI.AspNet.Mvc.dll 68 | 69 | 70 | ..\packages\Microsoft.PowerBI.Core.1.1.11\lib\net45\Microsoft.PowerBI.Core.dll 71 | 72 | 73 | ..\packages\Microsoft.Rest.ClientRuntime.2.0.1\lib\net45\Microsoft.Rest.ClientRuntime.dll 74 | True 75 | 76 | 77 | ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll 78 | True 79 | 80 | 81 | ..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll 82 | True 83 | 84 | 85 | ..\packages\Owin.1.0\lib\net40\Owin.dll 86 | True 87 | 88 | 89 | 90 | ..\packages\System.IdentityModel.Tokens.Jwt.4.0.2.206221351\lib\net45\System.IdentityModel.Tokens.Jwt.dll 91 | True 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll 108 | True 109 | 110 | 111 | ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll 112 | True 113 | 114 | 115 | ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll 116 | True 117 | 118 | 119 | ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll 120 | True 121 | 122 | 123 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll 124 | True 125 | 126 | 127 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll 128 | True 129 | 130 | 131 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll 132 | True 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | ..\packages\WebGrease.1.6.0\lib\WebGrease.dll 143 | True 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | Designer 183 | 184 | 185 | 186 | 187 | PreserveNewest 188 | Designer 189 | 190 | 191 | 192 | Web.config 193 | 194 | 195 | Web.config 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | Global.asax 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 10.0 240 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | True 250 | True 251 | 23895 252 | / 253 | http://localhost:13526/ 254 | False 255 | False 256 | 257 | 258 | False 259 | 260 | 261 | 262 | 263 | 264 | 265 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 266 | 267 | 268 | 269 | 270 | 277 | --------------------------------------------------------------------------------