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
843e9942
Commit
843e9942
authored
Oct 10, 2019
by
Yrin Leung
Committed by
Savorboard
Oct 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Net Core 3.0,Dashboard Can't Load Js And Css. (#407)
parent
36ee097a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
CombinedResourceDispatcher.cs
src/DotNetCore.CAP/Dashboard/CombinedResourceDispatcher.cs
+4
-3
EmbeddedResourceDispatcher.cs
src/DotNetCore.CAP/Dashboard/EmbeddedResourceDispatcher.cs
+6
-7
No files found.
src/DotNetCore.CAP/Dashboard/CombinedResourceDispatcher.cs
View file @
843e9942
...
...
@@ -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
(
await
WriteResource
(
response
,
_assembly
,
$"
{
_baseNamespace
}
.
{
resourceName
}
"
);
$"
{
_baseNamespace
}
.
{
resourceName
}
"
)
.
ConfigureAwait
(
false
)
;
}
}
}
...
...
src/DotNetCore.CAP/Dashboard/EmbeddedResourceDispatcher.cs
View file @
843e9942
...
...
@@ -30,22 +30,21 @@ 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
.
Respon
se
);
await
WriteResponse
(
context
.
Response
).
ConfigureAwait
(
fal
se
);
return
Task
.
FromResult
(
true
);
}
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
))
{
...
...
@@ -55,7 +54,7 @@ namespace DotNetCore.CAP.Dashboard
$@"Resource with name
{
resourceName
}
not found in assembly
{
assembly
}
."
);
}
inputStream
.
CopyTo
(
response
.
Body
);
await
inputStream
.
CopyToAsync
(
response
.
Body
).
ConfigureAwait
(
false
);
}
}
}
...
...
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