mirror of https://github.com/abpframework/abp.git
195 changed files with 3534 additions and 286 deletions
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.AlertsDemo |
|||
{ |
|||
[Widget] |
|||
public class AlertsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/AlertsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.AlertsDemo |
|||
|
|||
<abp-component-demo-section title="Examples" view-path="@AlertsDemoViewComponent.ViewPath"> |
|||
<abp-alert alert-type="Primary"> |
|||
A simple primary alert—check it out! |
|||
</abp-alert> |
|||
<abp-alert alert-type="Secondary"> |
|||
A simple secondary alert—check it out! |
|||
</abp-alert> |
|||
<abp-alert alert-type="Success"> |
|||
A simple success alert—check it out! |
|||
</abp-alert> |
|||
<abp-alert alert-type="Danger"> |
|||
A simple danger alert—check it out! |
|||
</abp-alert> |
|||
<abp-alert alert-type="Warning"> |
|||
A simple warning alert—check it out! |
|||
</abp-alert> |
|||
<abp-alert alert-type="Info"> |
|||
A simple info alert—check it out! |
|||
</abp-alert> |
|||
<abp-alert alert-type="Light"> |
|||
A simple light alert—check it out! |
|||
</abp-alert> |
|||
<abp-alert alert-type="Dark"> |
|||
A simple dark alert—check it out! |
|||
</abp-alert> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Link color" view-path="@AlertsDemoViewComponent.ViewPath"> |
|||
<abp-alert alert-type="Primary"> |
|||
A simple primary alert with <a abp-alert-link href="#">an example link</a>. Give it a click if you like. |
|||
</abp-alert> |
|||
<abp-alert alert-type="Secondary"> |
|||
A simple secondary alert with <a abp-alert-link href="#">an example link</a>. Give it a click if you like. |
|||
</abp-alert> |
|||
<abp-alert alert-type="Success"> |
|||
A simple success alert with <a abp-alert-link href="#">an example link</a>. Give it a click if you like. |
|||
</abp-alert> |
|||
<abp-alert alert-type="Danger"> |
|||
A simple danger alert with <a abp-alert-link href="#">an example link</a>. Give it a click if you like. |
|||
</abp-alert> |
|||
<abp-alert alert-type="Warning"> |
|||
A simple warning alert with <a abp-alert-link href="#">an example link</a>. Give it a click if you like. |
|||
</abp-alert> |
|||
<abp-alert alert-type="Info"> |
|||
A simple info alert with <a abp-alert-link href="#">an example link</a>. Give it a click if you like. |
|||
</abp-alert> |
|||
<abp-alert alert-type="Light"> |
|||
A simple light alert with <a abp-alert-link href="#">an example link</a>. Give it a click if you like. |
|||
</abp-alert> |
|||
<abp-alert alert-type="Dark"> |
|||
A simple dark alert with <a abp-alert-link href="#">an example link</a>. Give it a click if you like. |
|||
</abp-alert> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Additional content" view-path="@AlertsDemoViewComponent.ViewPath"> |
|||
<abp-alert alert-type="Success"> |
|||
<h4>Well done!</h4> |
|||
<p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p> |
|||
<hr> |
|||
<p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p> |
|||
</abp-alert> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Dismissing" view-path="@AlertsDemoViewComponent.ViewPath"> |
|||
<abp-alert alert-type="Warning" dismissible="true"> |
|||
Holy guacamole! You should check in on some of those fields below. |
|||
</abp-alert> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BadgesDemo |
|||
{ |
|||
[Widget] |
|||
public class BadgesDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/BadgesDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BadgesDemo |
|||
|
|||
<abp-component-demo-section title="Example" view-path="@BadgesDemoViewComponent.ViewPath"> |
|||
<h1>Example heading <span abp-badge="Secondary">New</span></h1> |
|||
<h2>Example heading <span abp-badge="Secondary">New</span></h2> |
|||
<h3>Example heading <span abp-badge="Secondary">New</span></h3> |
|||
<h4>Example heading <span abp-badge="Secondary">New</span></h4> |
|||
<h5>Example heading <span abp-badge="Secondary">New</span></h5> |
|||
<h6>Example heading <span abp-badge="Secondary">New</span></h6> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Notifications" view-path="@BadgesDemoViewComponent.ViewPath"> |
|||
<abp-button button-type="Primary"> |
|||
Notifications <span abp-badge="Light">4</span> |
|||
</abp-button> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Contextual variations" view-path="@BadgesDemoViewComponent.ViewPath"> |
|||
<span abp-badge="Primary">Primary</span> |
|||
<span abp-badge="Secondary">Secondary</span> |
|||
<span abp-badge="Success">Success</span> |
|||
<span abp-badge="Danger">Danger</span> |
|||
<span abp-badge="Warning">Warning</span> |
|||
<span abp-badge="Info">Info</span> |
|||
<span abp-badge="Light">Light</span> |
|||
<span abp-badge="Dark">Dark</span> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Pill badges" view-path="@BadgesDemoViewComponent.ViewPath"> |
|||
<span abp-badge-pill="Primary">Primary</span> |
|||
<span abp-badge-pill="Secondary">Secondary</span> |
|||
<span abp-badge-pill="Success">Success</span> |
|||
<span abp-badge-pill="Danger">Danger</span> |
|||
<span abp-badge-pill="Warning">Warning</span> |
|||
<span abp-badge-pill="Info">Info</span> |
|||
<span abp-badge-pill="Light">Light</span> |
|||
<span abp-badge-pill="Dark">Dark</span> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Links" view-path="@BadgesDemoViewComponent.ViewPath"> |
|||
<a href="#" abp-badge="Primary">Primary</a> |
|||
<a href="#" abp-badge="Secondary">Secondary</a> |
|||
<a href="#" abp-badge="Success">Success</a> |
|||
<a href="#" abp-badge="Danger">Danger</a> |
|||
<a href="#" abp-badge="Warning">Warning</a> |
|||
<a href="#" abp-badge="Info">Info</a> |
|||
<a href="#" abp-badge="Light">Light</a> |
|||
<a href="#" abp-badge="Dark">Dark</a> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BordersDemo |
|||
{ |
|||
[Widget] |
|||
public class BordersDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/BordersDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BordersDemo |
|||
|
|||
<abp-component-demo-section title="Additive" view-path="@BordersDemoViewComponent.ViewPath"> |
|||
<span abp-border="Default"></span> |
|||
<span abp-border="Top"></span> |
|||
<span abp-border="Right"></span> |
|||
<span abp-border="Bottom"></span> |
|||
<span abp-border="Left"></span> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Subtractive" view-path="@BordersDemoViewComponent.ViewPath"> |
|||
<span abp-border="_0"></span> |
|||
<span abp-border="Top_0"></span> |
|||
<span abp-border="Right_0"></span> |
|||
<span abp-border="Bottom_0"></span> |
|||
<span abp-border="Left_0"></span> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Border color" view-path="@BordersDemoViewComponent.ViewPath"> |
|||
<span abp-border="Primary"></span> |
|||
<span abp-border="Secondary"></span> |
|||
<span abp-border="Success"></span> |
|||
<span abp-border="Danger"></span> |
|||
<span abp-border="Info"></span> |
|||
<span abp-border="Light"></span> |
|||
<span abp-border="Dark"></span> |
|||
<span abp-border="White"></span> |
|||
<br /> |
|||
<span abp-border="Left_Primary"></span> |
|||
<span abp-border="Top_Secondary"></span> |
|||
<span abp-border="Right_Success"></span> |
|||
<span abp-border="Bottom_Danger"></span> |
|||
<span abp-border="Bottom_Warning"></span> |
|||
<span abp-border="Left_Info"></span> |
|||
<span abp-border="Top_Light"></span> |
|||
<span abp-border="Right_Dark"></span> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Border-radius" view-path="@BordersDemoViewComponent.ViewPath"> |
|||
<span abp-border="Primary" abp-rounded="Default"></span> |
|||
<span abp-border="Primary" abp-rounded="_0"></span> |
|||
<span abp-border="Primary" abp-rounded="Top"></span> |
|||
<span abp-border="Primary" abp-rounded="Left"></span> |
|||
<span abp-border="Primary" abp-rounded="Bottom"></span> |
|||
<span abp-border="Primary" abp-rounded="Right"></span> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BreadcrumbsDemo |
|||
{ |
|||
[Widget] |
|||
public class BreadcrumbsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/BreadcrumbsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BreadcrumbsDemo |
|||
|
|||
<abp-component-demo-section title="Example" view-path="@BreadcrumbsDemoViewComponent.ViewPath"> |
|||
<abp-breadcrumb> |
|||
<abp-breadcrumb-item title="Home" /> |
|||
</abp-breadcrumb> |
|||
|
|||
<abp-breadcrumb> |
|||
<abp-breadcrumb-item href="#" title="Home" /> |
|||
<abp-breadcrumb-item title="Library" /> |
|||
</abp-breadcrumb> |
|||
|
|||
<abp-breadcrumb> |
|||
<abp-breadcrumb-item href="#" title="Home" /> |
|||
<abp-breadcrumb-item href="#" title="Library" /> |
|||
<abp-breadcrumb-item title="Page" /> |
|||
</abp-breadcrumb> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ButtonGroupsDemo |
|||
{ |
|||
[Widget] |
|||
public class ButtonGroupsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/ButtonGroupsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ButtonGroupsDemo |
|||
|
|||
<abp-component-demo-section title="Basic example" view-path="@ButtonGroupsDemoViewComponent.ViewPath"> |
|||
<abp-button-group> |
|||
<abp-button button-type="Secondary">Left</abp-button> |
|||
<abp-button button-type="Secondary">Middle</abp-button> |
|||
<abp-button button-type="Secondary">Right</abp-button> |
|||
</abp-button-group> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Button Toolbar" view-path="@ButtonGroupsDemoViewComponent.ViewPath"> |
|||
<abp-button-toolbar> |
|||
<abp-button-group class="mr-2"> |
|||
<abp-button button-type="Secondary">1</abp-button> |
|||
<abp-button button-type="Secondary">2</abp-button> |
|||
<abp-button button-type="Secondary">3</abp-button> |
|||
<abp-button button-type="Secondary">4</abp-button> |
|||
</abp-button-group> |
|||
<abp-button-group class="mr-2"> |
|||
<abp-button button-type="Secondary">5</abp-button> |
|||
<abp-button button-type="Secondary">6</abp-button> |
|||
<abp-button button-type="Secondary">7</abp-button> |
|||
</abp-button-group> |
|||
<abp-button-group> |
|||
<abp-button button-type="Secondary">8</abp-button> |
|||
</abp-button-group> |
|||
</abp-button-toolbar> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Sizing" view-path="@ButtonGroupsDemoViewComponent.ViewPath"> |
|||
<abp-button-group size="Large"> |
|||
<abp-button button-type="Secondary">Left</abp-button> |
|||
<abp-button button-type="Secondary">Middle</abp-button> |
|||
<abp-button button-type="Secondary">Right</abp-button> |
|||
</abp-button-group> |
|||
<abp-button-group> |
|||
<abp-button button-type="Secondary">Left</abp-button> |
|||
<abp-button button-type="Secondary">Middle</abp-button> |
|||
<abp-button button-type="Secondary">Right</abp-button> |
|||
</abp-button-group> |
|||
<abp-button-group size="Small"> |
|||
<abp-button button-type="Secondary">Left</abp-button> |
|||
<abp-button button-type="Secondary">Middle</abp-button> |
|||
<abp-button button-type="Secondary">Right</abp-button> |
|||
</abp-button-group> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Nesting" view-path="@ButtonGroupsDemoViewComponent.ViewPath"> |
|||
<abp-button-group> |
|||
<abp-button button-type="Secondary">1</abp-button> |
|||
<abp-button button-type="Secondary">2</abp-button> |
|||
<abp-dropdown> |
|||
<abp-dropdown-button button-type="Secondary" text="Dropdown" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#"> Dropdown link </abp-dropdown-item> |
|||
<abp-dropdown-item href="#"> Dropdown link </abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-button-group> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Vertical variation" view-path="@ButtonGroupsDemoViewComponent.ViewPath"> |
|||
<abp-button-group direction="Vertical"> |
|||
<abp-button button-type="Secondary">Left</abp-button> |
|||
<abp-button button-type="Secondary">Middle</abp-button> |
|||
<abp-button button-type="Secondary">Right</abp-button> |
|||
</abp-button-group> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.CardsDemo |
|||
{ |
|||
[Widget] |
|||
public class CardsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/CardsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,156 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.CardsDemo |
|||
|
|||
<abp-component-demo-section title="Example" view-path="@CardsDemoViewComponent.ViewPath"> |
|||
<abp-card style="width: 18rem;"> |
|||
<img abp-card-image="Top" src="~/imgs/demo/300x200.png" /> |
|||
<abp-card-body> |
|||
<abp-card-title>Card Title</abp-card-title> |
|||
<abp-card-text>Some quick example text to build on the card title and make up the bulk of the card's content.</abp-card-text> |
|||
<a abp-button="Primary" href="#"> Go somewhere</a> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Titles, text, and links" view-path="@CardsDemoViewComponent.ViewPath"> |
|||
<abp-card style="width: 18rem;"> |
|||
<abp-card-body> |
|||
<abp-card-title>Card title</abp-card-title> |
|||
<abp-card-subtitle class="mb-2 text-muted">Card subtitle</abp-card-subtitle> |
|||
<abp-card-text>Some quick example text to build on the card title and make up the bulk of the card's content.</abp-card-text> |
|||
<a abp-card-link href="#">Card link</a> |
|||
<a abp-card-link href="#">Another link</a> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="List groups" view-path="@CardsDemoViewComponent.ViewPath"> |
|||
<abp-card style="width: 18rem;"> |
|||
<abp-list-group flush="true"> |
|||
<abp-list-group-item>Cras justo odio</abp-list-group-item> |
|||
<abp-list-group-item>Dapibus ac facilisis in</abp-list-group-item> |
|||
<abp-list-group-item>Vestibulum at eros</abp-list-group-item> |
|||
</abp-list-group> |
|||
</abp-card> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="List Title" view-path="@CardsDemoViewComponent.ViewPath"> |
|||
<abp-card style="width: 18rem;"> |
|||
<abp-card-header>Featured</abp-card-header> |
|||
<abp-list-group flush="true"> |
|||
<abp-list-group-item>Cras justo odio</abp-list-group-item> |
|||
<abp-list-group-item>Dapibus ac facilisis in</abp-list-group-item> |
|||
<abp-list-group-item>Vestibulum at eros</abp-list-group-item> |
|||
</abp-list-group> |
|||
</abp-card> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Kitchen sink" view-path="@CardsDemoViewComponent.ViewPath"> |
|||
<abp-card style="width: 18rem;"> |
|||
<img abp-card-image="Top" src="~/imgs/demo/300x200.png" /> |
|||
<abp-card-body> |
|||
<abp-card-title>Card Title</abp-card-title><abp-card-text>Some quick example text to build on the card title and make up the bulk of the card's content.</abp-card-text> |
|||
</abp-card-body> |
|||
<abp-list-group flush="true"> |
|||
<abp-list-group-item>Cras justo odio</abp-list-group-item> |
|||
<abp-list-group-item>Dapibus ac facilisis in</abp-list-group-item> |
|||
<abp-list-group-item>Vestibulum at eros</abp-list-group-item> |
|||
</abp-list-group> |
|||
<abp-card-body> |
|||
<a abp-card-link href="#">Card link</a> |
|||
<a abp-card-link href="#">Another link</a> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Header and footer" view-path="@CardsDemoViewComponent.ViewPath"> |
|||
<abp-card style="width: 18rem;"> |
|||
<abp-card-header>Featured</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-card-title> Special title treatment</abp-card-title> |
|||
<abp-card-text>With supporting text below as a natural lead-in to additional content.</abp-card-text> |
|||
<a abp-button="Primary" href="#"> Go somewhere</a> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Quoate" view-path="@CardsDemoViewComponent.ViewPath"> |
|||
<abp-card> |
|||
<abp-card-header>Quote</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-blockquote> |
|||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> |
|||
<footer>Someone famous in Source Title</footer> |
|||
</abp-blockquote> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Featured" view-path="@CardsDemoViewComponent.ViewPath"> |
|||
<abp-card class="text-center"> |
|||
<abp-card-header>Featured</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-card-title> Special title treatment</abp-card-title> |
|||
<abp-card-text>With supporting text below as a natural lead-in to additional content.</abp-card-text> |
|||
<a abp-button="Primary" href="#"> Go somewhere</a> |
|||
</abp-card-body> |
|||
<abp-card-footer class="text-muted"> 2 days ago</abp-card-footer> |
|||
</abp-card> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Card Styles" view-path="@CardsDemoViewComponent.ViewPath"> |
|||
<abp-card background="Primary" class="mb-3" style="max-width: 18rem;"> |
|||
<abp-card-header>Featured</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-card-title> Special title treatment</abp-card-title> |
|||
<abp-card-text>With supporting text below as a natural lead-in to additional content.</abp-card-text> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
|
|||
<abp-card background="Success" text-color="Danger" border="Dark" class="mb-3" style="max-width: 18rem;"> |
|||
<abp-card-header>Featured</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-card-title> Special title treatment</abp-card-title> |
|||
<abp-card-text>With supporting text below as a natural lead-in to additional content.</abp-card-text> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
|
|||
<abp-card background="Warning" text-color="Secondary" class="mb-3" style="max-width: 18rem;"> |
|||
<abp-card-header>Featured</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-card-title> Special title treatment</abp-card-title> |
|||
<abp-card-text>With supporting text below as a natural lead-in to additional content.</abp-card-text> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
|
|||
<abp-card background="Light" text-color="Dark" border="Success" class="mb-3" style="max-width: 18rem;"> |
|||
<abp-card-header>Featured</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-card-title> Special title treatment</abp-card-title> |
|||
<abp-card-text>With supporting text below as a natural lead-in to additional content.</abp-card-text> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
|
|||
<abp-card background="Dark" text-color="White" border="Danger" class="mb-3" style="max-width: 18rem;"> |
|||
<abp-card-header>Featured</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-card-title> Special title treatment</abp-card-title> |
|||
<abp-card-text>With supporting text below as a natural lead-in to additional content.</abp-card-text> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
|
|||
<abp-card background="Danger" class="mb-3" style="max-width: 18rem;"> |
|||
<abp-card-header text-color="Primary">Featured</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-card-title> Special title treatment</abp-card-title> |
|||
<abp-card-text>With supporting text below as a natural lead-in to additional content.</abp-card-text> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
|
|||
<abp-card background="Info" border="Danger" class="mb-3" style="max-width: 18rem;"> |
|||
<abp-card-header>Featured</abp-card-header> |
|||
<abp-card-body text-color="Danger"> |
|||
<abp-card-title> Special title treatment</abp-card-title> |
|||
<abp-card-text>With supporting text below as a natural lead-in to additional content.</abp-card-text> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.CollapseDemo |
|||
{ |
|||
[Widget] |
|||
public class CollapseDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/CollapseDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.CollapseDemo |
|||
|
|||
<abp-component-demo-section title="Example" view-path="@CollapseDemoViewComponent.ViewPath"> |
|||
<abp-button button-type="Primary" abp-collapse-id="collapseExample" text="Button with data-target" /> |
|||
<a abp-button="Primary" abp-collapse-id="collapseExample"> Link with href </a> |
|||
|
|||
<abp-collapse-body id="collapseExample"> |
|||
Anim pariatur wolf moon tempor,,, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. |
|||
</abp-collapse-body> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Multiple targets" view-path="@CollapseDemoViewComponent.ViewPath"> |
|||
<a abp-button="Primary" abp-collapse-id="FirstCollapseExample"> Toggle first element </a> |
|||
<abp-button button-type="Primary" abp-collapse-id="SecondCollapseExample" text="Toggle second element" /> |
|||
<abp-button button-type="Primary" abp-collapse-id="FirstCollapseExample SecondCollapseExample" text="Toggle both elements" /> |
|||
|
|||
<abp-row class="mt-3"> |
|||
<abp-column size-sm="_6"> |
|||
<abp-collapse-body id="FirstCollapseExample" multi="true"> |
|||
Curabitur porta porttitor libero eu luctus. Praesent ultrices mattis commodo. Integer sodales massa risus, in molestie enim sagittis blandit |
|||
</abp-collapse-body> |
|||
</abp-column> |
|||
<abp-column size-sm="_6"> |
|||
<abp-collapse-body id="SecondCollapseExample" multi="true"> |
|||
Anim pariatur wolf moon tempor,,, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. |
|||
</abp-collapse-body> |
|||
</abp-column> |
|||
</abp-row> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Accordion example" view-path="@CollapseDemoViewComponent.ViewPath"> |
|||
<abp-accordion> |
|||
<abp-accordion-item title="Collapsible Group Item #1"> |
|||
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry rtat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. |
|||
</abp-accordion-item> |
|||
<abp-accordion-item title="Collapsible Group Item #2"> |
|||
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. |
|||
</abp-accordion-item> |
|||
<abp-accordion-item title="Collapsible Group Item #3"> |
|||
Anim pariatur wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. |
|||
</abp-accordion-item> |
|||
</abp-accordion> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,171 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.DropdownsDemo |
|||
|
|||
<abp-component-demo-section title="Single button" view-path="@DropdownsDemoViewComponent.ViewPath"> |
|||
<abp-dropdown> |
|||
<abp-dropdown-button text="Dropdown button" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Another action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Single button 2" view-path="@DropdownsDemoViewComponent.ViewPath"> |
|||
<abp-dropdown> |
|||
<abp-dropdown-button button-type="Secondary" link="true" text="Dropdown button" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Another action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Single button 3" view-path="@DropdownsDemoViewComponent.ViewPath"> |
|||
<abp-dropdown> |
|||
<abp-dropdown-button button-type="Danger" text="Dropdown button" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Another action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
<abp-dropdown-divider /> |
|||
<abp-dropdown-item href="#">Separated link</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Split button" view-path="@DropdownsDemoViewComponent.ViewPath"> |
|||
<abp-dropdown> |
|||
<abp-dropdown-button button-type="Danger" dropdown-style="Split" text="Dropdown button" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Another action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
<abp-dropdown-divider /> |
|||
<abp-dropdown-item href="#">Separated link</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Split button 2" view-path="@DropdownsDemoViewComponent.ViewPath"> |
|||
<abp-dropdown> |
|||
<abp-dropdown-button size="Large" button-type="Secondary" text="Large button" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Another action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
<abp-dropdown-divider /> |
|||
<abp-dropdown-item href="#">Separated link</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown><abp-dropdown> |
|||
<abp-dropdown-button size="Large" button-type="Secondary" dropdown-style="Split" text="Large split button" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Another action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
<abp-dropdown-divider /> |
|||
<abp-dropdown-item href="#">Separated link</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown><abp-dropdown> |
|||
<abp-dropdown-button size="Small" button-type="Secondary" text="Small button" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Another action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
<abp-dropdown-divider /> |
|||
<abp-dropdown-item href="#">Separated link</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown><abp-dropdown> |
|||
<abp-dropdown-button size="Small" button-type="Secondary" dropdown-style="Split" text="Small split button" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Another action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
<abp-dropdown-divider /> |
|||
<abp-dropdown-item href="#">Separated link</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Directions" view-path="@DropdownsDemoViewComponent.ViewPath"> |
|||
<abp-dropdown direction="Up"> |
|||
<abp-dropdown-button button-type="Secondary" text="Dropup" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Another action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown><abp-dropdown direction="Right"> |
|||
<abp-dropdown-button button-type="Secondary" text="dropright" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Another action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown><abp-dropdown direction="Right"> |
|||
<abp-dropdown-button button-type="Secondary" dropdown-style="Split" text="Split right" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Another action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Menu Items" view-path="@DropdownsDemoViewComponent.ViewPath"> |
|||
<abp-dropdown> |
|||
<abp-dropdown-button button-type="Secondary" text="Dropdown" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-header>Dropdown Header</abp-dropdown-header> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item active="true" href="#">Active action</abp-dropdown-item> |
|||
<abp-dropdown-item disabled="true" href="#">Disabled action</abp-dropdown-item> |
|||
<abp-dropdown-divider /> |
|||
<abp-dropdown-item-text>Dropdown Item Text</abp-dropdown-item-text> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Menu alignment" view-path="@DropdownsDemoViewComponent.ViewPath"> |
|||
<abp-dropdown> |
|||
<abp-dropdown-button button-type="Secondary" text="Right-aligned" /> |
|||
<abp-dropdown-menu align="Right"> |
|||
<abp-dropdown-item href="#">Action</abp-dropdown-item> |
|||
<abp-dropdown-item active="true" href="#">Active action</abp-dropdown-item> |
|||
<abp-dropdown-item disabled="true" href="#">Disabled action</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Custom Content" view-path="@DropdownsDemoViewComponent.ViewPath"> |
|||
<abp-dropdown> |
|||
<abp-dropdown-button button-type="Secondary" text="Dropdown With Only Text" /> |
|||
<abp-dropdown-menu class="p-4" style="max-width: 200px;"> |
|||
<p> |
|||
Some example text that's free-flowing within the dropdown menu. |
|||
</p> |
|||
<p class="mb-0"> |
|||
And this is more example text. |
|||
</p> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="With Form" view-path="@DropdownsDemoViewComponent.ViewPath"> |
|||
<abp-dropdown> |
|||
<abp-dropdown-button button-type="Secondary" text="Dropdown With Form" /> |
|||
<abp-dropdown-menu> |
|||
<form class="px-4 py-3"> |
|||
<abp-input asp-for="EmailAddress"></abp-input> |
|||
<abp-input asp-for="Password"></abp-input> |
|||
<abp-input asp-for="RememberMe"></abp-input> |
|||
<abp-button button-type="Primary" text="Sign In" type="submit" /> |
|||
</form> |
|||
<abp-dropdown-divider></abp-dropdown-divider> |
|||
<abp-dropdown-item href="#">New around here? Sign up</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Forgot password?</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.DropdownsDemo |
|||
{ |
|||
[Widget] |
|||
public class DropdownsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/DropdownsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,223 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.GridsDemo |
|||
|
|||
<abp-component-demo-section title="Equal-width" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-container> |
|||
<abp-row> |
|||
<abp-column>1 of 2</abp-column> |
|||
<abp-column>2 of 2</abp-column> |
|||
</abp-row> |
|||
<abp-row> |
|||
<abp-column>1 of 3</abp-column> |
|||
<abp-column>2 of 3</abp-column> |
|||
<abp-column>3 of 3</abp-column> |
|||
</abp-row> |
|||
</abp-container> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Column Breaker" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-container> |
|||
<abp-row> |
|||
<abp-column>column</abp-column> |
|||
<abp-column>column</abp-column> |
|||
<abp-column-breaker /> |
|||
<abp-column>column</abp-column> |
|||
<abp-column>column</abp-column> |
|||
</abp-row> |
|||
</abp-container> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Setting one column width" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-container> |
|||
<abp-row> |
|||
<abp-column>1 of 3</abp-column> |
|||
<abp-column size="_6">2 of 3 (wider)</abp-column> |
|||
<abp-column>3 of 3</abp-column> |
|||
</abp-row> |
|||
<abp-row> |
|||
<abp-column>1 of 3</abp-column> |
|||
<abp-column size="_5">2 of 3 (wider)</abp-column> |
|||
<abp-column>3 of 3</abp-column> |
|||
</abp-row> |
|||
</abp-container> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Variable width content" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-container> |
|||
<abp-row h-align="Center"> |
|||
<abp-column size-lg="_2">1 of 3</abp-column> |
|||
<abp-column size-md="Auto">Variable width content</abp-column> |
|||
<abp-column size-lg="_2">3 of 3</abp-column> |
|||
</abp-row> |
|||
<abp-row> |
|||
<abp-column>1 of 3</abp-column> |
|||
<abp-column size-md="Auto">Variable width content</abp-column> |
|||
<abp-column size-lg="_2">3 of 3</abp-column> |
|||
</abp-row> |
|||
</abp-container> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Responsive classes" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-row> |
|||
<abp-column>col</abp-column> |
|||
<abp-column>col</abp-column> |
|||
<abp-column>col</abp-column> |
|||
<abp-column>col</abp-column> |
|||
</abp-row> |
|||
<abp-row> |
|||
<abp-column size="_8">col-8</abp-column> |
|||
<abp-column size="_4">col-4</abp-column> |
|||
</abp-row> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="All breakpoints" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-row> |
|||
<abp-column size-sm="_8">col-sm-8</abp-column> |
|||
<abp-column size-sm="_4">col-sm-4</abp-column> |
|||
</abp-row> |
|||
<abp-row> |
|||
<abp-column size-sm="_">col-sm</abp-column> |
|||
<abp-column size-sm="_">col-sm</abp-column> |
|||
<abp-column size-sm="_">col-sm</abp-column> |
|||
<abp-column size-sm="_">col-sm</abp-column> |
|||
</abp-row> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Mix and match" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<!-- Stack the columns on mobile by making one full-width and the other half-width --> |
|||
<abp-row> |
|||
<abp-column size="_12" size-md="_8">.col-12 .col-md-8</abp-column> |
|||
<abp-column size="_6" size-md="_4">.col-6 .col-md-4</abp-column> |
|||
</abp-row> |
|||
|
|||
<!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop --> |
|||
<abp-row> |
|||
<abp-column size="_6" size-md="_4">.col-6 .col-md-4</abp-column> |
|||
<abp-column size="_6" size-md="_4">.col-6 .col-md-4</abp-column> |
|||
<abp-column size="_6" size-md="_4">.col-6 .col-md-4</abp-column> |
|||
</abp-row> |
|||
|
|||
<!-- Columns are always 50% wide, on mobile and desktop --> |
|||
<abp-row> |
|||
<abp-column size="_6">.col-6</abp-column> |
|||
<abp-column size="_6">.col-6</abp-column> |
|||
</abp-row> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Vertical Alignment" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-container> |
|||
<abp-row v-align="Start"> |
|||
<abp-column>column</abp-column> |
|||
<abp-column>column</abp-column> |
|||
<abp-column>column</abp-column> |
|||
</abp-row> |
|||
<abp-row v-align="Center"> |
|||
<abp-column>column</abp-column> |
|||
<abp-column>column</abp-column> |
|||
<abp-column>column</abp-column> |
|||
</abp-row> |
|||
<abp-row v-align="End"> |
|||
<abp-column>column</abp-column> |
|||
<abp-column>column</abp-column> |
|||
<abp-column>column</abp-column> |
|||
</abp-row> |
|||
</abp-container> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Vertical Alignment 2" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-container> |
|||
<abp-row v-align="Start"> |
|||
<abp-column v-align="Start">column</abp-column> |
|||
<abp-column v-align="Center">column</abp-column> |
|||
<abp-column v-align="End">column</abp-column> |
|||
</abp-row> |
|||
</abp-container> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Horizontal alignment" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-container> |
|||
<abp-row h-align="Start"> |
|||
<abp-column size="_4">One of two columns</abp-column> |
|||
<abp-column size="_4">One of two columns</abp-column> |
|||
</abp-row> |
|||
<abp-row h-align="Center"> |
|||
<abp-column size="_4">One of two columns</abp-column> |
|||
<abp-column size="_4">One of two columns</abp-column> |
|||
</abp-row> |
|||
<abp-row h-align="End"> |
|||
<abp-column size="_4">One of two columns</abp-column> |
|||
<abp-column size="_4">One of two columns</abp-column> |
|||
</abp-row> |
|||
<abp-row h-align="Around"> |
|||
<abp-column size="_4">One of two columns</abp-column> |
|||
<abp-column size="_4">One of two columns</abp-column> |
|||
</abp-row> |
|||
<abp-row h-align="Between"> |
|||
<abp-column size="_4">One of two columns</abp-column> |
|||
<abp-column size="_4">One of two columns</abp-column> |
|||
</abp-row> |
|||
</abp-container> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="No gutters" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-row gutters="false"> |
|||
<abp-column size="_8">One of two columns</abp-column> |
|||
<abp-column size="_4">One of two columns</abp-column> |
|||
</abp-row> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Column wrapping" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-row> |
|||
<abp-column size="_9">.col-9</abp-column> |
|||
<abp-column size="_4">.col-4<br>Since 9 + 4 = 13 > 12, this 4-column-wide div gets wrapped onto a new line as one contiguous unit.</abp-column> |
|||
<abp-column size="_6">.col-6<br>Subsequent columns continue along the new line.s</abp-column> |
|||
</abp-row> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Reordering" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-container> |
|||
<abp-row> |
|||
<abp-column order="_12">First, but Last</abp-column> |
|||
<abp-column>Second, but unordered</abp-column> |
|||
<abp-column order="_6">Third, but Second</abp-column> |
|||
</abp-row> |
|||
</abp-container> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Reordering 2" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-container> |
|||
<abp-row> |
|||
<abp-column order="Last">First, but Last</abp-column> |
|||
<abp-column>Second, but unordered</abp-column> |
|||
<abp-column order="First">Third, but First</abp-column> |
|||
</abp-row> |
|||
</abp-container> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Offsetting columns" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-container> |
|||
<abp-row> |
|||
<abp-column size-md="_4">.col-md-4</abp-column> |
|||
<abp-column size-md="_4" offset-md="_4">.col-md-4 .offset-md-4</abp-column> |
|||
</abp-row> |
|||
<abp-row> |
|||
<abp-column size-md="_3" offset-md="_3">.col-md-3 .offset-md-3</abp-column> |
|||
<abp-column size-md="_3" offset-md="_3">.col-md-3 .offset-md-3</abp-column> |
|||
</abp-row> |
|||
<abp-row> |
|||
<abp-column size-md="_6" offset-md="_3">.col-md-6 .offset-md-3</abp-column> |
|||
</abp-row> |
|||
</abp-container> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Offsetting columns 2" view-path="@GridsDemoViewComponent.ViewPath"> |
|||
<abp-container> |
|||
<abp-row> |
|||
<abp-column size-sm="_5" size-md="_6">.col-sm-5 .col-md-6</abp-column> |
|||
<abp-column size-sm="_5" offset-sm="_2" size-md="_6" offset-md="_">.col-sm-5 .offset-sm-2 .col-md-6 .offset-md-0</abp-column> |
|||
</abp-row> |
|||
<abp-row> |
|||
<abp-column size-sm="_6" size-md="_5" size-lg="_6">col-sm-6 .col-md-5 .col-lg-6</abp-column> |
|||
<abp-column size-sm="_6" size-md="_5" offset-md="_2" size-lg="_6" offset-lg="_">.col-sm-6 .col-md-5 .offset-md-2 .col-lg-6 .offset-lg-0</abp-column> |
|||
</abp-row> |
|||
</abp-container> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.GridsDemo |
|||
{ |
|||
[Widget] |
|||
public class GridsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/GridsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,82 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ListGroupsDemo |
|||
|
|||
<abp-component-demo-section title="Basic example" view-path="@ListGroupsDemoViewComponent.ViewPath"> |
|||
<abp-list-group> |
|||
<abp-list-group-item>Cras justo odio</abp-list-group-item> |
|||
<abp-list-group-item>Dapibus ac facilisis in</abp-list-group-item> |
|||
<abp-list-group-item>Morbi leo risus</abp-list-group-item> |
|||
<abp-list-group-item>Vestibulum at eros</abp-list-group-item> |
|||
</abp-list-group> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Active & disabled items" view-path="@ListGroupsDemoViewComponent.ViewPath"> |
|||
<abp-list-group> |
|||
<abp-list-group-item>Cras justo odio</abp-list-group-item> |
|||
<abp-list-group-item active="true">Dapibus ac facilisis in</abp-list-group-item> |
|||
<abp-list-group-item>Morbi leo risus</abp-list-group-item> |
|||
<abp-list-group-item disabled="true">Vestibulum at eros</abp-list-group-item> |
|||
</abp-list-group> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Links and buttons" view-path="@ListGroupsDemoViewComponent.ViewPath"> |
|||
<abp-list-group> |
|||
<abp-list-group-item href="#" active="true">Cras justo odio</abp-list-group-item> |
|||
<abp-list-group-item href="#">Dapibus ac facilisis in</abp-list-group-item> |
|||
<abp-list-group-item href="#">Morbi leo risus</abp-list-group-item> |
|||
<abp-list-group-item href="#" disabled="true">Vestibulum at eros</abp-list-group-item> |
|||
</abp-list-group> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Links and buttons 2" view-path="@ListGroupsDemoViewComponent.ViewPath"> |
|||
<abp-list-group> |
|||
<abp-list-group-item href="#" active="true">Cras justo odio</abp-list-group-item> |
|||
<abp-list-group-item href="#">Dapibus ac facilisis in</abp-list-group-item> |
|||
<abp-list-group-item href="#">Morbi leo risus</abp-list-group-item> |
|||
<abp-list-group-item href="#" disabled="true">Vestibulum at eros</abp-list-group-item> |
|||
</abp-list-group> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Flush" view-path="@ListGroupsDemoViewComponent.ViewPath"> |
|||
<abp-list-group flush="true"> |
|||
<abp-list-group-item>Cras justo odio</abp-list-group-item> |
|||
<abp-list-group-item>Dapibus ac facilisis in</abp-list-group-item> |
|||
<abp-list-group-item>Morbi leo risus</abp-list-group-item> |
|||
<abp-list-group-item>Vestibulum at eros</abp-list-group-item> |
|||
</abp-list-group> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Contextual classes" view-path="@ListGroupsDemoViewComponent.ViewPath"> |
|||
<abp-list-group> |
|||
<abp-list-group-item>Cras justo odio</abp-list-group-item> |
|||
<abp-list-group-item type="Primary">A simple Primary list group item</abp-list-group-item> |
|||
<abp-list-group-item type="Secondary">A simple Secondary list group item</abp-list-group-item> |
|||
<abp-list-group-item type="Success">A simple Success list group item</abp-list-group-item> |
|||
<abp-list-group-item type="Danger">A simple Danger list group item</abp-list-group-item> |
|||
<abp-list-group-item type="Warning">A simple Warning list group item</abp-list-group-item> |
|||
<abp-list-group-item type="Info">A simple Info list group item</abp-list-group-item> |
|||
<abp-list-group-item type="Light">A simple Light list group item</abp-list-group-item> |
|||
<abp-list-group-item type="Dark">A simple Dark list group item</abp-list-group-item> |
|||
</abp-list-group> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Contextual classes 2" view-path="@ListGroupsDemoViewComponent.ViewPath"> |
|||
<abp-list-group> |
|||
<abp-list-group-item href="#">Cras justo odio</abp-list-group-item> |
|||
<abp-list-group-item href="#" type="Primary">A simple Primary list group item</abp-list-group-item> |
|||
<abp-list-group-item href="#" type="Secondary">A simple Secondary list group item</abp-list-group-item> |
|||
<abp-list-group-item href="#" type="Success">A simple Success list group item</abp-list-group-item> |
|||
<abp-list-group-item href="#" type="Danger">A simple Danger list group item</abp-list-group-item> |
|||
<abp-list-group-item href="#" type="Warning">A simple Warning list group item</abp-list-group-item> |
|||
<abp-list-group-item href="#" type="Info">A simple Info list group item</abp-list-group-item> |
|||
<abp-list-group-item href="#" type="Light">A simple Light list group item</abp-list-group-item> |
|||
<abp-list-group-item href="#" type="Dark">A simple Dark list group item</abp-list-group-item> |
|||
</abp-list-group> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="With badges" view-path="@ListGroupsDemoViewComponent.ViewPath"> |
|||
<abp-list-group> |
|||
<abp-list-group-item>Cras justo odio <span abp-badge-pill="Primary">14</span></abp-list-group-item> |
|||
<abp-list-group-item>Dapibus ac facilisis in <span abp-badge-pill="Primary">2</span></abp-list-group-item> |
|||
<abp-list-group-item>Morbi leo risus <span abp-badge-pill="Primary">1</span></abp-list-group-item> |
|||
</abp-list-group> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ListGroupsDemo |
|||
{ |
|||
[Widget] |
|||
public class ListGroupsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/ListGroupsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ModalsDemo |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal |
|||
|
|||
<abp-component-demo-section title="Example" view-path="@ModalsDemoViewComponent.ViewPath"> |
|||
|
|||
<abp-button button-type="Primary" data-toggle="modal" data-target="#myModal">Launch modal</abp-button> |
|||
|
|||
<abp-modal centered="true" size="Large" id="myModal"> |
|||
<abp-modal-header title="Modal title"></abp-modal-header> |
|||
<abp-modal-body> |
|||
Woohoo, you're reading this text in a modal! |
|||
</abp-modal-body> |
|||
<abp-modal-footer buttons="@(AbpModalButtons.Save|AbpModalButtons.Close)"></abp-modal-footer> |
|||
</abp-modal> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ModalsDemo |
|||
{ |
|||
[Widget] |
|||
public class ModalsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/ModalsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.NavsDemo |
|||
|
|||
<abp-component-demo-section title="Base nav" view-path="@NavsDemoViewComponent.ViewPath"> |
|||
<abp-nav nav-style="Pill" align="Center"> |
|||
<abp-nav-item> |
|||
<a abp-nav-link active="true" href="#">Active</a> |
|||
</abp-nav-item> |
|||
<abp-nav-item> |
|||
<a abp-nav-link href="#">Longer nav link</a> |
|||
</abp-nav-item> |
|||
<abp-nav-item> |
|||
<a abp-nav-link href="#">link</a> |
|||
</abp-nav-item> |
|||
<abp-nav-item> |
|||
<a abp-nav-link disabled="true" href="#">disabled</a> |
|||
</abp-nav-item> |
|||
</abp-nav> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Base nav 2" view-path="@NavsDemoViewComponent.ViewPath"> |
|||
<abp-nav-bar size="Lg" navbar-style="Dark_Warning"> |
|||
<a abp-navbar-brand href="#">Navbar</a> |
|||
<abp-navbar-toggle> |
|||
<abp-navbar-nav> |
|||
<abp-nav-item active="true"> |
|||
<a abp-nav-link href="#">Home <span class="sr-only">(current)</span></a> |
|||
</abp-nav-item> |
|||
<abp-nav-item> |
|||
<a abp-nav-link href="#">Link</a> |
|||
</abp-nav-item> |
|||
<abp-nav-item dropdown="true"> |
|||
<abp-dropdown> |
|||
<abp-dropdown-button nav-link="true" text="Dropdown" /> |
|||
<abp-dropdown-menu> |
|||
<abp-dropdown-header>Dropdown header</abp-dropdown-header> |
|||
<abp-dropdown-item href="#" active="true">Action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#" disabled="true">Another disabled action</abp-dropdown-item> |
|||
<abp-dropdown-item href="#">Something else here</abp-dropdown-item> |
|||
<abp-dropdown-divider /> |
|||
<abp-dropdown-item href="#">Separated link</abp-dropdown-item> |
|||
</abp-dropdown-menu> |
|||
</abp-dropdown> |
|||
</abp-nav-item> |
|||
<abp-nav-item> |
|||
<a abp-nav-link disabled="true" href="#">Disabled</a> |
|||
</abp-nav-item> |
|||
</abp-navbar-nav> |
|||
<span abp-navbar-text> |
|||
Sample Text |
|||
</span> |
|||
</abp-navbar-toggle> |
|||
</abp-nav-bar> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.NavsDemo |
|||
{ |
|||
[Widget] |
|||
public class NavsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/NavsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.PopoversDemo |
|||
|
|||
<abp-component-demo-section title="Example" view-path="@PopoversDemoViewComponent.ViewPath"> |
|||
<abp-button abp-popover="Hi, i'm popover content!"> |
|||
Popover Default |
|||
</abp-button> |
|||
<abp-button abp-popover-top="Hi, i'm popover content!" title="Popover Title"> |
|||
Popover With Title |
|||
</abp-button> |
|||
<abp-button abp-popover-right="Hi, i'm popover content!" title="Popover Title" dismissible="true"> |
|||
Dismissible Popover |
|||
</abp-button> |
|||
<abp-button abp-popover-left="Hi, i'm popover content!" title="Popover Title" disabled="true"> |
|||
Disabled Popover |
|||
</abp-button> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.PopoversDemo |
|||
{ |
|||
[Widget] |
|||
public class PopoversDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/PopoversDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ProgressBarsDemo |
|||
|
|||
<abp-component-demo-section title="Example" view-path="@ProgressBarsDemoViewComponent.ViewPath"> |
|||
<abp-progress-bar value="70" /> |
|||
|
|||
<abp-progress-bar type="Warning" value="25"> %25 </abp-progress-bar> |
|||
|
|||
<abp-progress-bar type="Success" value="40" strip="true" /> |
|||
|
|||
<abp-progress-bar type="Dark" value="10" min-value="5" max-value="15" strip="true"> %50 </abp-progress-bar> |
|||
|
|||
<abp-progress-group> |
|||
<abp-progress-part type="Success" value="25" /> |
|||
<abp-progress-part type="Danger" value="10" strip="true"> %10 </abp-progress-part> |
|||
<abp-progress-part type="Primary" value="50" animation="true" strip="true" /> |
|||
</abp-progress-group> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ProgressBarsDemo |
|||
{ |
|||
[Widget] |
|||
public class ProgressBarsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/ProgressBarsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,134 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TablesDemo |
|||
|
|||
<abp-component-demo-section title="Example 1" view-path="@TablesDemoViewComponent.ViewPath"> |
|||
<abp-table hoverable-rows="true" responsive-sm="true"> |
|||
<thead> |
|||
<tr> |
|||
<th scope="Column">#</th> |
|||
<th scope="Column">First</th> |
|||
<th scope="Column">Last</th> |
|||
<th scope="Column">Handle</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr> |
|||
<th scope="Row">1</th> |
|||
<td>Mark</td> |
|||
<td>Otto</td> |
|||
<td table-style="Danger">mdo</td> |
|||
</tr> |
|||
<tr table-style="Warning"> |
|||
<th scope="Row">2</th> |
|||
<td>Jacob</td> |
|||
<td>Thornton</td> |
|||
<td>fat</td> |
|||
</tr> |
|||
<tr> |
|||
<th scope="Row">3</th> |
|||
<td table-style="Success">Larry</td> |
|||
<td>the Bird</td> |
|||
<td>twitter</td> |
|||
</tr> |
|||
</tbody> |
|||
</abp-table> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Example 2" view-path="@TablesDemoViewComponent.ViewPath"> |
|||
<abp-table small="true" striped-rows="true" border-style="Bordered"> |
|||
<thead Theme="Dark"> |
|||
<tr> |
|||
<th scope="Column">#</th> |
|||
<th scope="Column">First</th> |
|||
<th scope="Column">Last</th> |
|||
<th scope="Column">Handle</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr> |
|||
<th scope="Row">1</th> |
|||
<td>Mark</td> |
|||
<td>Otto</td> |
|||
<td>mdo</td> |
|||
</tr> |
|||
<tr> |
|||
<th scope="Row">2</th> |
|||
<td>Jacob</td> |
|||
<td>Thornton</td> |
|||
<td>fat</td> |
|||
</tr> |
|||
<tr> |
|||
<th scope="Row">3</th> |
|||
<td>Larry</td> |
|||
<td>the Bird</td> |
|||
<td>twitter</td> |
|||
</tr> |
|||
</tbody> |
|||
</abp-table> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Example 3" view-path="@TablesDemoViewComponent.ViewPath"> |
|||
<abp-table striped-rows="true" dark-theme="true"> |
|||
<caption>List of users</caption> |
|||
<thead> |
|||
<tr> |
|||
<th scope="Column">#</th> |
|||
<th scope="Column">First</th> |
|||
<th scope="Column">Last</th> |
|||
<th scope="Column">Handle</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr> |
|||
<th scope="Row">1</th> |
|||
<td>Mark</td> |
|||
<td>Otto</td> |
|||
<td>mdo</td> |
|||
</tr> |
|||
<tr> |
|||
<th scope="Row">2</th> |
|||
<td>Jacob</td> |
|||
<td>Thornton</td> |
|||
<td>fat</td> |
|||
</tr> |
|||
<tr> |
|||
<th scope="Row">3</th> |
|||
<td>Larry</td> |
|||
<td>the Bird</td> |
|||
<td>twitter</td> |
|||
</tr> |
|||
</tbody> |
|||
</abp-table> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Example 4" view-path="@TablesDemoViewComponent.ViewPath"> |
|||
<abp-table border-style="Borderless"> |
|||
<thead> |
|||
<tr> |
|||
<th scope="Column">#</th> |
|||
<th scope="Column">First</th> |
|||
<th scope="Column">Last</th> |
|||
<th scope="Column">Handle</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr> |
|||
<th scope="Row">1</th> |
|||
<td>Mark</td> |
|||
<td>Otto</td> |
|||
<td>mdo</td> |
|||
</tr> |
|||
<tr> |
|||
<th scope="Row">2</th> |
|||
<td>Jacob</td> |
|||
<td>Thornton</td> |
|||
<td>fat</td> |
|||
</tr> |
|||
<tr> |
|||
<th scope="Row">3</th> |
|||
<td>Larry</td> |
|||
<td>the Bird</td> |
|||
<td>twitter</td> |
|||
</tr> |
|||
</tbody> |
|||
</abp-table> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TablesDemo |
|||
{ |
|||
[Widget] |
|||
public class TablesDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/TablesDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,63 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TabsDemo |
|||
|
|||
<abp-component-demo-section title="Example" view-path="@TabsDemoViewComponent.ViewPath"> |
|||
<abp-tabs> |
|||
<abp-tab title="Home"> |
|||
Content_Home |
|||
</abp-tab> |
|||
<abp-tab-link title="Link" href="#" /> |
|||
<abp-tab title="profile"> |
|||
Content_Profile |
|||
</abp-tab> |
|||
<abp-tab-dropdown title="Contact" name="ContactDropdown"> |
|||
<abp-tab title="Contact 1" parent-dropdown-name="ContactDropdown"> |
|||
Content_1_Content |
|||
</abp-tab> |
|||
<abp-tab title="Contact 2" parent-dropdown-name="ContactDropdown"> |
|||
Content_2_Content |
|||
</abp-tab> |
|||
</abp-tab-dropdown> |
|||
</abp-tabs> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Tab attributes" view-path="@TabsDemoViewComponent.ViewPath"> |
|||
<abp-tabs> |
|||
<abp-tab name="nav-home" title="Home"> |
|||
Content_Home |
|||
</abp-tab> |
|||
<abp-tab name="nav-profile" active="true" title="profile"> |
|||
Content_Profile |
|||
</abp-tab> |
|||
<abp-tab name="nav-contact" title="Contact"> |
|||
Content_Contact |
|||
</abp-tab> |
|||
</abp-tabs> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Pill Example" view-path="@TabsDemoViewComponent.ViewPath"> |
|||
<abp-tabs tab-style="Pill"> |
|||
<abp-tab title="Home"> |
|||
Content_Home |
|||
</abp-tab> |
|||
<abp-tab title="profile"> |
|||
Content_Profile |
|||
</abp-tab> |
|||
<abp-tab title="Contact"> |
|||
Content_Contact |
|||
</abp-tab> |
|||
</abp-tabs> |
|||
</abp-component-demo-section> |
|||
|
|||
<abp-component-demo-section title="Vertical Example" view-path="@TabsDemoViewComponent.ViewPath"> |
|||
<abp-tabs tab-style="PillVertical" vertical-header-size="_2"> |
|||
<abp-tab active="true" title="Home"> |
|||
Content_Home |
|||
</abp-tab> |
|||
<abp-tab title="profile"> |
|||
Content_Profile |
|||
</abp-tab> |
|||
<abp-tab title="Contact"> |
|||
Content_Contact |
|||
</abp-tab> |
|||
</abp-tabs> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TabsDemo |
|||
{ |
|||
[Widget] |
|||
public class TabsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/TabsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TooltipsDemo |
|||
|
|||
<abp-component-demo-section title="Example" view-path="@TooltipsDemoViewComponent.ViewPath"> |
|||
<abp-button abp-tooltip="Tooltip"> |
|||
Tooltip Default |
|||
</abp-button> |
|||
|
|||
<abp-button abp-tooltip-top="Tooltip"> |
|||
Tooltip on top |
|||
</abp-button> |
|||
|
|||
<abp-button abp-tooltip-right="Tooltip"> |
|||
Tooltip on right |
|||
</abp-button> |
|||
|
|||
<abp-button abp-tooltip-bottom="Tooltip"> |
|||
Tooltip on bottom |
|||
</abp-button> |
|||
|
|||
<abp-button disabled="true" abp-tooltip="Tooltip"> |
|||
Disabled button Tooltip |
|||
</abp-button> |
|||
</abp-component-demo-section> |
|||
@ -0,0 +1,16 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TooltipsDemo |
|||
{ |
|||
[Widget] |
|||
public class TooltipsDemoViewComponent : AbpViewComponent |
|||
{ |
|||
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/TooltipsDemo/Default.cshtml"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View(ViewPath); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Abp.BackgroundJobs.Quartz</AssemblyName> |
|||
<PackageId>Volo.Abp.BackgroundJobs.Quartz</PackageId> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.BackgroundJobs.Abstractions\Volo.Abp.BackgroundJobs.Abstractions.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.Quartz\Volo.Abp.Quartz.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,18 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.Quartz; |
|||
|
|||
namespace Volo.Abp.BackgroundJobs.Quartz |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpBackgroundJobsAbstractionsModule), |
|||
typeof(AbpQuartzModule) |
|||
)] |
|||
public class AbpBackgroundJobsQuartzModule :AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddTransient(typeof(QuartzJobExecutionAdapter<>)); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Quartz; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.BackgroundJobs.Quartz |
|||
{ |
|||
[Dependency(ReplaceServices = true)] |
|||
public class QuartzBackgroundJobManager : IBackgroundJobManager, ITransientDependency |
|||
{ |
|||
private readonly IScheduler _scheduler; |
|||
|
|||
public QuartzBackgroundJobManager(IScheduler scheduler) |
|||
{ |
|||
_scheduler = scheduler; |
|||
} |
|||
|
|||
public async Task<string> EnqueueAsync<TArgs>(TArgs args, BackgroundJobPriority priority = BackgroundJobPriority.Normal, |
|||
TimeSpan? delay = null) |
|||
{ |
|||
var jobDetail = JobBuilder.Create<QuartzJobExecutionAdapter<TArgs>>().SetJobData(new JobDataMap { { nameof(TArgs), args } }).Build(); |
|||
var trigger = !delay.HasValue ? TriggerBuilder.Create().StartNow().Build() : TriggerBuilder.Create().StartAt(new DateTimeOffset(DateTime.Now.Add(delay.Value))).Build(); |
|||
await _scheduler.ScheduleJob(jobDetail, trigger); |
|||
return jobDetail.Key.ToString(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Options; |
|||
using Quartz; |
|||
|
|||
namespace Volo.Abp.BackgroundJobs.Quartz |
|||
{ |
|||
public class QuartzJobExecutionAdapter<TArgs> : IJob |
|||
{ |
|||
protected AbpBackgroundJobOptions Options { get; } |
|||
protected IServiceScopeFactory ServiceScopeFactory { get; } |
|||
protected IBackgroundJobExecuter JobExecuter { get; } |
|||
|
|||
public QuartzJobExecutionAdapter( |
|||
IOptions<AbpBackgroundJobOptions> options, |
|||
IBackgroundJobExecuter jobExecuter, |
|||
IServiceScopeFactory serviceScopeFactory) |
|||
{ |
|||
JobExecuter = jobExecuter; |
|||
ServiceScopeFactory = serviceScopeFactory; |
|||
Options = options.Value; |
|||
} |
|||
|
|||
public async Task Execute(IJobExecutionContext context) |
|||
{ |
|||
using (var scope = ServiceScopeFactory.CreateScope()) |
|||
{ |
|||
var args = (TArgs)context.JobDetail.JobDataMap.Get(nameof(TArgs)); |
|||
var jobType = Options.GetJob(typeof(TArgs)).JobType; |
|||
var jobContext = new JobExecutionContext(scope.ServiceProvider, jobType, args); |
|||
await JobExecuter.ExecuteAsync(jobContext); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Abp.BackgroundWorkers.Quartz</AssemblyName> |
|||
<PackageId>Volo.Abp.BackgroundWorkers.Quartz</PackageId> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.BackgroundWorkers\Volo.Abp.BackgroundWorkers.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.Quartz\Volo.Abp.Quartz.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,30 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.DependencyInjection.Extensions; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.Quartz; |
|||
|
|||
namespace Volo.Abp.BackgroundWorkers.Quartz |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpBackgroundWorkersModule), |
|||
typeof(AbpQuartzModule) |
|||
)] |
|||
public class AbpBackgroundWorkersQuartzModule : AbpModule |
|||
{ |
|||
public override void PreConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddConventionalRegistrar(new AbpQuartzConventionalRegistrar()); |
|||
} |
|||
|
|||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|||
{ |
|||
var backgroundWorkerManager = context.ServiceProvider.GetService<IBackgroundWorkerManager>(); |
|||
var works = context.ServiceProvider.GetServices<IQuartzBackgroundWorker>(); |
|||
|
|||
foreach (var work in works) |
|||
{ |
|||
backgroundWorkerManager.Add(work); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
using System; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.BackgroundWorkers.Quartz |
|||
{ |
|||
public class AbpQuartzConventionalRegistrar : DefaultConventionalRegistrar |
|||
{ |
|||
public override void AddType(IServiceCollection services, Type type) |
|||
{ |
|||
if (!typeof(IQuartzBackgroundWorker).IsAssignableFrom(type)) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
var dependencyAttribute = GetDependencyAttributeOrNull(type); |
|||
var lifeTime = GetLifeTimeOrNull(type, dependencyAttribute); |
|||
|
|||
if (lifeTime == null) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
services.Add(ServiceDescriptor.Describe(typeof(IQuartzBackgroundWorker), type, lifeTime.Value)); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using Quartz; |
|||
|
|||
namespace Volo.Abp.BackgroundWorkers.Quartz |
|||
{ |
|||
public interface IQuartzBackgroundWorker : IBackgroundWorker, IJob |
|||
{ |
|||
ITrigger Trigger { get; set; } |
|||
|
|||
IJobDetail JobDetail { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System.Threading.Tasks; |
|||
using Quartz; |
|||
|
|||
namespace Volo.Abp.BackgroundWorkers.Quartz |
|||
{ |
|||
public abstract class QuartzBackgroundWorkerBase : BackgroundWorkerBase, IQuartzBackgroundWorker |
|||
{ |
|||
public ITrigger Trigger { get; set; } |
|||
|
|||
public IJobDetail JobDetail { get; set; } |
|||
|
|||
public abstract Task Execute(IJobExecutionContext context); |
|||
} |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Quartz; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Threading; |
|||
|
|||
namespace Volo.Abp.BackgroundWorkers.Quartz |
|||
{ |
|||
[Dependency(ReplaceServices = true)] |
|||
public class QuartzBackgroundWorkerManager : IBackgroundWorkerManager, ISingletonDependency |
|||
{ |
|||
private readonly IScheduler _scheduler; |
|||
|
|||
public QuartzBackgroundWorkerManager(IScheduler scheduler) |
|||
{ |
|||
_scheduler = scheduler; |
|||
} |
|||
|
|||
public async Task StartAsync(CancellationToken cancellationToken = default) |
|||
{ |
|||
await _scheduler.ResumeAll(cancellationToken); |
|||
} |
|||
|
|||
public async Task StopAsync(CancellationToken cancellationToken = default) |
|||
{ |
|||
if (!_scheduler.IsShutdown) |
|||
{ |
|||
await _scheduler.PauseAll(cancellationToken); |
|||
} |
|||
} |
|||
|
|||
public void Add(IBackgroundWorker worker) |
|||
{ |
|||
if (worker is IQuartzBackgroundWorker quartzWork) |
|||
{ |
|||
Check.NotNull(quartzWork.Trigger, nameof(quartzWork.Trigger)); |
|||
Check.NotNull(quartzWork.JobDetail, nameof(quartzWork.JobDetail)); |
|||
|
|||
AsyncHelper.RunSync(() => _scheduler.ScheduleJob(quartzWork.JobDetail, quartzWork.Trigger)); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using ICSharpCode.SharpZipLib.Core; |
|||
using ICSharpCode.SharpZipLib.Zip; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Logging.Abstractions; |
|||
using Volo.Abp.Cli.Args; |
|||
using Volo.Abp.Cli.ProjectBuilding; |
|||
using Volo.Abp.Cli.ProjectBuilding.Building; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Cli.Commands.Services |
|||
{ |
|||
public class SourceCodeDownloadService : ITransientDependency |
|||
{ |
|||
public ModuleProjectBuilder ModuleProjectBuilder { get; } |
|||
public ILogger<SourceCodeDownloadService> Logger { get; set; } |
|||
|
|||
public SourceCodeDownloadService(ModuleProjectBuilder moduleProjectBuilder) |
|||
{ |
|||
ModuleProjectBuilder = moduleProjectBuilder; |
|||
Logger = NullLogger<SourceCodeDownloadService>.Instance; |
|||
} |
|||
|
|||
public async Task DownloadAsync(string moduleName, string outputFolder, string version, string gitHubLocalRepositoryPath, AbpCommandLineOptions options) |
|||
{ |
|||
Logger.LogInformation("Downloading source code of " + moduleName); |
|||
Logger.LogInformation("Version: " + version); |
|||
Logger.LogInformation("Output folder: " + outputFolder); |
|||
|
|||
var result = await ModuleProjectBuilder.BuildAsync( |
|||
new ProjectBuildArgs( |
|||
SolutionName.Parse(moduleName), |
|||
moduleName, |
|||
version, |
|||
DatabaseProvider.NotSpecified, |
|||
UiFramework.NotSpecified, |
|||
null, |
|||
gitHubLocalRepositoryPath, |
|||
null, |
|||
options |
|||
) |
|||
); |
|||
|
|||
using (var templateFileStream = new MemoryStream(result.ZipContent)) |
|||
{ |
|||
using (var zipInputStream = new ZipInputStream(templateFileStream)) |
|||
{ |
|||
var zipEntry = zipInputStream.GetNextEntry(); |
|||
while (zipEntry != null) |
|||
{ |
|||
var fullZipToPath = Path.Combine(outputFolder, zipEntry.Name); |
|||
var directoryName = Path.GetDirectoryName(fullZipToPath); |
|||
|
|||
if (!string.IsNullOrEmpty(directoryName)) |
|||
{ |
|||
Directory.CreateDirectory(directoryName); |
|||
} |
|||
|
|||
var fileName = Path.GetFileName(fullZipToPath); |
|||
if (fileName.Length == 0) |
|||
{ |
|||
zipEntry = zipInputStream.GetNextEntry(); |
|||
continue; |
|||
} |
|||
|
|||
var buffer = new byte[4096]; // 4K is optimum
|
|||
using (var streamWriter = File.Create(fullZipToPath)) |
|||
{ |
|||
StreamUtils.Copy(zipInputStream, streamWriter, buffer); |
|||
} |
|||
|
|||
zipEntry = zipInputStream.GetNextEntry(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
Logger.LogInformation($"'{moduleName}' has been successfully downloaded to '{outputFolder}'"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Text.RegularExpressions; |
|||
using System.Xml; |
|||
using Volo.Abp.Cli.ProjectBuilding.Files; |
|||
using Volo.Abp.Cli.Utils; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps |
|||
{ |
|||
public class ReplaceConfigureAwaitPropsStep : ProjectBuildPipelineStep |
|||
{ |
|||
public override void Execute(ProjectBuildContext context) |
|||
{ |
|||
new ConfigureAwaitPropsReplacer(context.Files).Run(); |
|||
} |
|||
|
|||
private class ConfigureAwaitPropsReplacer |
|||
{ |
|||
private readonly List<FileEntry> _entries; |
|||
|
|||
public ConfigureAwaitPropsReplacer( |
|||
List<FileEntry> entries) |
|||
{ |
|||
_entries = entries; |
|||
} |
|||
|
|||
public void Run() |
|||
{ |
|||
foreach (var fileEntry in _entries) |
|||
{ |
|||
if (fileEntry.Name.EndsWith(".csproj")) |
|||
{ |
|||
fileEntry.SetContent(ProcessFileContent(fileEntry.Content)); |
|||
} |
|||
} |
|||
} |
|||
|
|||
private string ProcessFileContent(string content) |
|||
{ |
|||
Check.NotNull(content, nameof(content)); |
|||
|
|||
var doc = new XmlDocument() { PreserveWhitespace = true }; |
|||
|
|||
doc.Load(StreamHelper.GenerateStreamFromString(content)); |
|||
|
|||
return ProcessReferenceNodes(doc, content); |
|||
} |
|||
|
|||
private string ProcessReferenceNodes(XmlDocument doc, string content) |
|||
{ |
|||
Check.NotNull(content, nameof(content)); |
|||
|
|||
var importNodes = doc.SelectNodes("/Project/Import[@Project]"); |
|||
|
|||
if (importNodes == null) |
|||
{ |
|||
return doc.OuterXml; |
|||
} |
|||
|
|||
foreach (XmlNode node in importNodes) |
|||
{ |
|||
if (!(node.Attributes?["Project"]?.Value?.EndsWith("\\configureawait.props") ?? false)) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
node.ParentNode?.RemoveChild(node); |
|||
} |
|||
|
|||
return doc.OuterXml; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectModification |
|||
{ |
|||
public class ModuleWithMastersInfo : ModuleInfo |
|||
{ |
|||
public List<ModuleWithMastersInfo> MasterModuleInfos { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,140 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using System.Xml; |
|||
using Volo.Abp.Cli.Utils; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectModification |
|||
{ |
|||
public class NugetPackageToLocalReferenceConverter : ITransientDependency |
|||
{ |
|||
public async Task Convert(ModuleWithMastersInfo module, string solutionFile) |
|||
{ |
|||
var nugetPackageList = GetNugetPackages(module); |
|||
var modulesFolder = Path.Combine(Path.GetDirectoryName(solutionFile), "modules"); |
|||
var srcFolder = Path.Combine(Path.GetDirectoryName(solutionFile), "src"); |
|||
var testFolder = Path.Combine(Path.GetDirectoryName(solutionFile), "test"); |
|||
|
|||
ConvertToLocalReference(modulesFolder, nugetPackageList, "..\\..\\..\\"); |
|||
ConvertToLocalReference(srcFolder, nugetPackageList, "..\\..\\modules\\"); |
|||
ConvertToLocalReference(testFolder, nugetPackageList, "..\\..\\modules\\", "test"); |
|||
} |
|||
|
|||
private void ConvertToLocalReference(string folder, List<NugetPackageInfoWithModuleName> nugetPackageList, string localPathPrefix, string sourceFile = "src") |
|||
{ |
|||
var projectFiles = GetProjectFilesUnder(folder); |
|||
|
|||
foreach (var projectFile in projectFiles) |
|||
{ |
|||
var content = File.ReadAllText(projectFile); |
|||
var doc = new XmlDocument() { PreserveWhitespace = true }; |
|||
|
|||
doc.Load(StreamHelper.GenerateStreamFromString(content)); |
|||
|
|||
var convertedProject = ProcessReferenceNodes(folder, doc, nugetPackageList, localPathPrefix, sourceFile); |
|||
|
|||
File.WriteAllText(projectFile, convertedProject); |
|||
} |
|||
} |
|||
|
|||
private string ProcessReferenceNodes(string folder, XmlDocument doc, List<NugetPackageInfoWithModuleName> nugetPackageList, string localPathPrefix, string sourceFile = "src") |
|||
{ |
|||
var nodes = doc.SelectNodes("/Project/ItemGroup/PackageReference[starts-with(@Include, 'Volo.Abp')]"); |
|||
|
|||
if (nodes == null) |
|||
{ |
|||
return doc.OuterXml; |
|||
} |
|||
|
|||
foreach (XmlNode oldNode in nodes) |
|||
{ |
|||
var oldNodeIncludeValue = oldNode?.Attributes?["Include"]?.Value; |
|||
|
|||
var moduleName = nugetPackageList.FirstOrDefault(n => n.NugetPackage.Name == oldNodeIncludeValue)?.ModuleName; |
|||
|
|||
if (moduleName == null) |
|||
{ |
|||
var localProject = GetProjectFilesUnder(folder).FirstOrDefault(f=> f.EndsWith($"{oldNodeIncludeValue}.csproj")); |
|||
|
|||
if (localProject != null) |
|||
{ |
|||
moduleName = Directory.GetParent(Directory.GetParent(Path.GetDirectoryName(localProject)).FullName).Name; |
|||
|
|||
if (oldNodeIncludeValue.EndsWith(".test", StringComparison.InvariantCultureIgnoreCase) || |
|||
oldNodeIncludeValue.EndsWith(".tests", StringComparison.InvariantCultureIgnoreCase)) |
|||
{ |
|||
sourceFile = "test"; |
|||
} |
|||
else |
|||
{ |
|||
sourceFile = "src"; |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
continue; |
|||
} |
|||
} |
|||
|
|||
var referenceProjectPath = |
|||
$"{localPathPrefix}{moduleName}\\{sourceFile}\\{oldNodeIncludeValue}\\{oldNodeIncludeValue}.csproj"; |
|||
|
|||
XmlNode newNode = GetNewReferenceNode(doc, referenceProjectPath); |
|||
|
|||
oldNode?.ParentNode?.ReplaceChild(newNode, oldNode); |
|||
} |
|||
|
|||
return doc.OuterXml; |
|||
} |
|||
|
|||
protected XmlElement GetNewReferenceNode(XmlDocument doc, string newValue) |
|||
{ |
|||
var newNode = doc.CreateElement("ProjectReference"); |
|||
|
|||
var includeAttr = doc.CreateAttribute("Include"); |
|||
includeAttr.Value = newValue; |
|||
newNode.Attributes.Append(includeAttr); |
|||
|
|||
return newNode; |
|||
} |
|||
|
|||
public List<NugetPackageInfoWithModuleName> GetNugetPackages(ModuleWithMastersInfo module) |
|||
{ |
|||
var list = new List<NugetPackageInfoWithModuleName>(); |
|||
|
|||
list.AddRange(module.NugetPackages.Select(n => new NugetPackageInfoWithModuleName |
|||
{ |
|||
ModuleName = module.Name, |
|||
NugetPackage = n |
|||
})); |
|||
|
|||
if (module.MasterModuleInfos != null) |
|||
{ |
|||
foreach (var masterModule in module.MasterModuleInfos) |
|||
{ |
|||
list.AddRange(GetNugetPackages(masterModule)); |
|||
} |
|||
} |
|||
|
|||
return list; |
|||
} |
|||
|
|||
private static string[] GetProjectFilesUnder(string path) |
|||
{ |
|||
return Directory.GetFiles(path, |
|||
"*.csproj", |
|||
SearchOption.AllDirectories); |
|||
} |
|||
|
|||
public class NugetPackageInfoWithModuleName |
|||
{ |
|||
public NugetPackageInfo NugetPackage { get; set; } |
|||
|
|||
public string ModuleName { get; set; } |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
using System.IO; |
|||
using System.Xml; |
|||
using Volo.Abp.Cli.Utils; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectModification |
|||
{ |
|||
public class SolutionAbpVersionFinder : ITransientDependency |
|||
{ |
|||
public string Find(string solutionFile) |
|||
{ |
|||
var projectFilesUnderSrc = Directory.GetFiles(Path.GetDirectoryName(solutionFile), |
|||
"*.csproj", |
|||
SearchOption.AllDirectories); |
|||
|
|||
foreach (var projectFile in projectFilesUnderSrc) |
|||
{ |
|||
var content = File.ReadAllText(projectFile); |
|||
var doc = new XmlDocument() { PreserveWhitespace = true }; |
|||
|
|||
doc.Load(StreamHelper.GenerateStreamFromString(content)); |
|||
|
|||
var nodes = doc.SelectNodes("/Project/ItemGroup/PackageReference[starts-with(@Include, 'Volo.Abp')]"); |
|||
|
|||
var value = nodes?[0]?.Attributes?["Version"]?.Value; |
|||
|
|||
if (value != null) |
|||
{ |
|||
return value; |
|||
} |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,117 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectModification |
|||
{ |
|||
public class SolutionFileModifier : ITransientDependency |
|||
{ |
|||
public async Task AddModuleToSolutionFileAsync(ModuleWithMastersInfo module, string solutionFile) |
|||
{ |
|||
await AddModule(module, solutionFile); |
|||
} |
|||
|
|||
private async Task AddModule(ModuleWithMastersInfo module, string solutionFile) |
|||
{ |
|||
var srcModuleFolderId = await AddNewFolderAndGetIdOrGetExistingId(solutionFile, module.Name, await AddNewFolderAndGetIdOrGetExistingId(solutionFile, "modules")); |
|||
var testModuleFolderId = await AddNewFolderAndGetIdOrGetExistingId(solutionFile, module.Name + ".Tests", await AddNewFolderAndGetIdOrGetExistingId(solutionFile, "test")); |
|||
|
|||
var file = File.ReadAllText(solutionFile); |
|||
var lines = file.Split(Environment.NewLine).ToList(); |
|||
|
|||
|
|||
var projectsUnderModule = Directory.GetFiles( |
|||
Path.Combine(Path.GetDirectoryName(solutionFile), "modules", module.Name), |
|||
"*.csproj", |
|||
SearchOption.AllDirectories); |
|||
|
|||
var projectsUnderTest = Directory.GetFiles( |
|||
Path.Combine(Path.GetDirectoryName(solutionFile), "modules", module.Name, "test"), |
|||
"*.csproj", |
|||
SearchOption.AllDirectories); |
|||
|
|||
foreach (var projectPath in projectsUnderModule) |
|||
{ |
|||
var parentFolderId = projectsUnderTest.Contains(projectPath) ? testModuleFolderId : srcModuleFolderId; |
|||
var projectId = Path.GetFileName(projectPath).Replace(".csproj",""); |
|||
var projectParentFolderInModule = projectsUnderTest.Contains(projectPath) ? "test" : "src"; |
|||
|
|||
if (lines.Any(l => l.Contains($"\"{projectId}\""))) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
var projectGuid = Guid.NewGuid().ToString(); |
|||
|
|||
var newProjectLine = "Project(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"" + projectId + "\"," + |
|||
" \"modules\\" + module.Name + "\\"+ projectParentFolderInModule + "\\" + projectId + "\\" + projectId + ".csproj\", \"{" + projectGuid + "}\"" |
|||
+ Environment.NewLine + "EndProject"; |
|||
|
|||
lines.InsertAfter(l => l.Trim().Equals("EndProject"), newProjectLine); |
|||
|
|||
var newPostSolutionLine = |
|||
" {" + projectGuid + "}.Debug|Any CPU.ActiveCfg = Debug|Any CPU" + Environment.NewLine + |
|||
" {" + projectGuid + "}.Debug|Any CPU.Build.0 = Debug|Any CPU" + Environment.NewLine + |
|||
" {" + projectGuid + "}.Release|Any CPU.ActiveCfg = Release|Any CPU" + Environment.NewLine + |
|||
" {" + projectGuid + "}.Release|Any CPU.Build.0 = Release|Any CPU"; |
|||
|
|||
lines.InsertAfter(l=>l.Contains("GlobalSection") && l.Contains("ProjectConfigurationPlatforms"), newPostSolutionLine); |
|||
|
|||
var newPreSolutionLine = |
|||
" {"+ projectGuid + "} = {"+ parentFolderId + "}"; |
|||
|
|||
lines.InsertAfter(l=>l.Contains("GlobalSection") && l.Contains("NestedProjects"), newPreSolutionLine); |
|||
} |
|||
|
|||
File.WriteAllText(solutionFile, string.Join(Environment.NewLine, lines)); |
|||
|
|||
if (module.MasterModuleInfos != null) |
|||
{ |
|||
foreach (var masterModule in module.MasterModuleInfos) |
|||
{ |
|||
await AddModule(masterModule, solutionFile); |
|||
} |
|||
} |
|||
} |
|||
|
|||
private async Task<string> AddNewFolderAndGetIdOrGetExistingId(string solutionFile, string folderName, string parentFolderId = null) |
|||
{ |
|||
var file = File.ReadAllText(solutionFile); |
|||
var lines = file.Split(Environment.NewLine).ToList(); |
|||
string folderId; |
|||
|
|||
var folderLineIndex = lines.FindIndex(l => |
|||
l.Contains("2150E333-8FDC-42A3-9474-1A3956D46DE8") && l.Contains("\""+ folderName + "\"")); |
|||
|
|||
if (folderLineIndex < 0) |
|||
{ |
|||
folderId = Guid.NewGuid().ToString(); |
|||
var newFolderLine = "Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \""+ folderName + "\", \""+ folderName + "\", \"{" + folderId + "}\"" |
|||
+ Environment.NewLine + "EndProject"; |
|||
|
|||
lines.InsertAfter(l => l.Trim().Equals("EndProject"), newFolderLine); |
|||
|
|||
if (parentFolderId != null) |
|||
{ |
|||
var newPreSolutionLine = |
|||
" {" + folderId + "} = {" + parentFolderId + "}"; |
|||
|
|||
lines.InsertAfter(l => l.Contains("GlobalSection") && l.Contains("NestedProjects"), newPreSolutionLine); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
folderId = lines[folderLineIndex].Replace("\"", " ").Replace("{", " ").Replace("}", " ").TrimEnd() |
|||
.Split(" ").Last(); |
|||
} |
|||
|
|||
File.WriteAllText(solutionFile, string.Join(Environment.NewLine, lines)); |
|||
|
|||
return folderId; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Text; |
|||
|
|||
namespace Volo.Abp.Cli.Utils |
|||
{ |
|||
public static class StreamHelper |
|||
{ |
|||
public static Stream GenerateStreamFromString(string s) |
|||
{ |
|||
var stream = new MemoryStream(); |
|||
var writer = new StreamWriter(stream); |
|||
writer.Write(s); |
|||
writer.Flush(); |
|||
stream.Position = 0; |
|||
return stream; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
{ |
|||
"iisSettings": { |
|||
"windowsAuthentication": false, |
|||
"anonymousAuthentication": true, |
|||
"iisExpress": { |
|||
"applicationUrl": "http://localhost:52306/", |
|||
"sslPort": 0 |
|||
} |
|||
}, |
|||
"profiles": { |
|||
"IIS Express": { |
|||
"commandName": "IISExpress", |
|||
"launchBrowser": true, |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
}, |
|||
"Volo.Abp.Http.Client.IdentityModel": { |
|||
"commandName": "Project", |
|||
"launchBrowser": true, |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
}, |
|||
"applicationUrl": "http://localhost:52307/" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp3.1</TargetFramework> |
|||
<AssemblyName>Volo.Abp.Http.Client.IdentityModel.Web</AssemblyName> |
|||
<PackageId>Volo.Abp.Http.Client.IdentityModel.Web</PackageId> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<IsPackable>true</IsPackable> |
|||
<OutputType>Library</OutputType> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.Http.Client.IdentityModel\Volo.Abp.Http.Client.IdentityModel.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,12 @@ |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.Http.Client.IdentityModel.Web |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpHttpClientIdentityModelModule) |
|||
)] |
|||
public class AbpHttpClientIdentityModelWebModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
using System.Threading.Tasks; |
|||
using IdentityModel.Client; |
|||
using Microsoft.AspNetCore.Authentication; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client.Authentication; |
|||
using Volo.Abp.IdentityModel; |
|||
|
|||
namespace Volo.Abp.Http.Client.IdentityModel.Web |
|||
{ |
|||
[Dependency(ReplaceServices = true)] |
|||
public class HttpContextIdentityModelRemoteServiceHttpClientAuthenticator : IdentityModelRemoteServiceHttpClientAuthenticator |
|||
{ |
|||
public IHttpContextAccessor HttpContextAccessor { get; set; } |
|||
|
|||
public HttpContextIdentityModelRemoteServiceHttpClientAuthenticator( |
|||
IIdentityModelAuthenticationService identityModelAuthenticationService) |
|||
: base(identityModelAuthenticationService) |
|||
{ |
|||
} |
|||
|
|||
public override async Task Authenticate(RemoteServiceHttpClientAuthenticateContext context) |
|||
{ |
|||
if (context.RemoteService.GetUseCurrentAccessToken() != false) |
|||
{ |
|||
var accessToken = await GetAccessTokenFromHttpContextOrNullAsync(); |
|||
if (accessToken != null) |
|||
{ |
|||
context.Request.SetBearerToken(accessToken); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
await base.Authenticate(context); |
|||
} |
|||
|
|||
protected virtual async Task<string> GetAccessTokenFromHttpContextOrNullAsync() |
|||
{ |
|||
var httpContext = HttpContextAccessor?.HttpContext; |
|||
if (httpContext == null) |
|||
{ |
|||
return null; |
|||
} |
|||
|
|||
return await httpContext.GetTokenAsync("access_token"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,25 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Abp.Quartz</AssemblyName> |
|||
<PackageId>Volo.Abp.Quartz</PackageId> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Quartz" Version="3.0.7" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.Core\Volo.Abp.Core.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,41 @@ |
|||
using System; |
|||
using System.Collections.Concurrent; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Quartz; |
|||
using Quartz.Spi; |
|||
|
|||
namespace Volo.Abp.Quartz |
|||
{ |
|||
/// <summary>
|
|||
/// Get the job from the dependency injection
|
|||
/// </summary>
|
|||
public class AbpQuartzJobFactory : IJobFactory |
|||
{ |
|||
private readonly IServiceProvider _serviceProvider; |
|||
|
|||
private readonly ConcurrentDictionary<IJob, IServiceScope> _scopes = new ConcurrentDictionary<IJob, IServiceScope>(); |
|||
|
|||
public AbpQuartzJobFactory(IServiceProvider serviceProvider) |
|||
{ |
|||
_serviceProvider = serviceProvider; |
|||
} |
|||
|
|||
public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler) |
|||
{ |
|||
var scope = _serviceProvider.CreateScope(); |
|||
var job = scope.ServiceProvider.GetRequiredService(bundle.JobDetail.JobType) as IJob; |
|||
if (job == null) |
|||
{ |
|||
throw new ArgumentException("Given job does not implement IJob"); |
|||
} |
|||
_scopes.TryAdd(job, scope); |
|||
return job; |
|||
} |
|||
|
|||
public void ReturnJob(IJob job) |
|||
{ |
|||
_scopes.TryRemove(job, out var serviceScope); |
|||
serviceScope?.Dispose(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Quartz; |
|||
using Quartz.Impl; |
|||
using Quartz.Spi; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.Threading; |
|||
|
|||
namespace Volo.Abp.Quartz |
|||
{ |
|||
public class AbpQuartzModule : AbpModule |
|||
{ |
|||
private IScheduler _scheduler; |
|||
|
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
var options = context.Services.ExecutePreConfiguredActions<AbpQuartzPreOptions>(); |
|||
context.Services.AddSingleton(AsyncHelper.RunSync(() => new StdSchedulerFactory(options.Properties).GetScheduler())); |
|||
context.Services.AddSingleton(typeof(IJobFactory), typeof(AbpQuartzJobFactory)); |
|||
} |
|||
|
|||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|||
{ |
|||
_scheduler = context.ServiceProvider.GetService<IScheduler>(); |
|||
_scheduler.JobFactory = context.ServiceProvider.GetService<IJobFactory>(); |
|||
_scheduler.Start(); |
|||
} |
|||
|
|||
public override void OnApplicationShutdown(ApplicationShutdownContext context) |
|||
{ |
|||
//TODO: ABP may provide two methods for application shutdown: OnPreApplicationShutdown & OnApplicationShutdown
|
|||
_scheduler.Shutdown(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System.Collections.Specialized; |
|||
|
|||
namespace Volo.Abp.Quartz |
|||
{ |
|||
public class AbpQuartzPreOptions |
|||
{ |
|||
public NameValueCollection Properties { get; set; } |
|||
|
|||
public AbpQuartzPreOptions() |
|||
{ |
|||
Properties = new NameValueCollection(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
@page |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.AlertsDemo |
|||
@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Alerts.IndexModel |
|||
|
|||
<h2>Alerts</h2> |
|||
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/alerts/" target="_blank"> Bootstrap Alert</a>.</p> |
|||
|
|||
@await Component.InvokeAsync(typeof(AlertsDemoViewComponent)) |
|||
@ -0,0 +1,12 @@ |
|||
using Microsoft.AspNetCore.Mvc.RazorPages; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Alerts |
|||
{ |
|||
public class IndexModel : PageModel |
|||
{ |
|||
public void OnGet() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue