-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
3,337 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Microsoft.AspNetCore.SignalR; | ||
|
||
namespace CWASP_Razor_Edition.Hubs | ||
{ | ||
public class IndexHub : Hub | ||
{ | ||
public async Task UpdateDatabaseView() | ||
{ | ||
// Like a repeater, tell all clients to update their database view. | ||
await Clients.All.SendAsync("UpdateDatabaseView"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
CWASP Razor Edition/Properties/ServiceDependencies/local/signalr1.arm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"resourceGroupName": { | ||
"type": "string", | ||
"defaultValue": "CWASP-AppService", | ||
"metadata": { | ||
"_parameterType": "resourceGroup", | ||
"description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking." | ||
} | ||
}, | ||
"resourceGroupLocation": { | ||
"type": "string", | ||
"defaultValue": "eastus", | ||
"metadata": { | ||
"_parameterType": "location", | ||
"description": "Location of the resource group. Resource groups could have different location than resources." | ||
} | ||
}, | ||
"resourceLocation": { | ||
"type": "string", | ||
"defaultValue": "[parameters('resourceGroupLocation')]", | ||
"metadata": { | ||
"_parameterType": "location", | ||
"description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there." | ||
} | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Resources/resourceGroups", | ||
"name": "[parameters('resourceGroupName')]", | ||
"location": "[parameters('resourceGroupLocation')]", | ||
"apiVersion": "2019-10-01" | ||
}, | ||
{ | ||
"type": "Microsoft.Resources/deployments", | ||
"name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat('CWASP-SignalR-Service', subscription().subscriptionId)))]", | ||
"resourceGroup": "[parameters('resourceGroupName')]", | ||
"apiVersion": "2019-10-01", | ||
"dependsOn": [ | ||
"[parameters('resourceGroupName')]" | ||
], | ||
"properties": { | ||
"mode": "Incremental", | ||
"template": { | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"resources": [ | ||
{ | ||
"sku": { | ||
"name": "Free_F1", | ||
"tier": "Free", | ||
"size": "F1", | ||
"capacity": 1 | ||
}, | ||
"location": "[parameters('resourceLocation')]", | ||
"name": "CWASP-SignalR-Service", | ||
"type": "Microsoft.SignalRService/SignalR", | ||
"apiVersion": "2018-10-01" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"metadata": { | ||
"_dependencyType": "signalr.azure" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"use strict"; | ||
|
||
var connection = new signalR.HubConnectionBuilder().withUrl("/indexHub").build(); | ||
|
||
document.getElementById("createButton").addEventListener("click", function (event) { | ||
// Tell the SignalR hub to invoke the "RefreshDatabaseView" function. | ||
connection.invoke("RefreshDatabaseView").catch(function (err) { | ||
return console.error(err.toString()); | ||
}); | ||
|
||
console.log("SignalR detected an event."); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use strict"; | ||
|
||
var connection = new signalR.HubConnectionBuilder().withUrl("/indexHub").build(); | ||
|
||
// Run function when told to by the SignalR hub. | ||
connection.on("RefreshDatabaseView", function () { | ||
// Refresh the page to display updated data. | ||
window.location.reload(); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.