Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
c4f4f5f4
Commit
c4f4f5f4
authored
Nov 05, 2019
by
Savorboard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upgrade dashoboard module
parent
200d14a8
Changes
45
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
2481 additions
and
1773 deletions
+2481
-1773
ValuesController.cs
...les/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs
+7
-0
Sample.RabbitMQ.MySql.csproj
samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj
+1
-0
Startup.cs
samples/Sample.RabbitMQ.MySql/Startup.cs
+1
-1
AwaitableInfo.cs
src/DotNetCore.CAP.Dashboard/AwaitableInfo.cs
+128
-0
CAP.DashboardMiddleware.cs
src/DotNetCore.CAP.Dashboard/CAP.DashboardMiddleware.cs
+72
-2
CAP.DashboardOptionsExtensions.cs
...otNetCore.CAP.Dashboard/CAP.DashboardOptionsExtensions.cs
+3
-0
CapCache.cs
src/DotNetCore.CAP.Dashboard/CapCache.cs
+378
-0
CoercedAwaitableInfo.cs
src/DotNetCore.CAP.Dashboard/CoercedAwaitableInfo.cs
+44
-0
CombinedResourceDispatcher.cs
src/DotNetCore.CAP.Dashboard/CombinedResourceDispatcher.cs
+6
-5
DashboardContext.cs
src/DotNetCore.CAP.Dashboard/DashboardContext.cs
+4
-3
DashboardRoutes.cs
src/DotNetCore.CAP.Dashboard/DashboardRoutes.cs
+5
-5
DotNetCore.CAP.Dashboard.csproj
src/DotNetCore.CAP.Dashboard/DotNetCore.CAP.Dashboard.csproj
+141
-27
EmbeddedResourceDispatcher.cs
src/DotNetCore.CAP.Dashboard/EmbeddedResourceDispatcher.cs
+6
-9
GatewayProxyMiddleware.cs
...Core.CAP.Dashboard/GatewayProxy/GatewayProxyMiddleware.cs
+1
-1
HtmlHelper.cs
src/DotNetCore.CAP.Dashboard/HtmlHelper.cs
+1
-1
JsonDispatcher.cs
src/DotNetCore.CAP.Dashboard/JsonDispatcher.cs
+1
-1
JsonStats.cs
src/DotNetCore.CAP.Dashboard/JsonStats.cs
+2
-2
LocalRequestsOnlyAuthorizationFilter.cs
...ore.CAP.Dashboard/LocalRequestsOnlyAuthorizationFilter.cs
+1
-1
MessageHistoryRenderer.cs
src/DotNetCore.CAP.Dashboard/MessageHistoryRenderer.cs
+9
-9
BlockMetric.cs
src/DotNetCore.CAP.Dashboard/Pages/BlockMetric.cs
+2
-2
HomePage.generated.cs
src/DotNetCore.CAP.Dashboard/Pages/HomePage.generated.cs
+210
-228
LayoutPage.generated.cs
src/DotNetCore.CAP.Dashboard/Pages/LayoutPage.generated.cs
+206
-213
NodePage.cs
src/DotNetCore.CAP.Dashboard/Pages/NodePage.cs
+1
-1
NodePage.generated.cs
src/DotNetCore.CAP.Dashboard/Pages/NodePage.generated.cs
+162
-163
PublishedPage.cs
src/DotNetCore.CAP.Dashboard/Pages/PublishedPage.cs
+5
-4
PublishedPage.cshtml
src/DotNetCore.CAP.Dashboard/Pages/PublishedPage.cshtml
+4
-4
PublishedPage.generated.cs
...DotNetCore.CAP.Dashboard/Pages/PublishedPage.generated.cs
+441
-429
ReceivedPage.cs
src/DotNetCore.CAP.Dashboard/Pages/ReceivedPage.cs
+2
-1
ReceivedPage.cshtml
src/DotNetCore.CAP.Dashboard/Pages/ReceivedPage.cshtml
+1
-1
ReceivedPage.generated.cs
src/DotNetCore.CAP.Dashboard/Pages/ReceivedPage.generated.cs
+428
-424
SubscriberPage.generated.cs
...otNetCore.CAP.Dashboard/Pages/SubscriberPage.generated.cs
+58
-73
_BlockMetric.cshtml
src/DotNetCore.CAP.Dashboard/Pages/_BlockMetric.cshtml
+6
-5
_BlockMetric.generated.cs
src/DotNetCore.CAP.Dashboard/Pages/_BlockMetric.generated.cs
+14
-18
_Breadcrumbs.generated.cs
src/DotNetCore.CAP.Dashboard/Pages/_Breadcrumbs.generated.cs
+13
-19
_InlineMetric.generated.cs
...DotNetCore.CAP.Dashboard/Pages/_InlineMetric.generated.cs
+7
-7
_Navigation.generated.cs
src/DotNetCore.CAP.Dashboard/Pages/_Navigation.generated.cs
+17
-14
_Paginator.generated.cs
src/DotNetCore.CAP.Dashboard/Pages/_Paginator.generated.cs
+24
-26
_PerPageSelector.generated.cs
...NetCore.CAP.Dashboard/Pages/_PerPageSelector.generated.cs
+23
-23
_SidebarMenu.generated.cs
src/DotNetCore.CAP.Dashboard/Pages/_SidebarMenu.generated.cs
+12
-20
RazorPage.cs
src/DotNetCore.CAP.Dashboard/RazorPage.cs
+6
-6
MySqlDataStorage.cs
src/DotNetCore.CAP.MySql/MySqlDataStorage.cs
+8
-21
Helper.cs
src/DotNetCore.CAP/Internal/Helper.cs
+8
-0
MethodMatcherCache.cs
src/DotNetCore.CAP/Internal/MethodMatcherCache.cs
+1
-1
IDataStorage.cs
src/DotNetCore.CAP/Persistence/IDataStorage.cs
+9
-3
MediumMessage.cs
src/DotNetCore.CAP/Persistence/MediumMessage.cs
+2
-0
No files found.
samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs
View file @
c4f4f5f4
...
...
@@ -75,5 +75,12 @@ namespace Sample.RabbitMQ.MySql.Controllers
{
Console
.
WriteLine
(
$@"
{
DateTime
.
Now
}
Subscriber invoked, Info:
{
p
}
"
);
}
[
NonAction
]
[
CapSubscribe
(
"sample.rabbitmq.mysql"
,
Group
=
"group.test2"
)]
public
void
Subscriber2
(
DateTime
p
,
[
FromCap
]
CapHeader
header
)
{
Console
.
WriteLine
(
$@"
{
DateTime
.
Now
}
Subscriber invoked, Info:
{
p
}
"
);
}
}
}
samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj
View file @
c4f4f5f4
...
...
@@ -8,6 +8,7 @@
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.0.0-rc1.final" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetCore.CAP.Dashboard\DotNetCore.CAP.Dashboard.csproj" />
<ProjectReference Include="..\..\src\DotNetCore.CAP.MySql\DotNetCore.CAP.MySql.csproj" />
<ProjectReference Include="..\..\src\DotNetCore.CAP.RabbitMQ\DotNetCore.CAP.RabbitMQ.csproj" />
<ProjectReference Include="..\..\src\DotNetCore.CAP\DotNetCore.CAP.csproj" />
...
...
samples/Sample.RabbitMQ.MySql/Startup.cs
View file @
c4f4f5f4
...
...
@@ -15,7 +15,7 @@ namespace Sample.RabbitMQ.MySql
{
x
.
UseEntityFramework
<
AppDbContext
>();
x
.
UseRabbitMQ
(
"192.168.2.120"
);
//
x.UseDashboard();
x
.
UseDashboard
();
x
.
FailedRetryCount
=
5
;
x
.
FailedThresholdCallback
=
(
type
,
msg
)
=>
{
...
...
src/DotNetCore.CAP.Dashboard/AwaitableInfo.cs
0 → 100644
View file @
c4f4f5f4
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System
;
using
System.Linq
;
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
namespace
Microsoft.Extensions.Internal
{
internal
struct
AwaitableInfo
{
public
Type
AwaiterType
{
get
;
}
public
PropertyInfo
AwaiterIsCompletedProperty
{
get
;
}
public
MethodInfo
AwaiterGetResultMethod
{
get
;
}
public
MethodInfo
AwaiterOnCompletedMethod
{
get
;
}
public
MethodInfo
AwaiterUnsafeOnCompletedMethod
{
get
;
}
public
Type
ResultType
{
get
;
}
public
MethodInfo
GetAwaiterMethod
{
get
;
}
public
AwaitableInfo
(
Type
awaiterType
,
PropertyInfo
awaiterIsCompletedProperty
,
MethodInfo
awaiterGetResultMethod
,
MethodInfo
awaiterOnCompletedMethod
,
MethodInfo
awaiterUnsafeOnCompletedMethod
,
Type
resultType
,
MethodInfo
getAwaiterMethod
)
{
AwaiterType
=
awaiterType
;
AwaiterIsCompletedProperty
=
awaiterIsCompletedProperty
;
AwaiterGetResultMethod
=
awaiterGetResultMethod
;
AwaiterOnCompletedMethod
=
awaiterOnCompletedMethod
;
AwaiterUnsafeOnCompletedMethod
=
awaiterUnsafeOnCompletedMethod
;
ResultType
=
resultType
;
GetAwaiterMethod
=
getAwaiterMethod
;
}
public
static
bool
IsTypeAwaitable
(
Type
type
,
out
AwaitableInfo
awaitableInfo
)
{
// Based on Roslyn code: http://source.roslyn.io/#Microsoft.CodeAnalysis.Workspaces/Shared/Extensions/ISymbolExtensions.cs,db4d48ba694b9347
// Awaitable must have method matching "object GetAwaiter()"
var
getAwaiterMethod
=
type
.
GetRuntimeMethods
().
FirstOrDefault
(
m
=>
m
.
Name
.
Equals
(
"GetAwaiter"
,
StringComparison
.
OrdinalIgnoreCase
)
&&
m
.
GetParameters
().
Length
==
0
&&
m
.
ReturnType
!=
null
);
if
(
getAwaiterMethod
==
null
)
{
awaitableInfo
=
default
(
AwaitableInfo
);
return
false
;
}
var
awaiterType
=
getAwaiterMethod
.
ReturnType
;
// Awaiter must have property matching "bool IsCompleted { get; }"
var
isCompletedProperty
=
awaiterType
.
GetRuntimeProperties
().
FirstOrDefault
(
p
=>
p
.
Name
.
Equals
(
"IsCompleted"
,
StringComparison
.
OrdinalIgnoreCase
)
&&
p
.
PropertyType
==
typeof
(
bool
)
&&
p
.
GetMethod
!=
null
);
if
(
isCompletedProperty
==
null
)
{
awaitableInfo
=
default
(
AwaitableInfo
);
return
false
;
}
// Awaiter must implement INotifyCompletion
var
awaiterInterfaces
=
awaiterType
.
GetInterfaces
();
var
implementsINotifyCompletion
=
awaiterInterfaces
.
Any
(
t
=>
t
==
typeof
(
INotifyCompletion
));
if
(!
implementsINotifyCompletion
)
{
awaitableInfo
=
default
(
AwaitableInfo
);
return
false
;
}
// INotifyCompletion supplies a method matching "void OnCompleted(Action action)"
var
iNotifyCompletionMap
=
awaiterType
.
GetTypeInfo
()
.
GetRuntimeInterfaceMap
(
typeof
(
INotifyCompletion
));
var
onCompletedMethod
=
iNotifyCompletionMap
.
InterfaceMethods
.
Single
(
m
=>
m
.
Name
.
Equals
(
"OnCompleted"
,
StringComparison
.
OrdinalIgnoreCase
)
&&
m
.
ReturnType
==
typeof
(
void
)
&&
m
.
GetParameters
().
Length
==
1
&&
m
.
GetParameters
()[
0
].
ParameterType
==
typeof
(
Action
));
// Awaiter optionally implements ICriticalNotifyCompletion
var
implementsICriticalNotifyCompletion
=
awaiterInterfaces
.
Any
(
t
=>
t
==
typeof
(
ICriticalNotifyCompletion
));
MethodInfo
unsafeOnCompletedMethod
;
if
(
implementsICriticalNotifyCompletion
)
{
// ICriticalNotifyCompletion supplies a method matching "void UnsafeOnCompleted(Action action)"
var
iCriticalNotifyCompletionMap
=
awaiterType
.
GetTypeInfo
()
.
GetRuntimeInterfaceMap
(
typeof
(
ICriticalNotifyCompletion
));
unsafeOnCompletedMethod
=
iCriticalNotifyCompletionMap
.
InterfaceMethods
.
Single
(
m
=>
m
.
Name
.
Equals
(
"UnsafeOnCompleted"
,
StringComparison
.
OrdinalIgnoreCase
)
&&
m
.
ReturnType
==
typeof
(
void
)
&&
m
.
GetParameters
().
Length
==
1
&&
m
.
GetParameters
()[
0
].
ParameterType
==
typeof
(
Action
));
}
else
{
unsafeOnCompletedMethod
=
null
;
}
// Awaiter must have method matching "void GetResult" or "T GetResult()"
var
getResultMethod
=
awaiterType
.
GetRuntimeMethods
().
FirstOrDefault
(
m
=>
m
.
Name
.
Equals
(
"GetResult"
)
&&
m
.
GetParameters
().
Length
==
0
);
if
(
getResultMethod
==
null
)
{
awaitableInfo
=
default
(
AwaitableInfo
);
return
false
;
}
awaitableInfo
=
new
AwaitableInfo
(
awaiterType
,
isCompletedProperty
,
getResultMethod
,
onCompletedMethod
,
unsafeOnCompletedMethod
,
getResultMethod
.
ReturnType
,
getAwaiterMethod
);
return
true
;
}
}
}
\ No newline at end of file
src/DotNetCore.CAP.Dashboard/CAP.DashboardMiddleware.cs
View file @
c4f4f5f4
...
...
@@ -6,19 +6,89 @@ using System.Linq;
using
System.Net
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Dashboard
;
using
DotNetCore.CAP.Dashboard.GatewayProxy
;
using
DotNetCore.CAP.Dashboard.NodeDiscovery
;
using
DotNetCore.CAP.Persistence
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.Extensions.DependencyInjection
;
// ReSharper disable once CheckNamespace
namespace
DotNetCore.CAP
{
public
static
class
CapBuilderExtension
{
public
static
IApplicationBuilder
UseCapDashboard
(
this
IApplicationBuilder
app
)
{
if
(
app
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
app
));
}
CheckRequirement
(
app
);
var
provider
=
app
.
ApplicationServices
;
if
(
provider
.
GetService
<
DashboardOptions
>()
!=
null
)
{
if
(
provider
.
GetService
<
DiscoveryOptions
>()
!=
null
)
{
app
.
UseMiddleware
<
GatewayProxyMiddleware
>();
}
app
.
UseMiddleware
<
DashboardMiddleware
>();
}
return
app
;
}
private
static
void
CheckRequirement
(
IApplicationBuilder
app
)
{
var
marker
=
app
.
ApplicationServices
.
GetService
<
CapMarkerService
>();
if
(
marker
==
null
)
{
throw
new
InvalidOperationException
(
"AddCap() must be called on the service collection. eg: services.AddCap(...)"
);
}
var
messageQueueMarker
=
app
.
ApplicationServices
.
GetService
<
CapMessageQueueMakerService
>();
if
(
messageQueueMarker
==
null
)
{
throw
new
InvalidOperationException
(
"You must be config used message queue provider at AddCap() options! eg: services.AddCap(options=>{ options.UseKafka(...) })"
);
}
var
databaseMarker
=
app
.
ApplicationServices
.
GetService
<
CapStorageMarkerService
>();
if
(
databaseMarker
==
null
)
{
throw
new
InvalidOperationException
(
"You must be config used database provider at AddCap() options! eg: services.AddCap(options=>{ options.UseSqlServer(...) })"
);
}
}
}
sealed
class
CapStartupFilter
:
IStartupFilter
{
public
Action
<
IApplicationBuilder
>
Configure
(
Action
<
IApplicationBuilder
>
next
)
{
return
app
=>
{
app
.
UseCapDashboard
();
next
(
app
);
};
}
}
public
class
DashboardMiddleware
{
private
readonly
RequestDelegate
_next
;
private
readonly
DashboardOptions
_options
;
private
readonly
RouteCollection
_routes
;
private
readonly
IStorage
_storage
;
private
readonly
I
Data
Storage
_storage
;
public
DashboardMiddleware
(
RequestDelegate
next
,
DashboardOptions
options
,
IStorage
storage
,
public
DashboardMiddleware
(
RequestDelegate
next
,
DashboardOptions
options
,
I
Data
Storage
storage
,
RouteCollection
routes
)
{
_next
=
next
??
throw
new
ArgumentNullException
(
nameof
(
next
));
...
...
src/DotNetCore.CAP.Dashboard/CAP.DashboardOptionsExtensions.cs
View file @
c4f4f5f4
...
...
@@ -6,6 +6,7 @@ using DotNetCore.CAP;
using
DotNetCore.CAP.Dashboard
;
using
DotNetCore.CAP.Dashboard.GatewayProxy
;
using
DotNetCore.CAP.Dashboard.GatewayProxy.Requester
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.DependencyInjection
;
namespace
DotNetCore.CAP
...
...
@@ -23,11 +24,13 @@ namespace DotNetCore.CAP
{
var
dashboardOptions
=
new
DashboardOptions
();
_options
?.
Invoke
(
dashboardOptions
);
services
.
AddTransient
<
IStartupFilter
,
CapStartupFilter
>();
services
.
AddSingleton
(
dashboardOptions
);
services
.
AddSingleton
(
DashboardRoutes
.
Routes
);
services
.
AddSingleton
<
IHttpRequester
,
HttpClientHttpRequester
>();
services
.
AddSingleton
<
IHttpClientCache
,
MemoryHttpClientCache
>();
services
.
AddSingleton
<
IRequestMapper
,
RequestMapper
>();
}
}
}
...
...
src/DotNetCore.CAP.Dashboard/CapCache.cs
0 → 100644
View file @
c4f4f5f4
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading
;
namespace
DotNetCore.CAP.Dashboard
{
#
region
Cache
<
T
>
class
/// <summary>
/// This is a generic cache subsystem based on key/value pairs, where key is generic, too. Key must be unique.
/// Every cache entry has its own timeout.
/// Cache is thread safe and will delete expired entries on its own using System.Threading.Timers (which run on
/// <see cref="ThreadPool" /> threads).
/// </summary>
// ReSharper disable once InheritdocConsiderUsage
// ReSharper disable once InconsistentNaming
internal
class
Cache
<
K
,
T
>
:
IDisposable
{
#
region
Constructor
and
class
members
private
readonly
Dictionary
<
K
,
T
>
_cache
=
new
Dictionary
<
K
,
T
>();
private
readonly
Dictionary
<
K
,
Timer
>
_timers
=
new
Dictionary
<
K
,
Timer
>();
private
readonly
ReaderWriterLockSlim
_locker
=
new
ReaderWriterLockSlim
();
#
endregion
#
region
IDisposable
implementation
&
Clear
private
bool
disposed
;
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public
void
Dispose
()
{
Dispose
(
true
);
GC
.
SuppressFinalize
(
this
);
}
/// <summary>
/// Releases unmanaged and - optionally - managed resources.
/// </summary>
/// <param name="disposing">
/// <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.
/// </param>
protected
virtual
void
Dispose
(
bool
disposing
)
{
if
(!
disposed
)
{
disposed
=
true
;
if
(
disposing
)
{
// Dispose managed resources.
Clear
();
_locker
.
Dispose
();
}
// Dispose unmanaged resources
}
}
/// <summary>
/// Clears the entire cache and disposes all active timers.
/// </summary>
public
void
Clear
()
{
_locker
.
EnterWriteLock
();
try
{
try
{
foreach
(
var
t
in
_timers
.
Values
)
{
t
.
Dispose
();
}
}
catch
{
}
_timers
.
Clear
();
_cache
.
Clear
();
}
finally
{
_locker
.
ExitWriteLock
();
}
}
#
endregion
#
region
CheckTimer
// Checks whether a specific timer already exists and adds a new one, if not
private
void
CheckTimer
(
K
key
,
TimeSpan
?
cacheTimeout
,
bool
restartTimerIfExists
)
{
Timer
timer
;
if
(
_timers
.
TryGetValue
(
key
,
out
timer
))
{
if
(
restartTimerIfExists
)
{
timer
.
Change
(
cacheTimeout
??
Timeout
.
InfiniteTimeSpan
,
Timeout
.
InfiniteTimeSpan
);
}
}
else
{
_timers
.
Add
(
key
,
new
Timer
(
RemoveByTimer
,
key
,
cacheTimeout
??
Timeout
.
InfiniteTimeSpan
,
Timeout
.
InfiniteTimeSpan
));
}
}
private
void
RemoveByTimer
(
object
state
)
{
Remove
((
K
)
state
);
}
#
endregion
#
region
AddOrUpdate
,
Get
,
Remove
,
Exists
,
Clear
/// <summary>
/// Adds or updates the specified cache-key with the specified cacheObject and applies a specified timeout (in seconds)
/// to this key.
/// </summary>
/// <param name="key">The cache-key to add or update.</param>
/// <param name="cacheObject">The cache object to store.</param>
/// <param name="cacheTimeout">
/// The cache timeout (lifespan) of this object. Must be 1 or greater.
/// Specify Timeout.Infinite to keep the entry forever.
/// </param>
/// <param name="restartTimerIfExists">
/// (Optional). If set to <c>true</c>, the timer for this cacheObject will be reset if the object already
/// exists in the cache. (Default = false).
/// </param>
public
void
AddOrUpdate
(
K
key
,
T
cacheObject
,
TimeSpan
?
cacheTimeout
,
bool
restartTimerIfExists
=
false
)
{
if
(
disposed
)
{
return
;
}
_locker
.
EnterWriteLock
();
try
{
CheckTimer
(
key
,
cacheTimeout
,
restartTimerIfExists
);
if
(!
_cache
.
ContainsKey
(
key
))
{
_cache
.
Add
(
key
,
cacheObject
);
}
else
{
_cache
[
key
]
=
cacheObject
;
}
}
finally
{
_locker
.
ExitWriteLock
();
}
}
/// <summary>
/// Adds or updates the specified cache-key with the specified cacheObject and applies <c>Timeout.Infinite</c> to this
/// key.
/// </summary>
/// <param name="key">The cache-key to add or update.</param>
/// <param name="cacheObject">The cache object to store.</param>
public
void
AddOrUpdate
(
K
key
,
T
cacheObject
)
{
AddOrUpdate
(
key
,
cacheObject
,
Timeout
.
InfiniteTimeSpan
);
}
/// <summary>
/// Gets the cache entry with the specified key or returns <c>default(T)</c> if the key is not found.
/// </summary>
/// <param name="key">The cache-key to retrieve.</param>
/// <returns>The object from the cache or <c>default(T)</c>, if not found.</returns>
public
T
this
[
K
key
]
=>
Get
(
key
);
/// <summary>
/// Gets the cache entry with the specified key or return <c>default(T)</c> if the key is not found.
/// </summary>
/// <param name="key">The cache-key to retrieve.</param>
/// <returns>The object from the cache or <c>default(T)</c>, if not found.</returns>
public
T
Get
(
K
key
)
{
if
(
disposed
)
{
return
default
(
T
);
}
_locker
.
EnterReadLock
();
try
{
T
rv
;
return
_cache
.
TryGetValue
(
key
,
out
rv
)
?
rv
:
default
(
T
);
}
finally
{
_locker
.
ExitReadLock
();
}
}
/// <summary>
/// Tries to gets the cache entry with the specified key.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="value">(out) The value, if found, or <c>default(T)</c>, if not.</param>
/// <returns><c>True</c>, if <c>key</c> exists, otherwise <c>false</c>.</returns>
public
bool
TryGet
(
K
key
,
out
T
value
)
{
if
(
disposed
)
{
value
=
default
(
T
);
return
false
;
}
_locker
.
EnterReadLock
();
try
{
return
_cache
.
TryGetValue
(
key
,
out
value
);
}
finally
{
_locker
.
ExitReadLock
();
}
}
/// <summary>
/// Removes a series of cache entries in a single call for all key that match the specified key pattern.
/// </summary>
/// <param name="keyPattern">The key pattern to remove. The Predicate has to return true to get key removed.</param>
public
void
Remove
(
Predicate
<
K
>
keyPattern
)
{
if
(
disposed
)
{
return
;
}
_locker
.
EnterWriteLock
();
try
{
var
removers
=
(
from
k
in
_cache
.
Keys
.
Cast
<
K
>()
where
keyPattern
(
k
)
select
k
).
ToList
();
foreach
(
var
workKey
in
removers
)
{
try
{
_timers
[
workKey
].
Dispose
();
}
catch
{
}
_timers
.
Remove
(
workKey
);
_cache
.
Remove
(
workKey
);
}
}
finally
{
_locker
.
ExitWriteLock
();
}
}
/// <summary>
/// Removes the specified cache entry with the specified key.
/// If the key is not found, no exception is thrown, the statement is just ignored.
/// </summary>
/// <param name="key">The cache-key to remove.</param>
public
void
Remove
(
K
key
)
{
if
(
disposed
)
{
return
;
}
_locker
.
EnterWriteLock
();
try
{
if
(
_cache
.
ContainsKey
(
key
))
{
try
{
_timers
[
key
].
Dispose
();
}
catch
{
}
_timers
.
Remove
(
key
);
_cache
.
Remove
(
key
);
}
}
finally
{
_locker
.
ExitWriteLock
();
}
}
/// <summary>
/// Checks if a specified key exists in the cache.
/// </summary>
/// <param name="key">The cache-key to check.</param>
/// <returns><c>True</c> if the key exists in the cache, otherwise <c>False</c>.</returns>
public
bool
Exists
(
K
key
)
{
if
(
disposed
)
{
return
false
;
}
_locker
.
EnterReadLock
();
try
{
return
_cache
.
ContainsKey
(
key
);
}
finally
{
_locker
.
ExitReadLock
();
}
}
#
endregion
}
#
endregion
#
region
Other
Cache
classes
(
derived
)
/// <summary>
/// This is a generic cache subsystem based on key/value pairs, where key is a string.
/// You can add any item to this cache as long as the key is unique, so treat keys as something like namespaces and
/// build them with a
/// specific system/syntax in your application.
/// Every cache entry has its own timeout.
/// Cache is thread safe and will delete expired entries on its own using System.Threading.Timers (which run on
/// <see cref="ThreadPool" /> threads).
/// </summary>
/// <summary>
/// The non-generic Cache class instanciates a Cache{object} that can be used with any type of (mixed) contents.
/// It also publishes a static <c>.Global</c> member, so a cache can be used even without creating a dedicated
/// instance.
/// The <c>.Global</c> member is lazy instanciated.
/// </summary>
internal
class
CapCache
:
Cache
<
string
,
object
>
{
#
region
Static
Global
Cache
instance
private
static
readonly
Lazy
<
CapCache
>
global
=
new
Lazy
<
CapCache
>();
/// <summary>
/// Gets the global shared cache instance valid for the entire process.
/// </summary>
/// <value>
/// The global shared cache instance.
/// </value>
public
static
CapCache
Global
=>
global
.
Value
;
#
endregion
}
#
endregion
}
\ No newline at end of file
src/DotNetCore.CAP.Dashboard/CoercedAwaitableInfo.cs
0 → 100644
View file @
c4f4f5f4
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System
;
using
System.Linq.Expressions
;
using
Microsoft.Extensions.Internal
;
namespace
DotNetCore.CAP.Dashboard
{
internal
struct
CoercedAwaitableInfo
{
public
AwaitableInfo
AwaitableInfo
{
get
;
}
public
Expression
CoercerExpression
{
get
;
}
public
Type
CoercerResultType
{
get
;
}
public
bool
RequiresCoercion
=>
CoercerExpression
!=
null
;
public
CoercedAwaitableInfo
(
AwaitableInfo
awaitableInfo
)
{
AwaitableInfo
=
awaitableInfo
;
CoercerExpression
=
null
;
CoercerResultType
=
null
;
}
public
CoercedAwaitableInfo
(
Expression
coercerExpression
,
Type
coercerResultType
,
AwaitableInfo
coercedAwaitableInfo
)
{
CoercerExpression
=
coercerExpression
;
CoercerResultType
=
coercerResultType
;
AwaitableInfo
=
coercedAwaitableInfo
;
}
public
static
bool
IsTypeAwaitable
(
Type
type
,
out
CoercedAwaitableInfo
info
)
{
if
(
AwaitableInfo
.
IsTypeAwaitable
(
type
,
out
var
directlyAwaitableInfo
))
{
info
=
new
CoercedAwaitableInfo
(
directlyAwaitableInfo
);
return
true
;
}
info
=
default
(
CoercedAwaitableInfo
);
return
false
;
}
}
}
\ No newline at end of file
src/DotNetCore.CAP.Dashboard/CombinedResourceDispatcher.cs
View file @
c4f4f5f4
...
...
@@ -2,6 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System.Reflection
;
using
System.Threading.Tasks
;
namespace
DotNetCore.CAP.Dashboard
{
...
...
@@ -22,14 +23,14 @@ namespace DotNetCore.CAP.Dashboard
_resourceNames
=
resourceNames
;
}
protected
override
void
WriteResponse
(
DashboardResponse
response
)
protected
override
async
Task
WriteResponse
(
DashboardResponse
response
)
{
foreach
(
var
resourceName
in
_resourceNames
)
{
WriteResource
(
response
,
_assembly
,
$"
{
_baseNamespace
}
.
{
resourceName
}
"
);
await
WriteResource
(
response
,
_assembly
,
$"
{
_baseNamespace
}
.
{
resourceName
}
"
);
}
}
}
...
...
src/DotNetCore.CAP.Dashboard/DashboardContext.cs
View file @
c4f4f5f4
...
...
@@ -3,13 +3,14 @@
using
System
;
using
System.Text.RegularExpressions
;
using
DotNetCore.CAP.Persistence
;
using
Microsoft.AspNetCore.Http
;
namespace
DotNetCore.CAP.Dashboard
{
public
abstract
class
DashboardContext
{
protected
DashboardContext
(
IStorage
storage
,
DashboardOptions
options
)
protected
DashboardContext
(
I
Data
Storage
storage
,
DashboardOptions
options
)
{
if
(
storage
==
null
)
{
...
...
@@ -25,7 +26,7 @@ namespace DotNetCore.CAP.Dashboard
Options
=
options
;
}
public
IStorage
Storage
{
get
;
}
public
I
Data
Storage
Storage
{
get
;
}
public
DashboardOptions
Options
{
get
;
}
...
...
@@ -41,7 +42,7 @@ namespace DotNetCore.CAP.Dashboard
public
sealed
class
CapDashboardContext
:
DashboardContext
{
public
CapDashboardContext
(
IStorage
storage
,
I
Data
Storage
storage
,
DashboardOptions
options
,
HttpContext
httpContext
)
:
base
(
storage
,
options
)
...
...
src/DotNetCore.CAP.Dashboard/DashboardRoutes.cs
View file @
c4f4f5f4
...
...
@@ -83,14 +83,14 @@ namespace DotNetCore.CAP.Dashboard
Routes
.
AddJsonResult
(
"/published/message/(?<Id>.+)"
,
x
=>
{
var
id
=
long
.
Parse
(
x
.
UriMatch
.
Groups
[
"Id"
].
Value
);
var
message
=
x
.
Storage
.
Get
Connection
().
GetPublishedMessageAsync
(
id
)
var
message
=
x
.
Storage
.
Get
MonitoringApi
().
GetPublishedMessageAsync
(
id
)
.
GetAwaiter
().
GetResult
();
return
message
.
Content
;
});
Routes
.
AddJsonResult
(
"/received/message/(?<Id>.+)"
,
x
=>
{
var
id
=
long
.
Parse
(
x
.
UriMatch
.
Groups
[
"Id"
].
Value
);
var
message
=
x
.
Storage
.
Get
Connection
().
GetReceivedMessageAsync
(
id
)
var
message
=
x
.
Storage
.
Get
MonitoringApi
().
GetReceivedMessageAsync
(
id
)
.
GetAwaiter
().
GetResult
();
return
message
.
Content
;
});
...
...
@@ -99,7 +99,7 @@ namespace DotNetCore.CAP.Dashboard
"/published/requeue"
,
(
client
,
messageId
)
=>
{
var
msg
=
client
.
Storage
.
Get
Connection
().
GetPublishedMessageAsync
(
messageId
)
var
msg
=
client
.
Storage
.
Get
MonitoringApi
().
GetPublishedMessageAsync
(
messageId
)
.
GetAwaiter
().
GetResult
();
client
.
RequestServices
.
GetService
<
IDispatcher
>().
EnqueueToPublish
(
msg
);
});
...
...
@@ -107,9 +107,9 @@ namespace DotNetCore.CAP.Dashboard
"/received/requeue"
,
(
client
,
messageId
)
=>
{
var
msg
=
client
.
Storage
.
Get
Connection
().
GetReceivedMessageAsync
(
messageId
)
var
msg
=
client
.
Storage
.
Get
MonitoringApi
().
GetReceivedMessageAsync
(
messageId
)
.
GetAwaiter
().
GetResult
();
client
.
RequestServices
.
GetService
<
I
Dispatcher
>().
EnqueueToExecute
(
msg
);
client
.
RequestServices
.
GetService
<
I
SubscriberExecutor
>().
ExecuteAsync
(
msg
);
});
Routes
.
AddRazorPage
(
...
...
src/DotNetCore.CAP.Dashboard/DotNetCore.CAP.Dashboard.csproj
View file @
c4f4f5f4
...
...
@@ -2,8 +2,21 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup>
<MSBuildCurrentFullPath>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe</MSBuildCurrentFullPath>
<RazorProjectFile>Razor.build</RazorProjectFile>
<InnerTargets>GenerateRazorClasses;Build</InnerTargets>
</PropertyGroup>
<Target Name="GenerateRazorClasses">
<Exec Command=""$(MSBuildCurrentFullPath)" $(RazorProjectFile) /v:quiet /nologo" Condition="Exists('$(MSBuildCurrentFullPath)')" />
<Warning Text="Classes for Razor files (*.cshtml) weren't re-generated: couldn't find the '$(MSBuildCurrentFullPath)' file" Condition="!Exists('$(MSBuildCurrentFullPath)')" />
</Target>
<ItemGroup>
<EmbeddedResource Include="Content\css\bootstrap.min.css" />
<EmbeddedResource Include="Content\css\cap.css" />
...
...
@@ -25,83 +38,129 @@
<EmbeddedResource Include="Content\js\rickshaw.min.js" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Consul" Version="0.7.2.6" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DotNetCore.CAP\DotNetCore.CAP.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="
Dashboard\
Content\resx\Strings.Designer.cs">
<Compile Update="Content\resx\Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_SidebarMenu.generated.cs">
<Compile Update="Pages\_BlockMetric.generated.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>_BlockMetric.cshtml</DependentUpon>
</Compile>
<Compile Update="Pages\_SidebarMenu.generated.cs">
<DependentUpon>_SidebarMenu.cshtml</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="
Dashboard\
Pages\SidebarMenu.cs">
<Compile Update="Pages\SidebarMenu.cs">
<DependentUpon>_SidebarMenu.cshtml</DependentUpon>
</Compile>
<Compile Update="
Dashboard\
Pages\ReceivedPage.generated.cs">
<Compile Update="Pages\ReceivedPage.generated.cs">
<DependentUpon>ReceivedPage.cshtml</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="
Dashboard\
Pages\ReceivedPage.cs">
<Compile Update="Pages\ReceivedPage.cs">
<DependentUpon>ReceivedPage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_BlockMetric.generated.cs">
<DependentUpon>_BlockMetric.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\BlockMetric.cs">
<Compile Update="Pages\BlockMetric.cs">
<DependentUpon>_BlockMetric.cshtml</DependentUpon>
</Compile>
<Compile Update="
Dashboard\
Pages\Breadcrumbs.cs">
<Compile Update="Pages\Breadcrumbs.cs">
<DependentUpon>_Breadcrumbs.cshtml</DependentUpon>
</Compile>
<Compile Update="
Dashboard\
Pages\_Breadcrumbs.generated.cs">
<Compile Update="Pages\_Breadcrumbs.generated.cs">
<DependentUpon>_Breadcrumbs.cshtml</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="
Dashboard\
Pages\_Paginator.generated.cs">
<Compile Update="Pages\_Paginator.generated.cs">
<DependentUpon>_Paginator.cshtml</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="
Dashboard\
Pages\_Paginator.cs">
<Compile Update="Pages\_Paginator.cs">
<DependentUpon>_Paginator.cshtml</DependentUpon>
</Compile>
<Compile Update="
Dashboard\
Pages\_PerPageSelector.cs">
<Compile Update="Pages\_PerPageSelector.cs">
<DependentUpon>_PerPageSelector.cshtml</DependentUpon>
</Compile>
<Compile Update="
Dashboard\
Pages\_PerPageSelector.generated.cs">
<Compile Update="Pages\_PerPageSelector.generated.cs">
<DependentUpon>_PerPageSelector.cshtml</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="
Dashboard\
Pages\PublishedPage.cs">
<Compile Update="Pages\PublishedPage.cs">
<DependentUpon>PublishedPage.cshtml</DependentUpon>
</Compile>
<Compile Update="
Dashboard\
Pages\PublishedPage*.cs">
<Compile Update="Pages\PublishedPage*.cs">
<DependentUpon>PublishedPage.cshtml</DependentUpon>
</Compile>
<Compile Update="
Dashboard\
Pages\LayoutPage.*.cs">
<Compile Update="Pages\LayoutPage.*.cs">
<DependentUpon>LayoutPage.cshtml</DependentUpon>
</Compile>
<Compile Update="
Dashboard\
Pages\LayoutPage.cs">
<Compile Update="Pages\LayoutPage.cs">
<DependentUpon>LayoutPage.cshtml</DependentUpon>
</Compile>
<Compile Update="
Dashboard\
Pages\InlineMetric.cs">
<Compile Update="Pages\InlineMetric.cs">
<DependentUpon>_InlineMetric.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\_InlineMetric.generated.cs">
<Compile Update="Pages\LayoutPage.generated.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>LayoutPage.cshtml</DependentUpon>
</Compile>
<Compile Update="Pages\PublishedPage.generated.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>PublishedPage.cshtml</DependentUpon>
</Compile>
<Compile Update="Pages\_InlineMetric.generated.cs">
<DependentUpon>_InlineMetric.cshtml</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="
Dashboard\
Pages\_Navigation.generated.cs">
<Compile Update="Pages\_Navigation.generated.cs">
<DependentUpon>_Navigation.cshtml</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="
Dashboard\
Pages\HomePage.generated.cs">
<Compile Update="Pages\HomePage.generated.cs">
<DependentUpon>HomePage.cshtml</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="
Dashboard\
Pages\HomePage.cs">
<Compile Update="Pages\HomePage.cs">
<DependentUpon>HomePage.cshtml</DependentUpon>
</Compile>
<Compile Update="
Dashboard\
Pages\SubscriberPage.generated.cs">
<Compile Update="Pages\SubscriberPage.generated.cs">
<DependentUpon>SubscriberPage.cshtml</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="Pages\NodePage*.cs">
<DependentUpon>NodePage.cshtml</DependentUpon>
</Compile>
<Compile Update="Dashboard\Pages\NodePage*.cs">
</ItemGroup>
<ItemGroup>
<Compile Update="Pages\NodePage.generated.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>NodePage.cshtml</DependentUpon>
</Compile>
</ItemGroup>
...
...
@@ -115,11 +174,66 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="
Dashboard\
Content\resx\Strings.resx">
<EmbeddedResource Update="Content\resx\Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<CustomToolNamespace>DotNetCore.CAP.Dashboard.Resources</CustomToolNamespace>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="Pages\HomePage.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>HomePage.generated.cs</LastGenOutput>
</None>
<None Update="Pages\LayoutPage.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>LayoutPage.generated.cs</LastGenOutput>
</None>
<None Update="Pages\NodePage.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>NodePage.generated.cs</LastGenOutput>
</None>
<None Update="Pages\PublishedPage.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>PublishedPage.generated.cs</LastGenOutput>
</None>
<None Update="Pages\ReceivedPage.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>ReceivedPage.generated.cs</LastGenOutput>
</None>
<None Update="Pages\SubscriberPage.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>SubscriberPage.generated.cs</LastGenOutput>
</None>
<None Update="Pages\_BlockMetric.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>_BlockMetric.generated.cs</LastGenOutput>
</None>
<None Update="Pages\_Breadcrumbs.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>_Breadcrumbs.generated.cs</LastGenOutput>
</None>
<None Update="Pages\_InlineMetric.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>_InlineMetric.generated.cs</LastGenOutput>
</None>
<None Update="Pages\_Navigation.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>_Navigation.generated.cs</LastGenOutput>
</None>
<None Update="Pages\_Paginator.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>_Paginator.generated.cs</LastGenOutput>
</None>
<None Update="Pages\_PerPageSelector.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>_PerPageSelector.generated.cs</LastGenOutput>
</None>
<None Update="Pages\_SidebarMenu.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>_SidebarMenu.generated.cs</LastGenOutput>
</None>
</ItemGroup>
</Project>
src/DotNetCore.CAP.Dashboard/EmbeddedResourceDispatcher.cs
View file @
c4f4f5f4
...
...
@@ -30,22 +30,20 @@ namespace DotNetCore.CAP.Dashboard
}
}
public
Task
Dispatch
(
DashboardContext
context
)
public
async
Task
Dispatch
(
DashboardContext
context
)
{
context
.
Response
.
ContentType
=
_contentType
;
context
.
Response
.
SetExpire
(
DateTimeOffset
.
Now
.
AddYears
(
1
));
WriteResponse
(
context
.
Response
);
return
Task
.
FromResult
(
true
);
await
WriteResponse
(
context
.
Response
);
}
protected
virtual
void
WriteResponse
(
DashboardResponse
response
)
protected
virtual
Task
WriteResponse
(
DashboardResponse
response
)
{
WriteResource
(
response
,
_assembly
,
_resourceName
);
return
WriteResource
(
response
,
_assembly
,
_resourceName
);
}
protected
void
WriteResource
(
DashboardResponse
response
,
Assembly
assembly
,
string
resourceName
)
protected
async
Task
WriteResource
(
DashboardResponse
response
,
Assembly
assembly
,
string
resourceName
)
{
using
(
var
inputStream
=
assembly
.
GetManifestResourceStream
(
resourceName
))
{
...
...
@@ -54,8 +52,7 @@ namespace DotNetCore.CAP.Dashboard
throw
new
ArgumentException
(
$@"Resource with name
{
resourceName
}
not found in assembly
{
assembly
}
."
);
}
inputStream
.
CopyTo
(
response
.
Body
);
await
inputStream
.
CopyToAsync
(
response
.
Body
);
}
}
}
...
...
src/DotNetCore.CAP.Dashboard/GatewayProxy/GatewayProxyMiddleware.cs
View file @
c4f4f5f4
...
...
@@ -9,7 +9,7 @@ using System.Net;
using
System.Net.Http
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Dashboard.GatewayProxy.Requester
;
using
DotNetCore.CAP.NodeDiscovery
;
using
DotNetCore.CAP.
Dashboard.
NodeDiscovery
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Primitives
;
...
...
src/DotNetCore.CAP.Dashboard/HtmlHelper.cs
View file @
c4f4f5f4
...
...
@@ -10,7 +10,7 @@ using System.Text;
using
System.Text.RegularExpressions
;
using
DotNetCore.CAP.Dashboard.Pages
;
using
DotNetCore.CAP.Dashboard.Resources
;
using
DotNetCore.CAP.In
frastructure
;
using
DotNetCore.CAP.In
ternal
;
using
DotNetCore.CAP.Messages
;
using
Microsoft.Extensions.Internal
;
...
...
src/DotNetCore.CAP.Dashboard/JsonDispatcher.cs
View file @
c4f4f5f4
...
...
@@ -38,7 +38,7 @@ namespace DotNetCore.CAP.Dashboard
{
new
StringEnumConverter
{
NamingStrategy
=
new
CamelCaseNamingStrategy
()
CamelCaseText
=
true
}
}
};
...
...
src/DotNetCore.CAP.Dashboard/JsonStats.cs
View file @
c4f4f5f4
...
...
@@ -34,7 +34,7 @@ namespace DotNetCore.CAP.Dashboard
{
new
StringEnumConverter
{
NamingStrategy
=
new
CamelCaseNamingStrategy
()
CamelCaseText
=
true
}
}
};
...
...
@@ -46,7 +46,7 @@ namespace DotNetCore.CAP.Dashboard
private
class
StubPage
:
RazorPage
{
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
}
}
...
...
src/DotNetCore.CAP.Dashboard/LocalRequestsOnlyAuthorizationFilter.cs
View file @
c4f4f5f4
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using
DotNetCore.CAP.In
frastructure
;
using
DotNetCore.CAP.In
ternal
;
namespace
DotNetCore.CAP.Dashboard
{
...
...
src/DotNetCore.CAP.Dashboard/MessageHistoryRenderer.cs
View file @
c4f4f5f4
...
...
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using
System.Diagnostics.CodeAnalysis
;
using
System.Net
;
using
System.Text
;
using
DotNetCore.CAP.In
frastructure
;
using
DotNetCore.CAP.In
ternal
;
namespace
DotNetCore.CAP.Dashboard
{
...
...
@@ -24,16 +24,16 @@ namespace DotNetCore.CAP.Dashboard
[
SuppressMessage
(
"Microsoft.Performance"
,
"CA1810:InitializeReferenceTypeStaticFieldsInline"
)]
static
MessageHistoryRenderer
()
{
Register
(
StatusName
.
Succeeded
,
SucceededRenderer
);
Register
(
StatusName
.
Failed
,
FailedRenderer
);
Register
(
nameof
(
StatusName
.
Succeeded
)
,
SucceededRenderer
);
Register
(
nameof
(
StatusName
.
Failed
)
,
FailedRenderer
);
BackgroundStateColors
.
Add
(
StatusName
.
Succeeded
,
"#EDF7ED"
);
BackgroundStateColors
.
Add
(
StatusName
.
Failed
,
"#FAEBEA"
);
BackgroundStateColors
.
Add
(
StatusName
.
Scheduled
,
"#E0F3F8"
);
BackgroundStateColors
.
Add
(
nameof
(
StatusName
.
Succeeded
)
,
"#EDF7ED"
);
BackgroundStateColors
.
Add
(
nameof
(
StatusName
.
Failed
)
,
"#FAEBEA"
);
BackgroundStateColors
.
Add
(
nameof
(
StatusName
.
Scheduled
)
,
"#E0F3F8"
);
ForegroundStateColors
.
Add
(
StatusName
.
Succeeded
,
"#5cb85c"
);
ForegroundStateColors
.
Add
(
StatusName
.
Failed
,
"#d9534f"
);
ForegroundStateColors
.
Add
(
StatusName
.
Scheduled
,
"#5bc0de"
);
ForegroundStateColors
.
Add
(
nameof
(
StatusName
.
Succeeded
)
,
"#5cb85c"
);
ForegroundStateColors
.
Add
(
nameof
(
StatusName
.
Failed
)
,
"#d9534f"
);
ForegroundStateColors
.
Add
(
nameof
(
StatusName
.
Scheduled
)
,
"#5bc0de"
);
}
public
static
void
AddBackgroundStateColor
(
string
stateName
,
string
color
)
...
...
src/DotNetCore.CAP.Dashboard/Pages/BlockMetric.cs
View file @
c4f4f5f4
...
...
@@ -7,9 +7,9 @@ namespace DotNetCore.CAP.Dashboard.Pages
{
public
BlockMetric
(
DashboardMetric
dashboardMetric
)
{
Dashboard
Metric
=
dashboardMetric
;
Metric
=
dashboardMetric
;
}
public
DashboardMetric
Dashboard
Metric
{
get
;
}
public
DashboardMetric
Metric
{
get
;
}
}
}
\ No newline at end of file
src/DotNetCore.CAP.Dashboard/Pages/HomePage.generated.cs
View file @
c4f4f5f4
using
DotNetCore.CAP.Messages
;
#pragma warning disable 1591
#
pragma
warning
disable
1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
...
...
@@ -13,63 +11,45 @@
namespace
DotNetCore.CAP.Dashboard.Pages
{
#line 2 "..\..\HomePage.cshtml"
using
System
;
#line default
#line hidden
#line 3 "..\..\HomePage.cshtml"
using
System.Collections.Generic
;
#line default
#line hidden
using
System.Linq
;
using
System.Text
;
#line 5 "..\..\HomePage.cshtml"
using
DotNetCore.CAP.Dashboard
;
#line default
#line hidden
#line 6 "..\..\HomePage.cshtml"
#
line
2
"..\..\Pages\HomePage.cshtml"
using
DotNetCore.CAP.Dashboard.Pages
;
#line default
#line hidden
#line 7 "..\..
\HomePage.cshtml"
#
line
default
#
line
hidden
#
line
3
"..\..\Pages
\HomePage.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
#line default
#line hidden
#line 4 "..\..\HomePage.cshtml"
#line default
#line hidden
#line 8 "..\..\HomePage.cshtml"
#
line
default
#
line
hidden
#
line
4
"..\..\Pages\HomePage.cshtml"
using
DotNetCore.CAP.Messages
;
#
line
default
#
line
hidden
#
line
5
"..\..\Pages\HomePage.cshtml"
using
Newtonsoft.Json
;
#line default
#line hidden
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
HomePage
:
RazorPage
internal
partial
class
HomePage
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"\r\n"
);
...
...
@@ -77,175 +57,177 @@ namespace DotNetCore.CAP.Dashboard.Pages
#line 10 "..\..\HomePage.cshtml"
#
line
7
"..\..\Pages\HomePage.cshtml"
Layout
=
new
LayoutPage
(
Strings
.
HomePage_Title
);
Layout
=
new
LayoutPage
(
Strings
.
HomePage_Title
);
var
monitor
=
Storage
.
GetMonitoringApi
();
var
publishedSucceeded
=
monitor
.
HourlySucceededJobs
(
MessageType
.
Publish
);
var
publishedFailed
=
monitor
.
HourlyFailedJobs
(
MessageType
.
Publish
);
var
monitor
=
Storage
.
GetMonitoringApi
();
IDictionary
<
DateTime
,
int
>
publishedSucceeded
=
monitor
.
HourlySucceededJobs
(
MessageType
.
Publish
);
IDictionary
<
DateTime
,
int
>
publishedFailed
=
monitor
.
HourlyFailedJobs
(
MessageType
.
Publish
);
var
receivedSucceeded
=
monitor
.
HourlySucceededJobs
(
MessageType
.
Subscribe
);
var
receivedFailed
=
monitor
.
HourlyFailedJobs
(
MessageType
.
Subscribe
);
IDictionary
<
DateTime
,
int
>
receivedSucceeded
=
monitor
.
HourlySucceededJobs
(
MessageType
.
Subscribe
);
IDictionary
<
DateTime
,
int
>
receivedFailed
=
monitor
.
HourlyFailedJobs
(
MessageType
.
Subscribe
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <h1 class=\"page-header\""
+
">"
);
#line default
#line hidden
WriteLiteral
(
"\r\n<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <h1 class=\"page-header\""
+
">"
);
#line 23 "..\..\HomePage.cshtml"
Write
(
Strings
.
HomePage_Title
);
#line default
#line hidden
WriteLiteral
(
"</h1>\r\n"
);
#
line
20
"..\..\Pages\HomePage.cshtml"
Write
(
Strings
.
HomePage_Title
);
#
line
default
#
line
hidden
WriteLiteral
(
"</h1>\r\n"
);
#line 24 "..\..\HomePage.cshtml"
if
(
Metrics
.
Count
>
0
)
{
#line default
#line hidden
WriteLiteral
(
" <div class=\"row\">\r\n"
);
#
line
21
"..\..\Pages\HomePage.cshtml"
if
(
Metrics
.
Count
>
0
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <div class=\"row\">\r\n"
);
#line 27 "..\..\HomePage.cshtml"
foreach
(
var
metric
in
Metrics
)
#
line
24
"..\..\Pages\HomePage.cshtml"
foreach
(
var
metric
in
Metrics
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <div class=\"col-md-2\">\r\n "
);
#line default
#line hidden
WriteLiteral
(
" <div class=\"col-md-2\">\r\n "
);
#line 30 "..\..\HomePage.cshtml"
Write
(
Html
.
BlockMetric
(
metric
));
#
line
27
"..\..\Pages\HomePage.cshtml"
Write
(
Html
.
BlockMetric
(
metric
));
#line default
#line hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#line 32 "..\..\HomePage.cshtml"
#
line
29
"..\..\Pages\HomePage.cshtml"
}
#line default
#line hidden
WriteLiteral
(
" </div>\r\n"
);
#line 34 "..\..\HomePage.cshtml"
}
#line default
#line hidden
WriteLiteral
(
" <h3>"
);
#
line
default
#
line
hidden
WriteLiteral
(
" </div>\r\n"
);
#line 35 "..\..\HomePage.cshtml"
Write
(
Strings
.
HomePage_RealtimeGraph
);
#line default
#line hidden
WriteLiteral
(
"</h3>\r\n <div id=\"realtimeGraph\"\r\n data-published-succeeded=\""
);
#line 37 "..\..\HomePage.cshtml"
Write
(
Statistics
.
PublishedSucceeded
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-published-failed=\""
);
#line 38 "..\..\HomePage.cshtml"
Write
(
Statistics
.
PublishedFailed
);
#
line
31
"..\..\Pages\HomePage.cshtml"
}
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-published-succeeded-string=\""
);
#
line
default
#
line
hidden
WriteLiteral
(
" <h3>"
);
#
line
32
"..\..\Pages\HomePage.cshtml"
Write
(
Strings
.
HomePage_RealtimeGraph
);
#line 39 "..\..\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_PSucceeded
);
#
line
default
#
line
hidden
WriteLiteral
(
"</h3>\r\n <div id=\"realtimeGraph\"\r\n data-published-succeeded=\""
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-published-failed-string=\""
);
#
line
34
"..\..\Pages\HomePage.cshtml"
Write
(
Statistics
.
PublishedSucceeded
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-published-failed=\""
);
#line 40 "..\..\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_PFailed
);
#
line
35
"..\..\Pages\HomePage.cshtml"
Write
(
Statistics
.
PublishedFailed
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-published-succeeded-string=\""
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-received-succeeded=\""
);
#
line
36
"..\..\Pages\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_PSucceeded
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-published-failed-string=\""
);
#line 41 "..\..\HomePage.cshtml"
Write
(
Statistics
.
ReceivedSucceeded
);
#
line
37
"..\..\Pages\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_PFailed
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-received-failed=\""
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-received-succeeded=\""
);
#
line
38
"..\..\Pages\HomePage.cshtml"
Write
(
Statistics
.
ReceivedSucceeded
);
#line 42 "..\..\HomePage.cshtml"
Write
(
Statistics
.
ReceivedFailed
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-received-failed=\""
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-received-succeeded-string=\""
);
#
line
39
"..\..\Pages\HomePage.cshtml"
Write
(
Statistics
.
ReceivedFailed
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-received-succeeded-string=\""
);
#line 43 "..\..\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_RSucceeded
);
#
line
40
"..\..\Pages\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_RSucceeded
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-received-failed-string=\""
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-received-failed-string=\""
);
#
line
41
"..\..\Pages\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_RFailed
);
#line 44 "..\..\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_RFailed
);
#line default
#line hidden
WriteLiteral
(
@"""></div>
#
line
default
#
line
hidden
WriteLiteral
(
@""">
</div>
<div style=""display: none;"">
<span data-metric=""published_succeeded:count""></span>
<span data-metric=""published_failed:count""></span>
...
...
@@ -257,95 +239,95 @@ namespace DotNetCore.CAP.Dashboard.Pages
"
);
#
line
51
"..\..\Pages\HomePage.cshtml"
Write
(
Strings
.
HomePage_HistoryGraph
);
#line 53 "..\..\HomePage.cshtml"
Write
(
Strings
.
HomePage_HistoryGraph
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </h3>\r\n\r\n <div id=\"historyGraph\"\r\n data-published-su"
+
"cceeded=\""
);
#line default
#line hidden
WriteLiteral
(
"\r\n </h3>\r\n\r\n <div id=\"historyGraph\"\r\n data-published-su"
+
"cceeded=\""
);
#line 57 "..\..\HomePage.cshtml"
Write
(
JsonConvert
.
SerializeObject
(
publishedSucceeded
));
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-published-failed=\""
);
#line 58 "..\..\HomePage.cshtml"
Write
(
JsonConvert
.
SerializeObject
(
publishedFailed
));
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-published-succeeded-string=\""
);
#
line
55
"..\..\Pages\HomePage.cshtml"
Write
(
JsonConvert
.
SerializeObject
(
publishedSucceeded
));
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-published-failed=\""
);
#line 59 "..\..\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_PSucceeded
);
#
line
56
"..\..\Pages\HomePage.cshtml"
Write
(
JsonConvert
.
SerializeObject
(
publishedFailed
));
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-published-failed-string=\""
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-published-succeeded-string=\""
);
#
line
57
"..\..\Pages\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_PSucceeded
);
#line 60 "..\..\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_PFailed
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-published-failed-string=\""
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-received-succeeded=\""
);
#
line
58
"..\..\Pages\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_PFailed
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-received-succeeded=\""
);
#line 61 "..\..\HomePage.cshtml"
Write
(
JsonConvert
.
SerializeObject
(
receivedSucceeded
));
#
line
59
"..\..\Pages\HomePage.cshtml"
Write
(
JsonConvert
.
SerializeObject
(
receivedSucceeded
));
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-received-failed=\""
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-received-failed=\""
);
#
line
60
"..\..\Pages\HomePage.cshtml"
Write
(
JsonConvert
.
SerializeObject
(
receivedFailed
));
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-received-succeeded-string=\""
);
#line 62 "..\..\HomePage.cshtml"
Write
(
JsonConvert
.
SerializeObject
(
receivedFailed
));
#
line
61
"..\..\Pages\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_RSucceeded
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-received-succeeded-string=\""
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-received-failed-string=\""
);
#
line
62
"..\..\Pages\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_RFailed
);
#line 63 "..\..\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_RSucceeded
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-received-failed-string=\""
);
#line 64 "..\..\HomePage.cshtml"
Write
(
Strings
.
HomePage_GraphHover_RFailed
);
#line default
#line hidden
WriteLiteral
(
"\">\r\n </div>\r\n </div>\r\n</div>"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n </div>\r\n </div>\r\n</div>"
);
}
...
...
src/DotNetCore.CAP.Dashboard/Pages/LayoutPage.generated.cs
View file @
c4f4f5f4
...
...
@@ -11,313 +11,306 @@
namespace
DotNetCore.CAP.Dashboard.Pages
{
#line 2 "..\..
\LayoutPage.cshtml"
#
line
2
"..\..\Pages
\LayoutPage.cshtml"
using
System
;
#line default
#line hidden
#
line
default
#
line
hidden
using
System.Collections.Generic
;
#line 3 "..\..
\LayoutPage.cshtml"
#
line
3
"..\..\Pages
\LayoutPage.cshtml"
using
System.Globalization
;
#line default
#line hidden
#
line
default
#
line
hidden
using
System.Linq
;
#line 4 "..\..
\LayoutPage.cshtml"
#
line
4
"..\..\Pages
\LayoutPage.cshtml"
using
System.Reflection
;
#line default
#line hidden
#
line
default
#
line
hidden
using
System.Text
;
#line 5 "..\..
\LayoutPage.cshtml"
#
line
5
"..\..\Pages
\LayoutPage.cshtml"
using
DotNetCore.CAP.Dashboard.Pages
;
#line default
#line hidden
#line 6 "..\..
\LayoutPage.cshtml"
#
line
default
#
line
hidden
#
line
6
"..\..\Pages
\LayoutPage.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
#line default
#line hidden
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
public
partial
class
LayoutPage
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"<!DOCTYPE html>\r\n<html lang=\""
);
#line 9 "..\..\LayoutPage.cshtml"
Write
(
CultureInfo
.
CurrentUICulture
.
TwoLetterISOLanguageName
);
#line default
#line hidden
WriteLiteral
(
"\">\r\n<head>\r\n <title>"
);
#line 11 "..\..\LayoutPage.cshtml"
Write
(
Title
);
WriteLiteral
(
"<!DOCTYPE html>\r\n<html lang=\""
);
#line default
#line hidden
WriteLiteral
(
" - CAP</title>\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n <m"
+
"eta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, ini"
+
"tial-scale=1.0\">\r\n"
);
#
line
9
"..\..\Pages\LayoutPage.cshtml"
Write
(
CultureInfo
.
CurrentUICulture
.
TwoLetterISOLanguageName
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n<head>\r\n <title>"
);
#line 15 "..\..\LayoutPage.cshtml"
var
version
=
GetType
().
GetTypeInfo
().
Assembly
.
GetName
().
Version
;
#
line
11
"..\..\Pages\LayoutPage.cshtml"
Write
(
Title
);
#
line
default
#
line
hidden
WriteLiteral
(
" - CAP</title>\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n <m"
+
"eta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, ini"
+
"tial-scale=1.0\">\r\n"
);
#line default
#line hidden
WriteLiteral
(
" <link rel=\"stylesheet\" href=\""
);
#
line
15
"..\..\Pages\LayoutPage.cshtml"
var
version
=
GetType
().
GetTypeInfo
().
Assembly
.
GetName
().
Version
;
#
line
default
#
line
hidden
WriteLiteral
(
" <link rel=\"stylesheet\" href=\""
);
#line 16 "..\..\LayoutPage.cshtml"
Write
(
Url
.
To
(
$"/css
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
#
line
16
"..\..\Pages\LayoutPage.cshtml"
Write
(
Url
.
To
(
$"/css
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
#line default
#line hidden
WriteLiteral
(
@""">
#
line
default
#
line
hidden
WriteLiteral
(
@""">
</head>
<body>
<!-- Wrap all page content here -->
<div id=""wrap"">
<!-- Fixed navbar -->
<div class=""navbar navbar-default navbar-fixed-top"">
<div class=""container"">
<div class=""navbar-header"">
<button type=""button"" class=""navbar-toggle"" data-toggle=""collapse"" data-target="".navbar-collapse"">
<span class=""icon-bar""></span>
<span class=""icon-bar""></span>
<span class=""icon-bar""></span>
</button>
<a class=""navbar-brand"" href="""
);
#line 31 "..\..\LayoutPage.cshtml"
Write
(
Url
.
Home
());
#line default
#line hidden
WriteLiteral
(
"\">CAP Dashboard</a>\r\n </div>\r\n <div class=\"collapse"
+
" navbar-collapse\">\r\n "
);
#line 34 "..\..\LayoutPage.cshtml"
Write
(
Html
.
RenderPartial
(
new
Navigation
()));
#line default
#line hidden
WriteLiteral
(
"\r\n"
);
#line 35 "..\..\LayoutPage.cshtml"
if
(
AppPath
!=
null
)
{
#line default
#line hidden
WriteLiteral
(
" <ul class=\"nav navbar-nav navbar-right\">\r\n "
+
" <li>\r\n <a href=\""
);
#line 39 "..\..\LayoutPage.cshtml"
Write
(
AppPath
);
#line default
#line hidden
WriteLiteral
(
"\">\r\n <span class=\"glyphicon glyphicon-log-out\""
+
"></span>\r\n "
);
<!-- Wrap all page content here -->
<div id=""wrap"">
<!-- Fixed navbar -->
<div class=""navbar navbar-default navbar-fixed-top"">
<div class=""container"">
<div class=""navbar-header"">
<button type=""button"" class=""navbar-toggle"" data-toggle=""collapse"" data-target="".navbar-collapse"">
<span class=""icon-bar""></span>
<span class=""icon-bar""></span>
<span class=""icon-bar""></span>
</button>
<a class=""navbar-brand"" href="""
);
#line 41 "..\..\LayoutPage.cshtml"
Write
(
Strings
.
LayoutPage_Back
);
#
line
31
"..\..\Pages\LayoutPage.cshtml"
Write
(
Url
.
Home
());
#line default
#line hidden
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n "
+
" </ul>\r\n"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">CAP Dashboard</a>\r\n </div>\r\n <div class=\"collapse navbar-"
+
"collapse\">\r\n "
);
#
line
34
"..\..\Pages\LayoutPage.cshtml"
Write
(
Html
.
RenderPartial
(
new
Navigation
()));
#line 45 "..\..\LayoutPage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n"
);
#line default
#line hidden
WriteLiteral
(
" </div>\r\n <!--/.nav-collapse -->\r\n </div"
+
">\r\n </div>\r\n\r\n <!-- Begin page content -->\r\n <div class=\"co"
+
"ntainer\" style=\"margin-bottom: 20px;\">\r\n "
);
#
line
35
"..\..\Pages\LayoutPage.cshtml"
if
(
AppPath
!=
null
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <ul class=\"nav navbar-nav navbar-right\">\r\n "
+
" <li>\r\n <a href=\""
);
#line 53 "..\..\LayoutPage.cshtml"
Write
(
RenderBody
());
#
line
39
"..\..\Pages\LayoutPage.cshtml"
Write
(
AppPath
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n <span class=\"glyphicon glyphicon-log-out\"></s"
+
"pan>\r\n "
);
#line default
#line hidden
WriteLiteral
(
@"
</div>
</div>
<div id=""footer"">
<div class=""container"">
<ul class=""list-inline credit"">
<li>
<a href=""https://github.com/dotnetcore/cap/"" target=""_blank"">
CAP "
);
#
line
41
"..\..\Pages\LayoutPage.cshtml"
Write
(
Strings
.
LayoutPage_Back
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n "
+
" </ul>\r\n"
);
#line 62 "..\..\LayoutPage.cshtml"
Write
(
$"
{
version
.
Major
}
.
{
version
.
Minor
}
.
{
version
.
Build
}
"
);
#
line
45
"..\..\Pages\LayoutPage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" </div>\r\n <!--/.nav-collapse -->\r\n </div>\r\n </div"
+
">\r\n\r\n <!-- Begin page content -->\r\n <div class=\"container\" style=\"margin-b"
+
"ottom: 20px;\">\r\n "
);
#line default
#line hidden
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n <li>"
);
#
line
53
"..\..\Pages\LayoutPage.cshtml"
Write
(
RenderBody
());
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </div>\r\n</div>\r\n\r\n<div id=\"footer\">\r\n <div class=\"container\">\r\n <"
+
"ul class=\"list-inline credit\">\r\n <li>\r\n <a href=\"https"
+
"://github.com/dotnetcore/cap/\" target=\"_blank\">\r\n CAP "
);
#line 65 "..\..\LayoutPage.cshtml"
Write
(
Storage
);
#
line
62
"..\..\Pages\LayoutPage.cshtml"
Write
(
$"
{
version
.
Major
}
.
{
version
.
Minor
}
.
{
version
.
Build
}
"
);
#line default
#line hidden
WriteLiteral
(
"</li>\r\n <li>"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </a>\r\n </li>\r\n <li>"
);
#
line
65
"..\..\Pages\LayoutPage.cshtml"
Write
(
Storage
);
#line 66 "..\..\LayoutPage.cshtml"
Write
(
Strings
.
LayoutPage_Footer_Time
);
#
line
default
#
line
hidden
WriteLiteral
(
"</li>\r\n <li>"
);
#line default
#line hidden
WriteLiteral
(
" "
);
#
line
66
"..\..\Pages\LayoutPage.cshtml"
Write
(
Strings
.
LayoutPage_Footer_Time
);
#
line
default
#
line
hidden
WriteLiteral
(
" "
);
#line 66 "..\..\LayoutPage.cshtml"
Write
(
Html
.
LocalTime
(
DateTime
.
UtcNow
));
#
line
66
"..\..\Pages\LayoutPage.cshtml"
Write
(
Html
.
LocalTime
(
DateTime
.
UtcNow
));
#line default
#line hidden
WriteLiteral
(
"</li>\r\n
<li>"
);
#
line
default
#
line
hidden
WriteLiteral
(
"</li>\r\n
<li>"
);
#
line
67
"..\..\Pages\LayoutPage.cshtml"
Write
(
string
.
Format
(
Strings
.
LayoutPage_Footer_Generatedms
,
GenerationTime
.
Elapsed
.
TotalMilliseconds
.
ToString
(
"N"
)));
#line 67 "..\..\LayoutPage.cshtml"
Write
(
string
.
Format
(
Strings
.
LayoutPage_Footer_Generatedms
,
GenerationTime
.
Elapsed
.
TotalMilliseconds
.
ToString
(
"N"
)));
#
line
default
#
line
hidden
WriteLiteral
(
"</li>\r\n"
);
#line default
#line hidden
WriteLiteral
(
"</li>\r\n"
);
#line 68 "..\..\LayoutPage.cshtml"
if
(
NodeName
!=
null
)
#
line
68
"..\..\Pages\LayoutPage.cshtml"
if
(
NodeName
!=
null
)
{
#line default
#line hidden
WriteLiteral
(
"
<li>"
);
#
line
default
#
line
hidden
WriteLiteral
(
"
<li>"
);
#
line
70
"..\..\Pages\LayoutPage.cshtml"
Write
(
string
.
Format
(
Strings
.
LayoutPage_Footer_NodeCurrent
,
NodeName
));
#line 70 "..\..\LayoutPage.cshtml"
Write
(
string
.
Format
(
Strings
.
LayoutPage_Footer_NodeCurrent
,
NodeName
));
#
line
default
#
line
hidden
WriteLiteral
(
"</li>\r\n"
);
#line default
#line hidden
WriteLiteral
(
"</li>\r\n"
);
#line 71 "..\..\LayoutPage.cshtml"
#
line
71
"..\..\Pages\LayoutPage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" </ul>\r\n </div>\r\n</div>\r\n\r\n<div id=\"capConfig\"\r\n data-pollinterval="
+
"\""
);
#line default
#line hidden
WriteLiteral
(
" </ul>\r\n </div>\r\n </div>\r\n\r\n <div id=\"capConfig\"\r\n "
+
" data-pollinterval=\""
);
#
line
77
"..\..\Pages\LayoutPage.cshtml"
Write
(
StatsPollingInterval
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-pollurl=\""
);
#line 77 "..\..\LayoutPage.cshtml"
Write
(
StatsPollingInterval
);
#
line
78
"..\..\Pages\LayoutPage.cshtml"
Write
(
Url
.
To
(
"/stats"
));
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-pollurl=\""
);
#line 78 "..\..\LayoutPage.cshtml"
Write
(
Url
.
To
(
"/stats"
));
#line default
#line hidden
WriteLiteral
(
"\">\r\n </div>\r\n\r\n <script src=\""
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n</div>\r\n\r\n<script src=\""
);
#line 81 "..\..\LayoutPage.cshtml"
Write
(
Url
.
To
(
$"/js
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
#
line
81
"..\..\Pages\LayoutPage.cshtml"
Write
(
Url
.
To
(
$"/js
{
version
.
Major
}{
version
.
Minor
}{
version
.
Build
}
"
));
#line default
#line hidden
WriteLiteral
(
"\"></script>\r\n</body>\r\n</html>"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"></script>\r\n</body>\r\n</html>"
);
}
...
...
src/DotNetCore.CAP.Dashboard/Pages/NodePage.cs
View file @
c4f4f5f4
...
...
@@ -2,7 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System.Collections.Generic
;
using
DotNetCore.CAP.NodeDiscovery
;
using
DotNetCore.CAP.
Dashboard.
NodeDiscovery
;
using
Microsoft.Extensions.DependencyInjection
;
namespace
DotNetCore.CAP.Dashboard.Pages
...
...
src/DotNetCore.CAP.Dashboard/Pages/NodePage.generated.cs
View file @
c4f4f5f4
...
...
@@ -15,243 +15,242 @@ namespace DotNetCore.CAP.Dashboard.Pages
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
#line 2 "..\..
\NodePage.cshtml"
#
line
2
"..\..\Pages
\NodePage.cshtml"
using
DotNetCore.CAP.Dashboard.Pages
;
#line default
#line hidden
#line 3 "..\..
\NodePage.cshtml"
#
line
default
#
line
hidden
#
line
3
"..\..\Pages
\NodePage.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
#line default
#line hidden
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
NodePage
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
WriteLiteral
(
"\r\n"
);
#line 5 "..\..\NodePage.cshtml"
Layout
=
new
LayoutPage
(
Strings
.
NodePage_Title
);
#line default
#line hidden
WriteLiteral
(
"<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <h1 class=\"page-header\">"
);
#line 10 "..\..\NodePage.cshtml"
Write
(
Strings
.
NodePage_Title
);
#line default
#line hidden
WriteLiteral
(
"</h1>\r\n\r\n"
);
#line 12 "..\..\NodePage.cshtml"
if
(
Nodes
==
null
||
Nodes
.
Count
==
0
)
{
#line default
#line hidden
WriteLiteral
(
" <div class=\"alert alert-warning\">\r\n "
);
#line 15 "..\..\NodePage.cshtml"
Write
(
Strings
.
NodePage_NoNodes
);
#line default
#line hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#line 17 "..\..\NodePage.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral
(
" <div class=\"table-responsive\">\r\n <table class=\"table\">"
+
"\r\n <thead>\r\n <tr>\r\n "
+
" <th width=\"10%\">"
);
#line 24 "..\..\NodePage.cshtml"
Write
(
Strings
.
Common_Id
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n <th width=\"20%\">"
);
#line 25 "..\..\NodePage.cshtml"
Write
(
Strings
.
NodePage_Table_NodeName
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n <th width=\"20%\">"
);
WriteLiteral
(
"\r\n"
);
#line 26 "..\..\NodePage.cshtml"
Write
(
Strings
.
NodePage_Table_IP
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n <th width=\"7%\">"
);
#
line
5
"..\..\Pages\NodePage.cshtml"
Layout
=
new
LayoutPage
(
Strings
.
NodePage_Title
);
#line 27 "..\..\NodePage.cshtml"
Write
(
Strings
.
NodePage_Table_Port
);
#
line
default
#
line
hidden
WriteLiteral
(
"<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <h1 class=\"page-header\">"
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n <th>Tags</th>\r\n <th"
+
" width=\"20%\">"
);
#
line
10
"..\..\Pages\NodePage.cshtml"
Write
(
Strings
.
NodePage_Title
);
#
line
default
#
line
hidden
WriteLiteral
(
"</h1>\r\n\r\n"
);
#line 29 "..\..\NodePage.cshtml"
Write
(
Strings
.
NodePage_Switch
);
#
line
12
"..\..\Pages\NodePage.cshtml"
if
(
Nodes
==
null
||
Nodes
.
Count
==
0
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <div class=\"alert alert-warning\">\r\n "
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n </tr>\r\n </thead>\r\n "
+
" <tbody>\r\n"
);
#
line
15
"..\..\Pages\NodePage.cshtml"
Write
(
Strings
.
NodePage_NoNodes
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#line 33 "..\..\NodePage.cshtml"
foreach
(
var
node
in
Nodes
)
{
#
line
17
"..\..\Pages\NodePage.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral
(
" <tr class=\""
);
#
line
default
#
line
hidden
WriteLiteral
(
" <div class=\"table-responsive\">\r\n <table class=\"table\">"
+
"\r\n <thead>\r\n <tr>\r\n "
+
" <th width=\"10%\">"
);
#
line
24
"..\..\Pages\NodePage.cshtml"
Write
(
Strings
.
Common_Id
);
#line 35 "..\..\NodePage.cshtml"
Write
(
CurrentNodeId
==
node
.
Id
?
"active"
:
null
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th width=\"20%\">"
);
#line default
#line hidden
WriteLiteral
(
"\">\r\n <td>"
);
#
line
25
"..\..\Pages\NodePage.cshtml"
Write
(
Strings
.
NodePage_Table_NodeName
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th width=\"20%\">"
);
#line 36 "..\..\NodePage.cshtml"
Write
(
node
.
Id
);
#
line
26
"..\..\Pages\NodePage.cshtml"
Write
(
Strings
.
NodePage_Table_IP
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th width=\"7%\">"
);
#line default
#line hidden
WriteLiteral
(
"</td>\r\n <td>"
);
#
line
27
"..\..\Pages\NodePage.cshtml"
Write
(
Strings
.
NodePage_Table_Port
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th>Tags</th>\r\n <th width=\""
+
"20%\">"
);
#line 37 "..\..\NodePage.cshtml"
Write
(
node
.
Name
);
#
line
29
"..\..\Pages\NodePage.cshtml"
Write
(
Strings
.
NodePage_Switch
);
#line default
#line hidden
WriteLiteral
(
"</td>\r\n <td>"
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n </tr>\r\n </thead>\r\n "
+
" <tbody>\r\n"
);
#
line
33
"..\..\Pages\NodePage.cshtml"
foreach
(
var
node
in
Nodes
)
{
#line 38 "..\..\NodePage.cshtml"
Write
(
node
.
Address
);
#
line
default
#
line
hidden
WriteLiteral
(
" <tr class=\""
);
#line default
#line hidden
WriteLiteral
(
"</td>\r\n <td>"
);
#
line
35
"..\..\Pages\NodePage.cshtml"
Write
(
CurrentNodeId
==
node
.
Id
?
"active"
:
null
);
#
line
default
#
line
hidden
WriteLiteral
(
"\">\r\n <td>"
);
#line 39 "..\..\NodePage.cshtml"
Write
(
node
.
Port
);
#
line
36
"..\..\Pages\NodePage.cshtml"
Write
(
node
.
Id
);
#
line
default
#
line
hidden
WriteLiteral
(
"</td>\r\n <td>"
);
#line default
#line hidden
WriteLiteral
(
"</td>\r\n <td>"
);
#
line
37
"..\..\Pages\NodePage.cshtml"
Write
(
node
.
Name
);
#
line
default
#
line
hidden
WriteLiteral
(
"</td>\r\n <td>"
);
#line 40 "..\..\NodePage.cshtml"
Write
(
node
.
Tags
);
#
line
38
"..\..\Pages\NodePage.cshtml"
Write
(
node
.
Address
);
#line default
#line hidden
WriteLiteral
(
"</td>\r\n <td>\r\n "
+
"
"
);
#
line
default
#
line
hidden
WriteLiteral
(
"</td>\r\n <td>
"
);
#
line
39
"..\..\Pages\NodePage.cshtml"
Write
(
node
.
Port
);
#line 42 "..\..\NodePage.cshtml"
Write
(
Html
.
NodeSwitchLink
(
node
.
Id
));
#
line
default
#
line
hidden
WriteLiteral
(
"</td>\r\n <td>"
);
#line default
#line hidden
WriteLiteral
(
"\r\n </td>\r\n </tr>\r\n"
);
#
line
40
"..\..\Pages\NodePage.cshtml"
Write
(
node
.
Tags
);
#
line
default
#
line
hidden
WriteLiteral
(
"</td>\r\n <td>\r\n "
);
#line 45 "..\..\NodePage.cshtml"
}
#
line
42
"..\..\Pages\NodePage.cshtml"
Write
(
Html
.
NodeSwitchLink
(
node
.
Id
));
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </td>\r\n </tr>\r\n"
);
#line default
#line hidden
WriteLiteral
(
" </tbody>\r\n </table>\r\n </div>\r\n"
);
#
line
45
"..\..\Pages\NodePage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" </tbody>\r\n </table>\r\n </div>\r\n"
);
#line 49 "..\..\NodePage.cshtml"
}
#
line
49
"..\..\Pages\NodePage.cshtml"
}
#line default
#line hidden
WriteLiteral
(
" </div>\r\n</div>"
);
#
line
default
#
line
hidden
WriteLiteral
(
" </div>\r\n</div>"
);
}
...
...
src/DotNetCore.CAP.Dashboard/Pages/PublishedPage.cs
View file @
c4f4f5f4
...
...
@@ -2,21 +2,22 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System
;
using
DotNetCore.CAP.Monitoring
;
namespace
DotNetCore.CAP.Dashboard.Pages
{
internal
partial
class
PublishedPage
internal
partial
class
PublishedPage
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
public
PublishedPage
(
string
statusName
)
{
Status
Name
=
statusName
;
Name
=
statusName
;
}
public
string
Status
Name
{
get
;
set
;
}
public
string
Name
{
get
;
set
;
}
public
int
GetTotal
(
IMonitoringApi
api
)
{
if
(
string
.
Equals
(
StatusName
,
Infrastructure
.
StatusName
.
Succeeded
,
if
(
string
.
Equals
(
Name
,
nameof
(
Internal
.
StatusName
.
Succeeded
)
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
return
api
.
PublishedSucceededCount
();
...
...
src/DotNetCore.CAP.Dashboard/Pages/PublishedPage.cshtml
View file @
c4f4f5f4
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@
@using System
@using DotNetCore.CAP.Dashboard
@using DotNetCore.CAP.Dashboard.Monitoring
@using DotNetCore.CAP.Dashboard.Pages
@using DotNetCore.CAP.Dashboard.Resources
@using DotNetCore.CAP.Messages
@using DotNetCore.CAP.Monitoring
@inherits DotNetCore.CAP.Dashboard.RazorPage
@{
Layout = new LayoutPage(Strings.PublishedMessagesPage_Title);
...
...
@@ -23,7 +23,7 @@
MessageType = MessageType.Publish,
Name = name,
Content = content,
StatusName =
Status
Name,
StatusName = Name,
CurrentPage = pager.CurrentPage - 1,
PageSize = pager.RecordsPerPage
};
...
...
@@ -84,7 +84,7 @@
<th>@Strings.Common_Version</th>
<th>@Strings.MessagesPage_Table_Name</th>
<th class="min-width">@Strings.MessagesPage_Table_Retries</th>
@if (string.Equals(
Status
Name, "Processing", StringComparison.CurrentCultureIgnoreCase))
@if (string.Equals(Name, "Processing", StringComparison.CurrentCultureIgnoreCase))
{
<th>@Strings.MessagesPage_Table_State</th>
}
...
...
@@ -110,7 +110,7 @@
<td>
@message.Retries
</td>
@if (string.Equals(
Status
Name, "Processing", StringComparison.CurrentCultureIgnoreCase))
@if (string.Equals(Name, "Processing", StringComparison.CurrentCultureIgnoreCase))
{
<td>
@message.StatusName
...
...
src/DotNetCore.CAP.Dashboard/Pages/PublishedPage.generated.cs
View file @
c4f4f5f4
using
DotNetCore.CAP.Messages
;
#pragma warning disable 1591
#
pragma
warning
disable
1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
...
...
@@ -13,567 +11,581 @@
namespace
DotNetCore.CAP.Dashboard.Pages
{
#line 2 "..\..
\PublishedPage.cshtml"
#
line
2
"..\..\Pages
\PublishedPage.cshtml"
using
System
;
#line default
#line hidden
#
line
default
#
line
hidden
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
#line 4 "..\..
\PublishedPage.cshtml"
#
line
3
"..\..\Pages
\PublishedPage.cshtml"
using
DotNetCore.CAP.Dashboard
;
#line default
#line hidden
#line 6 "..\..\PublishedPage.cshtml"
using
DotNetCore.CAP.Dashboard.Monitoring
;
#line default
#line hidden
#line 5 "..\..\PublishedPage.cshtml"
#
line
default
#
line
hidden
#
line
4
"..\..\Pages\PublishedPage.cshtml"
using
DotNetCore.CAP.Dashboard.Pages
;
#line default
#line hidden
#line 7 "..\..
\PublishedPage.cshtml"
#
line
default
#
line
hidden
#
line
5
"..\..\Pages
\PublishedPage.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
#line default
#line hidden
#line 3 "..\..\PublishedPage.cshtml"
#line default
#line hidden
#
line
default
#
line
hidden
#
line
6
"..\..\Pages\PublishedPage.cshtml"
using
DotNetCore.CAP.Messages
;
#
line
default
#
line
hidden
#
line
7
"..\..\Pages\PublishedPage.cshtml"
using
DotNetCore.CAP.Monitoring
;
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
PublishedPage
:
RazorPage
internal
partial
class
PublishedPage
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
WriteLiteral
(
"\r\n"
);
#line 9 "..\..\PublishedPage.cshtml"
Layout
=
new
LayoutPage
(
Strings
.
PublishedMessagesPage_Title
);
int
from
,
perPage
;
int
.
TryParse
(
Query
(
"from"
),
out
from
);
int
.
TryParse
(
Query
(
"count"
),
out
perPage
);
string
name
=
Query
(
"name"
);
string
content
=
Query
(
"content"
);
var
monitor
=
Storage
.
GetMonitoringApi
();
var
pager
=
new
Pager
(
from
,
perPage
,
GetTotal
(
monitor
));
var
queryDto
=
new
MessageQueryDto
{
MessageType
=
MessageType
.
Publish
,
Name
=
name
,
Content
=
content
,
StatusName
=
StatusName
,
CurrentPage
=
pager
.
CurrentPage
-
1
,
PageSize
=
pager
.
RecordsPerPage
};
var
succeededMessages
=
monitor
.
Messages
(
queryDto
);
#line default
#line hidden
WriteLiteral
(
"\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "
);
#line 35 "..\..\PublishedPage.cshtml"
Write
(
Html
.
MessagesSidebar
(
MessageType
.
Publish
));
#line default
#line hidden
WriteLiteral
(
"\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"
);
WriteLiteral
(
"\r\n"
);
#line 38 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
PublishedPage_Title
);
#line default
#line hidden
WriteLiteral
(
"</h1>\r\n\r\n"
);
#line 40 "..\..\PublishedPage.cshtml"
if
(
succeededMessages
.
Count
==
0
)
{
#line default
#line hidden
WriteLiteral
(
" <div class=\"alert alert-info\">\r\n "
);
#
line
9
"..\..\Pages\PublishedPage.cshtml"
Layout
=
new
LayoutPage
(
Strings
.
PublishedMessagesPage_Title
);
int
from
,
perPage
;
int
.
TryParse
(
Query
(
"from"
),
out
from
);
int
.
TryParse
(
Query
(
"count"
),
out
perPage
);
var
name
=
Query
(
"name"
);
var
content
=
Query
(
"content"
);
#line 43 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_NoMessages
);
var
monitor
=
Storage
.
GetMonitoringApi
();
var
pager
=
new
Pager
(
from
,
perPage
,
GetTotal
(
monitor
));
var
queryDto
=
new
MessageQueryDto
{
MessageType
=
MessageType
.
Publish
,
Name
=
name
,
Content
=
content
,
StatusName
=
Name
,
CurrentPage
=
pager
.
CurrentPage
-
1
,
PageSize
=
pager
.
RecordsPerPage
};
var
succeededMessages
=
monitor
.
Messages
(
queryDto
);
#line default
#line hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "
);
#
line
35
"..\..\Pages\PublishedPage.cshtml"
Write
(
Html
.
MessagesSidebar
(
MessageType
.
Publish
));
#line 45 "..\..\PublishedPage.cshtml"
}
else
{
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"
);
#line default
#line hidden
WriteLiteral
(
" <div class=\"js-jobs-list\">\r\n <div class=\"btn-toolbar btn-toolb"
+
"ar-top\">\r\n <form class=\"row\">\r\n <div class=\"c"
+
"ol-md-3\">\r\n <input type=\"text\" class=\"form-control\" name="
+
"\"name\" value=\""
);
#
line
38
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
PublishedPage_Title
);
#
line
default
#
line
hidden
WriteLiteral
(
"</h1>\r\n\r\n"
);
#line 52 "..\..\PublishedPage.cshtml"
Write
(
Query
(
" name"
));
#
line
40
"..\..\Pages\PublishedPage.cshtml"
if
(
succeededMessages
.
Count
==
0
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <div class=\"alert alert-info\">\r\n "
);
#line default
#line hidden
WriteLiteral
(
"\" placeholder=\""
);
#
line
43
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_NoMessages
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#line 52 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_MessageName
);
#
line
45
"..\..\Pages\PublishedPage.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral
(
"\" />\r\n </div>\r\n <div class=\"col-md-5\">\r\n "
+
" <div class=\"input-group\">\r\n <in"
+
"put type=\"text\" class=\"form-control\" name=\"content\" value=\""
);
#
line
default
#
line
hidden
WriteLiteral
(
@" <div class=""js-jobs-list"">
<div class=""btn-toolbar btn-toolbar-top"">
<form class=""row"">
<div class=""col-md-3"">
<input type=""text"" class=""form-control"" name=""name"" value="""
);
#
line
52
"..\..\Pages\PublishedPage.cshtml"
Write
(
Query
(
"name"
));
#line 56 "..\..\PublishedPage.cshtml"
Write
(
Query
(
" content"
));
#
line
default
#
line
hidden
WriteLiteral
(
"\" placeholder=\""
);
#line default
#line hidden
WriteLiteral
(
"\" placeholder=\""
);
#
line
52
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_MessageName
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"/>\r\n </div>\r\n <div class=\"col-md-5"
+
"\">\r\n <div class=\"input-group\">\r\n "
+
" <input type=\"text\" class=\"form-control\" name=\"content\" value=\""
);
#line 56 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_MessageBody
);
#
line
56
"..\..\Pages\PublishedPage.cshtml"
Write
(
Query
(
"content"
));
#
line
default
#
line
hidden
WriteLiteral
(
"\" placeholder=\""
);
#line default
#line hidden
WriteLiteral
(
"\" />\r\n <span class=\"input-group-btn\">\r\n "
+
" <button class=\"btn btn-info\">"
);
#
line
56
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_MessageBody
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"/>\r\n <span class=\"input-group-btn\">\r\n "
+
" <button class=\"btn btn-info\">"
);
#line 58 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_Button
);
#
line
58
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_Button
);
#line default
#line hidden
WriteLiteral
(
@"</button>
</span>
#
line
default
#
line
hidden
WriteLiteral
(
@"</button>
</span>
</div>
</div>
</div>
</form>
</div>
<div class=""btn-toolbar btn-toolbar-top"">
<button class=""js-jobs-list-command btn btn-sm btn-primary""
data-url="""
);
#line 66 "..\..\PublishedPage.cshtml"
Write
(
Url
.
To
(
"/published/requeue"
));
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-loading-text=\""
);
</form>
</div>
<div class=""btn-toolbar btn-toolbar-top"">
<button class=""js-jobs-list-command btn btn-sm btn-primary""
data-url="""
);
#line 67 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
Common_Enqueueing
);
#
line
66
"..\..\Pages\PublishedPage.cshtml"
Write
(
Url
.
To
(
"/published/requeue"
));
#line default
#line hidden
WriteLiteral
(
"\"\r\n disabled=\"disabled\">\r\n <span class=\"glyphicon g"
+
"lyphicon-repeat\"></span>\r\n "
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-loading-text=\""
);
#line 70 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
Common_RequeueMessages
);
#
line
67
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
Common_Enqueueing
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n disabled=\"disabled\">\r\n <spa"
+
"n class=\"glyphicon glyphicon-repeat\"></span>\r\n "
);
#line default
#line hidden
WriteLiteral
(
"\r\n </button>\r\n\r\n "
);
#
line
70
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
Common_RequeueMessages
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </button>\r\n\r\n "
);
#line 73 "..\..\PublishedPage.cshtml"
Write
(
Html
.
PerPageSelector
(
pager
));
#
line
73
"..\..\Pages\PublishedPage.cshtml"
Write
(
Html
.
PerPageSelector
(
pager
));
#line default
#line hidden
WriteLiteral
(
@"
</div>
#
line
default
#
line
hidden
WriteLiteral
(
@"
</div>
<div class=""table-responsive"">
<table class=""table"">
<thead>
<div class=""table-responsive"">
<table class=""table"">
<thead>
<tr>
<th style=""width:30px;"">
<input type=""checkbox"" class=""js-jobs-list-select-all""
/>
<th style=""width:
30px;"">
<input type=""checkbox"" class=""js-jobs-list-select-all""/>
</th>
<th style=""width:22%;"">"
);
#line 83 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
Common_Id
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n <th>"
);
#line 84 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
Common_Version
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n <th>"
);
#line 84 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_Name
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n <th class=\"min-width\">"
);
#line 85 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_Retries
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n"
);
#line 86 "..\..\PublishedPage.cshtml"
if
(
string
.
Equals
(
StatusName
,
"Processing"
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
#line default
#line hidden
WriteLiteral
(
" <th>"
);
#line 88 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_State
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n"
);
#line 89 "..\..\PublishedPage.cshtml"
}
#line default
#line hidden
WriteLiteral
(
" <th class=\"align-right\">"
);
#line 90 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_ExpiresAt
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n </tr>\r\n </thead>\r\n "
+
" <tbody>\r\n"
);
#line 94 "..\..\PublishedPage.cshtml"
foreach
(
var
message
in
succeededMessages
)
{
#line default
#line hidden
WriteLiteral
(
" <tr class=\"js-jobs-list-row hover\">\r\n "
+
" <td>\r\n <input type=\"checkbox\" class=\"js-j"
+
"obs-list-checkbox\" name=\"messages[]\" value=\""
);
#line 98 "..\..\PublishedPage.cshtml"
Write
(
message
.
Id
);
#line default
#line hidden
WriteLiteral
(
"\" />\r\n </td>\r\n <td class=\"w"
+
"ord-break\">\r\n <a href=\"javascript:;\" data-url=\'"
);
#line 101 "..\..\PublishedPage.cshtml"
Write
(
Url
.
To
(
"/published/message/"
)
+
message
.
Id
);
#line default
#line hidden
WriteLiteral
(
"\' class=\"openModal\">#"
);
<th>"
);
#
line
83
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
Common_Id
);
#line 101 "..\..\PublishedPage.cshtml"
Write
(
message
.
Id
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th>"
);
#line default
#line hidden
WriteLiteral
(
"</a>\r\n </td>\r\n <td>\r\n "
+
" "
);
#line 102 "..\..\PublishedPage.cshtml"
Write
(
message
.
Version
);
#line default
#line hidden
WriteLiteral
(
"</a>\r\n </td>\r\n <td>\r\n "
+
" "
);
#line 104 "..\..\PublishedPage.cshtml"
Write
(
message
.
Name
);
#line default
#line hidden
WriteLiteral
(
"\r\n </td>\r\n <td>\r\n "
+
" "
);
#line 107 "..\..\PublishedPage.cshtml"
Write
(
message
.
Retries
);
#line default
#line hidden
WriteLiteral
(
"\r\n </td>\r\n"
);
#line 109 "..\..\PublishedPage.cshtml"
if
(
string
.
Equals
(
StatusName
,
"Processing"
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
#line default
#line hidden
WriteLiteral
(
" <td>\r\n "
);
#
line
84
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
Common_Version
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th>"
);
#line 112 "..\..\PublishedPage.cshtml"
Write
(
message
.
StatusName
);
#line default
#line hidden
WriteLiteral
(
"\r\n </td>\r\n"
);
#
line
85
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_Name
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th class=\"min-width\">"
);
#line 114 "..\..\PublishedPage.cshtml"
}
#
line
86
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_Retries
);
#line default
#line hidden
WriteLiteral
(
" <td class=\"align-right\">\r\n"
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n"
);
#
line
87
"..\..\Pages\PublishedPage.cshtml"
if
(
string
.
Equals
(
Name
,
"Processing"
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
#line 116 "..\..\PublishedPage.cshtml"
if
(
message
.
ExpiresAt
.
HasValue
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <th>"
);
#line default
#line hidden
#
line
89
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_State
);
#line 118 "..\..\PublishedPage.cshtml"
Write
(
Html
.
RelativeTime
(
message
.
ExpiresAt
.
Value
));
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n"
);
#line default
#line hidden
#line 118 "..\..\PublishedPage.cshtml"
}
#line default
#line hidden
WriteLiteral
(
" </td>\r\n\r\n </tr>\r\n"
);
#
line
90
"..\..\Pages\PublishedPage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" <th class=\"align-right\">"
);
#line 123 "..\..\PublishedPage.cshtml"
}
#
line
91
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_ExpiresAt
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n </tr>\r\n </thead>\r\n "
+
" <tbody>\r\n"
);
#line default
#line hidden
WriteLiteral
(
" </tbody>\r\n </table>\r\n </div>\r\n "
+
" "
);
#
line
95
"..\..\Pages\PublishedPage.cshtml"
foreach
(
var
message
in
succeededMessages
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <tr class=\"js-jobs-list-row hover\">\r\n "
+
" <td>\r\n <input type=\"checkbox\""
+
" class=\"js-jobs-list-checkbox\" name=\"messages[]\" value=\""
);
#line 127 "..\..\PublishedPage.cshtml"
Write
(
Html
.
Paginator
(
pager
));
#
line
99
"..\..\Pages\PublishedPage.cshtml"
Write
(
message
.
Id
);
#line default
#line hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\" />\r\n </td>\r\n <td "
+
"class=\"word-break\">\r\n <a href=\"javascript:;\" "
+
"data-url=\'"
);
#
line
102
"..\..\Pages\PublishedPage.cshtml"
Write
(
Url
.
To
(
"/published/message/"
)
+
message
.
Id
);
#line 129 "..\..\PublishedPage.cshtml"
#
line
default
#
line
hidden
WriteLiteral
(
"\' class=\"openModal\">#"
);
#
line
102
"..\..\Pages\PublishedPage.cshtml"
Write
(
message
.
Id
);
#line default
#line hidden
WriteLiteral
(
@" <div>
<div class=""modal fade"" tabindex=""-1"" role=""dialog"">
<div class=""modal-dialog"" role=""document"">
<div class=""modal-content"">
<div class=""modal-header"">
<button type=""button"" class=""close"" data-dismiss=""modal"" aria-label=""Close""><span aria-hidden=""true"">×</span></button>
<h4 class=""modal-title"">Message Content</h4>
</div>
<div id=""jsonContent"" style=""max-height:500px;overflow-y:auto;"" class=""modal-body"">
</div>
<div class=""modal-footer"">
<button type=""button"" class=""btn btn-sm btn-primary"" id=""formatBtn"" onclick="""">"
);
#
line
default
#
line
hidden
WriteLiteral
(
"</a>\r\n </td>\r\n <td>"
+
"\r\n "
);
#
line
105
"..\..\Pages\PublishedPage.cshtml"
Write
(
message
.
Version
);
#line 141 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Format
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </td>\r\n <td>\r\n "
+
" "
);
#line default
#line hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-sm bt"
+
"n-primary\" id=\"rawBtn\" onclick=\"\">"
);
#
line
108
"..\..\Pages\PublishedPage.cshtml"
Write
(
message
.
Name
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </td>\r\n <td>\r\n "
+
" "
);
#line 142 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Raw
);
#
line
111
"..\..\Pages\PublishedPage.cshtml"
Write
(
message
.
Retries
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </td>\r\n"
);
#line default
#line hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-sm bt"
+
"n-primary\" id=\"expandBtn\" onclick=\"\">"
);
#
line
113
"..\..\Pages\PublishedPage.cshtml"
if
(
string
.
Equals
(
Name
,
"Processing"
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
#
line
default
#
line
hidden
WriteLiteral
(
" <td>\r\n "
+
" "
);
#
line
116
"..\..\Pages\PublishedPage.cshtml"
Write
(
message
.
StatusName
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </td>\r\n"
);
#line 143 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Expand
);
#
line
118
"..\..\Pages\PublishedPage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" <td class=\"align-right\">\r\n"
);
#line default
#line hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-sm bt"
+
"n-primary\" id=\"collapseBtn\" onclick=\"\">"
);
#
line
120
"..\..\Pages\PublishedPage.cshtml"
if
(
message
.
ExpiresAt
.
HasValue
)
{
#
line
default
#
line
hidden
#
line
122
"..\..\Pages\PublishedPage.cshtml"
Write
(
Html
.
RelativeTime
(
message
.
ExpiresAt
.
Value
));
#
line
default
#
line
hidden
#
line
122
"..\..\Pages\PublishedPage.cshtml"
}
#line 144 "..\..\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Model_Collaspse
);
#
line
default
#
line
hidden
WriteLiteral
(
" </td>\r\n\r\n </tr>\r\n"
);
#line default
#line hidden
WriteLiteral
(
"</button>\r\n </div>\r\n </div><!-- /.modal"
+
"-content -->\r\n </div><!-- /.modal-dialog -->\r\n </div><"
+
"!-- /.modal -->\r\n </div>\r\n"
);
#
line
127
"..\..\Pages\PublishedPage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" </tbody>\r\n </table>\r\n <"
+
"/div>\r\n "
);
#
line
131
"..\..\Pages\PublishedPage.cshtml"
Write
(
Html
.
Paginator
(
pager
));
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#
line
133
"..\..\Pages\PublishedPage.cshtml"
#
line
default
#
line
hidden
WriteLiteral
(
@" <div>
<div class=""modal fade"" tabindex=""-1"" role=""dialog"">
<div class=""modal-dialog"" role=""document"">
<div class=""modal-content"">
<div class=""modal-header"">
<button type=""button"" class=""close"" data-dismiss=""modal"" aria-label=""Close"">
<span aria-hidden=""true"">×</span>
</button>
<h4 class=""modal-title"">Message Content</h4>
</div>
<div id=""jsonContent"" style=""max-height: 500px; overflow-y: auto;"" class=""modal-body"">
</div>
<div class=""modal-footer"">
<button type=""button"" class=""btn btn-sm btn-primary"" id=""formatBtn"" onclick="""">"
);
#
line
147
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Format
);
#
line
default
#
line
hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-s"
+
"m btn-primary\" id=\"rawBtn\" onclick=\"\">"
);
#
line
148
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Raw
);
#
line
default
#
line
hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-s"
+
"m btn-primary\" id=\"expandBtn\" onclick=\"\">"
);
#
line
149
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Expand
);
#
line
default
#
line
hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-s"
+
"m btn-primary\" id=\"collapseBtn\" onclick=\"\">"
);
#
line
150
"..\..\Pages\PublishedPage.cshtml"
Write
(
Strings
.
MessagesPage_Model_Collaspse
);
#
line
default
#
line
hidden
WriteLiteral
(
"</button>\r\n </div>\r\n </div><!--"
+
" /.modal-content -->\r\n </div><!-- /.modal-dialog -->\r\n "
+
" </div><!-- /.modal -->\r\n </div>\r\n"
);
#line 150 "..\..\PublishedPage.cshtml"
}
#
line
156
"..\..\Pages\PublishedPage.cshtml"
}
#line default
#line hidden
WriteLiteral
(
" </div>\r\n</div>"
);
#
line
default
#
line
hidden
WriteLiteral
(
" </div>\r\n</div>"
);
}
...
...
src/DotNetCore.CAP.Dashboard/Pages/ReceivedPage.cs
View file @
c4f4f5f4
...
...
@@ -2,6 +2,7 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System
;
using
DotNetCore.CAP.Monitoring
;
namespace
DotNetCore.CAP.Dashboard.Pages
{
...
...
@@ -16,7 +17,7 @@ namespace DotNetCore.CAP.Dashboard.Pages
public
int
GetTotal
(
IMonitoringApi
api
)
{
if
(
string
.
Equals
(
StatusName
,
Infrastructure
.
StatusName
.
Succeeded
,
if
(
string
.
Equals
(
StatusName
,
nameof
(
Internal
.
StatusName
.
Succeeded
)
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
return
api
.
ReceivedSucceededCount
();
...
...
src/DotNetCore.CAP.Dashboard/Pages/ReceivedPage.cshtml
View file @
c4f4f5f4
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True *@
@using System
@using DotNetCore.CAP.Dashboard
@using DotNetCore.CAP.Dashboard.Monitoring
@using DotNetCore.CAP.Dashboard.Pages
@using DotNetCore.CAP.Dashboard.Resources
@using DotNetCore.CAP.Messages
@using DotNetCore.CAP.Monitoring
@inherits DotNetCore.CAP.Dashboard.RazorPage
@{
Layout = new LayoutPage(Strings.ReceivedMessagesPage_Title);
...
...
src/DotNetCore.CAP.Dashboard/Pages/ReceivedPage.generated.cs
View file @
c4f4f5f4
using
DotNetCore.CAP.M
essages
;
using
DotNetCore.CAP.M
onitoring
;
#pragma warning disable 1591
//------------------------------------------------------------------------------
...
...
@@ -13,58 +13,54 @@
namespace
DotNetCore.CAP.Dashboard.Pages
{
#line 2 "..\..
\ReceivedPage.cshtml"
#
line
2
"..\..\Pages
\ReceivedPage.cshtml"
using
System
;
#line default
#line hidden
#
line
default
#
line
hidden
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
#line 4 "..\..
\ReceivedPage.cshtml"
#
line
3
"..\..\Pages
\ReceivedPage.cshtml"
using
DotNetCore.CAP.Dashboard
;
#line default
#line hidden
#line 6 "..\..\ReceivedPage.cshtml"
using
DotNetCore.CAP.Dashboard.Monitoring
;
#line default
#line hidden
#line 5 "..\..\ReceivedPage.cshtml"
#
line
default
#
line
hidden
#
line
4
"..\..\Pages\ReceivedPage.cshtml"
#line default
#
line
hidden
#
line
5
"..\..\Pages\ReceivedPage.cshtml"
using
DotNetCore.CAP.Dashboard.Pages
;
#line default
#line hidden
#line 7 "..\..
\ReceivedPage.cshtml"
#
line
default
#
line
hidden
#
line
6
"..\..\Pages
\ReceivedPage.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
#line default
#line hidden
#line 3 "..\..\ReceivedPage.cshtml"
#line default
#line hidden
#
line
default
#
line
hidden
#
line
7
"..\..\Pages\ReceivedPage.cshtml"
using
DotNetCore.CAP.Messages
;
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
ReceivedPage
:
RazorPage
internal
partial
class
ReceivedPage
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"\r\n"
);
...
...
@@ -72,169 +68,172 @@ namespace DotNetCore.CAP.Dashboard.Pages
#line 9 "..\..\ReceivedPage.cshtml"
Layout
=
new
LayoutPage
(
Strings
.
ReceivedMessagesPage_Title
);
int
from
,
perPage
;
#
line
9
"..\..\Pages\ReceivedPage.cshtml"
Layout
=
new
LayoutPage
(
Strings
.
ReceivedMessagesPage_Title
);
int
.
TryParse
(
Query
(
"from"
),
out
from
);
int
.
TryParse
(
Query
(
"count"
),
out
perPage
);
string
group
=
Query
(
"group"
);
string
name
=
Query
(
"name"
);
string
content
=
Query
(
"content"
);
int
from
,
perPage
;
var
monitor
=
Storage
.
GetMonitoringApi
();
var
pager
=
new
Pager
(
from
,
perPage
,
GetTotal
(
monitor
));
var
queryDto
=
new
MessageQueryDto
{
MessageType
=
MessageType
.
Subscribe
,
Group
=
group
,
Name
=
name
,
Content
=
content
,
StatusName
=
StatusName
,
CurrentPage
=
pager
.
CurrentPage
-
1
,
PageSize
=
pager
.
RecordsPerPage
};
var
succeededMessages
=
monitor
.
Messages
(
queryDto
);
int
.
TryParse
(
Query
(
"from"
),
out
from
);
int
.
TryParse
(
Query
(
"count"
),
out
perPage
);
var
group
=
Query
(
"group"
);
var
name
=
Query
(
"name"
);
var
content
=
Query
(
"content"
);
var
monitor
=
Storage
.
GetMonitoringApi
();
var
pager
=
new
Pager
(
from
,
perPage
,
GetTotal
(
monitor
));
var
queryDto
=
new
MessageQueryDto
{
MessageType
=
MessageType
.
Subscribe
,
Group
=
group
,
Name
=
name
,
Content
=
content
,
StatusName
=
StatusName
,
CurrentPage
=
pager
.
CurrentPage
-
1
,
PageSize
=
pager
.
RecordsPerPage
};
var
succeededMessages
=
monitor
.
Messages
(
queryDto
);
#line default
#line hidden
WriteLiteral
(
"\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "
);
#line 37 "..\..\ReceivedPage.cshtml"
Write
(
Html
.
MessagesSidebar
(
MessageType
.
Subscribe
));
#line default
#line hidden
WriteLiteral
(
"\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"
);
#line 40 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
ReceivedPage_Title
);
#line default
#line hidden
WriteLiteral
(
"</h1>\r\n\r\n"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n<div class=\"row\">\r\n <div class=\"col-md-3\">\r\n "
);
#
line
37
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Html
.
MessagesSidebar
(
MessageType
.
Subscribe
));
#line 42 "..\..\ReceivedPage.cshtml"
if
(
succeededMessages
.
Count
==
0
)
{
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </div>\r\n <div class=\"col-md-9\">\r\n <h1 class=\"page-header\">"
);
#line default
#line hidden
WriteLiteral
(
" <div class=\"alert alert-info\">\r\n "
);
#
line
40
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
ReceivedPage_Title
);
#
line
default
#
line
hidden
WriteLiteral
(
"</h1>\r\n\r\n"
);
#line 45 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_NoMessages
);
#
line
42
"..\..\Pages\ReceivedPage.cshtml"
if
(
succeededMessages
.
Count
==
0
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <div class=\"alert alert-info\">\r\n "
);
#line default
#line hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#
line
45
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_NoMessages
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#line 47 "..\..\ReceivedPage.cshtml"
}
else
{
#
line
47
"..\..\Pages\ReceivedPage.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral
(
@" <div class=""js-jobs-list"">
#
line
default
#
line
hidden
WriteLiteral
(
@" <div class=""js-jobs-list"">
<div class=""btn-toolbar btn-toolbar-top"">
<form class=""row"">
<div class=""col-md-2"">
<input type=""text"" class=""form-control"" name=""group"" value="""
);
#
line
54
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Query
(
"group"
));
#line 54 "..\..\ReceivedPage.cshtml"
Write
(
Query
(
"group"
));
#
line
default
#
line
hidden
WriteLiteral
(
"\" placeholder=\""
);
#line default
#line hidden
WriteLiteral
(
"\" placeholder=\""
);
#
line
54
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_MessageGroup
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"/>\r\n </div>\r\n <div class=\"col-md-3"
+
"\">\r\n <input type=\"text\" class=\"form-control\" name=\"na"
+
"me\" value=\""
);
#line 54 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_MessageGroup
);
#line default
#line hidden
WriteLiteral
(
"\" />\r\n </div>\r\n <div class=\"col-m"
+
"d-3\">\r\n <input type=\"text\" class=\"form-control\" name="
+
"\"name\" value=\""
);
#line 57 "..\..\ReceivedPage.cshtml"
Write
(
Query
(
"name"
));
#line default
#line hidden
WriteLiteral
(
"\" placeholder=\""
);
#line 57 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_MessageName
);
#line default
#line hidden
WriteLiteral
(
"\" />\r\n </div>\r\n <div class=\"col-md"
+
"-5\">\r\n <div class=\"input-group\">\r\n "
+
" <input type=\"text\" class=\"form-control\" name=\"content\" value=\""
);
#
line
57
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Query
(
"name"
));
#
line
default
#
line
hidden
WriteLiteral
(
"\" placeholder=\""
);
#line 61 "..\..\ReceivedPage.cshtml"
Write
(
Query
(
"content"
));
#line default
#line hidden
WriteLiteral
(
"\" placeholder=\""
);
#
line
57
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_MessageName
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"/>\r\n </div>\r\n <div class=\"col-md-5"
+
"\">\r\n <div class=\"input-group\">\r\n "
+
" <input type=\"text\" class=\"form-control\" name=\"content\" value=\""
);
#line 61 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_MessageBody
);
#
line
61
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Query
(
"content"
));
#
line
default
#
line
hidden
WriteLiteral
(
"\" placeholder=\""
);
#line default
#line hidden
WriteLiteral
(
"\" />\r\n <span class=\"input-group-btn\">\r\n "
+
" <button class=\"btn btn-info\">"
);
#
line
61
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_MessageBody
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"/>\r\n <span class=\"input-group-btn\">\r\n "
+
" <button class=\"btn btn-info\">"
);
#line 63 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_Button
);
#
line
63
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Query_Button
);
#line default
#line hidden
WriteLiteral
(
@"</button>
#
line
default
#
line
hidden
WriteLiteral
(
@"</button>
</span>
</div>
</div>
...
...
@@ -245,388 +244,393 @@ namespace DotNetCore.CAP.Dashboard.Pages
data-url="""
);
#
line
71
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Url
.
To
(
"/received/requeue"
));
#line 71 "..\..\ReceivedPage.cshtml"
Write
(
Url
.
To
(
"/received/requeue"
));
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n data-loading-text=\""
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n data-loading-text=\""
);
#
line
72
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
Common_Enqueueing
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"\r\n disabled=\"disabled\">\r\n <spa"
+
"n class=\"glyphicon glyphicon-repeat\"></span>\r\n "
);
#line 72 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
Common_Enqueueing
);
#line default
#line hidden
WriteLiteral
(
"\"\r\n disabled=\"disabled\">\r\n <spa"
+
"n class=\"glyphicon glyphicon-repeat\"></span>\r\n "
);
#line 75 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
Common_ReConsume
);
#line default
#line hidden
WriteLiteral
(
"\r\n </button>\r\n\r\n "
);
#
line
75
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
Common_ReConsume
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </button>\r\n\r\n "
);
#line 78 "..\..\ReceivedPage.cshtml"
Write
(
Html
.
PerPageSelector
(
pager
));
#
line
78
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Html
.
PerPageSelector
(
pager
));
#line default
#line hidden
WriteLiteral
(
@"
#
line
default
#
line
hidden
WriteLiteral
(
@"
</div>
<div class=""table-responsive"">
<table class=""table"">
<thead>
<tr>
<th style=""width:
30px;"">
<input type=""checkbox"" class=""js-jobs-list-select-all""
/>
</th>
<th>"
);
<tr>
<th style=""width:
30px;"">
<input type=""checkbox"" class=""js-jobs-list-select-all""
/>
</th>
<th>"
);
#
line
88
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
Common_Id
);
#line 88 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
Common_Id
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th style=\"width: 30px;\">"
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n <th style=\"width:50px;\">"
);
#
line
89
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
Common_Version
);
#line 88 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
Common_Version
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th>"
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n <th>"
);
#
line
90
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_Group
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th>"
);
#line 89 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_Group
);
#
line
91
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_Name
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th class=\"min-width\">"
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n <th>"
);
#
line
92
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_Retries
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n"
);
#line 90 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_Name
);
#
line
93
"..\..\Pages\ReceivedPage.cshtml"
if
(
string
.
Equals
(
StatusName
,
"Processing"
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
#line default
#line hidden
WriteLiteral
(
"</th>\r\n <th class=\"min-width\">"
);
#
line
default
#
line
hidden
WriteLiteral
(
" <th>"
);
#
line
95
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_State
);
#line 91 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_Retries
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n"
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n"
);
#
line
96
"..\..\Pages\ReceivedPage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" <th style=\"width: 75px;\" class=\"align-right\">"
);
#line 92 "..\..\ReceivedPage.cshtml"
if
(
string
.
Equals
(
StatusName
,
"Processing"
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
#
line
97
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_ExpiresAt
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n </tr>\r\n </thead>\r\n "
+
" <tbody>\r\n"
);
#line default
#line hidden
WriteLiteral
(
" <th>"
);
#
line
101
"..\..\Pages\ReceivedPage.cshtml"
foreach
(
var
message
in
succeededMessages
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <tr class=\"js-jobs-list-row hover\">\r\n "
+
" <td>\r\n <input type=\"checkbox\""
+
" class=\"js-jobs-list-checkbox\" name=\"messages[]\" value=\""
);
#line 94 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_State
);
#
line
105
"..\..\Pages\ReceivedPage.cshtml"
Write
(
message
.
Id
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n"
);
#line 95 "..\..\ReceivedPage.cshtml"
}
#line default
#line hidden
WriteLiteral
(
" <th style=\"width:75px;\" class=\"align-right\">"
);
#line 96 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Table_ExpiresAt
);
#line default
#line hidden
WriteLiteral
(
"</th>\r\n </tr>\r\n </thead>\r\n "
+
" <tbody>\r\n"
);
#line 100 "..\..\ReceivedPage.cshtml"
foreach
(
var
message
in
succeededMessages
)
{
#line default
#line hidden
WriteLiteral
(
" <tr class=\"js-jobs-list-row hover\">\r\n "
+
" <td>\r\n <input typ"
+
"e=\"checkbox\" class=\"js-jobs-list-checkbox\" name=\"messages[]\" value=\""
);
#line 104 "..\..\ReceivedPage.cshtml"
Write
(
message
.
Id
);
#line default
#line hidden
WriteLiteral
(
"\" />\r\n </td>\r\n "
+
" <td class=\"word-break\">\r\n <a href=\"ja"
+
"vascript:;\" data-url=\'"
);
#line 107 "..\..\ReceivedPage.cshtml"
Write
(
Url
.
To
(
"/received/message/"
)
+
message
.
Id
);
#line default
#line hidden
WriteLiteral
(
"\' class=\"openModal\">#"
);
#line 107 "..\..\ReceivedPage.cshtml"
Write
(
message
.
Id
);
#line default
#line hidden
WriteLiteral
(
"</a>\r\n </td>\r\n "
+
" <td>\r\n "
);
#line 111 "..\..\ReceivedPage.cshtml"
Write
(
message
.
Version
);
#line default
#line hidden
WriteLiteral
(
"\r\n </td>\r\n "
+
"<td class=\"word-break\">\r\n "
);
#line 110 "..\..\ReceivedPage.cshtml"
Write
(
message
.
Group
);
#line default
#line hidden
WriteLiteral
(
"\r\n </td>\r\n "
+
"<td>\r\n "
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"/>\r\n </td>\r\n <td c"
+
"lass=\"word-break\">\r\n <a href=\"javascript:;\" d"
+
"ata-url=\'"
);
#
line
108
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Url
.
To
(
"/received/message/"
)
+
message
.
Id
);
#line 113 "..\..\ReceivedPage.cshtml"
Write
(
message
.
Name
);
#line default
#line hidden
WriteLiteral
(
"\r\n </td>\r\n "
+
"<td>\r\n "
);
#line 116 "..\..\ReceivedPage.cshtml"
Write
(
message
.
Retries
);
#line default
#line hidden
WriteLiteral
(
"\r\n </td>\r\n"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\' class=\"openModal\">#"
);
#
line
108
"..\..\Pages\ReceivedPage.cshtml"
Write
(
message
.
Id
);
#line 118 "..\..\ReceivedPage.cshtml"
if
(
string
.
Equals
(
StatusName
,
"Processing"
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
#
line
default
#
line
hidden
WriteLiteral
(
"</a>\r\n </td>\r\n <td>"
+
"\r\n "
);
#line default
#line hidden
WriteLiteral
(
" <td>\r\n "
+
" "
);
#
line
111
"..\..\Pages\ReceivedPage.cshtml"
Write
(
message
.
Version
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </td>\r\n <td clas"
+
"s=\"word-break\">\r\n "
);
#line 121 "..\..\ReceivedPage.cshtml"
Write
(
message
.
StatusName
);
#
line
114
"..\..\Pages\ReceivedPage.cshtml"
Write
(
message
.
Group
);
#line default
#line hidden
WriteLiteral
(
"\r\n </td>\r\n"
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </td>\r\n <td>\r\n "
+
" "
);
#
line
117
"..\..\Pages\ReceivedPage.cshtml"
Write
(
message
.
Name
);
#line 123 "..\..\ReceivedPage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </td>\r\n <td>\r\n "
+
" "
);
#line default
#line hidden
WriteLiteral
(
" <td class=\"align-right\">\r\n"
);
#
line
120
"..\..\Pages\ReceivedPage.cshtml"
Write
(
message
.
Retries
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </td>\r\n"
);
#line 125 "..\..\ReceivedPage.cshtml"
if
(
message
.
ExpiresAt
.
HasValue
)
{
#
line
122
"..\..\Pages\ReceivedPage.cshtml"
if
(
string
.
Equals
(
StatusName
,
"Processing"
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
#
line
default
#
line
hidden
WriteLiteral
(
" <td>\r\n "
+
" "
);
#line default
#line hidden
#line 127 "..\..\ReceivedPage.cshtml"
Write
(
Html
.
RelativeTime
(
message
.
ExpiresAt
.
Value
));
#
line
125
"..\..\Pages\ReceivedPage.cshtml"
Write
(
message
.
StatusName
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </td>\r\n"
);
#line default
#line hidden
#line 127 "..\..\ReceivedPage.cshtml"
#
line
127
"..\..\Pages\ReceivedPage.cshtml"
}
}
#
line
default
#
line
hidden
WriteLiteral
(
" <td class=\"align-right\">\r\n"
);
#line default
#line hidden
WriteLiteral
(
" </td>\r\n\r\n </tr"
+
">\r\n"
);
#
line
129
"..\..\Pages\ReceivedPage.cshtml"
if
(
message
.
ExpiresAt
.
HasValue
)
{
#
line
default
#
line
hidden
#
line
131
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Html
.
RelativeTime
(
message
.
ExpiresAt
.
Value
));
#
line
default
#
line
hidden
#
line
131
"..\..\Pages\ReceivedPage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
" </td>\r\n\r\n </tr>\r\n"
);
#line 132 "..\..\ReceivedPage.cshtml"
}
#
line
136
"..\..\Pages\ReceivedPage.cshtml"
}
#line default
#line hidden
WriteLiteral
(
" </tbody>\r\n </table>\r\n <"
+
"/div>\r\n "
);
#
line
default
#
line
hidden
WriteLiteral
(
" </tbody>\r\n </table>\r\n <"
+
"/div>\r\n "
);
#
line
140
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Html
.
Paginator
(
pager
));
#line 136 "..\..\ReceivedPage.cshtml"
Write
(
Html
.
Paginator
(
pager
));
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#line default
#line hidden
WriteLiteral
(
"\r\n </div>\r\n"
);
#
line
142
"..\..\Pages\ReceivedPage.cshtml"
#line 138 "..\..\ReceivedPage.cshtml"
#line default
#line hidden
WriteLiteral
(
@" <div>
#
line
default
#
line
hidden
WriteLiteral
(
@" <div>
<div class=""modal fade"" tabindex=""-1"" role=""dialog"">
<div class=""modal-dialog"" role=""document"">
<div class=""modal-content"">
<div class=""modal-header"">
<button type=""button"" class=""close"" data-dismiss=""modal"" aria-label=""Close""><span aria-hidden=""true"">×</span></button>
<button type=""button"" class=""close"" data-dismiss=""modal"" aria-label=""Close"">
<span aria-hidden=""true"">×</span>
</button>
<h4 class=""modal-title"">Message Content</h4>
</div>
<div id=""jsonContent"" style=""max-height:
500px;overflow-y:
auto;"" class=""modal-body"">
<div id=""jsonContent"" style=""max-height:
500px; overflow-y:
auto;"" class=""modal-body"">
</div>
<div class=""modal-footer"">
<button type=""button"" class=""btn btn-sm btn-primary"" id=""formatBtn"" onclick="""">"
);
#
line
156
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Format
);
#line 150 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Format
);
#
line
default
#
line
hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-s"
+
"m btn-primary\" id=\"rawBtn\" onclick=\"\">"
);
#line default
#line hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-s"
+
"m btn-primary\" id=\"rawBtn\" onclick=\"\">"
);
#
line
157
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Raw
);
#
line
default
#
line
hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-s"
+
"m btn-primary\" id=\"expandBtn\" onclick=\"\">"
);
#line 151 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Raw
);
#
line
158
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Expand
);
#line default
#line hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-s"
+
"m btn-primary\" id=\"expandBtn\" onclick=\"\">"
);
#
line
default
#
line
hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-s"
+
"m btn-primary\" id=\"collapseBtn\" onclick=\"\">"
);
#
line
159
"..\..\Pages\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Model_Collaspse
);
#line 152 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Modal_Expand
);
#
line
default
#
line
hidden
WriteLiteral
(
"</button>\r\n </div>\r\n </div><!--"
+
" /.modal-content -->\r\n </div><!-- /.modal-dialog -->\r\n "
+
" </div><!-- /.modal -->\r\n </div>\r\n"
);
#line default
#line hidden
WriteLiteral
(
"</button>\r\n <button type=\"button\" class=\"btn btn-s"
+
"m btn-primary\" id=\"collapseBtn\" onclick=\"\">"
);
#line 153 "..\..\ReceivedPage.cshtml"
Write
(
Strings
.
MessagesPage_Model_Collaspse
);
#line default
#line hidden
WriteLiteral
(
"</button>\r\n </div>\r\n </div><!--"
+
" /.modal-content -->\r\n </div><!-- /.modal-dialog -->\r\n "
+
" </div><!-- /.modal -->\r\n </div>\r\n"
);
#line 159 "..\..\ReceivedPage.cshtml"
}
#
line
165
"..\..\Pages\ReceivedPage.cshtml"
}
#line default
#line hidden
WriteLiteral
(
" </div>\r\n</div>"
);
#
line
default
#
line
hidden
WriteLiteral
(
" </div>\r\n</div>"
);
}
...
...
src/DotNetCore.CAP.Dashboard/Pages/SubscriberPage.generated.cs
View file @
c4f4f5f4
...
...
@@ -16,36 +16,30 @@ namespace DotNetCore.CAP.Dashboard.Pages
using
System.Linq
;
using
System.Text
;
#
line
3
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
#
line
hidden
#
line
4
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
#
line
2
"..\..\Pages\SubscriberPage.cshtml"
using
DotNetCore.CAP.Dashboard.Pages
;
#
line
default
#
line
hidden
#
line
5
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
#
line
3
"..\..
\Pages\SubscriberPage.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
#
line
default
#
line
hidden
#
line
2
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
#
line
4
"..\..
\Pages\SubscriberPage.cshtml"
using
DotNetCore.CAP.Internal
;
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
SubscriberPage
:
RazorPage
internal
partial
class
SubscriberPage
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
...
...
@@ -56,9 +50,8 @@ WriteLiteral("\r\n");
#
line
7
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
#
line
6
"..\..
\Pages\SubscriberPage.cshtml"
Layout
=
new
LayoutPage
(
Strings
.
SubscribersPage_Title
);
...
...
@@ -74,7 +67,7 @@ WriteLiteral("\r\n<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n
#
line
1
6
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
#
line
1
5
"..\..
\Pages\SubscriberPage.cshtml"
Write
(
Strings
.
SubscribersPage_Title
);
...
...
@@ -84,7 +77,7 @@ WriteLiteral("</h1>\r\n\r\n");
#
line
1
8
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
#
line
1
7
"..\..
\Pages\SubscriberPage.cshtml"
if
(
subscribers
.
Count
==
0
)
{
...
...
@@ -95,7 +88,7 @@ WriteLiteral(" <div class=\"alert alert-warning\">\r\n
#
line
2
1
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
#
line
2
0
"..\..
\Pages\SubscriberPage.cshtml"
Write
(
Strings
.
SubscribersPage_NoSubscribers
);
...
...
@@ -105,7 +98,7 @@ WriteLiteral("\r\n </div>\r\n");
#
line
2
3
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
#
line
2
2
"..\..
\Pages\SubscriberPage.cshtml"
}
else
{
...
...
@@ -114,77 +107,70 @@ WriteLiteral("\r\n </div>\r\n");
#
line
default
#
line
hidden
WriteLiteral
(
" <div class=\"table-responsive\">\r\n <table class=\"table s"
+
"ubscribe-table\">\r\n <thead>\r\n
<tr>\r\n
"
+
"
<th width=\"20%\">"
);
"ubscribe-table\">\r\n <thead>\r\n
<tr>\r\n
"
+
" <th width=\"20%\">"
);
#
line
30
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
Write
(
Strings
.
Common_Group
);
#
line
29
"..\..
\Pages\SubscriberPage.cshtml"
Write
(
Strings
.
Common_Group
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n <th width=\"40%\">\r\n "
+
" "
);
WriteLiteral
(
"</th>\r\n <th width=\"40%\">\r\n "
);
#
line
3
2
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
Write
(
Strings
.
Common_Name
);
#
line
3
1
"..\..
\Pages\SubscriberPage.cshtml"
Write
(
Strings
.
Common_Name
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n
</th>\r\n
<th>"
);
WriteLiteral
(
"\r\n
</th>\r\n
<th>"
);
#
line
3
4
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
Write
(
Strings
.
Common_Method
);
#
line
3
3
"..\..
\Pages\SubscriberPage.cshtml"
Write
(
Strings
.
Common_Method
);
#
line
default
#
line
hidden
WriteLiteral
(
"</th>\r\n
</tr>\r\n </thead>\r\n
"
+
"
<tbody>\r\n"
);
WriteLiteral
(
"</th>\r\n
</tr>\r\n </thead>\r\n
"
+
" <tbody>\r\n"
);
#
line
38
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
foreach
(
var
subscriber
in
subscribers
)
#
line
37
"..\..\Pages\SubscriberPage.cshtml"
foreach
(
var
subscriber
in
subscribers
)
{
var
i
=
0
;
var
rowCount
=
subscriber
.
Value
.
Count
;
foreach
(
var
column
in
subscriber
.
Value
)
{
var
i
=
0
;
var
rowCount
=
subscriber
.
Value
.
Count
;
#
line
default
#
line
hidden
#
line
42
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
foreach
(
var
column
in
subscriber
.
Value
)
{
#
line
default
#
line
hidden
WriteLiteral
(
"
<tr>\r\n"
);
WriteLiteral
(
" <tr>\r\n"
);
#
line
4
5
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
if
(
i
==
0
)
{
#
line
4
4
"..\..
\Pages\SubscriberPage.cshtml"
if
(
i
==
0
)
{
#
line
default
#
line
hidden
WriteLiteral
(
"
<td rowspan=\""
);
WriteLiteral
(
" <td rowspan=\""
);
#
line
4
7
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
Write
(
rowCount
);
#
line
4
6
"..\..
\Pages\SubscriberPage.cshtml"
Write
(
rowCount
);
#
line
default
...
...
@@ -193,8 +179,8 @@ WriteLiteral("\">");
#
line
4
7
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
Write
(
subscriber
.
Key
);
#
line
4
6
"..\..
\Pages\SubscriberPage.cshtml"
Write
(
subscriber
.
Key
);
#
line
default
...
...
@@ -203,56 +189,55 @@ WriteLiteral("</td>\r\n");
#
line
4
8
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
}
#
line
4
7
"..\..
\Pages\SubscriberPage.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
"
<td>"
);
WriteLiteral
(
" <td>"
);
#
line
4
9
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
Write
(
column
.
Attribute
.
Name
);
#
line
4
8
"..\..
\Pages\SubscriberPage.cshtml"
Write
(
column
.
Attribute
.
Name
);
#
line
default
#
line
hidden
WriteLiteral
(
"</td>\r\n
<td>\r\n
"
+
"
<span style=\"color:
#00bcd4\">"
);
WriteLiteral
(
"</td>\r\n
<td>\r\n
"
+
"
<span style=\"color:
#00bcd4\">"
);
#
line
5
1
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
Write
(
column
.
ImplTypeInfo
.
Name
);
#
line
5
0
"..\..
\Pages\SubscriberPage.cshtml"
Write
(
column
.
ImplTypeInfo
.
Name
);
#
line
default
#
line
hidden
WriteLiteral
(
"</span>:\r\n
<div class=\"job-snippet-code\">\r
"
+
"
\n <code>\r\n
"
+
"
<pre>"
);
WriteLiteral
(
"</span>:\r\n
<div class=\"job-snippet-code\">\r\n
"
+
"
<code>\r\n
"
+
" <pre>"
);
#
line
5
4
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
Write
(
Html
.
MethodEscaped
(
column
.
MethodInfo
));
#
line
5
3
"..\..
\Pages\SubscriberPage.cshtml"
Write
(
Html
.
MethodEscaped
(
column
.
MethodInfo
));
#
line
default
#
line
hidden
WriteLiteral
(
"</pre>\r\n </code>\r\n "
+
" </div>\r\n </td>\r\n "
+
" </tr>\r\n"
);
WriteLiteral
(
"</pre>\r\n </code>\r\n "
+
" </div>\r\n </td>\r\n "
+
" </tr>\r\n"
);
#
line
59
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
i
++;
}
#
line
58
"..\..\Pages\SubscriberPage.cshtml"
i
++;
}
}
#
line
default
...
...
@@ -261,7 +246,7 @@ WriteLiteral(" </tbody>\r\n </table>\r\n
#
line
6
5
"..\..\Dashboard
\Pages\SubscriberPage.cshtml"
#
line
6
4
"..\..
\Pages\SubscriberPage.cshtml"
}
...
...
src/DotNetCore.CAP.Dashboard/Pages/_BlockMetric.cshtml
View file @
c4f4f5f4
@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True TrimLeadingUnderscores : true *@
@using DotNetCore.CAP.Dashboard
@using DotNetCore.CAP.Dashboard.Resources
@inherits RazorPage
@inherits DotNetCore.CAP.Dashboard.RazorPage
@{
var metric = DashboardMetric.Func(this);
var metric = Metric.Func(this);
var className = metric == null ? "metric-null" : metric.Style.ToClassName();
var highlighted = metric != null && metric.Highlighted ? "highlighted" : null;
}
<div class="metric @className @highlighted">
<div class="metric-body" data-metric="@
Dashboard
Metric.Name">
<div class="metric-body" data-metric="@Metric.Name">
@(metric?.Value)
</div>
<div class="metric-description">
@(Strings.ResourceManager.GetString(
DashboardMetric.Title) ?? Dashboard
Metric.Title)
@(Strings.ResourceManager.GetString(
Metric.Title) ??
Metric.Title)
</div>
</div>
\ No newline at end of file
src/DotNetCore.CAP.Dashboard/Pages/_BlockMetric.generated.cs
View file @
c4f4f5f4
...
...
@@ -16,37 +16,33 @@ namespace DotNetCore.CAP.Dashboard.Pages
using
System.Linq
;
using
System.Text
;
#
line
2
"..\..\Dashboard\Pages\_BlockMetric.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
#
line
hidden
#
line
3
"..\..\Dashboard\Pages\_BlockMetric.cshtml"
#
line
2
"..\..\Pages\_BlockMetric.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
BlockMetric
:
RazorPage
internal
partial
class
BlockMetric
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"\r\n"
);
#
line
5
"..\..\
Dashboard\
Pages\_BlockMetric.cshtml"
#
line
5
"..\..\Pages\_BlockMetric.cshtml"
var
metric
=
DashboardMetric
.
Func
(
this
);
var
metric
=
Metric
.
Func
(
this
);
var
className
=
metric
==
null
?
"metric-null"
:
metric
.
Style
.
ToClassName
();
var
highlighted
=
metric
!=
null
&&
metric
.
Highlighted
?
"highlighted"
:
null
;
...
...
@@ -58,7 +54,7 @@ WriteLiteral("<div class=\"metric ");
#
line
1
0
"..\..\Dashboard
\Pages\_BlockMetric.cshtml"
#
line
1
1
"..\..
\Pages\_BlockMetric.cshtml"
Write
(
className
);
...
...
@@ -68,7 +64,7 @@ WriteLiteral(" ");
#
line
1
0
"..\..\Dashboard
\Pages\_BlockMetric.cshtml"
#
line
1
1
"..\..
\Pages\_BlockMetric.cshtml"
Write
(
highlighted
);
...
...
@@ -78,8 +74,8 @@ WriteLiteral("\">\r\n <div class=\"metric-body\" data-metric=\"");
#
line
1
1
"..\..\Dashboard
\Pages\_BlockMetric.cshtml"
Write
(
Dashboard
Metric
.
Name
);
#
line
1
2
"..\..
\Pages\_BlockMetric.cshtml"
Write
(
Metric
.
Name
);
#
line
default
...
...
@@ -88,7 +84,7 @@ WriteLiteral("\">\r\n ");
#
line
1
2
"..\..\Dashboard
\Pages\_BlockMetric.cshtml"
#
line
1
3
"..\..
\Pages\_BlockMetric.cshtml"
Write
(
metric
?.
Value
);
...
...
@@ -98,8 +94,8 @@ WriteLiteral("\r\n </div>\r\n <div class=\"metric-description\">\r\n
#
line
1
5
"..\..\Dashboard
\Pages\_BlockMetric.cshtml"
Write
(
Strings
.
ResourceManager
.
GetString
(
DashboardMetric
.
Title
)
??
Dashboard
Metric
.
Title
);
#
line
1
6
"..\..
\Pages\_BlockMetric.cshtml"
Write
(
Strings
.
ResourceManager
.
GetString
(
Metric
.
Title
)
??
Metric
.
Title
);
#
line
default
...
...
src/DotNetCore.CAP.Dashboard/Pages/_Breadcrumbs.generated.cs
View file @
c4f4f5f4
...
...
@@ -16,51 +16,45 @@ namespace DotNetCore.CAP.Dashboard.Pages
using
System.Linq
;
using
System.Text
;
#
line
2
"..\..\Dashboard\Pages\_Breadcrumbs.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
Breadcrumbs
:
RazorPage
internal
partial
class
Breadcrumbs
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"\r\n<ol class=\"breadcrumb\">\r\n <li><a href=\""
);
WriteLiteral
(
"\r\n<ol class=\"breadcrumb\">\r\n <li>\r\n <a href=\""
);
#
line
6
"..\..\
Dashboard\
Pages\_Breadcrumbs.cshtml"
#
line
6
"..\..\Pages\_Breadcrumbs.cshtml"
Write
(
Url
.
Home
());
#
line
default
#
line
hidden
WriteLiteral
(
"\"><span class=\"glyphicon glyphicon-home\"></span></a></li>\r\n"
);
WriteLiteral
(
"\">\r\n <span class=\"glyphicon glyphicon-home\"></span>\r\n </a>\r\n "
+
" </li>\r\n"
);
#
line
7
"..\..\Dashboard
\Pages\_Breadcrumbs.cshtml"
#
line
10
"..\..
\Pages\_Breadcrumbs.cshtml"
foreach
(
var
item
in
Items
)
{
#
line
default
#
line
hidden
WriteLiteral
(
" <li><a href=\""
);
WriteLiteral
(
" <li>
\r\n
<a href=\""
);
#
line
9
"..\..\Dashboard
\Pages\_Breadcrumbs.cshtml"
#
line
13
"..\..
\Pages\_Breadcrumbs.cshtml"
Write
(
item
.
Value
);
...
...
@@ -70,17 +64,17 @@ WriteLiteral("\">");
#
line
9
"..\..\Dashboard
\Pages\_Breadcrumbs.cshtml"
#
line
13
"..\..
\Pages\_Breadcrumbs.cshtml"
Write
(
item
.
Key
);
#
line
default
#
line
hidden
WriteLiteral
(
"</a></li>\r\n"
);
WriteLiteral
(
"</a>
\r\n
</li>\r\n"
);
#
line
1
0
"..\..\Dashboard
\Pages\_Breadcrumbs.cshtml"
#
line
1
5
"..\..
\Pages\_Breadcrumbs.cshtml"
}
...
...
@@ -90,7 +84,7 @@ WriteLiteral(" <li class=\"active\">");
#
line
1
1
"..\..\Dashboard
\Pages\_Breadcrumbs.cshtml"
#
line
1
6
"..\..
\Pages\_Breadcrumbs.cshtml"
Write
(
Title
);
...
...
src/DotNetCore.CAP.Dashboard/Pages/_InlineMetric.generated.cs
View file @
c4f4f5f4
...
...
@@ -16,7 +16,7 @@ namespace DotNetCore.CAP.Dashboard.Pages
using
System.Linq
;
using
System.Text
;
#
line
2
"..\..\
Dashboard\
Pages\_InlineMetric.cshtml"
#
line
2
"..\..\Pages\_InlineMetric.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
...
...
@@ -27,7 +27,7 @@ namespace DotNetCore.CAP.Dashboard.Pages
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
...
...
@@ -37,7 +37,7 @@ WriteLiteral("\r\n");
#
line
4
"..\..\
Dashboard\
Pages\_InlineMetric.cshtml"
#
line
4
"..\..\Pages\_InlineMetric.cshtml"
var
metric
=
DashboardMetric
.
Func
(
this
);
var
className
=
metric
==
null
?
"metric-null"
:
metric
.
Style
.
ToClassName
();
...
...
@@ -51,7 +51,7 @@ WriteLiteral("<span data-metric=\"");
#
line
9
"..\..\
Dashboard\
Pages\_InlineMetric.cshtml"
#
line
9
"..\..\Pages\_InlineMetric.cshtml"
Write
(
DashboardMetric
.
Name
);
...
...
@@ -61,7 +61,7 @@ WriteLiteral("\" class=\"metric ");
#
line
9
"..\..\
Dashboard\
Pages\_InlineMetric.cshtml"
#
line
9
"..\..\Pages\_InlineMetric.cshtml"
Write
(
className
);
...
...
@@ -71,7 +71,7 @@ WriteLiteral(" ");
#
line
9
"..\..\
Dashboard\
Pages\_InlineMetric.cshtml"
#
line
9
"..\..\Pages\_InlineMetric.cshtml"
Write
(
highlighted
);
...
...
@@ -81,7 +81,7 @@ WriteLiteral("\">");
#
line
9
"..\..\
Dashboard\
Pages\_InlineMetric.cshtml"
#
line
9
"..\..\Pages\_InlineMetric.cshtml"
Write
(
metric
?.
Value
);
...
...
src/DotNetCore.CAP.Dashboard/Pages/_Navigation.generated.cs
View file @
c4f4f5f4
...
...
@@ -16,18 +16,18 @@ namespace DotNetCore.CAP.Dashboard.Pages
using
System.Linq
;
using
System.Text
;
#
line
2
"..\..\
Dashboard\
Pages\_Navigation.cshtml"
#
line
2
"..\..\Pages\_Navigation.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
Navigation
:
RazorPage
internal
partial
class
Navigation
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
...
...
@@ -37,7 +37,7 @@ WriteLiteral("\r\n");
#
line
4
"..\..\
Dashboard\
Pages\_Navigation.cshtml"
#
line
4
"..\..\Pages\_Navigation.cshtml"
if
(
NavigationMenu
.
Items
.
Count
>
0
)
{
...
...
@@ -48,12 +48,15 @@ WriteLiteral(" <ul class=\"nav navbar-nav\">\r\n");
#
line
7
"..\..\
Dashboard\
Pages\_Navigation.cshtml"
#
line
7
"..\..\Pages\_Navigation.cshtml"
foreach
(
var
item
in
NavigationMenu
.
Items
)
{
var
itemValue
=
item
(
this
);
if
(
itemValue
==
null
)
{
continue
;
}
if
(
itemValue
==
null
)
{
continue
;
}
...
...
@@ -63,7 +66,7 @@ WriteLiteral(" <li class=\"");
#
line
1
3
"..\..\Dashboard
\Pages\_Navigation.cshtml"
#
line
1
6
"..\..
\Pages\_Navigation.cshtml"
Write
(
itemValue
.
Active
?
"active"
:
null
);
...
...
@@ -73,7 +76,7 @@ WriteLiteral("\">\r\n <a href=\"");
#
line
1
4
"..\..\Dashboard
\Pages\_Navigation.cshtml"
#
line
1
7
"..\..
\Pages\_Navigation.cshtml"
Write
(
itemValue
.
Url
);
...
...
@@ -83,7 +86,7 @@ WriteLiteral("\">\r\n ");
#
line
1
5
"..\..\Dashboard
\Pages\_Navigation.cshtml"
#
line
1
8
"..\..
\Pages\_Navigation.cshtml"
Write
(
itemValue
.
Text
);
...
...
@@ -93,7 +96,7 @@ WriteLiteral("\r\n\r\n");
#
line
17
"..\..\Dashboard
\Pages\_Navigation.cshtml"
#
line
20
"..\..
\Pages\_Navigation.cshtml"
foreach
(
var
metric
in
itemValue
.
GetAllMetrics
())
{
...
...
@@ -101,14 +104,14 @@ WriteLiteral("\r\n\r\n");
#
line
default
#
line
hidden
#
line
19
"..\..\Dashboard
\Pages\_Navigation.cshtml"
#
line
22
"..\..
\Pages\_Navigation.cshtml"
Write
(
Html
.
InlineMetric
(
metric
));
#
line
default
#
line
hidden
#
line
19
"..\..\Dashboard
\Pages\_Navigation.cshtml"
#
line
22
"..\..
\Pages\_Navigation.cshtml"
}
...
...
@@ -119,7 +122,7 @@ WriteLiteral(" </a>\r\n </li>\r\n");
#
line
2
3
"..\..\Dashboard
\Pages\_Navigation.cshtml"
#
line
2
6
"..\..
\Pages\_Navigation.cshtml"
}
...
...
@@ -129,7 +132,7 @@ WriteLiteral(" </ul>\r\n");
#
line
2
5
"..\..\Dashboard
\Pages\_Navigation.cshtml"
#
line
2
8
"..\..
\Pages\_Navigation.cshtml"
}
#
line
default
...
...
src/DotNetCore.CAP.Dashboard/Pages/_Paginator.generated.cs
View file @
c4f4f5f4
...
...
@@ -16,24 +16,24 @@ namespace DotNetCore.CAP.Dashboard.Pages
using
System.Linq
;
using
System.Text
;
#
line
2
"..\..\
Dashboard\
Pages\_Paginator.cshtml"
#
line
2
"..\..\Pages\_Paginator.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
#
line
hidden
#
line
3
"..\..\
Dashboard\
Pages\_Paginator.cshtml"
#
line
3
"..\..\Pages\_Paginator.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
Paginator
:
RazorPage
internal
partial
class
Paginator
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
...
...
@@ -41,14 +41,12 @@ WriteLiteral("\r\n");
WriteLiteral
(
"\r\n"
);
WriteLiteral
(
"<div class=\"btn-toolbar\">\r\n"
);
#
line
7
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
6
"..\..
\Pages\_Paginator.cshtml"
if
(
_pager
.
TotalPageCount
>
1
)
{
...
...
@@ -59,7 +57,7 @@ WriteLiteral(" <div class=\"btn-group paginator\">\r\n");
#
line
10
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
9
"..\..
\Pages\_Paginator.cshtml"
foreach
(
var
page
in
_pager
.
PagerItems
)
{
switch
(
page
.
Type
)
...
...
@@ -73,7 +71,7 @@ WriteLiteral(" <a href=\"");
#
line
1
5
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
1
4
"..\..
\Pages\_Paginator.cshtml"
Write
(
_pager
.
PageUrl
(
page
.
PageIndex
));
...
...
@@ -83,7 +81,7 @@ WriteLiteral("\" class=\"btn btn-default ");
#
line
1
5
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
1
4
"..\..
\Pages\_Paginator.cshtml"
Write
(
_pager
.
CurrentPage
==
page
.
PageIndex
?
"active"
:
null
);
...
...
@@ -93,17 +91,17 @@ WriteLiteral("\">\r\n ");
#
line
1
6
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
1
5
"..\..
\Pages\_Paginator.cshtml"
Write
(
page
.
PageIndex
);
#
line
default
#
line
hidden
WriteLiteral
(
"
\r\n </a>\r\n"
);
WriteLiteral
(
"\r\n </a>\r\n"
);
#
line
1
8
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
1
7
"..\..
\Pages\_Paginator.cshtml"
break
;
case
Pager
.
ItemType
.
NextPage
:
...
...
@@ -114,7 +112,7 @@ WriteLiteral(" <a href=\"");
#
line
20
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
19
"..\..
\Pages\_Paginator.cshtml"
Write
(
_pager
.
PageUrl
(
page
.
PageIndex
));
...
...
@@ -124,7 +122,7 @@ WriteLiteral("\" class=\"btn btn-default ");
#
line
20
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
19
"..\..
\Pages\_Paginator.cshtml"
Write
(
page
.
Disabled
?
"disabled"
:
null
);
...
...
@@ -134,7 +132,7 @@ WriteLiteral("\">\r\n ");
#
line
2
1
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
2
0
"..\..
\Pages\_Paginator.cshtml"
Write
(
Strings
.
Paginator_Next
);
...
...
@@ -144,7 +142,7 @@ WriteLiteral("\r\n </a>\r\n");
#
line
2
3
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
2
2
"..\..
\Pages\_Paginator.cshtml"
break
;
case
Pager
.
ItemType
.
PrevPage
:
...
...
@@ -155,7 +153,7 @@ WriteLiteral(" <a href=\"");
#
line
2
5
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
2
4
"..\..
\Pages\_Paginator.cshtml"
Write
(
_pager
.
PageUrl
(
page
.
PageIndex
));
...
...
@@ -165,7 +163,7 @@ WriteLiteral("\" class=\"btn btn-default ");
#
line
2
5
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
2
4
"..\..
\Pages\_Paginator.cshtml"
Write
(
page
.
Disabled
?
"disabled"
:
null
);
...
...
@@ -175,7 +173,7 @@ WriteLiteral("\">\r\n ");
#
line
2
6
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
2
5
"..\..
\Pages\_Paginator.cshtml"
Write
(
Strings
.
Paginator_Prev
);
...
...
@@ -185,7 +183,7 @@ WriteLiteral("\r\n </a>\r\n");
#
line
2
8
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
2
7
"..\..
\Pages\_Paginator.cshtml"
break
;
case
Pager
.
ItemType
.
MorePage
:
...
...
@@ -197,7 +195,7 @@ WriteLiteral(" <a href=\"#\" class=\"btn btn-default disa
#
line
3
3
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
3
2
"..\..
\Pages\_Paginator.cshtml"
break
;
}
}
...
...
@@ -213,7 +211,7 @@ WriteLiteral(" <div class=\"btn-toolbar-spacer\"></div>\r\n");
#
line
3
8
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
3
7
"..\..
\Pages\_Paginator.cshtml"
}
...
...
@@ -223,7 +221,7 @@ WriteLiteral("\r\n <div class=\"btn-toolbar-label\">\r\n ");
#
line
4
1
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
4
0
"..\..
\Pages\_Paginator.cshtml"
Write
(
Strings
.
Paginator_TotalItems
);
...
...
@@ -233,13 +231,13 @@ WriteLiteral(": ");
#
line
4
1
"..\..\Dashboard
\Pages\_Paginator.cshtml"
#
line
4
0
"..\..
\Pages\_Paginator.cshtml"
Write
(
_pager
.
TotalRecordCount
);
#
line
default
#
line
hidden
WriteLiteral
(
"\r\n </div>\r\n</div>
\r\n
"
);
WriteLiteral
(
"\r\n </div>\r\n</div>"
);
}
...
...
src/DotNetCore.CAP.Dashboard/Pages/_PerPageSelector.generated.cs
View file @
c4f4f5f4
...
...
@@ -16,7 +16,7 @@ namespace DotNetCore.CAP.Dashboard.Pages
using
System.Linq
;
using
System.Text
;
#
line
2
"..\..\
Dashboard\
Pages\_PerPageSelector.cshtml"
#
line
2
"..\..\Pages\_PerPageSelector.cshtml"
using
DotNetCore.CAP.Dashboard.Resources
;
#
line
default
...
...
@@ -27,7 +27,7 @@ namespace DotNetCore.CAP.Dashboard.Pages
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
...
...
@@ -35,69 +35,69 @@ WriteLiteral("\r\n");
WriteLiteral
(
"\r\n
<div class=\"btn-group pull-right paginator\">\r\n"
);
WriteLiteral
(
"\r\n<div class=\"btn-group pull-right paginator\">\r\n"
);
#
line
6
"..\..\
Dashboard\
Pages\_PerPageSelector.cshtml"
foreach
(
var
count
in
new
[]
{
10
,
20
,
50
,
100
,
500
})
{
#
line
6
"..\..\Pages\_PerPageSelector.cshtml"
foreach
(
var
count
in
new
[]
{
10
,
20
,
50
,
100
,
500
})
{
#
line
default
#
line
hidden
WriteLiteral
(
"
<a class=\"btn btn-sm btn-default "
);
WriteLiteral
(
" <a class=\"btn btn-sm btn-default "
);
#
line
8
"..\..\
Dashboard\
Pages\_PerPageSelector.cshtml"
Write
(
count
==
_pager
.
RecordsPerPage
?
"active"
:
null
);
#
line
8
"..\..\Pages\_PerPageSelector.cshtml"
Write
(
count
==
_pager
.
RecordsPerPage
?
"active"
:
null
);
#
line
default
#
line
hidden
WriteLiteral
(
"\"
\r\n
href=\""
);
WriteLiteral
(
"\"
\r\n
href=\""
);
#
line
9
"..\..\
Dashboard\
Pages\_PerPageSelector.cshtml"
Write
(
_pager
.
RecordsPerPageUrl
(
count
));
#
line
9
"..\..\Pages\_PerPageSelector.cshtml"
Write
(
_pager
.
RecordsPerPageUrl
(
count
));
#
line
default
#
line
hidden
WriteLiteral
(
"\">"
);
WriteLiteral
(
"\">
\r\n
"
);
#
line
9
"..\..\Dashboard
\Pages\_PerPageSelector.cshtml"
Write
(
count
);
#
line
10
"..\..
\Pages\_PerPageSelector.cshtml"
Write
(
count
);
#
line
default
#
line
hidden
WriteLiteral
(
"</a>
\r\n"
);
WriteLiteral
(
"</a>\r\n"
);
#
line
1
0
"..\..\Dashboard
\Pages\_PerPageSelector.cshtml"
}
#
line
1
1
"..\..
\Pages\_PerPageSelector.cshtml"
}
#
line
default
#
line
hidden
WriteLiteral
(
"
</div>\r\n <div class=\"btn-toolbar-spacer pull-right\"></div>\r\n <div class
"
+
"
=\"btn-toolbar-label btn-toolbar-label-sm pull-right\">\r\n
"
);
WriteLiteral
(
"
</div>\r\n<div class=\"btn-toolbar-spacer pull-right\"></div>\r\n<div class=\"btn-toolba
"
+
"
r-label btn-toolbar-label-sm pull-right\">\r\n
"
);
#
line
1
4
"..\..\Dashboard
\Pages\_PerPageSelector.cshtml"
Write
(
Strings
.
PerPageSelector_ItemsPerPage
);
#
line
1
5
"..\..
\Pages\_PerPageSelector.cshtml"
Write
(
Strings
.
PerPageSelector_ItemsPerPage
);
#
line
default
#
line
hidden
WriteLiteral
(
":\r\n
</div>\r\n
"
);
WriteLiteral
(
":\r\n
</div>
"
);
}
...
...
src/DotNetCore.CAP.Dashboard/Pages/_SidebarMenu.generated.cs
View file @
c4f4f5f4
...
...
@@ -16,18 +16,12 @@ namespace DotNetCore.CAP.Dashboard.Pages
using
System.Linq
;
using
System.Text
;
#
line
2
"..\..\Dashboard\Pages\_SidebarMenu.cshtml"
using
DotNetCore.CAP.Dashboard
;
#
line
default
#
line
hidden
[
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"RazorGenerator"
,
"2.0.0.0"
)]
internal
partial
class
SidebarMenu
:
RazorPage
internal
partial
class
SidebarMenu
:
DotNetCore
.
CAP
.
Dashboard
.
RazorPage
{
#line hidden
p
rotected
override
void
Execute
()
p
ublic
override
void
Execute
()
{
...
...
@@ -35,9 +29,8 @@ WriteLiteral("\r\n");
#
line
4
"..\..\Dashboard
\Pages\_SidebarMenu.cshtml"
#
line
3
"..\..
\Pages\_SidebarMenu.cshtml"
if
(
Items
.
Any
())
{
...
...
@@ -48,7 +41,7 @@ WriteLiteral(" <div id=\"stats\" class=\"list-group\">\r\n");
#
line
7
"..\..\Dashboard
\Pages\_SidebarMenu.cshtml"
#
line
6
"..\..
\Pages\_SidebarMenu.cshtml"
foreach
(
var
item
in
Items
)
{
var
itemValue
=
item
(
this
);
...
...
@@ -60,7 +53,7 @@ WriteLiteral(" <a href=\"");
#
line
10
"..\..\Dashboard
\Pages\_SidebarMenu.cshtml"
#
line
9
"..\..
\Pages\_SidebarMenu.cshtml"
Write
(
itemValue
.
Url
);
...
...
@@ -70,7 +63,7 @@ WriteLiteral("\" class=\"list-group-item ");
#
line
10
"..\..\Dashboard
\Pages\_SidebarMenu.cshtml"
#
line
9
"..\..
\Pages\_SidebarMenu.cshtml"
Write
(
itemValue
.
Active
?
"active"
:
null
);
...
...
@@ -80,7 +73,7 @@ WriteLiteral("\">\r\n ");
#
line
1
1
"..\..\Dashboard
\Pages\_SidebarMenu.cshtml"
#
line
1
0
"..\..
\Pages\_SidebarMenu.cshtml"
Write
(
itemValue
.
Text
);
...
...
@@ -90,7 +83,7 @@ WriteLiteral("\r\n <span class=\"pull-right\">\r\n");
#
line
1
3
"..\..\Dashboard
\Pages\_SidebarMenu.cshtml"
#
line
1
2
"..\..
\Pages\_SidebarMenu.cshtml"
foreach
(
var
metric
in
itemValue
.
GetAllMetrics
())
{
...
...
@@ -98,14 +91,14 @@ WriteLiteral("\r\n <span class=\"pull-right\">\r\n");
#
line
default
#
line
hidden
#
line
1
5
"..\..\Dashboard
\Pages\_SidebarMenu.cshtml"
#
line
1
4
"..\..
\Pages\_SidebarMenu.cshtml"
Write
(
Html
.
InlineMetric
(
metric
));
#
line
default
#
line
hidden
#
line
1
5
"..\..\Dashboard
\Pages\_SidebarMenu.cshtml"
#
line
1
4
"..\..
\Pages\_SidebarMenu.cshtml"
}
...
...
@@ -116,7 +109,7 @@ WriteLiteral(" </span>\r\n </a>\r\n");
#
line
1
9
"..\..\Dashboard
\Pages\_SidebarMenu.cshtml"
#
line
1
8
"..\..
\Pages\_SidebarMenu.cshtml"
}
...
...
@@ -126,9 +119,8 @@ WriteLiteral(" </div>\r\n");
#
line
2
1
"..\..\Dashboard
\Pages\_SidebarMenu.cshtml"
#
line
2
0
"..\..
\Pages\_SidebarMenu.cshtml"
}
#
line
default
#
line
hidden
...
...
src/DotNetCore.CAP.Dashboard/RazorPage.cs
View file @
c4f4f5f4
...
...
@@ -5,9 +5,10 @@ using System;
using
System.Diagnostics
;
using
System.Net
;
using
System.Text
;
using
DotNetCore.CAP.Dashboard.
Monitoring
;
using
DotNetCore.CAP.Dashboard.
NodeDiscovery
;
using
DotNetCore.CAP.Internal
;
using
DotNetCore.CAP.NodeDiscovery
;
using
DotNetCore.CAP.Monitoring
;
using
DotNetCore.CAP.Persistence
;
using
Microsoft.Extensions.DependencyInjection
;
namespace
DotNetCore.CAP.Dashboard
...
...
@@ -28,7 +29,7 @@ namespace DotNetCore.CAP.Dashboard
protected
HtmlHelper
Html
{
get
;
}
public
UrlHelper
Url
{
get
;
private
set
;
}
protected
IStorage
Storage
{
get
;
set
;
}
protected
I
Data
Storage
Storage
{
get
;
set
;
}
protected
string
AppPath
{
get
;
set
;
}
protected
string
NodeName
{
get
;
set
;
}
...
...
@@ -55,7 +56,7 @@ namespace DotNetCore.CAP.Dashboard
public
string
RequestPath
=>
Request
.
Path
;
/// <exclude />
p
rotected
abstract
void
Execute
();
p
ublic
abstract
void
Execute
();
protected
string
Query
(
string
key
)
{
...
...
@@ -95,8 +96,7 @@ namespace DotNetCore.CAP.Dashboard
_statisticsLazy
=
new
Lazy
<
StatisticsDto
>(()
=>
{
var
monitoring
=
Storage
.
GetMonitoringApi
();
var
dto
=
monitoring
.
GetStatistics
();
var
dto
=
Storage
.
GetMonitoringApi
().
GetStatistics
();
SetServersCount
(
dto
);
...
...
src/DotNetCore.CAP.MySql/MySqlDataStorage.cs
View file @
c4f4f5f4
...
...
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using
Dapper
;
using
DotNetCore.CAP.Internal
;
using
DotNetCore.CAP.Messages
;
using
DotNetCore.CAP.Monitoring
;
using
DotNetCore.CAP.Persistence
;
using
DotNetCore.CAP.Serialization
;
using
Microsoft.EntityFrameworkCore.Storage
;
...
...
@@ -65,6 +66,7 @@ namespace DotNetCore.CAP.MySql
{
DbId
=
content
.
GetId
(),
Origin
=
content
,
Content
=
StringSerializer
.
Serialize
(
content
),
Added
=
DateTime
.
Now
,
ExpiresAt
=
null
,
Retries
=
0
...
...
@@ -74,7 +76,7 @@ namespace DotNetCore.CAP.MySql
{
Id
=
message
.
DbId
,
Name
=
name
,
Content
=
StringSerializer
.
Serialize
(
message
.
Origin
)
,
message
.
Content
,
message
.
Retries
,
message
.
Added
,
message
.
ExpiresAt
,
...
...
@@ -138,7 +140,7 @@ namespace DotNetCore.CAP.MySql
var
content
=
StringSerializer
.
Serialize
(
mdMessage
.
Origin
);
using
(
var
connection
=
new
MySqlConnection
(
_options
.
Value
.
ConnectionString
))
{
connection
.
Execute
(
sql
,
new
{
Id
=
mdMessage
.
DbId
,
...
...
@@ -212,24 +214,9 @@ namespace DotNetCore.CAP.MySql
return
result
;
}
//public Task<CapPublishedMessage> GetPublishedMessageAsync(long id)
//{
// var sql = $@"SELECT * FROM `{_prefix}.published` WHERE `Id`={id};";
// using (var connection = new MySqlConnection(Options.ConnectionString))
// {
// return await connection.QueryFirstOrDefaultAsync<CapPublishedMessage>(sql);
// }
//}
//public Task<CapReceivedMessage> GetReceivedMessageAsync(long id)
//{
// var sql =
// $@"SELECT * FROM `{_prefix}.received` WHERE Id={id};";
// using (var connection = new MySqlConnection(Options.ConnectionString))
// {
// return await connection.QueryFirstOrDefaultAsync<CapReceivedMessage>(sql);
// }
//}
public
IMonitoringApi
GetMonitoringApi
()
{
return
new
MySqlMonitoringApi
(
_options
);
}
}
}
src/DotNetCore.CAP/Internal/Helper.cs
View file @
c4f4f5f4
...
...
@@ -9,6 +9,14 @@ namespace DotNetCore.CAP.Internal
{
public
static
class
Helper
{
private
static
readonly
DateTime
Epoch
=
new
DateTime
(
1970
,
1
,
1
,
0
,
0
,
0
,
DateTimeKind
.
Local
);
public
static
long
ToTimestamp
(
DateTime
value
)
{
var
elapsedTime
=
value
-
Epoch
;
return
(
long
)
elapsedTime
.
TotalSeconds
;
}
public
static
bool
IsController
(
TypeInfo
typeInfo
)
{
if
(!
typeInfo
.
IsClass
)
...
...
src/DotNetCore.CAP/Internal/MethodMatcherCache.cs
View file @
c4f4f5f4
...
...
@@ -8,7 +8,7 @@ using System.Linq;
namespace
DotNetCore.CAP.Internal
{
internal
class
MethodMatcherCache
public
class
MethodMatcherCache
{
private
readonly
IConsumerServiceSelector
_selector
;
...
...
src/DotNetCore.CAP/Persistence/IDataStorage.cs
View file @
c4f4f5f4
...
...
@@ -4,6 +4,7 @@ using System.Threading;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Internal
;
using
DotNetCore.CAP.Messages
;
using
DotNetCore.CAP.Monitoring
;
namespace
DotNetCore.CAP.Persistence
{
...
...
@@ -13,16 +14,21 @@ namespace DotNetCore.CAP.Persistence
Task
ChangeReceiveStateAsync
(
MediumMessage
message
,
StatusName
state
);
Task
<
MediumMessage
>
StoreMessageAsync
(
string
name
,
Message
content
,
object
dbTransaction
=
null
,
CancellationToken
cancellationToken
=
default
);
Task
<
MediumMessage
>
StoreMessageAsync
(
string
name
,
Message
content
,
object
dbTransaction
=
null
,
CancellationToken
cancellationToken
=
default
);
Task
StoreReceivedExceptionMessageAsync
(
string
name
,
string
group
,
string
content
);
Task
<
MediumMessage
>
StoreReceivedMessageAsync
(
string
name
,
string
group
,
Message
content
);
Task
<
int
>
DeleteExpiresAsync
(
string
table
,
DateTime
timeout
,
int
batchCount
=
1000
,
CancellationToken
token
=
default
);
Task
<
int
>
DeleteExpiresAsync
(
string
table
,
DateTime
timeout
,
int
batchCount
=
1000
,
CancellationToken
token
=
default
);
Task
<
IEnumerable
<
MediumMessage
>>
GetPublishedMessagesOfNeedRetry
();
Task
<
IEnumerable
<
MediumMessage
>>
GetReceivedMessagesOfNeedRetry
();
//dashboard api
IMonitoringApi
GetMonitoringApi
();
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Persistence/MediumMessage.cs
View file @
c4f4f5f4
...
...
@@ -9,6 +9,8 @@ namespace DotNetCore.CAP.Persistence
public
Message
Origin
{
get
;
set
;
}
public
string
Content
{
get
;
set
;
}
public
DateTime
Added
{
get
;
set
;
}
public
DateTime
?
ExpiresAt
{
get
;
set
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment