Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
Design mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll committed May 21, 2019
1 parent 407e5ec commit a183f11
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 55 deletions.
5 changes: 0 additions & 5 deletions src/UniversalDashboard/Cmdlets/StartDashboardCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ public class StartDashboardCommand : PSCmdlet
[Parameter]
public PublishedFolder[] PublishedFolder { get; set; }

[Parameter]
public SwitchParameter Design { get; set; }

protected override void EndProcessing()
{
var assemblyBasePath = Path.GetDirectoryName(this.GetType().GetTypeInfo().Assembly.Location);
Expand Down Expand Up @@ -129,8 +126,6 @@ protected override void EndProcessing()

var server = new Server(Name, base.MyInvocation.ScriptName, AutoReload, Host, Port);

Dashboard.Design = Design;

var options = new DashboardOptions();
options.Dashboard = Dashboard;
options.StaticEndpoints = Endpoint;
Expand Down
35 changes: 0 additions & 35 deletions src/UniversalDashboard/Controllers/ComponentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,41 +465,6 @@ public IActionResult SetElementSessionState([FromRoute]string requestId, [FromBo
return Ok();
}

[HttpPost]
[Route("terminal")]
[Authorize]
public async Task<IActionResult> RunTerminalCommand() {

if (!_dashboardService.Dashboard.Design) {
NotFound();
}

Endpoint endpoint;
using (var streamReader = new StreamReader(Request.Body))
{
var body = streamReader.ReadToEnd();
endpoint = new Endpoint(ScriptBlock.Create(body));
endpoint.Name = Guid.NewGuid().ToString();
_dashboardService.EndpointService.Register(endpoint);
}

IActionResult result;
try
{
result = await RunScript(endpoint);
}
catch
{
return NotFound();
}
finally
{
_dashboardService.EndpointService.Unregister(endpoint.Name, null);
}

return result;
}

private void SetQueryStringValues(Dictionary<string, object> variables)
{
foreach (var item in HttpContext.Request.Query)
Expand Down
2 changes: 0 additions & 2 deletions src/UniversalDashboard/Models/Dashboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public class Dashboard
public int CyclePagesInterval { get; set; }
[JsonProperty("error")]
public string Error { get; set; }
[JsonProperty("design")]
public bool Design { get; set; }
[JsonProperty("footer")]
public Footer Footer { get; set; }
[JsonProperty("navBarLogo")]
Expand Down
4 changes: 1 addition & 3 deletions src/client/src/app/ud-dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const UdModalComponent = React.lazy(() => import('./ud-modal.jsx' /* webpackChun
const UdErrorCardComponent = React.lazy(() => import('./error-card.jsx' /* webpackChunkName: "ud-error-card" */))

import toaster from './services/toaster';
import UDDesigner from './ud-designer';
import NotFound from './not-found.jsx';

export default class UdDashboard extends React.Component {
Expand Down Expand Up @@ -357,8 +356,7 @@ export default class UdDashboard extends React.Component {
return <Suspense fallback={<div></div>}>
<UdPageCyclerComponent history={x.history} pages={this.state.dashboard.pages} cyclePages={this.state.dashboard.cyclePages && !this.state.pausePageCycle} cyclePagesInterval={this.state.dashboard.cyclePagesInterval} />
</Suspense>
}.bind(this)}/>,
this.state.design ? <UDDesigner/> : <span/>
}.bind(this)}/>
]
}
}
10 changes: 0 additions & 10 deletions src/client/src/app/ud-designer.jsx

This file was deleted.

0 comments on commit a183f11

Please sign in to comment.