Permalink
Browse files

#1003 : First pass at a reporting dashboard.

  • Loading branch information...
michaellwest committed May 15, 2018
1 parent 37c60ad commit 7a89fd957348c31bfdc312a1c7fd3da2635ad533
@@ -94,6 +94,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="sitecore modules\PowerShell\Styles\c3.min.css" />
<Content Include="sitecore modules\PowerShell\Styles\Console.css" />
<Content Include="sitecore modules\PowerShell\Styles\Dialogs.css" />
<Content Include="sitecore modules\PowerShell\Styles\Gallery.css" />
@@ -106,6 +107,7 @@
<Content Include="sitecore modules\PowerShell\Styles\jquery.ui.core.css" />
<Content Include="sitecore modules\PowerShell\Styles\jquery.ui.theme.css" />
<Content Include="sitecore modules\PowerShell\Styles\ListView.css" />
<Content Include="sitecore modules\PowerShell\Styles\reports.css" />
<Content Include="sitecore modules\PowerShell\Styles\Runner.css" />
<Content Include="sitecore modules\PowerShell\Styles\VariablePrompt.css" />
</ItemGroup>

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,43 @@
#chart > div {
float: left;
margin: .5rem;
border: .1rem solid #f0f0f0;
padding: 1rem;
}
#chart .no-data {
margin: 10px;
font-size: 1rem;
border: .1rem solid #efefef;
padding: 15px;
}
#chart h2.title {
font-size: 1.5rem;
text-align: center;
}
.sc-applicationHeader {
position: relative;
color: #121212;
width: 100%;
background-color: #ca241c;
padding-top: 50px;
}
.sc-applicationHeader-row1 {
height: 90px;
background-color: #ca241c;
background: url(/sitecore/shell/client/Speak/Assets/img/Speak/Layouts/breadcrumb_red_bg.png);
background-repeat: no-repeat;
}
.sc-applicationHeader-content {
padding: 10px 15px;
}
.sc-applicationHeader .sc-applicationHeader-title {
font-size: 2em;
color: #ffffff;
float: left;
}
View
@@ -1,14 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
VisualStudioVersion = 15.0.27130.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cognifide.PowerShell", "Cognifide.PowerShell\Cognifide.PowerShell.csproj", "{FAC57610-989C-4D7E-8D58-CCC914688096}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cognifide.PowerShell.Sitecore8", "Cognifide.PowerShell.Sitecore8\Cognifide.PowerShell.Sitecore8.csproj", "{EA6039EE-CA90-44DE-BD64-CA5DCF101EF5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cognifide.PowerShell.Sitecore7", "Cognifide.PowerShell.Sitecore7\Cognifide.PowerShell.Sitecore7.csproj", "{68AF3135-7687-423B-A767-F0AA479008EF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cognifide.PowerShell.Package", "Cognifide.PowerShell.Package\Cognifide.PowerShell.Package.csproj", "{DB7E4D87-B450-4EC4-BB77-61E39E0450A5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Nuget", "Nuget", "{91D50538-0272-4DD1-9065-50CBB9A45827}"
@@ -30,10 +28,6 @@ Global
{EA6039EE-CA90-44DE-BD64-CA5DCF101EF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA6039EE-CA90-44DE-BD64-CA5DCF101EF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA6039EE-CA90-44DE-BD64-CA5DCF101EF5}.Release|Any CPU.Build.0 = Release|Any CPU
{68AF3135-7687-423B-A767-F0AA479008EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{68AF3135-7687-423B-A767-F0AA479008EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68AF3135-7687-423B-A767-F0AA479008EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{68AF3135-7687-423B-A767-F0AA479008EF}.Release|Any CPU.Build.0 = Release|Any CPU
{DB7E4D87-B450-4EC4-BB77-61E39E0450A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DB7E4D87-B450-4EC4-BB77-61E39E0450A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DB7E4D87-B450-4EC4-BB77-61E39E0450A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -0,0 +1,9 @@
using Sitecore.Web.UI.Sheer;
namespace Cognifide.PowerShell.Client.Applications
{
public class PowerShellReports : BaseForm
{
}
}
@@ -164,6 +164,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Client\Applications\PowerShellReports.cs" />
<Compile Include="Client\Applications\PowerShellSessionElevation.cs" />
<Compile Include="Client\Commands\MenuItems\AddMaster.cs" />
<Compile Include="Client\Commands\SelectUser.cs" />
@@ -549,9 +550,6 @@
</ItemGroup>
<ItemGroup>
<CodeAnalysisDictionary Include="Properties\CustomDictionary.xml" />
<Content Include="sitecore modules\PowerShell\Assets\bg_left.gif" />
<Content Include="sitecore modules\PowerShell\Assets\bg_middle.gif" />
<Content Include="sitecore modules\PowerShell\Assets\bg_right.gif" />
<Content Include="sitecore modules\PowerShell\Assets\checked.png" />
<Content Include="App_Config\Include\Cognifide.PowerShell.Minimal.config.disabled" />
<Content Include="packages.config" />
@@ -582,11 +580,6 @@
<Content Include="sitecore modules\PowerShell\Assets\copy.png" />
<Content Include="sitecore modules\PowerShell\Assets\Download.png" />
<Content Include="sitecore modules\PowerShell\Assets\error.png" />
<Content Include="sitecore modules\PowerShell\Assets\fg_left.gif" />
<Content Include="sitecore modules\PowerShell\Assets\fg_middle.gif" />
<Content Include="sitecore modules\PowerShell\Assets\fg_right.gif" />
<Content Include="sitecore modules\PowerShell\Assets\highlight.png" />
<Content Include="sitecore modules\PowerShell\Assets\ind-highlight.png" />
<Content Include="sitecore modules\PowerShell\Assets\info.png" />
<Content Include="sitecore modules\PowerShell\Assets\question.png" />
<Content Include="sitecore modules\PowerShell\Assets\refresh.png" />
@@ -620,8 +613,10 @@
<Content Include="sitecore modules\PowerShell\Scripts\ace\snippets\powershell.js" />
<Content Include="sitecore modules\PowerShell\Scripts\ace\snippets\text.js" />
<Content Include="sitecore modules\PowerShell\Scripts\ace\theme-powershellise.js" />
<Content Include="sitecore modules\PowerShell\Scripts\c3.min.js" />
<Content Include="sitecore modules\PowerShell\Scripts\clipboard.min.js" />
<Content Include="sitecore modules\PowerShell\Scripts\console.js" />
<Content Include="sitecore modules\PowerShell\Scripts\d3.min.js" />
<Content Include="sitecore modules\PowerShell\Scripts\flexie.min.js" />
<Content Include="sitecore modules\PowerShell\Scripts\ise.js" />
<Content Include="sitecore modules\PowerShell\Scripts\jquery-1.10.2.min.js" />
@@ -633,10 +628,10 @@
<Content Include="sitecore modules\PowerShell\Scripts\jquery.qtip.js" />
<Content Include="sitecore modules\PowerShell\Scripts\jquery.qtip.min.js" />
<Content Include="sitecore modules\PowerShell\Scripts\jquery.terminal.js" />
<Content Include="sitecore modules\PowerShell\Scripts\jquery.VistaProgressBar-0.6.js" />
<Content Include="sitecore modules\PowerShell\Scripts\json2.js" />
<Content Include="sitecore modules\PowerShell\Scripts\listview.js" />
<Content Include="sitecore modules\PowerShell\Scripts\PsHSplitter.js" />
<Content Include="sitecore modules\PowerShell\Scripts\reports.js" />
<Content Include="sitecore modules\PowerShell\Scripts\Runner.js" />
<Content Include="sitecore modules\PowerShell\Scripts\SpeShared.js" />
<Content Include="sitecore modules\PowerShell\Scripts\split.js" />
@@ -672,11 +667,16 @@
<SubType>Designer</SubType>
</Content>
<Content Include="sitecore modules\Shell\PowerShell\PowerShellMultiValuePrompt.xml" />
<Content Include="sitecore modules\Shell\PowerShell\PowerShellReports.xml">
<SubType>Designer</SubType>
</Content>
<Content Include="sitecore modules\Shell\PowerShell\PowerShellResultViewerList.xml">
<SubType>Designer</SubType>
</Content>
<Content Include="sitecore modules\Shell\PowerShell\PowerShellResultViewerText.xml" />
<Content Include="sitecore modules\Shell\PowerShell\PowerShellRunner.xml" />
<Content Include="sitecore modules\Shell\PowerShell\PowerShellRunner.xml">
<SubType>Designer</SubType>
</Content>
<Content Include="sitecore modules\Shell\PowerShell\PowerShellScriptBrowser.xml" />
<Content Include="sitecore modules\Shell\PowerShell\PowerShellSessionElevation.xml" />
<Content Include="sitecore modules\Shell\PowerShell\PsHSplitter.xml" />
@@ -57,7 +57,7 @@ protected static IEnumerable<Item> RunEnumeration(string scriptSource, Item item
return new[] { scriptItem ?? item };
}
using (var session = ScriptSessionManager.NewSession(ApplicationNames.Default, true))
using (var session = ScriptSessionManager.NewSession(ApplicationNames.Default, false))
{
if (item != null)
{

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,24 @@
(function ($, window, cognifide, c3, undefined) {
"use strict";
$(function () {
const availabeReportsUrl = "/-/script/v2/master/get-availablereport?depth=5&compress=true";
$.getJSON(availabeReportsUrl, function (availableData) {
$.each(availableData.Results,
function (index, name) {
const url = `/-/script/v2/master/${name}?depth=5&compress=true`;
$("#chart").append(`<div id="chart-${index}-container"><img class="spinner" src="/sitecore/shell/Themes/Standard/Images/sc-spinner32.gif" /></div>`);
$.getJSON(url, function (chartData) {
if (chartData.Results.title) {
$(`#chart-${index}-container`).append(`<h2 class="title">${chartData.Results.title}</h2>`);
}
$(`#chart-${index}-container`).append(`<div id="chart-${index}" />`);
$(`#chart-${index}-container .spinner`).hide();
chartData.Results.bindto = `#chart-${index}`;
c3.generate(chartData.Results);
});
});
}).fail(function () {
$("#chart").append('<div class="no-data">No report data available.</div>');
});
});
}(jQuery, window, window.cognifide = window.cognifide || {}, c3));
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<control xmlns:def="Definition" xmlns="http://schemas.sitecore.net/Visual-Studio-Intellisense">
<PowerShellReports>
<FormPage Application="PowerShell/PowerShellReports">
<CodeBeside Type="Cognifide.PowerShell.Client.Applications.PowerShellReports,Cognifide.PowerShell" />
<Favicon Src="/sitecore/images/favicon.ico" />
<Stylesheet Src="Content Manager.css" DeviceDependant="true" />
<Stylesheet Src="Ribbon.css" DeviceDependant="true" />
<Stylesheet Src="/sitecore/shell/themes/standard/default.css" runat="server" />
<Stylesheet Src="/sitecore modules/PowerShell/Styles/reports.css" runat="server" />
<Stylesheet Src="/sitecore modules/PowerShell/Styles/c3.min.css" runat="server" />
<Script Src="/sitecore modules/PowerShell/Scripts/jquery.min.js" runat="server"/>
<Script>$spe = jQuery.noConflict();</Script>
<Script Src="/sitecore modules/PowerShell/Scripts/d3.min.js" runat="server"/>
<Script Src="/sitecore modules/PowerShell/Scripts/c3.min.js" runat="server"/>
<Script src="/sitecore modules/PowerShell/Scripts/SpeShared.js"></Script>
<Script src="/sitecore modules/PowerShell/Scripts/reports.js"></Script>
<header class="sc-applicationHeader">
<div class="sc-applicationHeader-row1 ">
<div class="sc-applicationHeader-content">
<div class="sc-applicationHeader-title">
<span class="sc-text">PowerShell Reports</span>
</div>
</div>
</div>
</header>
<Border>
<Scrollbox Class="">
<Border id="chart"></Border>
</Scrollbox>
</Border>
</FormPage>
</PowerShellReports>
</control>

0 comments on commit 7a89fd9

Please sign in to comment.