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
08f558a3
Commit
08f558a3
authored
Sep 13, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update subscriber page.
parent
01d92064
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
25 deletions
+66
-25
HtmlHelper.cs
src/DotNetCore.CAP/Dashboard/HtmlHelper.cs
+51
-17
SubscriberPage.cshtml
src/DotNetCore.CAP/Dashboard/Pages/SubscriberPage.cshtml
+5
-1
SubscriberPage.generated.cs
...otNetCore.CAP/Dashboard/Pages/SubscriberPage.generated.cs
+10
-7
No files found.
src/DotNetCore.CAP/Dashboard/HtmlHelper.cs
View file @
08f558a3
...
@@ -10,6 +10,7 @@ using DotNetCore.CAP.Dashboard.Resources;
...
@@ -10,6 +10,7 @@ using DotNetCore.CAP.Dashboard.Resources;
using
DotNetCore.CAP.Dashboard.Pages
;
using
DotNetCore.CAP.Dashboard.Pages
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Models
;
using
DotNetCore.CAP.Models
;
using
Microsoft.Extensions.Internal
;
namespace
DotNetCore.CAP.Dashboard
namespace
DotNetCore.CAP.Dashboard
{
{
...
@@ -222,11 +223,24 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -222,11 +223,24 @@ namespace DotNetCore.CAP.Dashboard
{
{
var
outputString
=
string
.
Empty
;
var
outputString
=
string
.
Empty
;
var
@public
=
"<span style=\"color:blue\">public </span>"
;
var
@public
=
WrapKeyword
(
"public"
);
var
@async
=
string
.
Empty
;
var
@return
=
string
.
Empty
;
var
key
=
Hignlight
(
method
.
ReturnType
);
var
isAwaitable
=
CoercedAwaitableInfo
.
IsTypeAwaitable
(
method
.
ReturnType
,
out
var
coercedAwaitableInfo
);
if
(
isAwaitable
)
{
@async
=
WrapKeyword
(
"async"
);
var
asyncResultType
=
coercedAwaitableInfo
.
AwaitableInfo
.
ResultType
;
var
name
=
method
.
Name
;
@return
=
WrapType
(
"Task"
)
+
WrapIdentifier
(
"<"
)
+
WrapType
(
asyncResultType
)
+
WrapIdentifier
(
">"
);
}
else
{
@return
=
WrapType
(
method
.
ReturnType
);
}
var
@name
=
method
.
Name
;
string
paramType
=
null
;
string
paramType
=
null
;
string
paramName
=
null
;
string
paramName
=
null
;
...
@@ -237,52 +251,72 @@ namespace DotNetCore.CAP.Dashboard
...
@@ -237,52 +251,72 @@ namespace DotNetCore.CAP.Dashboard
{
{
var
firstParam
=
@params
[
0
];
var
firstParam
=
@params
[
0
];
var
firstParamType
=
firstParam
.
ParameterType
;
var
firstParamType
=
firstParam
.
ParameterType
;
paramType
=
Hignlight
(
firstParamType
);
paramType
=
WrapType
(
firstParamType
);
paramName
=
firstParam
.
Name
;
paramName
=
firstParam
.
Name
;
}
}
if
(
paramType
==
null
)
if
(
paramType
==
null
)
{
{
paramString
=
"()
{ }
"
;
paramString
=
"()
;
"
;
}
}
else
else
{
{
paramString
=
$"(
{
paramType
}
{
paramName
}
)
{{
}}
"
;
paramString
=
$"(
{
paramType
}
{
paramName
}
)
;
"
;
}
}
outputString
=
@public
+
" "
+
(
string
.
IsNullOrEmpty
(
@async
)
?
""
:
@async
+
" "
)
+
@return
+
" "
+
@name
+
paramString
;
outputString
=
@public
+
key
+
name
+
paramString
;
return
new
NonEscapedString
(
outputString
);
return
new
NonEscapedString
(
outputString
);
}
}
p
ublic
string
Hignlight
(
Type
type
)
p
rivate
string
WrapType
(
Type
type
)
{
{
if
(
type
.
Name
==
"Void"
)
if
(
type
==
null
)
{
return
string
.
Empty
;
}
if
(
type
.
Name
==
"Void"
)
{
{
return
HighligthKey
(
type
.
Name
.
ToLower
());
return
WrapKeyword
(
type
.
Name
.
ToLower
());
}
}
if
(
Helper
.
IsComplexType
(
type
))
if
(
Helper
.
IsComplexType
(
type
))
{
{
return
HighligthClass
(
type
.
Name
);
return
WrapType
(
type
.
Name
);
}
}
if
(
type
.
IsPrimitive
||
type
.
Equals
(
typeof
(
string
))
||
type
.
Equals
(
typeof
(
decimal
)))
if
(
type
.
IsPrimitive
||
type
.
Equals
(
typeof
(
string
))
||
type
.
Equals
(
typeof
(
decimal
)))
{
{
return
HighligthKey
(
type
.
Name
.
ToLower
());
return
WrapKeyword
(
type
.
Name
.
ToLower
());
}
}
else
else
{
{
return
HighligthClass
(
type
.
Name
);
return
WrapType
(
type
.
Name
);
}
}
}
}
private
string
HighligthClass
(
string
key
)
private
string
WrapIdentifier
(
string
value
)
{
return
value
;
}
private
string
WrapKeyword
(
string
value
)
{
return
Span
(
"keyword"
,
value
);
}
private
string
WrapType
(
string
value
)
{
return
Span
(
"type"
,
value
);
}
private
string
WrapString
(
string
value
)
{
{
return
$"<span style=\"color:#07c1be\">
{
key
}
</span>"
;
return
Span
(
"string"
,
value
)
;
}
}
private
string
HighligthKey
(
string
key
)
private
string
Span
(
string
@class
,
string
value
)
{
{
return
$"<span
style=\"color:blue\">
{
key
}
</span>"
;
return
$"<span
class=\"
{
@class
}
\">
{
value
}
</span>"
;
}
}
//private static readonly StackTraceHtmlFragments StackTraceHtmlFragments = new StackTraceHtmlFragments
//private static readonly StackTraceHtmlFragments StackTraceHtmlFragments = new StackTraceHtmlFragments
...
...
src/DotNetCore.CAP/Dashboard/Pages/SubscriberPage.cshtml
View file @
08f558a3
...
@@ -48,7 +48,11 @@
...
@@ -48,7 +48,11 @@
<td>@column.Attribute.Name</td>
<td>@column.Attribute.Name</td>
<td>
<td>
<span style="color:#00bcd4">@column.ImplTypeInfo.Name</span>:
<span style="color:#00bcd4">@column.ImplTypeInfo.Name</span>:
@Html.MethodEscaped(column.MethodInfo)
<div class="job-snippet-code">
<code>
<pre>@Html.MethodEscaped(column.MethodInfo)</pre>
</code>
</div>
</td>
</td>
</tr>
</tr>
i++;
i++;
...
...
src/DotNetCore.CAP/Dashboard/Pages/SubscriberPage.generated.cs
View file @
08f558a3
...
@@ -229,23 +229,26 @@ WriteLiteral("</td>\r\n <td>\r\n
...
@@ -229,23 +229,26 @@ WriteLiteral("</td>\r\n <td>\r\n
#
line
default
#
line
default
#
line
hidden
#
line
hidden
WriteLiteral
(
"</span>:\r\n "
);
WriteLiteral
(
"</span>:\r\n <div class=\"job-snippet-code\">\r"
+
"\n <code>\r\n "
+
" <pre>"
);
#
line
5
1
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
#
line
5
3
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
Write
(
Html
.
MethodEscaped
(
column
.
MethodInfo
));
Write
(
Html
.
MethodEscaped
(
column
.
MethodInfo
));
#
line
default
#
line
default
#
line
hidden
#
line
hidden
WriteLiteral
(
"\r\n </td>\r\n </tr"
+
WriteLiteral
(
"</pre>\r\n </code>\r\n "
+
">\r\n"
);
" </div>\r\n </td>\r\n "
+
" </tr>\r\n"
);
#
line
5
4
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
#
line
5
8
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
i
++;
i
++;
}
}
}
}
...
@@ -257,7 +260,7 @@ WriteLiteral(" </tbody>\r\n </table>\r\n
...
@@ -257,7 +260,7 @@ WriteLiteral(" </tbody>\r\n </table>\r\n
#
line
6
0
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
#
line
6
4
"..\..\Dashboard\Pages\SubscriberPage.cshtml"
}
}
...
...
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