fangdawei
1 year ago
4366 changed files with 771393 additions and 327353 deletions
@ -1,536 +0,0 @@ |
|||
root = true |
|||
|
|||
[*] |
|||
indent_style = space |
|||
indent_size = 2 |
|||
end_of_line = lf |
|||
charset = utf-8 |
|||
trim_trailing_whitespace = true |
|||
insert_final_newline = true |
|||
|
|||
[*.md] |
|||
trim_trailing_whitespace = false |
|||
|
|||
[*.cs] |
|||
indent_size = 4 |
|||
dotnet_sort_system_directives_first = true |
|||
|
|||
# Don't use this. qualifier |
|||
dotnet_style_qualification_for_field = true:suggestion |
|||
dotnet_style_qualification_for_property = true:suggestion |
|||
|
|||
# use int x = .. over Int32 |
|||
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion |
|||
|
|||
# use int.MaxValue over Int32.MaxValue |
|||
dotnet_style_predefined_type_for_member_access = true:suggestion |
|||
|
|||
# Require var all the time. |
|||
csharp_style_var_for_built_in_types = true:suggestion |
|||
csharp_style_var_when_type_is_apparent = true:suggestion |
|||
csharp_style_var_elsewhere = true:suggestion |
|||
|
|||
# Disallow throw expressions. |
|||
csharp_style_throw_expression = false:suggestion |
|||
|
|||
# Newline settings |
|||
csharp_new_line_before_open_brace = all |
|||
csharp_new_line_before_else = true |
|||
csharp_new_line_before_catch = true |
|||
csharp_new_line_before_finally = true |
|||
csharp_new_line_before_members_in_object_initializers = true |
|||
csharp_new_line_before_members_in_anonymous_types = true |
|||
|
|||
# Namespace settings |
|||
csharp_style_namespace_declarations = file_scoped:silent |
|||
|
|||
# Brace settings |
|||
csharp_prefer_braces = true:silent# Prefer curly braces even for one line of code |
|||
|
|||
[*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}] |
|||
indent_size = 2 |
|||
|
|||
# Xml config files |
|||
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] |
|||
indent_size = 2 |
|||
|
|||
[*.json] |
|||
indent_size = 2 |
|||
|
|||
[*.{ps1,psm1}] |
|||
indent_size = 4 |
|||
|
|||
[*.sh] |
|||
indent_size = 4 |
|||
end_of_line = lf |
|||
|
|||
[*.{razor,cshtml}] |
|||
charset = utf-8-bom |
|||
|
|||
[*.{cs,vb}] |
|||
|
|||
# SYSLIB1054: Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time |
|||
dotnet_diagnostic.SYSLIB1054.severity = warning |
|||
|
|||
# CA1018: Mark attributes with AttributeUsageAttribute |
|||
dotnet_diagnostic.CA1018.severity = warning |
|||
|
|||
# CA1047: Do not declare protected member in sealed type |
|||
dotnet_diagnostic.CA1047.severity = warning |
|||
|
|||
# CA1305: Specify IFormatProvider |
|||
dotnet_diagnostic.CA1305.severity = warning |
|||
|
|||
# CA1416: Validate platform compatibility |
|||
dotnet_diagnostic.CA1416.severity = warning |
|||
|
|||
# CA1507: Use nameof to express symbol names |
|||
dotnet_diagnostic.CA1507.severity = warning |
|||
|
|||
# CA1725: Parameter names should match base declaration |
|||
dotnet_diagnostic.CA1725.severity = suggestion |
|||
|
|||
# CA1802: Use literals where appropriate |
|||
dotnet_diagnostic.CA1802.severity = warning |
|||
|
|||
# CA1805: Do not initialize unnecessarily |
|||
dotnet_diagnostic.CA1805.severity = warning |
|||
|
|||
# CA1810: Do not initialize unnecessarily |
|||
dotnet_diagnostic.CA1810.severity = warning |
|||
|
|||
# CA1821: Remove empty Finalizers |
|||
dotnet_diagnostic.CA1821.severity = warning |
|||
|
|||
# CA1822: Make member static |
|||
dotnet_diagnostic.CA1822.severity = warning |
|||
dotnet_code_quality.CA1822.api_surface = private, internal |
|||
|
|||
# CA1823: Avoid unused private fields |
|||
dotnet_diagnostic.CA1823.severity = warning |
|||
|
|||
# CA1825: Avoid zero-length array allocations |
|||
dotnet_diagnostic.CA1825.severity = warning |
|||
|
|||
# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly |
|||
dotnet_diagnostic.CA1826.severity = warning |
|||
|
|||
# CA1827: Do not use Count() or LongCount() when Any() can be used |
|||
dotnet_diagnostic.CA1827.severity = warning |
|||
|
|||
# CA1828: Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used |
|||
dotnet_diagnostic.CA1828.severity = warning |
|||
|
|||
# CA1829: Use Length/Count property instead of Count() when available |
|||
dotnet_diagnostic.CA1829.severity = warning |
|||
|
|||
# CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder |
|||
dotnet_diagnostic.CA1830.severity = warning |
|||
|
|||
# CA1831: Use AsSpan or AsMemory instead of Range-based indexers when appropriate |
|||
# CA1832: Use AsSpan or AsMemory instead of Range-based indexers when appropriate |
|||
# CA1833: Use AsSpan or AsMemory instead of Range-based indexers when appropriate |
|||
dotnet_diagnostic.CA1831.severity = warning |
|||
dotnet_diagnostic.CA1832.severity = warning |
|||
dotnet_diagnostic.CA1833.severity = warning |
|||
|
|||
# CA1834: Consider using 'StringBuilder.Append(char)' when applicable |
|||
dotnet_diagnostic.CA1834.severity = warning |
|||
|
|||
# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync' |
|||
dotnet_diagnostic.CA1835.severity = warning |
|||
|
|||
# CA1836: Prefer IsEmpty over Count |
|||
dotnet_diagnostic.CA1836.severity = warning |
|||
|
|||
# CA1837: Use 'Environment.ProcessId' |
|||
dotnet_diagnostic.CA1837.severity = warning |
|||
|
|||
# CA1838: Avoid 'StringBuilder' parameters for P/Invokes |
|||
dotnet_diagnostic.CA1838.severity = warning |
|||
|
|||
# CA1839: Use 'Environment.ProcessPath' |
|||
dotnet_diagnostic.CA1839.severity = warning |
|||
|
|||
# CA1840: Use 'Environment.CurrentManagedThreadId' |
|||
dotnet_diagnostic.CA1840.severity = warning |
|||
|
|||
# CA1841: Prefer Dictionary.Contains methods |
|||
dotnet_diagnostic.CA1841.severity = warning |
|||
|
|||
# CA1842: Do not use 'WhenAll' with a single task |
|||
dotnet_diagnostic.CA1842.severity = warning |
|||
|
|||
# CA1843: Do not use 'WaitAll' with a single task |
|||
dotnet_diagnostic.CA1843.severity = warning |
|||
|
|||
# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream' |
|||
dotnet_diagnostic.CA1844.severity = warning |
|||
|
|||
# CA1845: Use span-based 'string.Concat' |
|||
dotnet_diagnostic.CA1845.severity = warning |
|||
|
|||
# CA1846: Prefer AsSpan over Substring |
|||
dotnet_diagnostic.CA1846.severity = warning |
|||
|
|||
# CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters |
|||
dotnet_diagnostic.CA1847.severity = warning |
|||
|
|||
# CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method |
|||
dotnet_diagnostic.CA1854.severity = warning |
|||
|
|||
# CA2007: Consider calling ConfigureAwait on the awaited task |
|||
dotnet_diagnostic.CA2007.severity = warning |
|||
|
|||
# CA2008: Do not create tasks without passing a TaskScheduler |
|||
dotnet_diagnostic.CA2008.severity = warning |
|||
|
|||
# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value |
|||
dotnet_diagnostic.CA2009.severity = warning |
|||
|
|||
# CA2011: Avoid infinite recursion |
|||
dotnet_diagnostic.CA2011.severity = warning |
|||
|
|||
# CA2012: Use ValueTask correctly |
|||
dotnet_diagnostic.CA2012.severity = warning |
|||
|
|||
# CA2013: Do not use ReferenceEquals with value types |
|||
dotnet_diagnostic.CA2013.severity = warning |
|||
|
|||
# CA2014: Do not use stackalloc in loops. |
|||
dotnet_diagnostic.CA2014.severity = warning |
|||
|
|||
# CA2016: Forward the 'CancellationToken' parameter to methods that take one |
|||
dotnet_diagnostic.CA2016.severity = warning |
|||
|
|||
# CA2200: Rethrow to preserve stack details |
|||
dotnet_diagnostic.CA2200.severity = warning |
|||
|
|||
# CA2208: Instantiate argument exceptions correctly |
|||
dotnet_diagnostic.CA2208.severity = warning |
|||
|
|||
# CA2245: Do not assign a property to itself |
|||
dotnet_diagnostic.CA2245.severity = warning |
|||
|
|||
# CA2246: Assigning symbol and its member in the same statement |
|||
dotnet_diagnostic.CA2246.severity = warning |
|||
|
|||
# CA2249: Use string.Contains instead of string.IndexOf to improve readability. |
|||
dotnet_diagnostic.CA2249.severity = warning |
|||
|
|||
# IDE0005: Remove unnecessary usings |
|||
dotnet_diagnostic.IDE0005.severity = warning |
|||
|
|||
# IDE0011: Curly braces to surround blocks of code |
|||
dotnet_diagnostic.IDE0011.severity = warning |
|||
|
|||
# IDE0020: Use pattern matching to avoid is check followed by a cast (with variable) |
|||
dotnet_diagnostic.IDE0020.severity = warning |
|||
|
|||
# IDE0029: Use coalesce expression (non-nullable types) |
|||
dotnet_diagnostic.IDE0029.severity = warning |
|||
|
|||
# IDE0030: Use coalesce expression (nullable types) |
|||
dotnet_diagnostic.IDE0030.severity = warning |
|||
|
|||
# IDE0031: Use null propagation |
|||
dotnet_diagnostic.IDE0031.severity = warning |
|||
|
|||
# IDE0035: Remove unreachable code |
|||
dotnet_diagnostic.IDE0035.severity = warning |
|||
|
|||
# IDE0036: Order modifiers |
|||
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion |
|||
dotnet_diagnostic.IDE0036.severity = warning |
|||
|
|||
# IDE0038: Use pattern matching to avoid is check followed by a cast (without variable) |
|||
dotnet_diagnostic.IDE0038.severity = warning |
|||
|
|||
# IDE0043: Format string contains invalid placeholder |
|||
dotnet_diagnostic.IDE0043.severity = warning |
|||
|
|||
# IDE0044: Make field readonly |
|||
dotnet_diagnostic.IDE0044.severity = warning |
|||
|
|||
# IDE0051: Remove unused private members |
|||
dotnet_diagnostic.IDE0051.severity = warning |
|||
|
|||
# IDE0055: All formatting rules |
|||
dotnet_diagnostic.IDE0055.severity = suggestion |
|||
|
|||
# IDE0059: Unnecessary assignment to a value |
|||
dotnet_diagnostic.IDE0059.severity = warning |
|||
|
|||
# IDE0060: Remove unused parameter |
|||
dotnet_code_quality_unused_parameters = non_public:suggestion |
|||
dotnet_diagnostic.IDE0060.severity = warning |
|||
|
|||
# IDE0062: Make local function static |
|||
dotnet_diagnostic.IDE0062.severity = warning |
|||
|
|||
# IDE0161: Convert to file-scoped namespace |
|||
dotnet_diagnostic.IDE0161.severity = warning |
|||
|
|||
# IDE0200: Lambda expression can be removed |
|||
dotnet_diagnostic.IDE0200.severity = warning |
|||
|
|||
# IDE2000: Disallow multiple blank lines |
|||
dotnet_style_allow_multiple_blank_lines_experimental = false:silent |
|||
dotnet_diagnostic.IDE2000.severity = warning |
|||
|
|||
[{eng/tools/**.cs,**/{test,testassets,samples,Samples,perf,scripts,stress}/**.cs}] |
|||
# CA1018: Mark attributes with AttributeUsageAttribute |
|||
dotnet_diagnostic.CA1018.severity = suggestion |
|||
# CA1507: Use nameof to express symbol names |
|||
dotnet_diagnostic.CA1507.severity = suggestion |
|||
# CA1802: Use literals where appropriate |
|||
dotnet_diagnostic.CA1802.severity = suggestion |
|||
# CA1805: Do not initialize unnecessarily |
|||
dotnet_diagnostic.CA1805.severity = suggestion |
|||
# CA1810: Do not initialize unnecessarily |
|||
dotnet_diagnostic.CA1810.severity = suggestion |
|||
# CA1822: Make member static |
|||
dotnet_diagnostic.CA1822.severity = suggestion |
|||
# CA1823: Avoid zero-length array allocations |
|||
dotnet_diagnostic.CA1825.severity = suggestion |
|||
# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly |
|||
dotnet_diagnostic.CA1826.severity = suggestion |
|||
# CA1827: Do not use Count() or LongCount() when Any() can be used |
|||
dotnet_diagnostic.CA1827.severity = suggestion |
|||
# CA1829: Use Length/Count property instead of Count() when available |
|||
dotnet_diagnostic.CA1829.severity = suggestion |
|||
# CA1834: Consider using 'StringBuilder.Append(char)' when applicable |
|||
dotnet_diagnostic.CA1834.severity = suggestion |
|||
# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync' |
|||
dotnet_diagnostic.CA1835.severity = suggestion |
|||
# CA1837: Use 'Environment.ProcessId' |
|||
dotnet_diagnostic.CA1837.severity = suggestion |
|||
# CA1838: Avoid 'StringBuilder' parameters for P/Invokes |
|||
dotnet_diagnostic.CA1838.severity = suggestion |
|||
# CA1841: Prefer Dictionary.Contains methods |
|||
dotnet_diagnostic.CA1841.severity = suggestion |
|||
# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream' |
|||
dotnet_diagnostic.CA1844.severity = suggestion |
|||
# CA1845: Use span-based 'string.Concat' |
|||
dotnet_diagnostic.CA1845.severity = suggestion |
|||
# CA1846: Prefer AsSpan over Substring |
|||
dotnet_diagnostic.CA1846.severity = suggestion |
|||
# CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters |
|||
dotnet_diagnostic.CA1847.severity = suggestion |
|||
# CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method |
|||
dotnet_diagnostic.CA1854.severity = suggestion |
|||
# CA2007: Consider calling ConfigureAwait on the awaited task |
|||
dotnet_diagnostic.CA2007.severity = suggestion |
|||
# CA2008: Do not create tasks without passing a TaskScheduler |
|||
dotnet_diagnostic.CA2008.severity = suggestion |
|||
# CA2012: Use ValueTask correctly |
|||
dotnet_diagnostic.CA2012.severity = suggestion |
|||
# CA2249: Use string.Contains instead of string.IndexOf to improve readability. |
|||
dotnet_diagnostic.CA2249.severity = suggestion |
|||
# IDE0005: Remove unnecessary usings |
|||
dotnet_diagnostic.IDE0005.severity = suggestion |
|||
# IDE0020: Use pattern matching to avoid is check followed by a cast (with variable) |
|||
dotnet_diagnostic.IDE0020.severity = suggestion |
|||
# IDE0029: Use coalesce expression (non-nullable types) |
|||
dotnet_diagnostic.IDE0029.severity = suggestion |
|||
# IDE0030: Use coalesce expression (nullable types) |
|||
dotnet_diagnostic.IDE0030.severity = suggestion |
|||
# IDE0031: Use null propagation |
|||
dotnet_diagnostic.IDE0031.severity = suggestion |
|||
# IDE0038: Use pattern matching to avoid is check followed by a cast (without variable) |
|||
dotnet_diagnostic.IDE0038.severity = suggestion |
|||
# IDE0044: Make field readonly |
|||
dotnet_diagnostic.IDE0044.severity = suggestion |
|||
# IDE0051: Remove unused private members |
|||
dotnet_diagnostic.IDE0051.severity = suggestion |
|||
# IDE0059: Unnecessary assignment to a value |
|||
dotnet_diagnostic.IDE0059.severity = suggestion |
|||
# IDE0060: Remove unused parameters |
|||
dotnet_diagnostic.IDE0060.severity = suggestion |
|||
# IDE0062: Make local function static |
|||
dotnet_diagnostic.IDE0062.severity = suggestion |
|||
# IDE0200: Lambda expression can be removed |
|||
dotnet_diagnostic.IDE0200.severity = suggestion |
|||
|
|||
# CA2016: Forward the 'CancellationToken' parameter to methods that take one |
|||
dotnet_diagnostic.CA2016.severity = suggestion |
|||
|
|||
# Defaults for content in the shared src/ and shared runtime dir |
|||
|
|||
[{**/Shared/runtime/**.{cs,vb},src/Shared/test/Shared.Tests/runtime/**.{cs,vb},**/microsoft.extensions.hostfactoryresolver.sources/**.{cs,vb}}] |
|||
# CA1822: Make member static |
|||
dotnet_diagnostic.CA1822.severity = silent |
|||
# IDE0011: Use braces |
|||
dotnet_diagnostic.IDE0011.severity = silent |
|||
# IDE0055: Fix formatting |
|||
dotnet_diagnostic.IDE0055.severity = silent |
|||
# IDE0060: Remove unused parameters |
|||
dotnet_diagnostic.IDE0060.severity = silent |
|||
# IDE0062: Make local function static |
|||
dotnet_diagnostic.IDE0062.severity = silent |
|||
# IDE0161: Convert to file-scoped namespace |
|||
dotnet_diagnostic.IDE0161.severity = silent |
|||
|
|||
[{**/Shared/**.cs,**/microsoft.extensions.hostfactoryresolver.sources/**.{cs,vb}}] |
|||
# IDE0005: Remove unused usings. Ignore for shared src files since imports for those depend on the projects in which they are included. |
|||
dotnet_diagnostic.IDE0005.severity = silent |
|||
dotnet_style_qualification_for_field = true:suggestion |
|||
dotnet_style_qualification_for_property = true:suggestion |
|||
dotnet_style_qualification_for_method = false:suggestion |
|||
dotnet_style_qualification_for_event = false:suggestion |
|||
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent |
|||
dotnet_style_readonly_field = true:suggestion |
|||
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent |
|||
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent |
|||
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent |
|||
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent |
|||
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent |
|||
dotnet_style_coalesce_expression = true:suggestion |
|||
dotnet_style_null_propagation = true:suggestion |
|||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion |
|||
dotnet_style_prefer_auto_properties = true:silent |
|||
dotnet_style_object_initializer = true:suggestion |
|||
dotnet_style_collection_initializer = true:suggestion |
|||
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion |
|||
dotnet_style_prefer_conditional_expression_over_assignment = true:silent |
|||
dotnet_style_prefer_conditional_expression_over_return = true:silent |
|||
dotnet_style_explicit_tuple_names = true:suggestion |
|||
dotnet_style_prefer_inferred_tuple_names = true:suggestion |
|||
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion |
|||
dotnet_style_prefer_compound_assignment = true:suggestion |
|||
dotnet_style_prefer_simplified_interpolation = true:suggestion |
|||
dotnet_style_namespace_match_folder = true:suggestion |
|||
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion |
|||
dotnet_style_predefined_type_for_member_access = true:suggestion |
|||
|
|||
[*.cs] |
|||
#### 命名样式 #### |
|||
|
|||
# 命名规则 |
|||
|
|||
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion |
|||
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface |
|||
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i |
|||
|
|||
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion |
|||
dotnet_naming_rule.types_should_be_pascal_case.symbols = types |
|||
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case |
|||
|
|||
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion |
|||
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members |
|||
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case |
|||
|
|||
# 符号规范 |
|||
|
|||
dotnet_naming_symbols.interface.applicable_kinds = interface |
|||
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
|||
dotnet_naming_symbols.interface.required_modifiers = |
|||
|
|||
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum |
|||
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
|||
dotnet_naming_symbols.types.required_modifiers = |
|||
|
|||
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method |
|||
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
|||
dotnet_naming_symbols.non_field_members.required_modifiers = |
|||
|
|||
# 命名样式 |
|||
|
|||
dotnet_naming_style.begins_with_i.required_prefix = I |
|||
dotnet_naming_style.begins_with_i.required_suffix = |
|||
dotnet_naming_style.begins_with_i.word_separator = |
|||
dotnet_naming_style.begins_with_i.capitalization = pascal_case |
|||
|
|||
dotnet_naming_style.pascal_case.required_prefix = |
|||
dotnet_naming_style.pascal_case.required_suffix = |
|||
dotnet_naming_style.pascal_case.word_separator = |
|||
dotnet_naming_style.pascal_case.capitalization = pascal_case |
|||
|
|||
dotnet_naming_style.pascal_case.required_prefix = |
|||
dotnet_naming_style.pascal_case.required_suffix = |
|||
dotnet_naming_style.pascal_case.word_separator = |
|||
dotnet_naming_style.pascal_case.capitalization = pascal_case |
|||
csharp_using_directive_placement = outside_namespace:silent |
|||
csharp_style_expression_bodied_methods = false:silent |
|||
csharp_style_expression_bodied_constructors = false:silent |
|||
csharp_style_expression_bodied_operators = false:silent |
|||
csharp_style_expression_bodied_properties = true:silent |
|||
csharp_style_expression_bodied_indexers = true:silent |
|||
csharp_style_expression_bodied_accessors = true:silent |
|||
csharp_style_expression_bodied_lambdas = true:silent |
|||
csharp_style_expression_bodied_local_functions = false:silent |
|||
csharp_style_conditional_delegate_call = true:suggestion |
|||
csharp_prefer_simple_using_statement = true:suggestion |
|||
csharp_style_prefer_method_group_conversion = true:silent |
|||
csharp_style_prefer_top_level_statements = true:silent |
|||
csharp_prefer_static_local_function = true:suggestion |
|||
csharp_style_prefer_readonly_struct = true:suggestion |
|||
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent |
|||
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent |
|||
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent |
|||
csharp_style_prefer_switch_expression = true:suggestion |
|||
csharp_style_prefer_pattern_matching = true:silent |
|||
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion |
|||
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion |
|||
csharp_style_prefer_not_pattern = true:suggestion |
|||
csharp_style_prefer_extended_property_pattern = true:suggestion |
|||
csharp_style_prefer_null_check_over_type_check = true:suggestion |
|||
csharp_prefer_simple_default_expression = true:suggestion |
|||
csharp_style_prefer_local_over_anonymous_function = true:suggestion |
|||
csharp_style_prefer_index_operator = true:suggestion |
|||
csharp_style_prefer_range_operator = true:suggestion |
|||
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion |
|||
csharp_style_prefer_tuple_swap = true:suggestion |
|||
csharp_style_prefer_utf8_string_literals = true:suggestion |
|||
csharp_style_inlined_variable_declaration = true:suggestion |
|||
csharp_style_deconstructed_variable_declaration = true:suggestion |
|||
csharp_style_unused_value_assignment_preference = discard_variable:suggestion |
|||
csharp_style_unused_value_expression_statement_preference = discard_variable:silent |
|||
|
|||
[*.vb] |
|||
#### 命名样式 #### |
|||
|
|||
# 命名规则 |
|||
|
|||
dotnet_naming_rule.interface_should_be_以_i_开始.severity = suggestion |
|||
dotnet_naming_rule.interface_should_be_以_i_开始.symbols = interface |
|||
dotnet_naming_rule.interface_should_be_以_i_开始.style = 以_i_开始 |
|||
|
|||
dotnet_naming_rule.类型_should_be_帕斯卡拼写法.severity = suggestion |
|||
dotnet_naming_rule.类型_should_be_帕斯卡拼写法.symbols = 类型 |
|||
dotnet_naming_rule.类型_should_be_帕斯卡拼写法.style = 帕斯卡拼写法 |
|||
|
|||
dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.severity = suggestion |
|||
dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.symbols = 非字段成员 |
|||
dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.style = 帕斯卡拼写法 |
|||
|
|||
# 符号规范 |
|||
|
|||
dotnet_naming_symbols.interface.applicable_kinds = interface |
|||
dotnet_naming_symbols.interface.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected |
|||
dotnet_naming_symbols.interface.required_modifiers = |
|||
|
|||
dotnet_naming_symbols.类型.applicable_kinds = class, struct, interface, enum |
|||
dotnet_naming_symbols.类型.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected |
|||
dotnet_naming_symbols.类型.required_modifiers = |
|||
|
|||
dotnet_naming_symbols.非字段成员.applicable_kinds = property, event, method |
|||
dotnet_naming_symbols.非字段成员.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected |
|||
dotnet_naming_symbols.非字段成员.required_modifiers = |
|||
|
|||
# 命名样式 |
|||
|
|||
dotnet_naming_style.以_i_开始.required_prefix = I |
|||
dotnet_naming_style.以_i_开始.required_suffix = |
|||
dotnet_naming_style.以_i_开始.word_separator = |
|||
dotnet_naming_style.以_i_开始.capitalization = pascal_case |
|||
|
|||
dotnet_naming_style.帕斯卡拼写法.required_prefix = |
|||
dotnet_naming_style.帕斯卡拼写法.required_suffix = |
|||
dotnet_naming_style.帕斯卡拼写法.word_separator = |
|||
dotnet_naming_style.帕斯卡拼写法.capitalization = pascal_case |
|||
|
|||
dotnet_naming_style.帕斯卡拼写法.required_prefix = |
|||
dotnet_naming_style.帕斯卡拼写法.required_suffix = |
|||
dotnet_naming_style.帕斯卡拼写法.word_separator = |
|||
dotnet_naming_style.帕斯卡拼写法.capitalization = pascal_case |
@ -0,0 +1,18 @@ |
|||
################################################################################ |
|||
# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。 |
|||
################################################################################ |
|||
|
|||
/src/.vs/SettleAccount/DesignTimeBuild/.dtbcache.v2 |
|||
/.vs/slnx.sqlite |
|||
/src/.vs/SmartFactorySuite/DesignTimeBuild/.dtbcache.v2 |
|||
/src/.vs/SmartFactorySuite/v16/.suo |
|||
/src/.vs/SettleAccount/v16/.suo |
|||
|
|||
|
|||
/*.rar |
|||
/src/Shared |
|||
/.vs/Win.Sfs.SmartSettlementSystem.PG/v17/.suo |
|||
/src/.vs/SettleAccount/v17/.suo |
|||
/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20220226.txt |
|||
/src/.vs/SettleAccount/v17/.futdcache.v1 |
|||
/src/.vs/SettleAccount/v17/fileList.bin |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,52 +0,0 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net7.0</TargetFramework> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> |
|||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType> |
|||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> |
|||
<PreserveCompilationContext>true</PreserveCompilationContext> |
|||
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish> |
|||
<PreserveCompilationReferences>true</PreserveCompilationReferences> |
|||
<NoWin32Manifest>true</NoWin32Manifest> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" /> |
|||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" /> |
|||
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="8.4.1" /> |
|||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.2" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="7.0.2" /> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.2"> |
|||
<PrivateAssets>all</PrivateAssets> |
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
|||
</PackageReference> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Autofac" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.EventBus.RabbitMQ" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.Account.Application" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="7.0.1" /> |
|||
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="7.0.1" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Compile Remove="Logs\**" /> |
|||
<Content Remove="Logs\**" /> |
|||
<EmbeddedResource Remove="Logs\**" /> |
|||
<None Remove="Logs\**" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
@ -1,10 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
|||
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor> |
|||
</PropertyGroup> |
|||
<PropertyGroup> |
|||
<ActiveDebugProfile>AuthServer.Host</ActiveDebugProfile> |
|||
<NameOfLastUsedPublishProfile>D:\长春项目\北京北汽结算项目\SmartFactorySuite\AuthServer\AuthServer.Host\Properties\PublishProfiles\FolderProfile2.pubxml</NameOfLastUsedPublishProfile> |
|||
</PropertyGroup> |
|||
</Project> |
@ -1,299 +0,0 @@ |
|||
using IdentityServer4.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.IdentityServer.ApiResources; |
|||
using Volo.Abp.IdentityServer.ApiScopes; |
|||
using Volo.Abp.IdentityServer.Clients; |
|||
using Volo.Abp.IdentityServer.IdentityResources; |
|||
using Volo.Abp.PermissionManagement; |
|||
using Volo.Abp.Uow; |
|||
using ApiResource = Volo.Abp.IdentityServer.ApiResources.ApiResource; |
|||
using ApiScope = Volo.Abp.IdentityServer.ApiScopes.ApiScope; |
|||
using Client = Volo.Abp.IdentityServer.Clients.Client; |
|||
|
|||
namespace AuthServer.Host |
|||
{ |
|||
public class AuthServerDataSeeder : IDataSeedContributor, ITransientDependency |
|||
{ |
|||
private readonly IApiResourceRepository _apiResourceRepository; |
|||
private readonly IApiScopeRepository _apiScopeRepository; |
|||
private readonly IClientRepository _clientRepository; |
|||
private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder; |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
private readonly IPermissionDataSeeder _permissionDataSeeder; |
|||
|
|||
public AuthServerDataSeeder( |
|||
IClientRepository clientRepository, |
|||
IApiResourceRepository apiResourceRepository, |
|||
IApiScopeRepository apiScopeRepository, |
|||
IIdentityResourceDataSeeder identityResourceDataSeeder, |
|||
IGuidGenerator guidGenerator, |
|||
IPermissionDataSeeder permissionDataSeeder) |
|||
{ |
|||
_clientRepository = clientRepository; |
|||
_apiResourceRepository = apiResourceRepository; |
|||
_apiScopeRepository = apiScopeRepository; |
|||
_identityResourceDataSeeder = identityResourceDataSeeder; |
|||
_guidGenerator = guidGenerator; |
|||
_permissionDataSeeder = permissionDataSeeder; |
|||
} |
|||
|
|||
[UnitOfWork] |
|||
public virtual async Task SeedAsync(DataSeedContext context) |
|||
{ |
|||
await _identityResourceDataSeeder.CreateStandardResourcesAsync(); |
|||
await CreateApiResourcesAsync(); |
|||
await CreateApiScopesAsync(); |
|||
await CreateClientsAsync(); |
|||
} |
|||
|
|||
private async Task CreateApiScopesAsync() |
|||
{ |
|||
await CreateApiScopeAsync("BaseService"); |
|||
await CreateApiScopeAsync("InternalGateway"); |
|||
await CreateApiScopeAsync("WebAppGateway"); |
|||
await CreateApiScopeAsync("BusinessService"); |
|||
await CreateApiScopeAsync("WMSService"); |
|||
await CreateApiScopeAsync("SettleAccountService"); |
|||
await CreateApiScopeAsync("FileStorageService"); |
|||
} |
|||
|
|||
private async Task CreateApiResourcesAsync() |
|||
{ |
|||
var commonApiUserClaims = new[] |
|||
{ |
|||
"email", |
|||
"email_verified", |
|||
"name", |
|||
"phone_number", |
|||
"phone_number_verified", |
|||
"role" |
|||
}; |
|||
|
|||
await CreateApiResourceAsync("BaseService", commonApiUserClaims); |
|||
await CreateApiResourceAsync("InternalGateway", commonApiUserClaims); |
|||
await CreateApiResourceAsync("WebAppGateway", commonApiUserClaims); |
|||
await CreateApiResourceAsync("BusinessService", commonApiUserClaims); |
|||
await CreateApiResourceAsync("WMSService", commonApiUserClaims); |
|||
await CreateApiResourceAsync("SettleAccountService", commonApiUserClaims); |
|||
await CreateApiResourceAsync("FileStorageService", commonApiUserClaims); |
|||
} |
|||
|
|||
private async Task<ApiResource> CreateApiResourceAsync(string name, IEnumerable<string> claims) |
|||
{ |
|||
var apiResource = await _apiResourceRepository.FindByNameAsync(name); |
|||
if (apiResource == null) |
|||
{ |
|||
apiResource = await _apiResourceRepository.InsertAsync( |
|||
new ApiResource( |
|||
_guidGenerator.Create(), |
|||
name, |
|||
name + " API" |
|||
), |
|||
autoSave: true |
|||
); |
|||
} |
|||
|
|||
foreach (var claim in claims) |
|||
{ |
|||
if (apiResource.FindClaim(claim) == null) |
|||
{ |
|||
apiResource.AddUserClaim(claim); |
|||
} |
|||
} |
|||
|
|||
return await _apiResourceRepository.UpdateAsync(apiResource); |
|||
} |
|||
|
|||
private async Task<ApiScope> CreateApiScopeAsync(string name) |
|||
{ |
|||
var apiScope = await _apiScopeRepository.FindByNameAsync(name); |
|||
if (apiScope == null) |
|||
{ |
|||
apiScope = await _apiScopeRepository.InsertAsync( |
|||
new ApiScope( |
|||
_guidGenerator.Create(), |
|||
name, |
|||
name + " API" |
|||
), |
|||
autoSave: true |
|||
); |
|||
} |
|||
|
|||
return apiScope; |
|||
} |
|||
|
|||
private async Task CreateClientsAsync() |
|||
{ |
|||
var commonScopes = new[] |
|||
{ |
|||
"email", |
|||
"openid", |
|||
"profile", |
|||
"role", |
|||
"phone", |
|||
"address" |
|||
}; |
|||
await CreateClientAsync( |
|||
name: "blazor-app", |
|||
scopes: commonScopes.Append("BaseService").Append("WebAppGateway").Append("BusinessService"), |
|||
grantTypes: new[] { "authorization_code" }, |
|||
secret: null, |
|||
requireClientSecret: false, |
|||
redirectUri: $"http://localhost:44307/authentication/login-callback", |
|||
postLogoutRedirectUri: $"http://localhost:44307/authentication/logout-callback", |
|||
corsOrigins: new[] { "http://localhost:44307" } |
|||
); |
|||
await CreateClientAsync( |
|||
name: "basic-web", |
|||
scopes: commonScopes.Append("BaseService").Append("WebAppGateway").Append("BusinessService").Append("WMSService") |
|||
.Append("SettleAccountService") |
|||
.Append("FileStorageService"), |
|||
grantTypes: new[] { "password" }, |
|||
secret: null, |
|||
requireClientSecret: false |
|||
); |
|||
await CreateClientAsync( |
|||
name: "business-app", |
|||
scopes: new[] { "InternalGateway", "BaseService", "WMSService", "SettleAccountService" }, |
|||
grantTypes: new[] { "client_credentials" }, |
|||
secret: "1q2w3e*".Sha256(), |
|||
permissions: new[] { IdentityPermissions.Users.Default, IdentityPermissions.UserLookup.Default, "WMS.Entry", "WMS.Entry.Create" } |
|||
); |
|||
await CreateClientAsync( |
|||
name: "wms-app", |
|||
scopes: new[] { "InternalGateway", "IdentityService", "BaseService", "BusinessService" }, |
|||
grantTypes: new[] { "client_credentials" }, |
|||
secret: "1q2w3e*".Sha256(), |
|||
permissions: new[] { IdentityPermissions.Users.Default, IdentityPermissions.UserLookup.Default, "Business.PrintTemplate", "Business.Book", "Business.Book.Create" } |
|||
); |
|||
|
|||
await CreateClientAsync( |
|||
name: "file-app", |
|||
scopes: new[] { "InternalGateway", "IdentityService", "BaseService", "SettleAccountService" }, |
|||
grantTypes: new[] { "client_credentials" }, |
|||
secret: "1q2w3e*".Sha256(), |
|||
permissions: new[] { IdentityPermissions.Users.Default, IdentityPermissions.UserLookup.Default} |
|||
); |
|||
|
|||
await CreateClientAsync( |
|||
name: "settle-account-app", |
|||
scopes: new[] { "InternalGateway", "IdentityService", "BaseService", "FileStorageService", "BusinessService" }, |
|||
grantTypes: new[] { "client_credentials" }, |
|||
secret: "1q2w3e*".Sha256(), |
|||
permissions: new[] { IdentityPermissions.Users.Default, IdentityPermissions.UserLookup.Default, "Business.PrintTemplate", "Business.Book", "Business.Book.Create" } |
|||
); |
|||
} |
|||
|
|||
private async Task<Client> CreateClientAsync( |
|||
string name, |
|||
IEnumerable<string> scopes, |
|||
IEnumerable<string> grantTypes, |
|||
string secret = null, |
|||
string redirectUri = null, |
|||
string postLogoutRedirectUri = null, |
|||
string frontChannelLogoutUri = null, |
|||
bool requireClientSecret = true, |
|||
bool requirePkce = false, |
|||
IEnumerable<string> permissions = null, |
|||
IEnumerable<string> corsOrigins = null) |
|||
{ |
|||
var client = await _clientRepository.FindByClientIdAsync(name); |
|||
if (client == null) |
|||
{ |
|||
client = await _clientRepository.InsertAsync( |
|||
new Client( |
|||
_guidGenerator.Create(), |
|||
name |
|||
) |
|||
{ |
|||
ClientName = name, |
|||
ProtocolType = "oidc", |
|||
Description = name, |
|||
AlwaysIncludeUserClaimsInIdToken = true, |
|||
AllowOfflineAccess = true, |
|||
AbsoluteRefreshTokenLifetime = 31536000, //365 days
|
|||
AccessTokenLifetime = 31536000, //365 days
|
|||
AuthorizationCodeLifetime = 300, |
|||
IdentityTokenLifetime = 300, |
|||
RequireConsent = false, |
|||
FrontChannelLogoutUri = frontChannelLogoutUri, |
|||
RequireClientSecret = requireClientSecret, |
|||
RequirePkce = requirePkce |
|||
}, |
|||
autoSave: true |
|||
); |
|||
} |
|||
|
|||
foreach (var scope in scopes) |
|||
{ |
|||
if (client.FindScope(scope) == null) |
|||
{ |
|||
client.AddScope(scope); |
|||
} |
|||
} |
|||
|
|||
foreach (var grantType in grantTypes) |
|||
{ |
|||
if (client.FindGrantType(grantType) == null) |
|||
{ |
|||
client.AddGrantType(grantType); |
|||
} |
|||
} |
|||
|
|||
if (!secret.IsNullOrEmpty()) |
|||
{ |
|||
if (client.FindSecret(secret) == null) |
|||
{ |
|||
client.AddSecret(secret); |
|||
} |
|||
} |
|||
|
|||
if (redirectUri != null) |
|||
{ |
|||
if (client.FindRedirectUri(redirectUri) == null) |
|||
{ |
|||
client.AddRedirectUri(redirectUri); |
|||
} |
|||
} |
|||
|
|||
if (postLogoutRedirectUri != null) |
|||
{ |
|||
if (client.FindPostLogoutRedirectUri(postLogoutRedirectUri) == null) |
|||
{ |
|||
client.AddPostLogoutRedirectUri(postLogoutRedirectUri); |
|||
} |
|||
} |
|||
|
|||
if (permissions != null) |
|||
{ |
|||
await _permissionDataSeeder.SeedAsync( |
|||
ClientPermissionValueProvider.ProviderName, |
|||
name, |
|||
permissions, |
|||
null |
|||
); |
|||
} |
|||
|
|||
if (corsOrigins != null) |
|||
{ |
|||
foreach (var origin in corsOrigins) |
|||
{ |
|||
if (!origin.IsNullOrWhiteSpace() && client.FindCorsOrigin(origin) == null) |
|||
{ |
|||
client.AddCorsOrigin(origin); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return await _clientRepository.UpdateAsync(client); |
|||
} |
|||
} |
|||
} |
@ -1,140 +0,0 @@ |
|||
using AuthServer.Host.EntityFrameworkCore; |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.AspNetCore.Cors; |
|||
using Microsoft.AspNetCore.DataProtection; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using StackExchange.Redis; |
|||
using System; |
|||
using System.Linq; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Account; |
|||
using Volo.Abp.Account.Web; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; |
|||
using Volo.Abp.Auditing; |
|||
using Volo.Abp.AuditLogging.EntityFrameworkCore; |
|||
using Volo.Abp.Autofac; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore.SqlServer; |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.Identity.EntityFrameworkCore; |
|||
using Volo.Abp.IdentityServer.EntityFrameworkCore; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.PermissionManagement.EntityFrameworkCore; |
|||
using Volo.Abp.SettingManagement.EntityFrameworkCore; |
|||
using Volo.Abp.TenantManagement; |
|||
using Volo.Abp.TenantManagement.EntityFrameworkCore; |
|||
using Volo.Abp.Threading; |
|||
|
|||
namespace AuthServer.Host |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpAutofacModule), |
|||
typeof(AbpPermissionManagementEntityFrameworkCoreModule), |
|||
typeof(AbpAuditLoggingEntityFrameworkCoreModule), |
|||
typeof(AbpSettingManagementEntityFrameworkCoreModule), |
|||
typeof(AbpIdentityEntityFrameworkCoreModule), |
|||
typeof(AbpIdentityApplicationContractsModule), |
|||
typeof(AbpAccountApplicationModule), |
|||
typeof(AbpIdentityServerEntityFrameworkCoreModule), |
|||
typeof(AbpEntityFrameworkCoreSqlServerModule), |
|||
typeof(AbpAccountWebIdentityServerModule), |
|||
typeof(AbpAspNetCoreMvcUiBasicThemeModule), |
|||
typeof(AbpTenantManagementEntityFrameworkCoreModule), |
|||
typeof(AbpTenantManagementApplicationContractsModule) |
|||
)] |
|||
public class AuthServerHostModule : AbpModule |
|||
{ |
|||
private const string DefaultCorsPolicyName = "Default"; |
|||
|
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
var configuration = context.Services.GetConfiguration(); |
|||
|
|||
context.Services.AddAbpDbContext<AuthServerDbContext>(options => |
|||
{ |
|||
options.AddDefaultRepositories(); |
|||
}); |
|||
|
|||
Configure<AbpMultiTenancyOptions>(options => |
|||
{ |
|||
options.IsEnabled = true; |
|||
}); |
|||
|
|||
Configure<AbpDbContextOptions>(options => |
|||
{ |
|||
options.UseSqlServer(); |
|||
}); |
|||
|
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "¼òÌåÖÐÎÄ")); |
|||
}); |
|||
|
|||
context.Services.AddCors(options => |
|||
{ |
|||
options.AddPolicy(DefaultCorsPolicyName, |
|||
builder => |
|||
{ |
|||
builder.WithOrigins(configuration["CorsOrigins"] |
|||
.Split(",", StringSplitOptions.RemoveEmptyEntries) |
|||
.Select(o => o.RemovePostFix("/")) |
|||
.ToArray()) |
|||
.WithAbpExposedHeaders() |
|||
.SetIsOriginAllowedToAllowWildcardSubdomains() |
|||
.AllowAnyHeader() |
|||
.AllowAnyMethod() |
|||
.AllowCredentials(); |
|||
}); |
|||
}); |
|||
|
|||
context.Services.AddSameSiteCookiePolicy(); |
|||
|
|||
//context.Services.AddStackExchangeRedisCache(options =>
|
|||
//{
|
|||
// options.Configuration = configuration["Redis:Configuration"];
|
|||
//});
|
|||
|
|||
Configure<AbpAuditingOptions>(options => |
|||
{ |
|||
options.IsEnabledForGetRequests = true; |
|||
options.ApplicationName = "AuthServer"; |
|||
}); |
|||
|
|||
//TODO: ConnectionMultiplexer.Connect call has problem since redis may not be ready when this service has started!
|
|||
//var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
|
|||
//context.Services.AddDataProtection()
|
|||
// .PersistKeysToStackExchangeRedis(redis, "MsDemo-DataProtection-Keys");
|
|||
} |
|||
|
|||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|||
{ |
|||
var app = context.GetApplicationBuilder(); |
|||
|
|||
app.UseCookiePolicy(); |
|||
app.UseCorrelationId(); |
|||
app.UseStaticFiles(); |
|||
app.UseRouting(); |
|||
app.UseCors(DefaultCorsPolicyName); |
|||
app.UseAbpRequestLocalization(); |
|||
app.UseAuthentication(); |
|||
app.UseMultiTenancy(); |
|||
app.UseIdentityServer(); |
|||
app.UseAuthorization(); |
|||
app.UseAuditing(); |
|||
app.UseConfiguredEndpoints(); |
|||
|
|||
AsyncHelper.RunSync(async () => |
|||
{ |
|||
using (var scope = context.ServiceProvider.CreateScope()) |
|||
{ |
|||
await scope.ServiceProvider |
|||
.GetRequiredService<IDataSeeder>() |
|||
.SeedAsync(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
} |
@ -1,10 +0,0 @@ |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Ui.Branding; |
|||
|
|||
namespace AuthServer.Host |
|||
{ |
|||
public class BrandingProvider : DefaultBrandingProvider, ISingletonDependency |
|||
{ |
|||
public override string AppName => "Authentication Server"; |
|||
} |
|||
} |
@ -1,12 +0,0 @@ |
|||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build |
|||
WORKDIR /app |
|||
|
|||
WORKDIR /src |
|||
COPY . . |
|||
RUN dotnet restore |
|||
RUN dotnet publish -c Release -o publish |
|||
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 |
|||
WORKDIR /app |
|||
COPY --from=build /src/publish ./ |
|||
ENTRYPOINT ["dotnet", "AuthServer.Host.dll"] |
@ -1,34 +0,0 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.AuditLogging.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.FeatureManagement.EntityFrameworkCore; |
|||
using Volo.Abp.Identity.EntityFrameworkCore; |
|||
using Volo.Abp.IdentityServer.EntityFrameworkCore; |
|||
using Volo.Abp.PermissionManagement.EntityFrameworkCore; |
|||
using Volo.Abp.SettingManagement.EntityFrameworkCore; |
|||
using Volo.Abp.TenantManagement.EntityFrameworkCore; |
|||
|
|||
namespace AuthServer.Host.EntityFrameworkCore |
|||
{ |
|||
public class AuthServerDbContext : AbpDbContext<AuthServerDbContext> |
|||
{ |
|||
public AuthServerDbContext(DbContextOptions<AuthServerDbContext> options) |
|||
: base(options) |
|||
{ |
|||
|
|||
} |
|||
|
|||
protected override void OnModelCreating(ModelBuilder modelBuilder) |
|||
{ |
|||
base.OnModelCreating(modelBuilder); |
|||
|
|||
//modelBuilder.ConfigureIdentity();
|
|||
modelBuilder.ConfigureIdentityServer(); |
|||
//modelBuilder.ConfigureAuditLogging();
|
|||
//modelBuilder.ConfigurePermissionManagement();
|
|||
//modelBuilder.ConfigureSettingManagement();
|
|||
//modelBuilder.ConfigureTenantManagement();
|
|||
//modelBuilder.ConfigureFeatureManagement();
|
|||
} |
|||
} |
|||
} |
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,621 +0,0 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace AuthServer.Host.Migrations |
|||
{ |
|||
public partial class init : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerApiResources", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
DisplayName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true), |
|||
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true), |
|||
Enabled = table.Column<bool>(type: "bit", nullable: false), |
|||
AllowedAccessTokenSigningAlgorithms = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true), |
|||
ShowInDiscoveryDocument = table.Column<bool>(type: "bit", nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerApiScopes", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Enabled = table.Column<bool>(type: "bit", nullable: false), |
|||
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
DisplayName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true), |
|||
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true), |
|||
Required = table.Column<bool>(type: "bit", nullable: false), |
|||
Emphasize = table.Column<bool>(type: "bit", nullable: false), |
|||
ShowInDiscoveryDocument = table.Column<bool>(type: "bit", nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerApiScopes", x => x.Id); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerClients", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
ClientId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
ClientName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true), |
|||
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true), |
|||
ClientUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true), |
|||
LogoUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true), |
|||
Enabled = table.Column<bool>(type: "bit", nullable: false), |
|||
ProtocolType = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
RequireClientSecret = table.Column<bool>(type: "bit", nullable: false), |
|||
RequireConsent = table.Column<bool>(type: "bit", nullable: false), |
|||
AllowRememberConsent = table.Column<bool>(type: "bit", nullable: false), |
|||
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(type: "bit", nullable: false), |
|||
RequirePkce = table.Column<bool>(type: "bit", nullable: false), |
|||
AllowPlainTextPkce = table.Column<bool>(type: "bit", nullable: false), |
|||
RequireRequestObject = table.Column<bool>(type: "bit", nullable: false), |
|||
AllowAccessTokensViaBrowser = table.Column<bool>(type: "bit", nullable: false), |
|||
FrontChannelLogoutUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true), |
|||
FrontChannelLogoutSessionRequired = table.Column<bool>(type: "bit", nullable: false), |
|||
BackChannelLogoutUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true), |
|||
BackChannelLogoutSessionRequired = table.Column<bool>(type: "bit", nullable: false), |
|||
AllowOfflineAccess = table.Column<bool>(type: "bit", nullable: false), |
|||
IdentityTokenLifetime = table.Column<int>(type: "int", nullable: false), |
|||
AllowedIdentityTokenSigningAlgorithms = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true), |
|||
AccessTokenLifetime = table.Column<int>(type: "int", nullable: false), |
|||
AuthorizationCodeLifetime = table.Column<int>(type: "int", nullable: false), |
|||
ConsentLifetime = table.Column<int>(type: "int", nullable: true), |
|||
AbsoluteRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false), |
|||
SlidingRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false), |
|||
RefreshTokenUsage = table.Column<int>(type: "int", nullable: false), |
|||
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(type: "bit", nullable: false), |
|||
RefreshTokenExpiration = table.Column<int>(type: "int", nullable: false), |
|||
AccessTokenType = table.Column<int>(type: "int", nullable: false), |
|||
EnableLocalLogin = table.Column<bool>(type: "bit", nullable: false), |
|||
IncludeJwtId = table.Column<bool>(type: "bit", nullable: false), |
|||
AlwaysSendClientClaims = table.Column<bool>(type: "bit", nullable: false), |
|||
ClientClaimsPrefix = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true), |
|||
PairWiseSubjectSalt = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true), |
|||
UserSsoLifetime = table.Column<int>(type: "int", nullable: true), |
|||
UserCodeType = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true), |
|||
DeviceCodeLifetime = table.Column<int>(type: "int", nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerClients", x => x.Id); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerDeviceFlowCodes", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
DeviceCode = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
UserCode = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
SubjectId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true), |
|||
SessionId = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true), |
|||
ClientId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
Description = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true), |
|||
Expiration = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
Data = table.Column<string>(type: "nvarchar(max)", maxLength: 50000, nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerIdentityResources", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
DisplayName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true), |
|||
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true), |
|||
Enabled = table.Column<bool>(type: "bit", nullable: false), |
|||
Required = table.Column<bool>(type: "bit", nullable: false), |
|||
Emphasize = table.Column<bool>(type: "bit", nullable: false), |
|||
ShowInDiscoveryDocument = table.Column<bool>(type: "bit", nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerPersistedGrants", |
|||
columns: table => new |
|||
{ |
|||
Key = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false), |
|||
SubjectId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true), |
|||
SessionId = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true), |
|||
ClientId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
Description = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
Expiration = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
ConsumedTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
Data = table.Column<string>(type: "nvarchar(max)", maxLength: 50000, nullable: false), |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerApiResourceClaims", |
|||
columns: table => new |
|||
{ |
|||
Type = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
ApiResourceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerApiResourceClaims", x => new { x.ApiResourceId, x.Type }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_ApiResourceId", |
|||
column: x => x.ApiResourceId, |
|||
principalTable: "IdentityServerApiResources", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerApiResourceProperties", |
|||
columns: table => new |
|||
{ |
|||
ApiResourceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Key = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false), |
|||
Value = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key, x.Value }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerApiResourceProperties_IdentityServerApiResources_ApiResourceId", |
|||
column: x => x.ApiResourceId, |
|||
principalTable: "IdentityServerApiResources", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerApiResourceScopes", |
|||
columns: table => new |
|||
{ |
|||
ApiResourceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Scope = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerApiResourceScopes", x => new { x.ApiResourceId, x.Scope }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_ApiResourceId", |
|||
column: x => x.ApiResourceId, |
|||
principalTable: "IdentityServerApiResources", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerApiResourceSecrets", |
|||
columns: table => new |
|||
{ |
|||
Type = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false), |
|||
Value = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: false), |
|||
ApiResourceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true), |
|||
Expiration = table.Column<DateTime>(type: "datetime2", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerApiResourceSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_ApiResourceId", |
|||
column: x => x.ApiResourceId, |
|||
principalTable: "IdentityServerApiResources", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerApiScopeClaims", |
|||
columns: table => new |
|||
{ |
|||
Type = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
ApiScopeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiScopeId, x.Type }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScopeId", |
|||
column: x => x.ApiScopeId, |
|||
principalTable: "IdentityServerApiScopes", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerApiScopeProperties", |
|||
columns: table => new |
|||
{ |
|||
ApiScopeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Key = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false), |
|||
Value = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key, x.Value }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_ApiScopeId", |
|||
column: x => x.ApiScopeId, |
|||
principalTable: "IdentityServerApiScopes", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerClientClaims", |
|||
columns: table => new |
|||
{ |
|||
ClientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Type = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false), |
|||
Value = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", |
|||
column: x => x.ClientId, |
|||
principalTable: "IdentityServerClients", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerClientCorsOrigins", |
|||
columns: table => new |
|||
{ |
|||
ClientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Origin = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId", |
|||
column: x => x.ClientId, |
|||
principalTable: "IdentityServerClients", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerClientGrantTypes", |
|||
columns: table => new |
|||
{ |
|||
ClientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
GrantType = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", |
|||
column: x => x.ClientId, |
|||
principalTable: "IdentityServerClients", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerClientIdPRestrictions", |
|||
columns: table => new |
|||
{ |
|||
ClientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Provider = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId", |
|||
column: x => x.ClientId, |
|||
principalTable: "IdentityServerClients", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerClientPostLogoutRedirectUris", |
|||
columns: table => new |
|||
{ |
|||
ClientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
PostLogoutRedirectUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId", |
|||
column: x => x.ClientId, |
|||
principalTable: "IdentityServerClients", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerClientProperties", |
|||
columns: table => new |
|||
{ |
|||
ClientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Key = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false), |
|||
Value = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key, x.Value }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", |
|||
column: x => x.ClientId, |
|||
principalTable: "IdentityServerClients", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerClientRedirectUris", |
|||
columns: table => new |
|||
{ |
|||
ClientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
RedirectUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId", |
|||
column: x => x.ClientId, |
|||
principalTable: "IdentityServerClients", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerClientScopes", |
|||
columns: table => new |
|||
{ |
|||
ClientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Scope = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", |
|||
column: x => x.ClientId, |
|||
principalTable: "IdentityServerClients", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerClientSecrets", |
|||
columns: table => new |
|||
{ |
|||
Type = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false), |
|||
Value = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: false), |
|||
ClientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Description = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true), |
|||
Expiration = table.Column<DateTime>(type: "datetime2", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", |
|||
column: x => x.ClientId, |
|||
principalTable: "IdentityServerClients", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerIdentityResourceClaims", |
|||
columns: table => new |
|||
{ |
|||
Type = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false), |
|||
IdentityResourceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerIdentityResourceClaims", x => new { x.IdentityResourceId, x.Type }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityResources_IdentityResourceId", |
|||
column: x => x.IdentityResourceId, |
|||
principalTable: "IdentityServerIdentityResources", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "IdentityServerIdentityResourceProperties", |
|||
columns: table => new |
|||
{ |
|||
IdentityResourceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Key = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false), |
|||
Value = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key, x.Value }); |
|||
table.ForeignKey( |
|||
name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdentityResources_IdentityResourceId", |
|||
column: x => x.IdentityResourceId, |
|||
principalTable: "IdentityServerIdentityResources", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_IdentityServerClients_ClientId", |
|||
table: "IdentityServerClients", |
|||
column: "ClientId"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", |
|||
table: "IdentityServerDeviceFlowCodes", |
|||
column: "DeviceCode", |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_IdentityServerDeviceFlowCodes_Expiration", |
|||
table: "IdentityServerDeviceFlowCodes", |
|||
column: "Expiration"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_IdentityServerDeviceFlowCodes_UserCode", |
|||
table: "IdentityServerDeviceFlowCodes", |
|||
column: "UserCode"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_IdentityServerPersistedGrants_Expiration", |
|||
table: "IdentityServerPersistedGrants", |
|||
column: "Expiration"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", |
|||
table: "IdentityServerPersistedGrants", |
|||
columns: new[] { "SubjectId", "ClientId", "Type" }); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type", |
|||
table: "IdentityServerPersistedGrants", |
|||
columns: new[] { "SubjectId", "SessionId", "Type" }); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerApiResourceClaims"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerApiResourceProperties"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerApiResourceScopes"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerApiResourceSecrets"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerApiScopeClaims"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerApiScopeProperties"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerClientClaims"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerClientCorsOrigins"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerClientGrantTypes"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerClientIdPRestrictions"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerClientPostLogoutRedirectUris"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerClientProperties"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerClientRedirectUris"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerClientScopes"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerClientSecrets"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerDeviceFlowCodes"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerIdentityResourceClaims"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerIdentityResourceProperties"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerPersistedGrants"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerApiResources"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerApiScopes"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerClients"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "IdentityServerIdentityResources"); |
|||
} |
|||
} |
|||
} |
File diff suppressed because it is too large
@ -1,22 +0,0 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace AuthServer.Host.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class _20230531 : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
|
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
File diff suppressed because it is too large
@ -1,49 +0,0 @@ |
|||
using System; |
|||
using Microsoft.AspNetCore.Hosting; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Serilog; |
|||
using Serilog.Events; |
|||
|
|||
namespace AuthServer.Host |
|||
{ |
|||
public class Program |
|||
{ |
|||
public static int Main(string[] args) |
|||
{ |
|||
Log.Logger = new LoggerConfiguration() |
|||
.MinimumLevel.Debug() |
|||
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|||
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|||
.Enrich.WithProperty("Application", "AuthServer") |
|||
.Enrich.FromLogContext() |
|||
.WriteTo.File("Logs/logs.txt") |
|||
.WriteTo.Console() |
|||
.CreateLogger(); |
|||
|
|||
try |
|||
{ |
|||
Log.Information("Starting AuthServer.Host."); |
|||
CreateHostBuilder(args).Build().Run(); |
|||
return 0; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
Log.Fatal(ex, "AuthServer.Host terminated unexpectedly!"); |
|||
return 1; |
|||
} |
|||
finally |
|||
{ |
|||
Log.CloseAndFlush(); |
|||
} |
|||
} |
|||
|
|||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
|||
Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args) |
|||
.ConfigureWebHostDefaults(webBuilder => |
|||
{ |
|||
webBuilder.UseStartup<Startup>(); |
|||
}) |
|||
.UseAutofac() |
|||
.UseSerilog(); |
|||
} |
|||
} |
@ -1,17 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
https://go.microsoft.com/fwlink/?LinkID=208121. |
|||
--> |
|||
<Project> |
|||
<PropertyGroup> |
|||
<DeleteExistingFiles>false</DeleteExistingFiles> |
|||
<ExcludeApp_Data>false</ExcludeApp_Data> |
|||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish> |
|||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> |
|||
<LastUsedPlatform>Any CPU</LastUsedPlatform> |
|||
<PublishProvider>FileSystem</PublishProvider> |
|||
<PublishUrl>D:\上海富维东阳工作\设备管理\MicroService-nuget\ids4</PublishUrl> |
|||
<WebPublishMethod>FileSystem</WebPublishMethod> |
|||
<_TargetId>Folder</_TargetId> |
|||
</PropertyGroup> |
|||
</Project> |
@ -1,11 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
https://go.microsoft.com/fwlink/?LinkID=208121. |
|||
--> |
|||
<Project> |
|||
<PropertyGroup> |
|||
<_PublishTargetUrl>D:\上海富维东阳工作\设备管理\MicroService-nuget\ids4</_PublishTargetUrl> |
|||
<History>True|2023-06-02T03:45:39.2598672Z;True|2023-06-02T10:51:57.7256118+08:00;True|2023-06-01T22:37:50.4657282+08:00;True|2023-05-31T14:37:30.8035837+08:00;False|2023-05-31T14:36:55.4088873+08:00;False|2023-05-31T14:36:23.3151955+08:00;True|2023-05-31T14:09:37.9153414+08:00;</History> |
|||
<LastFailureDetails /> |
|||
</PropertyGroup> |
|||
</Project> |
@ -1,17 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
https://go.microsoft.com/fwlink/?LinkID=208121. |
|||
--> |
|||
<Project> |
|||
<PropertyGroup> |
|||
<DeleteExistingFiles>false</DeleteExistingFiles> |
|||
<ExcludeApp_Data>false</ExcludeApp_Data> |
|||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish> |
|||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> |
|||
<LastUsedPlatform>Any CPU</LastUsedPlatform> |
|||
<PublishProvider>FileSystem</PublishProvider> |
|||
<PublishUrl>D:\上海富维东阳工作\设备管理\MicroService-nuget\ids4</PublishUrl> |
|||
<WebPublishMethod>FileSystem</WebPublishMethod> |
|||
<_TargetId>Folder</_TargetId> |
|||
</PropertyGroup> |
|||
</Project> |
@ -1,11 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
https://go.microsoft.com/fwlink/?LinkID=208121. |
|||
--> |
|||
<Project> |
|||
<PropertyGroup> |
|||
<_PublishTargetUrl>D:\上海富维东阳工作\设备管理\MicroService-nuget\ids4</_PublishTargetUrl> |
|||
<History>True|2023-06-05T09:25:41.0255575Z;</History> |
|||
<LastFailureDetails /> |
|||
</PropertyGroup> |
|||
</Project> |
@ -1,17 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
https://go.microsoft.com/fwlink/?LinkID=208121. |
|||
--> |
|||
<Project> |
|||
<PropertyGroup> |
|||
<DeleteExistingFiles>false</DeleteExistingFiles> |
|||
<ExcludeApp_Data>false</ExcludeApp_Data> |
|||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish> |
|||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> |
|||
<LastUsedPlatform>Any CPU</LastUsedPlatform> |
|||
<PublishProvider>FileSystem</PublishProvider> |
|||
<PublishUrl>bin\Release\net7.0\publish\</PublishUrl> |
|||
<WebPublishMethod>FileSystem</WebPublishMethod> |
|||
<_TargetId>Folder</_TargetId> |
|||
</PropertyGroup> |
|||
</Project> |
@ -1,11 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
https://go.microsoft.com/fwlink/?LinkID=208121. |
|||
--> |
|||
<Project> |
|||
<PropertyGroup> |
|||
<_PublishTargetUrl>D:\长春项目\北京北汽结算项目\SmartFactorySuite\AuthServer\AuthServer.Host\bin\Release\net7.0\publish\</_PublishTargetUrl> |
|||
<History>True|2023-06-07T11:58:11.8271573Z;True|2023-06-07T19:00:47.2006818+08:00;True|2023-06-07T15:30:58.0379793+08:00;</History> |
|||
<LastFailureDetails /> |
|||
</PropertyGroup> |
|||
</Project> |
@ -1,27 +0,0 @@ |
|||
{ |
|||
"iisSettings": { |
|||
"windowsAuthentication": false, |
|||
"anonymousAuthentication": true, |
|||
"iisExpress": { |
|||
"applicationUrl": "http://localhost:53362", |
|||
"sslPort": 0 |
|||
} |
|||
}, |
|||
"profiles": { |
|||
"IIS Express": { |
|||
"commandName": "IISExpress", |
|||
"launchBrowser": true, |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
}, |
|||
"AuthServer.Host": { |
|||
"commandName": "Project", |
|||
"launchBrowser": true, |
|||
"applicationUrl": "http://localhost:53362", |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
} |
|||
} |
|||
} |
@ -1,71 +0,0 @@ |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
|
|||
namespace AuthServer.Host |
|||
{ |
|||
public static class SameSiteCookiesServiceCollectionExtensions |
|||
{ |
|||
public static IServiceCollection AddSameSiteCookiePolicy(this IServiceCollection services) |
|||
{ |
|||
services.Configure<CookiePolicyOptions>(options => |
|||
{ |
|||
options.MinimumSameSitePolicy = SameSiteMode.Unspecified; |
|||
options.OnAppendCookie = cookieContext => |
|||
CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); |
|||
options.OnDeleteCookie = cookieContext => |
|||
CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); |
|||
}); |
|||
|
|||
return services; |
|||
} |
|||
|
|||
private static void CheckSameSite(HttpContext httpContext, CookieOptions options) |
|||
{ |
|||
if (options.SameSite == SameSiteMode.None) |
|||
{ |
|||
var userAgent = httpContext.Request.Headers["User-Agent"].ToString(); |
|||
if (!httpContext.Request.IsHttps || DisallowsSameSiteNone(userAgent)) |
|||
{ |
|||
// For .NET Core < 3.1 set SameSite = (SameSiteMode)(-1)
|
|||
options.SameSite = SameSiteMode.Unspecified; |
|||
} |
|||
} |
|||
} |
|||
|
|||
private static bool DisallowsSameSiteNone(string userAgent) |
|||
{ |
|||
// Cover all iOS based browsers here. This includes:
|
|||
// - Safari on iOS 12 for iPhone, iPod Touch, iPad
|
|||
// - WkWebview on iOS 12 for iPhone, iPod Touch, iPad
|
|||
// - Chrome on iOS 12 for iPhone, iPod Touch, iPad
|
|||
// All of which are broken by SameSite=None, because they use the iOS networking stack
|
|||
if (userAgent.Contains("CPU iPhone OS 12") || userAgent.Contains("iPad; CPU OS 12")) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
// Cover Mac OS X based browsers that use the Mac OS networking stack. This includes:
|
|||
// - Safari on Mac OS X.
|
|||
// This does not include:
|
|||
// - Chrome on Mac OS X
|
|||
// Because they do not use the Mac OS networking stack.
|
|||
if (userAgent.Contains("Macintosh; Intel Mac OS X 10_14") && |
|||
userAgent.Contains("Version/") && userAgent.Contains("Safari")) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
// Cover Chrome 50-69, because some versions are broken by SameSite=None,
|
|||
// and none in this range require it.
|
|||
// Note: this covers some pre-Chromium Edge versions,
|
|||
// but pre-Chromium Edge does not require SameSite=None.
|
|||
if (userAgent.Contains("Chrome/5") || userAgent.Contains("Chrome/6")) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
return false; |
|||
} |
|||
} |
|||
} |
@ -1,7 +0,0 @@ |
|||
namespace AuthServer.Host.Services.Token; |
|||
|
|||
public class LoginModel |
|||
{ |
|||
public string UserName { get; set;} |
|||
public string Password { get; set;} |
|||
} |
@ -1,63 +0,0 @@ |
|||
using IdentityModel.Client; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using System.Net.Http; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.Account.Web.Pages.Account; |
|||
using Volo.Abp.Application.Services; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Configuration; |
|||
|
|||
namespace AuthServer.Host.Services.Token; |
|||
|
|||
[Route("/api/[controller]/[action]")]
|
|||
public class TokenService : ApplicationService |
|||
{ |
|||
private readonly IHttpContextAccessor _httpContextAccessor; |
|||
private readonly IHttpClientFactory _httpClientFactory; |
|||
private readonly ILogger<TokenService> _logger; |
|||
private readonly IConfiguration _configuration; |
|||
public TokenService(IHttpContextAccessor httpContextAccessor, IHttpClientFactory httpClientFactory, IConfiguration configuration, ILogger<TokenService> logger) |
|||
{ |
|||
this._httpContextAccessor = httpContextAccessor; |
|||
this._httpClientFactory = httpClientFactory; |
|||
this._configuration = configuration; |
|||
this._logger = logger; |
|||
} |
|||
|
|||
[HttpPost("token")] |
|||
[AllowAnonymous] |
|||
public async Task<IActionResult> CreateAsync(LoginModel model) |
|||
{ |
|||
var address = _configuration["AuthServer:Authority"]; |
|||
var clientId = _configuration["AuthServer:ClientId"]; |
|||
var clientSecret = _configuration["AuthServer:ClientSecret"]; |
|||
|
|||
var result = await _httpClientFactory.CreateClient().RequestPasswordTokenAsync(new PasswordTokenRequest |
|||
{ |
|||
Address = $"{address.TrimEnd('/')}/connect/token", |
|||
GrantType = "password", |
|||
ClientId = clientId, |
|||
ClientSecret = clientSecret, |
|||
UserName = model.UserName, |
|||
Password = model.Password |
|||
}).ConfigureAwait(false); |
|||
|
|||
return new JsonResult(new |
|||
{ |
|||
result.TokenType, |
|||
result.AccessToken, |
|||
result.ExpiresIn, |
|||
result.RefreshToken, |
|||
result.Scope, |
|||
result.HttpStatusCode, |
|||
result.Error, |
|||
result.HttpErrorReason, |
|||
result.ErrorDescription, |
|||
result.ErrorType, |
|||
result.Exception?.Message, |
|||
Exception = result.Exception?.ToString() |
|||
}); |
|||
} |
|||
} |
@ -1,22 +0,0 @@ |
|||
using System; |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.AspNetCore.Hosting; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
using Volo.Abp; |
|||
|
|||
namespace AuthServer.Host |
|||
{ |
|||
public class Startup |
|||
{ |
|||
public void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddApplication<AuthServerHostModule>(); |
|||
} |
|||
|
|||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) |
|||
{ |
|||
app.InitializeApplication(); |
|||
} |
|||
} |
|||
} |
@ -1,11 +0,0 @@ |
|||
module.exports = { |
|||
aliases: { |
|||
|
|||
}, |
|||
clean: [ |
|||
|
|||
], |
|||
mappings: { |
|||
|
|||
} |
|||
}; |
@ -1,9 +0,0 @@ |
|||
{ |
|||
"Logging": { |
|||
"LogLevel": { |
|||
"Default": "Debug", |
|||
"System": "Information", |
|||
"Microsoft": "Information" |
|||
} |
|||
} |
|||
} |
@ -1,29 +0,0 @@ |
|||
{ |
|||
"ConnectionStrings": { |
|||
"Default": "Server=dev.ccwin-in.com,13319;Database=BJABP;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True" |
|||
}, |
|||
"CorsOrigins": "http://localhost:9527,http://localhost:44307", |
|||
"ElasticSearch": { |
|||
"Url": "http://localhost:9200" |
|||
}, |
|||
"Redis": { |
|||
"Configuration": "127.0.0.1" |
|||
}, |
|||
"RabbitMQ": { |
|||
"Connections": { |
|||
"Default": { |
|||
"HostName": "localhost" |
|||
} |
|||
}, |
|||
"EventBus": { |
|||
"ClientName": "MsDemo_AuthServer", |
|||
"ExchangeName": "MsDemo" |
|||
} |
|||
}, |
|||
"Logging": { |
|||
"LogLevel": { |
|||
"Default": "Warning" |
|||
} |
|||
}, |
|||
"AllowedHosts": "*" |
|||
} |
File diff suppressed because it is too large
@ -1,8 +0,0 @@ |
|||
{ |
|||
"version": "1.0.0", |
|||
"name": "my-app-identityserver", |
|||
"private": true, |
|||
"dependencies": { |
|||
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.0.0" |
|||
} |
|||
} |
@ -1 +0,0 @@ |
|||
{"alg":"RS256","d":"R3o6B1Vv10PSuZn9Q0JBTxWULqmARJAUd8IdR9wOeohF4tJXpPbcbNXCLaV2e9usJAcEz81k-D-WIRx1hfMfifJ3pYlgVHQ_NP7U9H1OGElZ8P8xDtX5YTtIXcqPf0v-NS2BIkQjLAFpOwzYBIoQeTTLYvMKrwlSGLNWolkjd1hikiDABihdVaTSD6c2YFO5xzaCYccBhBTYElKMCcE3ThTGGfplJ9O2mC0g8Vsv0Ldc_F6p7oP-sg3X9ARuUilGP8vdJh6ZiPnRTXA8Gj0Pcran6T8uv85DnXkUCb8BkAduXAbwj-B2g_DZhs0zBtFFYc_w81-5z4lUIpcsar9kKQ","dp":"DbuS2j-f6tvmpUuvLtn1QaRN7xa82yd8TseX-l0umlebgjhpCPheHzMnmtjfsXbdb5NO1EVuZ14gFmXwBfJ_5XACq_MwihT3sLSK6JQU37iUr5zmjKQ556-HPbMtXEXuFt5WwlehN8uiQvPa7iwh47H3kFv6cmyeniltITcFmSk","dq":"mr5wHqM61RDrRJIQF-fUNe87OBNvooPA6UKXEe7LOUupilm6e7qgMBDcNSIyEgN0utw6KuNtmfTUj2IMdAMzOPnYgb7C042EnDgK_UxqXlt_vnZaTwnoQS7jJnXQLnAv6_xqC7oaadGa8HEvtjwtYoPnMwZscq8Tqi-7L6RFOSM","e":"AQAB","kid":"950552EDA53CA8F3463B378E0CEEFFA5","kty":"RSA","n":"v7eY67CIQL7fo-8Ok45OrUgDOsC6OPUtaBDQ-mCVGMam9IpTLoYqKDajhZ9cEQmeOT0XRJtdM5MamTQu4RlZdzBRDTuihUas-H-suFaxyzsivv2HJ_3oJUONhDCrbTAl5diLzi8JaPd8CLJlZFSf396FZKCnUl8v0XRPmj42MXUmG3ac3n2TIfqTvVydbQt0ZzcMsk-kxu4Ap3TZp83D-R2l8WrmXKXm3pLJs0mG3yPup7B0YlL6CHfPjwu-hPPJGlWzE7T8a78V_132qj10cjQFgAC4zbWPL5j1IWgNO0Mi3sMsiCWPlLiOz4HOFtIQ2bpXWpV3S-FNUeMXz8QrWQ","p":"6K20q7aL8fT7DJjI1oMNNdhC8CkHzXU-GSS3U7vDFEQo4-6-LAn_-Kv_3iU7MOF7h1RYZOG7fHYJTOhVgJBnPjT0WVbdqx6P3M40OizWKJnWtsXmr_f2MuyabCwmFe0YaJlj2cV21BwyvF4bIyXcg5B_OjYxIp5hm2czRNdqs2c","q":"0u7dZATB4Tu6PBmli8kX-avjelicJehd0waprO-cn2lkxzhgK2P35lHh-CoUxw_VesuFbHb0GKex25VLdG426yY7pMaLrQCftCkJnjSt9TN5IOE2TVMWDgqpXEZMYzsLy3rwbSeL3C0oCSM7xp8xJOabCP2-sdlIFd7AAuTHsz8","qi":"b7rcrKhkiUqzE6DjY7T-u-D_BAv5JU6SW0H2qH-cX85ZHeXd67S25M2dhWl_T1HScWBItJ-Bns1lXImo4kFM4mra37jWnhrB8eY-xmlw_OlJn6KKJUpMgaAEUkEmKJ24c-wfNIVSo3AdSrIYhlv2ZRDfLWbiVZfODWCoi5exkzM"} |
@ -1 +0,0 @@ |
|||
{"KeyId":"4a577ea79efd27c042a6b5289cd7e24e","Parameters":{"D":"VyCuYOq48gYJi3HpqUMJbj6QCm0e5K/prRs0q6H8jQb1jl9kzDvHiHfw7XZDvC0mekK7k3ib5Tt3IHviCv7vpL0Ajdts4ex2uvjKnYX20EtaIcz6kkVFsY1NP6OyjUlY6a6idCedw6pTybq2BG0tqCcicnDurwJDhS/R9NG6UnR3xlMAY6qOSbV/1/EGNPOlP5Pn6vcpUOXBx2l/7gMB02uMAtWysSLAR5vcl+nMg0dgCnR6Ea2hf641TDZZj8F6/fWg2UejUk9JJDVdBMR9yNHFE4PXLxLTXAA41pLu6cWJW8m5maDmSHV67fCKKArlcuWhvHSvy3WkMRVltz3kMQ==","DP":"BwIvmgmdx09DmXmPszZgKLvnAzJ4jlNC+sP2WiTVhLYLPhflwBjQ1/Orw88MJqK8xVFk8zte9fEz9eaANAxgXYfkmty3hG873TsS2VRws4anFC8WVDmtFrbfgqirgP2yBEgqY857wcKvGIb7nNBNRpa3t0huM18VzJCevn3F9/U=","DQ":"X5/ZYFlEDLVBp/w88XL6QKzY8gtzSmCaKd+iTZqren7+yp4yZWDIxldeirgIX4oirvTa+YxIxa6+Q8ilUhm9FGXiaHEYdgaaCpJGfNtxydcm6jkdSYZvJkt0uSIaU0Qsfl+aqi6nUwZDdrbk3f9NSgiQ7SubNgaSm7O08+l32eM=","Exponent":"AQAB","InverseQ":"0uInjerGTchFQ1gJYfW+003Ml8zmhiTXXZLR/ONarQYEK/hiJj0/slGVQpLuIOxFvkGgqjfraThlm5Q6+768Bv5EZ5KbhrKJ184R/nlIzFh7+9IjShf5XI7PSJmLrzX4cysaiPCFM94vZGkF4b7BabsL1TEQe5dBPZJ8tOpCa5I=","Modulus":"xU7G8MJp6Nmj8fKrkUqBlf2mRqvVjkRGmWU/gNHTepB1YQe0zoDmdIx8LF0j3Xk2Tvyekry68pV/qdURFJEGb9pmEksJkMQZ927V1+FTUBeWP666Ln4bTkJwkDtSfN4fPC70hmew1zQdeZmZBrc8BbQpIS8tHQ7rOZk9E+H8tgJbCbpLjAqWrg7gzJlgosd5xamm5XOk5R5oU+3QvkKwOLIn5RgOYzjVkkPKE+tOECPIi/2hDRCFVYwSvC5knmGP6UCHbib+mSDnloB4RMX0h95p+i3QXdeiF0daelVQUhGY56ONRqAFKqDpJzzJ/q4g9ci7sHHNUW8amJWwBgt8iQ==","P":"/uTPchvRiNBlQTr7R5x3NSQMX62RTYqOWjPexaNTeB/Q2qgumKhWe/QGvsQLCTfjmFEDyFs7kcgDSDv3RSAqUm8dFqJKmvT2Hxpvb4/GCG6crH1fp1pBZ7OZ7mjd2zvPaSdOIaa4t+TYZOB7SHDP0xtR1EPVWkBhH1BPbggFXDM=","Q":"xin88RYcPBMO6aYz/7U7wvUb/byUou64yxkzY1sqPYZYOxm5v9VfqoT5LT8wcbynDe1yLmjxwshhOTrd3rj2AQL2DdaT6xuQRJ1XHjONpW0VmaHzLtOWxc+Z2P1MzpnhoewcedrCd+XTPkr4of7o1dEGcxCOnL9FQPa8l0vfCFM="}} |
File diff suppressed because it is too large
File diff suppressed because it is too large
Binary file not shown.
Before Width: | Height: | Size: 730 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 141 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 898 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,56 +0,0 @@ |
|||
@keyframes spin { |
|||
0% { |
|||
transform: translateZ(0) rotate(0deg); |
|||
} |
|||
|
|||
100% { |
|||
transform: translateZ(0) rotate(360deg); |
|||
} |
|||
} |
|||
|
|||
.abp-block-area { |
|||
position: fixed; |
|||
top: 0; |
|||
left: 0; |
|||
width: 100%; |
|||
height: 100%; |
|||
z-index: 102; |
|||
background-color: #fff; |
|||
opacity: .8; |
|||
transition: opacity .25s; |
|||
} |
|||
|
|||
.abp-block-area.abp-block-area-disappearing { |
|||
opacity: 0; |
|||
} |
|||
|
|||
.abp-block-area.abp-block-area-busy:after { |
|||
content: attr(data-text); |
|||
display: block; |
|||
max-width: 125px; |
|||
position: absolute; |
|||
top: 50%; |
|||
left: 50%; |
|||
transform: translate(-50%, -50%); |
|||
font-size: 20px; |
|||
font-family: sans-serif; |
|||
color: #343a40; |
|||
text-align: center; |
|||
text-transform: uppercase; |
|||
} |
|||
|
|||
.abp-block-area.abp-block-area-busy:before { |
|||
content: ""; |
|||
display: block; |
|||
width: 150px; |
|||
height: 150px; |
|||
border-radius: 50%; |
|||
border-width: 2px; |
|||
border-style: solid; |
|||
border-color: transparent #228ae6 #228ae6 #228ae6; |
|||
position: absolute; |
|||
top: calc(50% - 75px); |
|||
left: calc(50% - 75px); |
|||
will-change: transform; |
|||
animation: spin .75s infinite ease-in-out; |
|||
} |
@ -1,788 +0,0 @@ |
|||
var abp = abp || {}; |
|||
(function () { |
|||
|
|||
/* Application paths *****************************************/ |
|||
|
|||
//Current application root path (including virtual directory if exists).
|
|||
abp.appPath = abp.appPath || '/'; |
|||
|
|||
abp.pageLoadTime = new Date(); |
|||
|
|||
//Converts given path to absolute path using abp.appPath variable.
|
|||
abp.toAbsAppPath = function (path) { |
|||
if (path.indexOf('/') == 0) { |
|||
path = path.substring(1); |
|||
} |
|||
|
|||
return abp.appPath + path; |
|||
}; |
|||
|
|||
/* LOGGING ***************************************************/ |
|||
//Implements Logging API that provides secure & controlled usage of console.log
|
|||
|
|||
abp.log = abp.log || {}; |
|||
|
|||
abp.log.levels = { |
|||
DEBUG: 1, |
|||
INFO: 2, |
|||
WARN: 3, |
|||
ERROR: 4, |
|||
FATAL: 5 |
|||
}; |
|||
|
|||
abp.log.level = abp.log.levels.DEBUG; |
|||
|
|||
abp.log.log = function (logObject, logLevel) { |
|||
if (!window.console || !window.console.log) { |
|||
return; |
|||
} |
|||
|
|||
if (logLevel != undefined && logLevel < abp.log.level) { |
|||
return; |
|||
} |
|||
|
|||
console.log(logObject); |
|||
}; |
|||
|
|||
abp.log.debug = function (logObject) { |
|||
abp.log.log("DEBUG: ", abp.log.levels.DEBUG); |
|||
abp.log.log(logObject, abp.log.levels.DEBUG); |
|||
}; |
|||
|
|||
abp.log.info = function (logObject) { |
|||
abp.log.log("INFO: ", abp.log.levels.INFO); |
|||
abp.log.log(logObject, abp.log.levels.INFO); |
|||
}; |
|||
|
|||
abp.log.warn = function (logObject) { |
|||
abp.log.log("WARN: ", abp.log.levels.WARN); |
|||
abp.log.log(logObject, abp.log.levels.WARN); |
|||
}; |
|||
|
|||
abp.log.error = function (logObject) { |
|||
abp.log.log("ERROR: ", abp.log.levels.ERROR); |
|||
abp.log.log(logObject, abp.log.levels.ERROR); |
|||
}; |
|||
|
|||
abp.log.fatal = function (logObject) { |
|||
abp.log.log("FATAL: ", abp.log.levels.FATAL); |
|||
abp.log.log(logObject, abp.log.levels.FATAL); |
|||
}; |
|||
|
|||
/* LOCALIZATION ***********************************************/ |
|||
|
|||
abp.localization = abp.localization || {}; |
|||
|
|||
abp.localization.values = abp.localization.values || {}; |
|||
|
|||
abp.localization.localize = function (key, sourceName) { |
|||
if (sourceName === '_') { //A convention to suppress the localization
|
|||
return key; |
|||
} |
|||
|
|||
sourceName = sourceName || abp.localization.defaultResourceName; |
|||
if (!sourceName) { |
|||
abp.log.warn('Localization source name is not specified and the defaultResourceName was not defined!'); |
|||
return key; |
|||
} |
|||
|
|||
var source = abp.localization.values[sourceName]; |
|||
if (!source) { |
|||
abp.log.warn('Could not find localization source: ' + sourceName); |
|||
return key; |
|||
} |
|||
|
|||
var value = source[key]; |
|||
if (value == undefined) { |
|||
return key; |
|||
} |
|||
|
|||
var copiedArguments = Array.prototype.slice.call(arguments, 0); |
|||
copiedArguments.splice(1, 1); |
|||
copiedArguments[0] = value; |
|||
|
|||
return abp.utils.formatString.apply(this, copiedArguments); |
|||
}; |
|||
|
|||
abp.localization.isLocalized = function (key, sourceName) { |
|||
if (sourceName === '_') { //A convention to suppress the localization
|
|||
return true; |
|||
} |
|||
|
|||
sourceName = sourceName || abp.localization.defaultResourceName; |
|||
if (!sourceName) { |
|||
return false; |
|||
} |
|||
|
|||
var source = abp.localization.values[sourceName]; |
|||
if (!source) { |
|||
return false; |
|||
} |
|||
|
|||
var value = source[key]; |
|||
if (value === undefined) { |
|||
return false; |
|||
} |
|||
|
|||
return true; |
|||
}; |
|||
|
|||
abp.localization.getResource = function (name) { |
|||
return function () { |
|||
var copiedArguments = Array.prototype.slice.call(arguments, 0); |
|||
copiedArguments.splice(1, 0, name); |
|||
return abp.localization.localize.apply(this, copiedArguments); |
|||
}; |
|||
}; |
|||
|
|||
abp.localization.defaultResourceName = undefined; |
|||
abp.localization.currentCulture = { |
|||
cultureName: undefined |
|||
}; |
|||
|
|||
var getMapValue = function (packageMaps, packageName, language) { |
|||
language = language || abp.localization.currentCulture.name; |
|||
if (!packageMaps || !packageName || !language) { |
|||
return language; |
|||
} |
|||
|
|||
var packageMap = packageMaps[packageName]; |
|||
if (!packageMap) { |
|||
return language; |
|||
} |
|||
|
|||
for (var i = 0; i < packageMap.length; i++) { |
|||
var map = packageMap[i]; |
|||
if (map.name === language){ |
|||
return map.value; |
|||
} |
|||
} |
|||
|
|||
return language; |
|||
}; |
|||
|
|||
abp.localization.getLanguagesMap = function (packageName, language) { |
|||
return getMapValue(abp.localization.languagesMap, packageName, language); |
|||
}; |
|||
|
|||
abp.localization.getLanguageFilesMap = function (packageName, language) { |
|||
return getMapValue(abp.localization.languageFilesMap, packageName, language); |
|||
}; |
|||
|
|||
/* AUTHORIZATION **********************************************/ |
|||
|
|||
abp.auth = abp.auth || {}; |
|||
|
|||
abp.auth.policies = abp.auth.policies || {}; |
|||
|
|||
abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; |
|||
|
|||
abp.auth.isGranted = function (policyName) { |
|||
return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; |
|||
}; |
|||
|
|||
abp.auth.isAnyGranted = function () { |
|||
if (!arguments || arguments.length <= 0) { |
|||
return true; |
|||
} |
|||
|
|||
for (var i = 0; i < arguments.length; i++) { |
|||
if (abp.auth.isGranted(arguments[i])) { |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
return false; |
|||
}; |
|||
|
|||
abp.auth.areAllGranted = function () { |
|||
if (!arguments || arguments.length <= 0) { |
|||
return true; |
|||
} |
|||
|
|||
for (var i = 0; i < arguments.length; i++) { |
|||
if (!abp.auth.isGranted(arguments[i])) { |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
return true; |
|||
}; |
|||
|
|||
abp.auth.tokenCookieName = 'Abp.AuthToken'; |
|||
|
|||
abp.auth.setToken = function (authToken, expireDate) { |
|||
abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); |
|||
}; |
|||
|
|||
abp.auth.getToken = function () { |
|||
return abp.utils.getCookieValue(abp.auth.tokenCookieName); |
|||
} |
|||
|
|||
abp.auth.clearToken = function () { |
|||
abp.auth.setToken(); |
|||
} |
|||
|
|||
/* SETTINGS *************************************************/ |
|||
|
|||
abp.setting = abp.setting || {}; |
|||
|
|||
abp.setting.values = abp.setting.values || {}; |
|||
|
|||
abp.setting.get = function (name) { |
|||
return abp.setting.values[name]; |
|||
}; |
|||
|
|||
abp.setting.getBoolean = function (name) { |
|||
var value = abp.setting.get(name); |
|||
return value == 'true' || value == 'True'; |
|||
}; |
|||
|
|||
abp.setting.getInt = function (name) { |
|||
return parseInt(abp.setting.values[name]); |
|||
}; |
|||
|
|||
/* NOTIFICATION *********************************************/ |
|||
//Defines Notification API, not implements it
|
|||
|
|||
abp.notify = abp.notify || {}; |
|||
|
|||
abp.notify.success = function (message, title, options) { |
|||
abp.log.warn('abp.notify.success is not implemented!'); |
|||
}; |
|||
|
|||
abp.notify.info = function (message, title, options) { |
|||
abp.log.warn('abp.notify.info is not implemented!'); |
|||
}; |
|||
|
|||
abp.notify.warn = function (message, title, options) { |
|||
abp.log.warn('abp.notify.warn is not implemented!'); |
|||
}; |
|||
|
|||
abp.notify.error = function (message, title, options) { |
|||
abp.log.warn('abp.notify.error is not implemented!'); |
|||
}; |
|||
|
|||
/* MESSAGE **************************************************/ |
|||
//Defines Message API, not implements it
|
|||
|
|||
abp.message = abp.message || {}; |
|||
|
|||
abp.message._showMessage = function (message, title) { |
|||
alert((title || '') + ' ' + message); |
|||
}; |
|||
|
|||
abp.message.info = function (message, title) { |
|||
abp.log.warn('abp.message.info is not implemented!'); |
|||
return abp.message._showMessage(message, title); |
|||
}; |
|||
|
|||
abp.message.success = function (message, title) { |
|||
abp.log.warn('abp.message.success is not implemented!'); |
|||
return abp.message._showMessage(message, title); |
|||
}; |
|||
|
|||
abp.message.warn = function (message, title) { |
|||
abp.log.warn('abp.message.warn is not implemented!'); |
|||
return abp.message._showMessage(message, title); |
|||
}; |
|||
|
|||
abp.message.error = function (message, title) { |
|||
abp.log.warn('abp.message.error is not implemented!'); |
|||
return abp.message._showMessage(message, title); |
|||
}; |
|||
|
|||
abp.message.confirm = function (message, titleOrCallback, callback) { |
|||
abp.log.warn('abp.message.confirm is not properly implemented!'); |
|||
|
|||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
|||
callback = titleOrCallback; |
|||
} |
|||
|
|||
var result = confirm(message); |
|||
callback && callback(result); |
|||
}; |
|||
|
|||
/* UI *******************************************************/ |
|||
|
|||
abp.ui = abp.ui || {}; |
|||
|
|||
/* UI BLOCK */ |
|||
//Defines UI Block API and implements basically
|
|||
|
|||
var $abpBlockArea = document.createElement('div'); |
|||
$abpBlockArea.classList.add('abp-block-area'); |
|||
|
|||
/* opts: { //Can be an object with options or a string for query a selector |
|||
* elm: a query selector (optional - default: document.body) |
|||
* busy: boolean (optional - default: false) |
|||
* promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) |
|||
* } |
|||
*/ |
|||
abp.ui.block = function (opts) { |
|||
if (!opts) { |
|||
opts = {}; |
|||
} else if (typeof opts == 'string') { |
|||
opts = { |
|||
elm: opts |
|||
}; |
|||
} |
|||
|
|||
var $elm = document.querySelector(opts.elm) || document.body; |
|||
|
|||
if (opts.busy) { |
|||
$abpBlockArea.classList.add('abp-block-area-busy'); |
|||
} else { |
|||
$abpBlockArea.classList.remove('abp-block-area-busy'); |
|||
} |
|||
|
|||
if (document.querySelector(opts.elm)) { |
|||
$abpBlockArea.style.position = 'absolute'; |
|||
} else { |
|||
$abpBlockArea.style.position = 'fixed'; |
|||
} |
|||
|
|||
$elm.appendChild($abpBlockArea); |
|||
|
|||
if (opts.promise) { |
|||
if (opts.promise.always) { //jQuery.Deferred style
|
|||
opts.promise.always(function () { |
|||
abp.ui.unblock({ |
|||
$elm: opts.elm |
|||
}); |
|||
}); |
|||
} else if (opts.promise['finally']) { //Q style
|
|||
opts.promise['finally'](function () { |
|||
abp.ui.unblock({ |
|||
$elm: opts.elm |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
}; |
|||
|
|||
/* opts: { |
|||
* |
|||
* } |
|||
*/ |
|||
abp.ui.unblock = function (opts) { |
|||
var element = document.querySelector('.abp-block-area'); |
|||
if (element) { |
|||
element.classList.add('abp-block-area-disappearing'); |
|||
setTimeout(function () { |
|||
if (element) { |
|||
element.classList.remove('abp-block-area-disappearing'); |
|||
if (element.parentElement) { |
|||
element.parentElement.removeChild(element); |
|||
} |
|||
} |
|||
}, 250); |
|||
} |
|||
}; |
|||
|
|||
/* UI BUSY */ |
|||
//Defines UI Busy API, not implements it
|
|||
|
|||
abp.ui.setBusy = function (opts) { |
|||
if (!opts) { |
|||
opts = { |
|||
busy: true |
|||
}; |
|||
} else if (typeof opts == 'string') { |
|||
opts = { |
|||
elm: opts, |
|||
busy: true |
|||
}; |
|||
} |
|||
|
|||
abp.ui.block(opts); |
|||
}; |
|||
|
|||
abp.ui.clearBusy = function (opts) { |
|||
abp.ui.unblock(opts); |
|||
}; |
|||
|
|||
/* SIMPLE EVENT BUS *****************************************/ |
|||
|
|||
abp.event = (function () { |
|||
|
|||
var _callbacks = {}; |
|||
|
|||
var on = function (eventName, callback) { |
|||
if (!_callbacks[eventName]) { |
|||
_callbacks[eventName] = []; |
|||
} |
|||
|
|||
_callbacks[eventName].push(callback); |
|||
}; |
|||
|
|||
var off = function (eventName, callback) { |
|||
var callbacks = _callbacks[eventName]; |
|||
if (!callbacks) { |
|||
return; |
|||
} |
|||
|
|||
var index = -1; |
|||
for (var i = 0; i < callbacks.length; i++) { |
|||
if (callbacks[i] === callback) { |
|||
index = i; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
if (index < 0) { |
|||
return; |
|||
} |
|||
|
|||
_callbacks[eventName].splice(index, 1); |
|||
}; |
|||
|
|||
var trigger = function (eventName) { |
|||
var callbacks = _callbacks[eventName]; |
|||
if (!callbacks || !callbacks.length) { |
|||
return; |
|||
} |
|||
|
|||
var args = Array.prototype.slice.call(arguments, 1); |
|||
for (var i = 0; i < callbacks.length; i++) { |
|||
callbacks[i].apply(this, args); |
|||
} |
|||
}; |
|||
|
|||
// Public interface ///////////////////////////////////////////////////
|
|||
|
|||
return { |
|||
on: on, |
|||
off: off, |
|||
trigger: trigger |
|||
}; |
|||
})(); |
|||
|
|||
|
|||
/* UTILS ***************************************************/ |
|||
|
|||
abp.utils = abp.utils || {}; |
|||
|
|||
/* Creates a name namespace. |
|||
* Example: |
|||
* var taskService = abp.utils.createNamespace(abp, 'services.task'); |
|||
* taskService will be equal to abp.services.task |
|||
* first argument (root) must be defined first |
|||
************************************************************/ |
|||
abp.utils.createNamespace = function (root, ns) { |
|||
var parts = ns.split('.'); |
|||
for (var i = 0; i < parts.length; i++) { |
|||
if (typeof root[parts[i]] == 'undefined') { |
|||
root[parts[i]] = {}; |
|||
} |
|||
|
|||
root = root[parts[i]]; |
|||
} |
|||
|
|||
return root; |
|||
}; |
|||
|
|||
/* Find and replaces a string (search) to another string (replacement) in |
|||
* given string (str). |
|||
* Example: |
|||
* abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' |
|||
************************************************************/ |
|||
abp.utils.replaceAll = function (str, search, replacement) { |
|||
var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); |
|||
return str.replace(new RegExp(fix, 'g'), replacement); |
|||
}; |
|||
|
|||
/* Formats a string just like string.format in C#. |
|||
* Example: |
|||
* abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' |
|||
************************************************************/ |
|||
abp.utils.formatString = function () { |
|||
if (arguments.length < 1) { |
|||
return null; |
|||
} |
|||
|
|||
var str = arguments[0]; |
|||
|
|||
for (var i = 1; i < arguments.length; i++) { |
|||
var placeHolder = '{' + (i - 1) + '}'; |
|||
str = abp.utils.replaceAll(str, placeHolder, arguments[i]); |
|||
} |
|||
|
|||
return str; |
|||
}; |
|||
|
|||
abp.utils.toPascalCase = function (str) { |
|||
if (!str || !str.length) { |
|||
return str; |
|||
} |
|||
|
|||
if (str.length === 1) { |
|||
return str.charAt(0).toUpperCase(); |
|||
} |
|||
|
|||
return str.charAt(0).toUpperCase() + str.substr(1); |
|||
} |
|||
|
|||
abp.utils.toCamelCase = function (str) { |
|||
if (!str || !str.length) { |
|||
return str; |
|||
} |
|||
|
|||
if (str.length === 1) { |
|||
return str.charAt(0).toLowerCase(); |
|||
} |
|||
|
|||
return str.charAt(0).toLowerCase() + str.substr(1); |
|||
} |
|||
|
|||
abp.utils.truncateString = function (str, maxLength) { |
|||
if (!str || !str.length || str.length <= maxLength) { |
|||
return str; |
|||
} |
|||
|
|||
return str.substr(0, maxLength); |
|||
}; |
|||
|
|||
abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { |
|||
postfix = postfix || '...'; |
|||
|
|||
if (!str || !str.length || str.length <= maxLength) { |
|||
return str; |
|||
} |
|||
|
|||
if (maxLength <= postfix.length) { |
|||
return postfix.substr(0, maxLength); |
|||
} |
|||
|
|||
return str.substr(0, maxLength - postfix.length) + postfix; |
|||
}; |
|||
|
|||
abp.utils.isFunction = function (obj) { |
|||
return !!(obj && obj.constructor && obj.call && obj.apply); |
|||
}; |
|||
|
|||
/** |
|||
* parameterInfos should be an array of { name, value } objects |
|||
* where name is query string parameter name and value is it's value. |
|||
* includeQuestionMark is true by default. |
|||
*/ |
|||
abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { |
|||
if (includeQuestionMark === undefined) { |
|||
includeQuestionMark = true; |
|||
} |
|||
|
|||
var qs = ''; |
|||
|
|||
function addSeperator() { |
|||
if (!qs.length) { |
|||
if (includeQuestionMark) { |
|||
qs = qs + '?'; |
|||
} |
|||
} else { |
|||
qs = qs + '&'; |
|||
} |
|||
} |
|||
|
|||
for (var i = 0; i < parameterInfos.length; ++i) { |
|||
var parameterInfo = parameterInfos[i]; |
|||
if (parameterInfo.value === undefined) { |
|||
continue; |
|||
} |
|||
|
|||
if (parameterInfo.value === null) { |
|||
parameterInfo.value = ''; |
|||
} |
|||
|
|||
addSeperator(); |
|||
|
|||
if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { |
|||
qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); |
|||
} else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { |
|||
for (var j = 0; j < parameterInfo.value.length; j++) { |
|||
if (j > 0) { |
|||
addSeperator(); |
|||
} |
|||
|
|||
qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); |
|||
} |
|||
} else { |
|||
qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); |
|||
} |
|||
} |
|||
|
|||
return qs; |
|||
} |
|||
|
|||
/** |
|||
* Sets a cookie value for given key. |
|||
* This is a simple implementation created to be used by ABP. |
|||
* Please use a complete cookie library if you need. |
|||
* @param {string} key |
|||
* @param {string} value |
|||
* @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. |
|||
* @param {string} path (optional) |
|||
*/ |
|||
abp.utils.setCookieValue = function (key, value, expireDate, path) { |
|||
var cookieValue = encodeURIComponent(key) + '='; |
|||
|
|||
if (value) { |
|||
cookieValue = cookieValue + encodeURIComponent(value); |
|||
} |
|||
|
|||
if (expireDate) { |
|||
cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); |
|||
} |
|||
|
|||
if (path) { |
|||
cookieValue = cookieValue + "; path=" + path; |
|||
} |
|||
|
|||
document.cookie = cookieValue; |
|||
}; |
|||
|
|||
/** |
|||
* Gets a cookie with given key. |
|||
* This is a simple implementation created to be used by ABP. |
|||
* Please use a complete cookie library if you need. |
|||
* @param {string} key |
|||
* @returns {string} Cookie value or null |
|||
*/ |
|||
abp.utils.getCookieValue = function (key) { |
|||
var equalities = document.cookie.split('; '); |
|||
for (var i = 0; i < equalities.length; i++) { |
|||
if (!equalities[i]) { |
|||
continue; |
|||
} |
|||
|
|||
var splitted = equalities[i].split('='); |
|||
if (splitted.length != 2) { |
|||
continue; |
|||
} |
|||
|
|||
if (decodeURIComponent(splitted[0]) === key) { |
|||
return decodeURIComponent(splitted[1] || ''); |
|||
} |
|||
} |
|||
|
|||
return null; |
|||
}; |
|||
|
|||
/** |
|||
* Deletes cookie for given key. |
|||
* This is a simple implementation created to be used by ABP. |
|||
* Please use a complete cookie library if you need. |
|||
* @param {string} key |
|||
* @param {string} path (optional) |
|||
*/ |
|||
abp.utils.deleteCookie = function (key, path) { |
|||
var cookieValue = encodeURIComponent(key) + '='; |
|||
|
|||
cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); |
|||
|
|||
if (path) { |
|||
cookieValue = cookieValue + "; path=" + path; |
|||
} |
|||
|
|||
document.cookie = cookieValue; |
|||
} |
|||
|
|||
/** |
|||
* Escape HTML to help prevent XSS attacks. |
|||
*/ |
|||
abp.utils.htmlEscape = function (html) { |
|||
return typeof html === 'string' ? html.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"') : html; |
|||
} |
|||
|
|||
/* SECURITY ***************************************/ |
|||
abp.security = abp.security || {}; |
|||
abp.security.antiForgery = abp.security.antiForgery || {}; |
|||
|
|||
abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; |
|||
abp.security.antiForgery.tokenHeaderName = 'RequestVerificationToken'; |
|||
|
|||
abp.security.antiForgery.getToken = function () { |
|||
return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); |
|||
}; |
|||
|
|||
/* CLOCK *****************************************/ |
|||
abp.clock = abp.clock || {}; |
|||
|
|||
abp.clock.kind = 'Unspecified'; |
|||
|
|||
abp.clock.supportsMultipleTimezone = function () { |
|||
return abp.clock.kind === 'Utc'; |
|||
}; |
|||
|
|||
var toLocal = function (date) { |
|||
return new Date( |
|||
date.getFullYear(), |
|||
date.getMonth(), |
|||
date.getDate(), |
|||
date.getHours(), |
|||
date.getMinutes(), |
|||
date.getSeconds(), |
|||
date.getMilliseconds() |
|||
); |
|||
}; |
|||
|
|||
var toUtc = function (date) { |
|||
return Date.UTC( |
|||
date.getUTCFullYear(), |
|||
date.getUTCMonth(), |
|||
date.getUTCDate(), |
|||
date.getUTCHours(), |
|||
date.getUTCMinutes(), |
|||
date.getUTCSeconds(), |
|||
date.getUTCMilliseconds() |
|||
); |
|||
}; |
|||
|
|||
abp.clock.now = function () { |
|||
if (abp.clock.kind === 'Utc') { |
|||
return toUtc(new Date()); |
|||
} |
|||
return new Date(); |
|||
}; |
|||
|
|||
abp.clock.normalize = function (date) { |
|||
var kind = abp.clock.kind; |
|||
|
|||
if (kind === 'Unspecified') { |
|||
return date; |
|||
} |
|||
|
|||
if (kind === 'Local') { |
|||
return toLocal(date); |
|||
} |
|||
|
|||
if (kind === 'Utc') { |
|||
return toUtc(date); |
|||
} |
|||
}; |
|||
|
|||
/* FEATURES *************************************************/ |
|||
|
|||
abp.features = abp.features || {}; |
|||
|
|||
abp.features.values = abp.features.values || {}; |
|||
|
|||
abp.features.isEnabled = function(name){ |
|||
var value = abp.features.get(name); |
|||
return value == 'true' || value == 'True'; |
|||
} |
|||
|
|||
abp.features.get = function (name) { |
|||
return abp.features.values[name]; |
|||
}; |
|||
|
|||
/* GLOBAL FEATURES *************************************************/ |
|||
|
|||
abp.globalFeatures = abp.globalFeatures || {}; |
|||
|
|||
abp.globalFeatures.enabledFeatures = abp.globalFeatures.enabledFeatures || []; |
|||
|
|||
abp.globalFeatures.isEnabled = function(name){ |
|||
return abp.globalFeatures.enabledFeatures.indexOf(name) != -1; |
|||
} |
|||
|
|||
})(); |
@ -1,406 +0,0 @@ |
|||
var abp = abp || {}; |
|||
(function($) { |
|||
|
|||
if (!$) { |
|||
throw "abp/jquery library requires the jquery library included to the page!"; |
|||
} |
|||
|
|||
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
|
|||
|
|||
abp.message._showMessage = function (message, title) { |
|||
alert((title || '') + ' ' + message); |
|||
|
|||
return $.Deferred(function ($dfd) { |
|||
$dfd.resolve(); |
|||
}); |
|||
}; |
|||
|
|||
abp.message.confirm = function (message, titleOrCallback, callback) { |
|||
if (titleOrCallback && !(typeof titleOrCallback == 'string')) { |
|||
callback = titleOrCallback; |
|||
} |
|||
|
|||
var result = confirm(message); |
|||
callback && callback(result); |
|||
|
|||
return $.Deferred(function ($dfd) { |
|||
$dfd.resolve(result); |
|||
}); |
|||
}; |
|||
|
|||
abp.utils.isFunction = function (obj) { |
|||
return $.isFunction(obj); |
|||
}; |
|||
|
|||
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
|
|||
|
|||
$.fn.findWithSelf = function (selector) { |
|||
return this.filter(selector).add(this.find(selector)); |
|||
}; |
|||
|
|||
// DOM ////////////////////////////////////////////////////////////////////
|
|||
|
|||
abp.dom = abp.dom || {}; |
|||
|
|||
abp.dom.onNodeAdded = function (callback) { |
|||
abp.event.on('abp.dom.nodeAdded', callback); |
|||
}; |
|||
|
|||
abp.dom.onNodeRemoved = function (callback) { |
|||
abp.event.on('abp.dom.nodeRemoved', callback); |
|||
}; |
|||
|
|||
var mutationObserverCallback = function (mutationsList) { |
|||
for (var i = 0; i < mutationsList.length; i++) { |
|||
var mutation = mutationsList[i]; |
|||
if (mutation.type === 'childList') { |
|||
if (mutation.addedNodes && mutation.removedNodes.length) { |
|||
for (var k = 0; k < mutation.removedNodes.length; k++) { |
|||
abp.event.trigger( |
|||
'abp.dom.nodeRemoved', |
|||
{ |
|||
$el: $(mutation.removedNodes[k]) |
|||
} |
|||
); |
|||
} |
|||
} |
|||
|
|||
if (mutation.addedNodes && mutation.addedNodes.length) { |
|||
for (var j = 0; j < mutation.addedNodes.length; j++) { |
|||
abp.event.trigger( |
|||
'abp.dom.nodeAdded', |
|||
{ |
|||
$el: $(mutation.addedNodes[j]) |
|||
} |
|||
); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
|
|||
$(function(){ |
|||
new MutationObserver(mutationObserverCallback).observe( |
|||
$('body')[0], |
|||
{ |
|||
subtree: true, |
|||
childList: true |
|||
} |
|||
); |
|||
}); |
|||
|
|||
// AJAX ///////////////////////////////////////////////////////////////////
|
|||
|
|||
abp.ajax = function (userOptions) { |
|||
userOptions = userOptions || {}; |
|||
|
|||
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); |
|||
|
|||
options.success = undefined; |
|||
options.error = undefined; |
|||
|
|||
var xhr = null; |
|||
var promise = $.Deferred(function ($dfd) { |
|||
xhr = $.ajax(options) |
|||
.done(function (data, textStatus, jqXHR) { |
|||
$dfd.resolve(data); |
|||
userOptions.success && userOptions.success(data); |
|||
}).fail(function (jqXHR) { |
|||
if(jqXHR.statusText === 'abort') { |
|||
//ajax request is abort, ignore error handle.
|
|||
return; |
|||
} |
|||
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { |
|||
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); |
|||
} else { |
|||
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); |
|||
} |
|||
}); |
|||
}).promise(); |
|||
|
|||
promise['jqXHR'] = xhr; |
|||
|
|||
return promise; |
|||
}; |
|||
|
|||
$.extend(abp.ajax, { |
|||
defaultOpts: { |
|||
dataType: 'json', |
|||
type: 'POST', |
|||
contentType: 'application/json', |
|||
headers: { |
|||
'X-Requested-With': 'XMLHttpRequest' |
|||
} |
|||
}, |
|||
|
|||
defaultError: { |
|||
message: 'An error has occurred!', |
|||
details: 'Error detail not sent by server.' |
|||
}, |
|||
|
|||
defaultError401: { |
|||
message: 'You are not authenticated!', |
|||
details: 'You should be authenticated (sign in) in order to perform this operation.' |
|||
}, |
|||
|
|||
defaultError403: { |
|||
message: 'You are not authorized!', |
|||
details: 'You are not allowed to perform this operation.' |
|||
}, |
|||
|
|||
defaultError404: { |
|||
message: 'Resource not found!', |
|||
details: 'The resource requested could not found on the server.' |
|||
}, |
|||
|
|||
logError: function (error) { |
|||
abp.log.error(error); |
|||
}, |
|||
|
|||
showError: function (error) { |
|||
if (error.details) { |
|||
return abp.message.error(error.details, error.message); |
|||
} else { |
|||
return abp.message.error(error.message || abp.ajax.defaultError.message); |
|||
} |
|||
}, |
|||
|
|||
handleTargetUrl: function (targetUrl) { |
|||
if (!targetUrl) { |
|||
location.href = abp.appPath; |
|||
} else { |
|||
location.href = targetUrl; |
|||
} |
|||
}, |
|||
|
|||
handleErrorStatusCode: function (status) { |
|||
switch (status) { |
|||
case 401: |
|||
abp.ajax.handleUnAuthorizedRequest( |
|||
abp.ajax.showError(abp.ajax.defaultError401), |
|||
abp.appPath |
|||
); |
|||
break; |
|||
case 403: |
|||
abp.ajax.showError(abp.ajax.defaultError403); |
|||
break; |
|||
case 404: |
|||
abp.ajax.showError(abp.ajax.defaultError404); |
|||
break; |
|||
default: |
|||
abp.ajax.showError(abp.ajax.defaultError); |
|||
break; |
|||
} |
|||
}, |
|||
|
|||
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
|||
if (userOptions.abpHandleError !== false) { |
|||
abp.ajax.handleErrorStatusCode(jqXHR.status); |
|||
} |
|||
|
|||
$dfd.reject.apply(this, arguments); |
|||
userOptions.error && userOptions.error.apply(this, arguments); |
|||
}, |
|||
|
|||
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
|||
var messagePromise = null; |
|||
|
|||
var responseJSON = jqXHR.responseJSON ? jqXHR.responseJSON : JSON.parse(jqXHR.responseText); |
|||
|
|||
if (userOptions.abpHandleError !== false) { |
|||
messagePromise = abp.ajax.showError(responseJSON.error); |
|||
} |
|||
|
|||
abp.ajax.logError(responseJSON.error); |
|||
|
|||
$dfd && $dfd.reject(responseJSON.error, jqXHR); |
|||
userOptions.error && userOptions.error(responseJSON.error, jqXHR); |
|||
|
|||
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
|||
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
|||
} |
|||
}, |
|||
|
|||
handleUnAuthorizedRequest: function (messagePromise, targetUrl) { |
|||
if (messagePromise) { |
|||
messagePromise.done(function () { |
|||
abp.ajax.handleTargetUrl(targetUrl); |
|||
}); |
|||
} else { |
|||
abp.ajax.handleTargetUrl(targetUrl); |
|||
} |
|||
}, |
|||
|
|||
blockUI: function (options) { |
|||
if (options.blockUI) { |
|||
if (options.blockUI === true) { //block whole page
|
|||
abp.ui.setBusy(); |
|||
} else { //block an element
|
|||
abp.ui.setBusy(options.blockUI); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
unblockUI: function (options) { |
|||
if (options.blockUI) { |
|||
if (options.blockUI === true) { //unblock whole page
|
|||
abp.ui.clearBusy(); |
|||
} else { //unblock an element
|
|||
abp.ui.clearBusy(options.blockUI); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
ajaxSendHandler: function (event, request, settings) { |
|||
var token = abp.security.antiForgery.getToken(); |
|||
if (!token) { |
|||
return; |
|||
} |
|||
|
|||
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { |
|||
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
$(document).ajaxSend(function (event, request, settings) { |
|||
return abp.ajax.ajaxSendHandler(event, request, settings); |
|||
}); |
|||
|
|||
abp.event.on('abp.configurationInitialized', function () { |
|||
var l = abp.localization.getResource('AbpUi'); |
|||
|
|||
abp.ajax.defaultError.message = l('DefaultErrorMessage'); |
|||
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); |
|||
abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); |
|||
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); |
|||
abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); |
|||
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); |
|||
abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); |
|||
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); |
|||
}); |
|||
|
|||
// RESOURCE LOADER ////////////////////////////////////////////////////////
|
|||
|
|||
/* UrlStates enum */ |
|||
var UrlStates = { |
|||
LOADING: 'LOADING', |
|||
LOADED: 'LOADED', |
|||
FAILED: 'FAILED' |
|||
}; |
|||
|
|||
/* UrlInfo class */ |
|||
function UrlInfo(url) { |
|||
this.url = url; |
|||
this.state = UrlStates.LOADING; |
|||
this.loadCallbacks = []; |
|||
this.failCallbacks = []; |
|||
} |
|||
|
|||
UrlInfo.prototype.succeed = function () { |
|||
this.state = UrlStates.LOADED; |
|||
for (var i = 0; i < this.loadCallbacks.length; i++) { |
|||
this.loadCallbacks[i](); |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.failed = function () { |
|||
this.state = UrlStates.FAILED; |
|||
for (var i = 0; i < this.failCallbacks.length; i++) { |
|||
this.failCallbacks[i](); |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
|||
switch (this.state) { |
|||
case UrlStates.LOADED: |
|||
loadCallback && loadCallback(); |
|||
break; |
|||
case UrlStates.FAILED: |
|||
failCallback && failCallback(); |
|||
break; |
|||
case UrlStates.LOADING: |
|||
this.addCallbacks(loadCallback, failCallback); |
|||
break; |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
|||
loadCallback && this.loadCallbacks.push(loadCallback); |
|||
failCallback && this.failCallbacks.push(failCallback); |
|||
}; |
|||
|
|||
/* ResourceLoader API */ |
|||
|
|||
abp.ResourceLoader = (function () { |
|||
|
|||
var _urlInfos = {}; |
|||
|
|||
function getCacheKey(url) { |
|||
return url; |
|||
} |
|||
|
|||
function appendTimeToUrl(url) { |
|||
|
|||
if (url.indexOf('?') < 0) { |
|||
url += '?'; |
|||
} else { |
|||
url += '&'; |
|||
} |
|||
|
|||
url += '_=' + new Date().getTime(); |
|||
|
|||
return url; |
|||
} |
|||
|
|||
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { |
|||
|
|||
var cacheKey = getCacheKey(url); |
|||
|
|||
var urlInfo = _urlInfos[cacheKey]; |
|||
|
|||
if (urlInfo) { |
|||
urlInfo.handleCallbacks(loadCallback, failCallback); |
|||
return; |
|||
} |
|||
|
|||
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url); |
|||
urlInfo.addCallbacks(loadCallback, failCallback); |
|||
|
|||
serverLoader(urlInfo); |
|||
}; |
|||
|
|||
var _loadScript = function (url, loadCallback, failCallback) { |
|||
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { |
|||
$.get({ |
|||
url: url, |
|||
dataType: 'text' |
|||
}) |
|||
.done(function (script) { |
|||
$.globalEval(script); |
|||
urlInfo.succeed(); |
|||
}) |
|||
.fail(function () { |
|||
urlInfo.failed(); |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
var _loadStyle = function (url) { |
|||
_loadFromUrl(url, undefined, undefined, function (urlInfo) { |
|||
|
|||
$('<link/>', { |
|||
rel: 'stylesheet', |
|||
type: 'text/css', |
|||
href: appendTimeToUrl(url) |
|||
}).appendTo('head'); |
|||
}); |
|||
}; |
|||
|
|||
return { |
|||
loadScript: _loadScript, |
|||
loadStyle: _loadStyle |
|||
} |
|||
})(); |
|||
|
|||
})(jQuery); |
@ -1,46 +0,0 @@ |
|||
var abp = abp || {}; |
|||
(function () { |
|||
|
|||
if (!luxon) { |
|||
throw "abp/luxon library requires the luxon library included to the page!"; |
|||
} |
|||
|
|||
/* TIMING *************************************************/ |
|||
|
|||
abp.timing = abp.timing || {}; |
|||
|
|||
var setObjectValue = function (obj, property, value) { |
|||
if (typeof property === "string") { |
|||
property = property.split('.'); |
|||
} |
|||
|
|||
if (property.length > 1) { |
|||
var p = property.shift(); |
|||
setObjectValue(obj[p], property, value); |
|||
} else { |
|||
obj[property[0]] = value; |
|||
} |
|||
} |
|||
|
|||
var getObjectValue = function (obj, property) { |
|||
return property.split('.').reduce((a, v) => a[v], obj) |
|||
} |
|||
|
|||
abp.timing.convertFieldsToIsoDate = function (form, fields) { |
|||
for (var field of fields) { |
|||
var dateTime = luxon.DateTime |
|||
.fromFormat( |
|||
getObjectValue(form, field), |
|||
abp.localization.currentCulture.dateTimeFormat.shortDatePattern, |
|||
{locale: abp.localization.currentCulture.cultureName} |
|||
); |
|||
|
|||
if (!dateTime.invalid) { |
|||
setObjectValue(form, field, dateTime.toFormat("yyyy-MM-dd HH:mm:ss")) |
|||
} |
|||
} |
|||
|
|||
return form; |
|||
} |
|||
|
|||
})(jQuery); |
@ -1,694 +0,0 @@ |
|||
(function (global, factory) { |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('just-compare')) : |
|||
typeof define === 'function' && define.amd ? define('@abp/utils', ['exports', 'just-compare'], factory) : |
|||
(global = global || self, factory((global.abp = global.abp || {}, global.abp.utils = global.abp.utils || {}, global.abp.utils.common = {}), global.compare)); |
|||
}(this, (function (exports, compare) { 'use strict'; |
|||
|
|||
compare = compare && Object.prototype.hasOwnProperty.call(compare, 'default') ? compare['default'] : compare; |
|||
|
|||
/*! ***************************************************************************** |
|||
Copyright (c) Microsoft Corporation. |
|||
|
|||
Permission to use, copy, modify, and/or distribute this software for any |
|||
purpose with or without fee is hereby granted. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH |
|||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
|||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, |
|||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
|||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR |
|||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
|||
PERFORMANCE OF THIS SOFTWARE. |
|||
***************************************************************************** */ |
|||
/* global Reflect, Promise */ |
|||
var extendStatics = function (d, b) { |
|||
extendStatics = Object.setPrototypeOf || |
|||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
|||
function (d, b) { for (var p in b) |
|||
if (b.hasOwnProperty(p)) |
|||
d[p] = b[p]; }; |
|||
return extendStatics(d, b); |
|||
}; |
|||
function __extends(d, b) { |
|||
extendStatics(d, b); |
|||
function __() { this.constructor = d; } |
|||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
|||
} |
|||
var __assign = function () { |
|||
__assign = Object.assign || function __assign(t) { |
|||
for (var s, i = 1, n = arguments.length; i < n; i++) { |
|||
s = arguments[i]; |
|||
for (var p in s) |
|||
if (Object.prototype.hasOwnProperty.call(s, p)) |
|||
t[p] = s[p]; |
|||
} |
|||
return t; |
|||
}; |
|||
return __assign.apply(this, arguments); |
|||
}; |
|||
function __rest(s, e) { |
|||
var t = {}; |
|||
for (var p in s) |
|||
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) |
|||
t[p] = s[p]; |
|||
if (s != null && typeof Object.getOwnPropertySymbols === "function") |
|||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { |
|||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) |
|||
t[p[i]] = s[p[i]]; |
|||
} |
|||
return t; |
|||
} |
|||
function __decorate(decorators, target, key, desc) { |
|||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
|||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") |
|||
r = Reflect.decorate(decorators, target, key, desc); |
|||
else |
|||
for (var i = decorators.length - 1; i >= 0; i--) |
|||
if (d = decorators[i]) |
|||
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
|||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
|||
} |
|||
function __param(paramIndex, decorator) { |
|||
return function (target, key) { decorator(target, key, paramIndex); }; |
|||
} |
|||
function __metadata(metadataKey, metadataValue) { |
|||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") |
|||
return Reflect.metadata(metadataKey, metadataValue); |
|||
} |
|||
function __awaiter(thisArg, _arguments, P, generator) { |
|||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } |
|||
return new (P || (P = Promise))(function (resolve, reject) { |
|||
function fulfilled(value) { try { |
|||
step(generator.next(value)); |
|||
} |
|||
catch (e) { |
|||
reject(e); |
|||
} } |
|||
function rejected(value) { try { |
|||
step(generator["throw"](value)); |
|||
} |
|||
catch (e) { |
|||
reject(e); |
|||
} } |
|||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } |
|||
step((generator = generator.apply(thisArg, _arguments || [])).next()); |
|||
}); |
|||
} |
|||
function __generator(thisArg, body) { |
|||
var _ = { label: 0, sent: function () { if (t[0] & 1) |
|||
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; |
|||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; |
|||
function verb(n) { return function (v) { return step([n, v]); }; } |
|||
function step(op) { |
|||
if (f) |
|||
throw new TypeError("Generator is already executing."); |
|||
while (_) |
|||
try { |
|||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) |
|||
return t; |
|||
if (y = 0, t) |
|||
op = [op[0] & 2, t.value]; |
|||
switch (op[0]) { |
|||
case 0: |
|||
case 1: |
|||
t = op; |
|||
break; |
|||
case 4: |
|||
_.label++; |
|||
return { value: op[1], done: false }; |
|||
case 5: |
|||
_.label++; |
|||
y = op[1]; |
|||
op = [0]; |
|||
continue; |
|||
case 7: |
|||
op = _.ops.pop(); |
|||
_.trys.pop(); |
|||
continue; |
|||
default: |
|||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { |
|||
_ = 0; |
|||
continue; |
|||
} |
|||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { |
|||
_.label = op[1]; |
|||
break; |
|||
} |
|||
if (op[0] === 6 && _.label < t[1]) { |
|||
_.label = t[1]; |
|||
t = op; |
|||
break; |
|||
} |
|||
if (t && _.label < t[2]) { |
|||
_.label = t[2]; |
|||
_.ops.push(op); |
|||
break; |
|||
} |
|||
if (t[2]) |
|||
_.ops.pop(); |
|||
_.trys.pop(); |
|||
continue; |
|||
} |
|||
op = body.call(thisArg, _); |
|||
} |
|||
catch (e) { |
|||
op = [6, e]; |
|||
y = 0; |
|||
} |
|||
finally { |
|||
f = t = 0; |
|||
} |
|||
if (op[0] & 5) |
|||
throw op[1]; |
|||
return { value: op[0] ? op[1] : void 0, done: true }; |
|||
} |
|||
} |
|||
var __createBinding = Object.create ? (function (o, m, k, k2) { |
|||
if (k2 === undefined) |
|||
k2 = k; |
|||
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); |
|||
}) : (function (o, m, k, k2) { |
|||
if (k2 === undefined) |
|||
k2 = k; |
|||
o[k2] = m[k]; |
|||
}); |
|||
function __exportStar(m, exports) { |
|||
for (var p in m) |
|||
if (p !== "default" && !exports.hasOwnProperty(p)) |
|||
__createBinding(exports, m, p); |
|||
} |
|||
function __values(o) { |
|||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; |
|||
if (m) |
|||
return m.call(o); |
|||
if (o && typeof o.length === "number") |
|||
return { |
|||
next: function () { |
|||
if (o && i >= o.length) |
|||
o = void 0; |
|||
return { value: o && o[i++], done: !o }; |
|||
} |
|||
}; |
|||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); |
|||
} |
|||
function __read(o, n) { |
|||
var m = typeof Symbol === "function" && o[Symbol.iterator]; |
|||
if (!m) |
|||
return o; |
|||
var i = m.call(o), r, ar = [], e; |
|||
try { |
|||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) |
|||
ar.push(r.value); |
|||
} |
|||
catch (error) { |
|||
e = { error: error }; |
|||
} |
|||
finally { |
|||
try { |
|||
if (r && !r.done && (m = i["return"])) |
|||
m.call(i); |
|||
} |
|||
finally { |
|||
if (e) |
|||
throw e.error; |
|||
} |
|||
} |
|||
return ar; |
|||
} |
|||
function __spread() { |
|||
for (var ar = [], i = 0; i < arguments.length; i++) |
|||
ar = ar.concat(__read(arguments[i])); |
|||
return ar; |
|||
} |
|||
function __spreadArrays() { |
|||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) |
|||
s += arguments[i].length; |
|||
for (var r = Array(s), k = 0, i = 0; i < il; i++) |
|||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) |
|||
r[k] = a[j]; |
|||
return r; |
|||
} |
|||
; |
|||
function __await(v) { |
|||
return this instanceof __await ? (this.v = v, this) : new __await(v); |
|||
} |
|||
function __asyncGenerator(thisArg, _arguments, generator) { |
|||
if (!Symbol.asyncIterator) |
|||
throw new TypeError("Symbol.asyncIterator is not defined."); |
|||
var g = generator.apply(thisArg, _arguments || []), i, q = []; |
|||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; |
|||
function verb(n) { if (g[n]) |
|||
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } |
|||
function resume(n, v) { try { |
|||
step(g[n](v)); |
|||
} |
|||
catch (e) { |
|||
settle(q[0][3], e); |
|||
} } |
|||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } |
|||
function fulfill(value) { resume("next", value); } |
|||
function reject(value) { resume("throw", value); } |
|||
function settle(f, v) { if (f(v), q.shift(), q.length) |
|||
resume(q[0][0], q[0][1]); } |
|||
} |
|||
function __asyncDelegator(o) { |
|||
var i, p; |
|||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; |
|||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } |
|||
} |
|||
function __asyncValues(o) { |
|||
if (!Symbol.asyncIterator) |
|||
throw new TypeError("Symbol.asyncIterator is not defined."); |
|||
var m = o[Symbol.asyncIterator], i; |
|||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); |
|||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } |
|||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } |
|||
} |
|||
function __makeTemplateObject(cooked, raw) { |
|||
if (Object.defineProperty) { |
|||
Object.defineProperty(cooked, "raw", { value: raw }); |
|||
} |
|||
else { |
|||
cooked.raw = raw; |
|||
} |
|||
return cooked; |
|||
} |
|||
; |
|||
var __setModuleDefault = Object.create ? (function (o, v) { |
|||
Object.defineProperty(o, "default", { enumerable: true, value: v }); |
|||
}) : function (o, v) { |
|||
o["default"] = v; |
|||
}; |
|||
function __importStar(mod) { |
|||
if (mod && mod.__esModule) |
|||
return mod; |
|||
var result = {}; |
|||
if (mod != null) |
|||
for (var k in mod) |
|||
if (Object.hasOwnProperty.call(mod, k)) |
|||
__createBinding(result, mod, k); |
|||
__setModuleDefault(result, mod); |
|||
return result; |
|||
} |
|||
function __importDefault(mod) { |
|||
return (mod && mod.__esModule) ? mod : { default: mod }; |
|||
} |
|||
function __classPrivateFieldGet(receiver, privateMap) { |
|||
if (!privateMap.has(receiver)) { |
|||
throw new TypeError("attempted to get private field on non-instance"); |
|||
} |
|||
return privateMap.get(receiver); |
|||
} |
|||
function __classPrivateFieldSet(receiver, privateMap, value) { |
|||
if (!privateMap.has(receiver)) { |
|||
throw new TypeError("attempted to set private field on non-instance"); |
|||
} |
|||
privateMap.set(receiver, value); |
|||
return value; |
|||
} |
|||
|
|||
var ListNode = /** @class */ (function () { |
|||
function ListNode(value) { |
|||
this.value = value; |
|||
} |
|||
return ListNode; |
|||
}()); |
|||
var LinkedList = /** @class */ (function () { |
|||
function LinkedList() { |
|||
this.size = 0; |
|||
} |
|||
Object.defineProperty(LinkedList.prototype, "head", { |
|||
get: function () { |
|||
return this.first; |
|||
}, |
|||
enumerable: false, |
|||
configurable: true |
|||
}); |
|||
Object.defineProperty(LinkedList.prototype, "tail", { |
|||
get: function () { |
|||
return this.last; |
|||
}, |
|||
enumerable: false, |
|||
configurable: true |
|||
}); |
|||
Object.defineProperty(LinkedList.prototype, "length", { |
|||
get: function () { |
|||
return this.size; |
|||
}, |
|||
enumerable: false, |
|||
configurable: true |
|||
}); |
|||
LinkedList.prototype.attach = function (value, previousNode, nextNode) { |
|||
if (!previousNode) |
|||
return this.addHead(value); |
|||
if (!nextNode) |
|||
return this.addTail(value); |
|||
var node = new ListNode(value); |
|||
node.previous = previousNode; |
|||
previousNode.next = node; |
|||
node.next = nextNode; |
|||
nextNode.previous = node; |
|||
this.size++; |
|||
return node; |
|||
}; |
|||
LinkedList.prototype.attachMany = function (values, previousNode, nextNode) { |
|||
if (!values.length) |
|||
return []; |
|||
if (!previousNode) |
|||
return this.addManyHead(values); |
|||
if (!nextNode) |
|||
return this.addManyTail(values); |
|||
var list = new LinkedList(); |
|||
list.addManyTail(values); |
|||
list.first.previous = previousNode; |
|||
previousNode.next = list.first; |
|||
list.last.next = nextNode; |
|||
nextNode.previous = list.last; |
|||
this.size += values.length; |
|||
return list.toNodeArray(); |
|||
}; |
|||
LinkedList.prototype.detach = function (node) { |
|||
if (!node.previous) |
|||
return this.dropHead(); |
|||
if (!node.next) |
|||
return this.dropTail(); |
|||
node.previous.next = node.next; |
|||
node.next.previous = node.previous; |
|||
this.size--; |
|||
return node; |
|||
}; |
|||
LinkedList.prototype.add = function (value) { |
|||
var _this = this; |
|||
return { |
|||
after: function () { |
|||
var _a; |
|||
var params = []; |
|||
for (var _i = 0; _i < arguments.length; _i++) { |
|||
params[_i] = arguments[_i]; |
|||
} |
|||
return (_a = _this.addAfter).call.apply(_a, __spread([_this, value], params)); |
|||
}, |
|||
before: function () { |
|||
var _a; |
|||
var params = []; |
|||
for (var _i = 0; _i < arguments.length; _i++) { |
|||
params[_i] = arguments[_i]; |
|||
} |
|||
return (_a = _this.addBefore).call.apply(_a, __spread([_this, value], params)); |
|||
}, |
|||
byIndex: function (position) { return _this.addByIndex(value, position); }, |
|||
head: function () { return _this.addHead(value); }, |
|||
tail: function () { return _this.addTail(value); }, |
|||
}; |
|||
}; |
|||
LinkedList.prototype.addMany = function (values) { |
|||
var _this = this; |
|||
return { |
|||
after: function () { |
|||
var _a; |
|||
var params = []; |
|||
for (var _i = 0; _i < arguments.length; _i++) { |
|||
params[_i] = arguments[_i]; |
|||
} |
|||
return (_a = _this.addManyAfter).call.apply(_a, __spread([_this, values], params)); |
|||
}, |
|||
before: function () { |
|||
var _a; |
|||
var params = []; |
|||
for (var _i = 0; _i < arguments.length; _i++) { |
|||
params[_i] = arguments[_i]; |
|||
} |
|||
return (_a = _this.addManyBefore).call.apply(_a, __spread([_this, values], params)); |
|||
}, |
|||
byIndex: function (position) { return _this.addManyByIndex(values, position); }, |
|||
head: function () { return _this.addManyHead(values); }, |
|||
tail: function () { return _this.addManyTail(values); }, |
|||
}; |
|||
}; |
|||
LinkedList.prototype.addAfter = function (value, previousValue, compareFn) { |
|||
if (compareFn === void 0) { compareFn = compare; } |
|||
var previous = this.find(function (node) { return compareFn(node.value, previousValue); }); |
|||
return previous ? this.attach(value, previous, previous.next) : this.addTail(value); |
|||
}; |
|||
LinkedList.prototype.addBefore = function (value, nextValue, compareFn) { |
|||
if (compareFn === void 0) { compareFn = compare; } |
|||
var next = this.find(function (node) { return compareFn(node.value, nextValue); }); |
|||
return next ? this.attach(value, next.previous, next) : this.addHead(value); |
|||
}; |
|||
LinkedList.prototype.addByIndex = function (value, position) { |
|||
if (position < 0) |
|||
position += this.size; |
|||
else if (position >= this.size) |
|||
return this.addTail(value); |
|||
if (position <= 0) |
|||
return this.addHead(value); |
|||
var next = this.get(position); |
|||
return this.attach(value, next.previous, next); |
|||
}; |
|||
LinkedList.prototype.addHead = function (value) { |
|||
var node = new ListNode(value); |
|||
node.next = this.first; |
|||
if (this.first) |
|||
this.first.previous = node; |
|||
else |
|||
this.last = node; |
|||
this.first = node; |
|||
this.size++; |
|||
return node; |
|||
}; |
|||
LinkedList.prototype.addTail = function (value) { |
|||
var node = new ListNode(value); |
|||
if (this.first) { |
|||
node.previous = this.last; |
|||
this.last.next = node; |
|||
this.last = node; |
|||
} |
|||
else { |
|||
this.first = node; |
|||
this.last = node; |
|||
} |
|||
this.size++; |
|||
return node; |
|||
}; |
|||
LinkedList.prototype.addManyAfter = function (values, previousValue, compareFn) { |
|||
if (compareFn === void 0) { compareFn = compare; } |
|||
var previous = this.find(function (node) { return compareFn(node.value, previousValue); }); |
|||
return previous ? this.attachMany(values, previous, previous.next) : this.addManyTail(values); |
|||
}; |
|||
LinkedList.prototype.addManyBefore = function (values, nextValue, compareFn) { |
|||
if (compareFn === void 0) { compareFn = compare; } |
|||
var next = this.find(function (node) { return compareFn(node.value, nextValue); }); |
|||
return next ? this.attachMany(values, next.previous, next) : this.addManyHead(values); |
|||
}; |
|||
LinkedList.prototype.addManyByIndex = function (values, position) { |
|||
if (position < 0) |
|||
position += this.size; |
|||
if (position <= 0) |
|||
return this.addManyHead(values); |
|||
if (position >= this.size) |
|||
return this.addManyTail(values); |
|||
var next = this.get(position); |
|||
return this.attachMany(values, next.previous, next); |
|||
}; |
|||
LinkedList.prototype.addManyHead = function (values) { |
|||
var _this = this; |
|||
return values.reduceRight(function (nodes, value) { |
|||
nodes.unshift(_this.addHead(value)); |
|||
return nodes; |
|||
}, []); |
|||
}; |
|||
LinkedList.prototype.addManyTail = function (values) { |
|||
var _this = this; |
|||
return values.map(function (value) { return _this.addTail(value); }); |
|||
}; |
|||
LinkedList.prototype.drop = function () { |
|||
var _this = this; |
|||
return { |
|||
byIndex: function (position) { return _this.dropByIndex(position); }, |
|||
byValue: function () { |
|||
var params = []; |
|||
for (var _i = 0; _i < arguments.length; _i++) { |
|||
params[_i] = arguments[_i]; |
|||
} |
|||
return _this.dropByValue.apply(_this, params); |
|||
}, |
|||
byValueAll: function () { |
|||
var params = []; |
|||
for (var _i = 0; _i < arguments.length; _i++) { |
|||
params[_i] = arguments[_i]; |
|||
} |
|||
return _this.dropByValueAll.apply(_this, params); |
|||
}, |
|||
head: function () { return _this.dropHead(); }, |
|||
tail: function () { return _this.dropTail(); }, |
|||
}; |
|||
}; |
|||
LinkedList.prototype.dropMany = function (count) { |
|||
var _this = this; |
|||
return { |
|||
byIndex: function (position) { return _this.dropManyByIndex(count, position); }, |
|||
head: function () { return _this.dropManyHead(count); }, |
|||
tail: function () { return _this.dropManyTail(count); }, |
|||
}; |
|||
}; |
|||
LinkedList.prototype.dropByIndex = function (position) { |
|||
if (position < 0) |
|||
position += this.size; |
|||
var current = this.get(position); |
|||
return current ? this.detach(current) : undefined; |
|||
}; |
|||
LinkedList.prototype.dropByValue = function (value, compareFn) { |
|||
if (compareFn === void 0) { compareFn = compare; } |
|||
var position = this.findIndex(function (node) { return compareFn(node.value, value); }); |
|||
return position < 0 ? undefined : this.dropByIndex(position); |
|||
}; |
|||
LinkedList.prototype.dropByValueAll = function (value, compareFn) { |
|||
if (compareFn === void 0) { compareFn = compare; } |
|||
var dropped = []; |
|||
for (var current = this.first, position = 0; current; position++, current = current.next) { |
|||
if (compareFn(current.value, value)) { |
|||
dropped.push(this.dropByIndex(position - dropped.length)); |
|||
} |
|||
} |
|||
return dropped; |
|||
}; |
|||
LinkedList.prototype.dropHead = function () { |
|||
var head = this.first; |
|||
if (head) { |
|||
this.first = head.next; |
|||
if (this.first) |
|||
this.first.previous = undefined; |
|||
else |
|||
this.last = undefined; |
|||
this.size--; |
|||
return head; |
|||
} |
|||
return undefined; |
|||
}; |
|||
LinkedList.prototype.dropTail = function () { |
|||
var tail = this.last; |
|||
if (tail) { |
|||
this.last = tail.previous; |
|||
if (this.last) |
|||
this.last.next = undefined; |
|||
else |
|||
this.first = undefined; |
|||
this.size--; |
|||
return tail; |
|||
} |
|||
return undefined; |
|||
}; |
|||
LinkedList.prototype.dropManyByIndex = function (count, position) { |
|||
if (count <= 0) |
|||
return []; |
|||
if (position < 0) |
|||
position = Math.max(position + this.size, 0); |
|||
else if (position >= this.size) |
|||
return []; |
|||
count = Math.min(count, this.size - position); |
|||
var dropped = []; |
|||
while (count--) { |
|||
var current = this.get(position); |
|||
dropped.push(this.detach(current)); |
|||
} |
|||
return dropped; |
|||
}; |
|||
LinkedList.prototype.dropManyHead = function (count) { |
|||
if (count <= 0) |
|||
return []; |
|||
count = Math.min(count, this.size); |
|||
var dropped = []; |
|||
while (count--) |
|||
dropped.unshift(this.dropHead()); |
|||
return dropped; |
|||
}; |
|||
LinkedList.prototype.dropManyTail = function (count) { |
|||
if (count <= 0) |
|||
return []; |
|||
count = Math.min(count, this.size); |
|||
var dropped = []; |
|||
while (count--) |
|||
dropped.push(this.dropTail()); |
|||
return dropped; |
|||
}; |
|||
LinkedList.prototype.find = function (predicate) { |
|||
for (var current = this.first, position = 0; current; position++, current = current.next) { |
|||
if (predicate(current, position, this)) |
|||
return current; |
|||
} |
|||
return undefined; |
|||
}; |
|||
LinkedList.prototype.findIndex = function (predicate) { |
|||
for (var current = this.first, position = 0; current; position++, current = current.next) { |
|||
if (predicate(current, position, this)) |
|||
return position; |
|||
} |
|||
return -1; |
|||
}; |
|||
LinkedList.prototype.forEach = function (iteratorFn) { |
|||
for (var node = this.first, position = 0; node; position++, node = node.next) { |
|||
iteratorFn(node, position, this); |
|||
} |
|||
}; |
|||
LinkedList.prototype.get = function (position) { |
|||
return this.find(function (_, index) { return position === index; }); |
|||
}; |
|||
LinkedList.prototype.indexOf = function (value, compareFn) { |
|||
if (compareFn === void 0) { compareFn = compare; } |
|||
return this.findIndex(function (node) { return compareFn(node.value, value); }); |
|||
}; |
|||
LinkedList.prototype.toArray = function () { |
|||
var array = new Array(this.size); |
|||
this.forEach(function (node, index) { return (array[index] = node.value); }); |
|||
return array; |
|||
}; |
|||
LinkedList.prototype.toNodeArray = function () { |
|||
var array = new Array(this.size); |
|||
this.forEach(function (node, index) { return (array[index] = node); }); |
|||
return array; |
|||
}; |
|||
LinkedList.prototype.toString = function (mapperFn) { |
|||
if (mapperFn === void 0) { mapperFn = JSON.stringify; } |
|||
return this.toArray() |
|||
.map(function (value) { return mapperFn(value); }) |
|||
.join(' <-> '); |
|||
}; |
|||
// Cannot use Generator type because of ng-packagr
|
|||
LinkedList.prototype[Symbol.iterator] = function () { |
|||
var node, position; |
|||
return __generator(this, function (_a) { |
|||
switch (_a.label) { |
|||
case 0: |
|||
node = this.first, position = 0; |
|||
_a.label = 1; |
|||
case 1: |
|||
if (!node) return [3 /*break*/, 4]; |
|||
return [4 /*yield*/, node.value]; |
|||
case 2: |
|||
_a.sent(); |
|||
_a.label = 3; |
|||
case 3: |
|||
position++, node = node.next; |
|||
return [3 /*break*/, 1]; |
|||
case 4: return [2 /*return*/]; |
|||
} |
|||
}); |
|||
}; |
|||
return LinkedList; |
|||
}()); |
|||
|
|||
/* |
|||
* Public API Surface of utils |
|||
*/ |
|||
|
|||
/** |
|||
* Generated bundle index. Do not edit. |
|||
*/ |
|||
|
|||
exports.LinkedList = LinkedList; |
|||
exports.ListNode = ListNode; |
|||
|
|||
Object.defineProperty(exports, '__esModule', { value: true }); |
|||
|
|||
}))); |
|||
//# sourceMappingURL=abp-utils.umd.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@ |
|||
!function(a){a.fn.datepicker.dates["ar-DZ"]={days:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت","الأحد"],daysShort:["أحد","اثنين","ثلاثاء","أربعاء","خميس","جمعة","سبت","أحد"],daysMin:["ح","ن","ث","ع","خ","ج","س","ح"],months:["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويليه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],monthsShort:["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويليه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],today:"هذا اليوم",rtl:!0,monthsTitle:"أشهر",clear:"إزالة",format:"yyyy/mm/dd",weekStart:0}}(jQuery); |
@ -1 +0,0 @@ |
|||
!function(a){a.fn.datepicker.dates.ca={days:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],daysShort:["dg.","dl.","dt.","dc.","dj.","dv.","ds."],daysMin:["dg","dl","dt","dc","dj","dv","ds"],months:["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],monthsShort:["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],today:"Avui",monthsTitle:"Mesos",clear:"Esborra",weekStart:1,format:"dd/mm/yyyy"}}(jQuery); |
@ -1 +0,0 @@ |
|||
!function(a){a.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["So","Mo","Di","Mi","Do","Fr","Sa"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",monthsTitle:"Monate",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}(jQuery); |
@ -1 +0,0 @@ |
|||
!function(a){a.fn.datepicker.dates["en-US"]={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",monthsTitle:"Months",clear:"Clear",weekStart:0,format:"m/d/yyyy"}}(jQuery); |
@ -1 +0,0 @@ |
|||
!function(a){a.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],daysShort:["sun","maa","tii","kes","tor","per","lau"],daysMin:["su","ma","ti","ke","to","pe","la"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tammi","helmi","maalis","huhti","touko","kesä","heinä","elo","syys","loka","marras","joulu"],today:"tänään",clear:"Tyhjennä",weekStart:1,format:"d.m.yyyy"}}(jQuery); |
@ -1 +0,0 @@ |
|||
!function(a){a.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],daysShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],daysMin:["Mg","Sn","Sl","Rb","Km","Jm","Sb"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],today:"Hari Ini",monthsTitle:"Bulan",clear:"Kosongkan",weekStart:0,format:"dd-mm-yyyy"}}(jQuery); |
@ -1 +0,0 @@ |
|||
!function(a){a.fn.datepicker.dates.mar={days:["रविवार","सोमवार","मंगळवार","बुधवार","गुरुवार","शुक्रवार","शनिवार"],daysShort:["रवि","सोम","मंगळ","बुध","गुरु","शुक्र","शनि"],daysMin:["र","सो","मं","बु","गु","शु","श"],months:["जानेवारी","फेब्रुवारी","मार्च","एप्रिल","मे","जून","जुलै","ऑगस्ट","सप्टेंबर","ऑक्टोबर","नोव्हेंबर","डिसेंबर"],monthsShort:["जाने.","फेब्रु.","मार्च","एप्रिल","मे","जून","जुलै","ऑगस्ट","सप्टें.","ऑक्टो.","नोव्हें.","डिसें."],today:"आज",monthsTitle:"महीने",clear:"हटवा",weekStart:1,format:"dd / mm / yyyy"}}(jQuery); |
@ -1 +0,0 @@ |
|||
!function(a){a.fn.datepicker.dates.uk={days:["Неділя","Понеділок","Вівторок","Середа","Четвер","П'ятниця","Субота"],daysShort:["Нед","Пнд","Втр","Срд","Чтв","Птн","Суб"],daysMin:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],monthsShort:["Січ","Лют","Бер","Кві","Тра","Чер","Лип","Сер","Вер","Жов","Лис","Гру"],today:"Сьогодні",clear:"Очистити",format:"dd.mm.yyyy",weekStart:1}}(jQuery); |
@ -1 +0,0 @@ |
|||
!function(a){a.fn.datepicker.dates["zh-TW"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],daysShort:["週日","週一","週二","週三","週四","週五","週六"],daysMin:["日","一","二","三","四","五","六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今天",monthsTitle:"月份",format:"yyyy/mm/dd",weekStart:0,titleFormat:"yyyy年mm月",clear:"清除"}}(jQuery); |
@ -1,411 +0,0 @@ |
|||
.daterangepicker { |
|||
position: absolute; |
|||
color: inherit; |
|||
background-color: #fff; |
|||
border-radius: 4px; |
|||
border: 1px solid #ddd; |
|||
width: 278px; |
|||
max-width: none; |
|||
padding: 0; |
|||
margin-top: 7px; |
|||
top: 100px; |
|||
left: 20px; |
|||
z-index: 3001; |
|||
display: none; |
|||
font-family: arial; |
|||
font-size: 15px; |
|||
line-height: 1em; |
|||
} |
|||
|
|||
.daterangepicker:before, .daterangepicker:after { |
|||
position: absolute; |
|||
display: inline-block; |
|||
border-bottom-color: rgba(0, 0, 0, 0.2); |
|||
content: ''; |
|||
} |
|||
|
|||
.daterangepicker:before { |
|||
top: -7px; |
|||
border-right: 7px solid transparent; |
|||
border-left: 7px solid transparent; |
|||
border-bottom: 7px solid #ccc; |
|||
} |
|||
|
|||
.daterangepicker:after { |
|||
top: -6px; |
|||
border-right: 6px solid transparent; |
|||
border-bottom: 6px solid #fff; |
|||
border-left: 6px solid transparent; |
|||
} |
|||
|
|||
.daterangepicker.opensleft:before { |
|||
right: 9px; |
|||
} |
|||
|
|||
.daterangepicker.opensleft:after { |
|||
right: 10px; |
|||
} |
|||
|
|||
.daterangepicker.openscenter:before { |
|||
left: 0; |
|||
right: 0; |
|||
width: 0; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
.daterangepicker.openscenter:after { |
|||
left: 0; |
|||
right: 0; |
|||
width: 0; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
.daterangepicker.opensright:before { |
|||
left: 9px; |
|||
} |
|||
|
|||
.daterangepicker.opensright:after { |
|||
left: 10px; |
|||
} |
|||
|
|||
.daterangepicker.drop-up { |
|||
margin-top: -7px; |
|||
} |
|||
|
|||
.daterangepicker.drop-up:before { |
|||
top: initial; |
|||
bottom: -7px; |
|||
border-bottom: initial; |
|||
border-top: 7px solid #ccc; |
|||
} |
|||
|
|||
.daterangepicker.drop-up:after { |
|||
top: initial; |
|||
bottom: -6px; |
|||
border-bottom: initial; |
|||
border-top: 6px solid #fff; |
|||
} |
|||
|
|||
.daterangepicker.single .daterangepicker .ranges, .daterangepicker.single .drp-calendar { |
|||
float: none; |
|||
} |
|||
|
|||
.daterangepicker.single .drp-selected { |
|||
display: none; |
|||
} |
|||
|
|||
.daterangepicker.show-calendar .drp-calendar { |
|||
display: block; |
|||
} |
|||
|
|||
.daterangepicker.show-calendar .drp-buttons { |
|||
display: block; |
|||
} |
|||
|
|||
.daterangepicker.auto-apply .drp-buttons { |
|||
display: none; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar { |
|||
display: none; |
|||
max-width: 270px; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left { |
|||
padding: 8px 0 8px 8px; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.right { |
|||
padding: 8px; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.single .calendar-table { |
|||
border: none; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table .next span, .daterangepicker .calendar-table .prev span { |
|||
color: #fff; |
|||
border: solid black; |
|||
border-width: 0 2px 2px 0; |
|||
border-radius: 0; |
|||
display: inline-block; |
|||
padding: 3px; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table .next span { |
|||
transform: rotate(-45deg); |
|||
-webkit-transform: rotate(-45deg); |
|||
} |
|||
|
|||
.daterangepicker .calendar-table .prev span { |
|||
transform: rotate(135deg); |
|||
-webkit-transform: rotate(135deg); |
|||
} |
|||
|
|||
.daterangepicker .calendar-table th, .daterangepicker .calendar-table td { |
|||
white-space: nowrap; |
|||
text-align: center; |
|||
vertical-align: middle; |
|||
min-width: 32px; |
|||
width: 32px; |
|||
height: 24px; |
|||
line-height: 24px; |
|||
font-size: 12px; |
|||
border-radius: 4px; |
|||
border: 1px solid transparent; |
|||
white-space: nowrap; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table { |
|||
border: 1px solid #fff; |
|||
border-radius: 4px; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
.daterangepicker .calendar-table table { |
|||
width: 100%; |
|||
margin: 0; |
|||
border-spacing: 0; |
|||
border-collapse: collapse; |
|||
} |
|||
|
|||
.daterangepicker td.available:hover, .daterangepicker th.available:hover { |
|||
background-color: #eee; |
|||
border-color: transparent; |
|||
color: inherit; |
|||
} |
|||
|
|||
.daterangepicker td.week, .daterangepicker th.week { |
|||
font-size: 80%; |
|||
color: #ccc; |
|||
} |
|||
|
|||
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date { |
|||
background-color: #fff; |
|||
border-color: transparent; |
|||
color: #999; |
|||
} |
|||
|
|||
.daterangepicker td.in-range { |
|||
background-color: #ebf4f8; |
|||
border-color: transparent; |
|||
color: #000; |
|||
border-radius: 0; |
|||
} |
|||
|
|||
.daterangepicker td.start-date { |
|||
border-radius: 4px 0 0 4px; |
|||
} |
|||
|
|||
.daterangepicker td.end-date { |
|||
border-radius: 0 4px 4px 0; |
|||
} |
|||
|
|||
.daterangepicker td.start-date.end-date { |
|||
border-radius: 4px; |
|||
} |
|||
|
|||
.daterangepicker td.active, .daterangepicker td.active:hover { |
|||
background-color: #357ebd; |
|||
border-color: transparent; |
|||
color: #fff; |
|||
} |
|||
|
|||
.daterangepicker th.month { |
|||
width: auto; |
|||
} |
|||
|
|||
.daterangepicker td.disabled, .daterangepicker option.disabled { |
|||
color: #999; |
|||
cursor: not-allowed; |
|||
text-decoration: line-through; |
|||
} |
|||
|
|||
.daterangepicker select.monthselect, .daterangepicker select.yearselect { |
|||
font-size: 12px; |
|||
padding: 1px; |
|||
height: auto; |
|||
margin: 0; |
|||
cursor: default; |
|||
} |
|||
|
|||
.daterangepicker select.monthselect { |
|||
margin-right: 2%; |
|||
width: 56%; |
|||
} |
|||
|
|||
.daterangepicker select.yearselect { |
|||
width: 40%; |
|||
} |
|||
|
|||
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect { |
|||
width: 50px; |
|||
margin: 0 auto; |
|||
background: #eee; |
|||
border: 1px solid #eee; |
|||
padding: 2px; |
|||
outline: 0; |
|||
font-size: 12px; |
|||
} |
|||
|
|||
.daterangepicker .calendar-time { |
|||
text-align: center; |
|||
margin: 4px auto 0 auto; |
|||
line-height: 30px; |
|||
position: relative; |
|||
} |
|||
|
|||
.daterangepicker .calendar-time select.disabled { |
|||
color: #ccc; |
|||
cursor: not-allowed; |
|||
} |
|||
|
|||
.daterangepicker .drp-buttons { |
|||
clear: both; |
|||
text-align: right; |
|||
padding: 8px; |
|||
border-top: 1px solid #ddd; |
|||
display: none; |
|||
line-height: 12px; |
|||
vertical-align: middle; |
|||
} |
|||
|
|||
.daterangepicker .drp-selected { |
|||
display: inline-block; |
|||
font-size: 12px; |
|||
padding-right: 8px; |
|||
} |
|||
|
|||
.daterangepicker .drp-buttons .btn { |
|||
margin-left: 8px; |
|||
font-size: 12px; |
|||
font-weight: bold; |
|||
padding: 4px 8px; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.single.rtl .drp-calendar.left { |
|||
border-right: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.single.ltr .drp-calendar.left { |
|||
border-left: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.rtl .drp-calendar.right { |
|||
border-right: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker.show-ranges.ltr .drp-calendar.left { |
|||
border-left: 1px solid #ddd; |
|||
} |
|||
|
|||
.daterangepicker .ranges { |
|||
float: none; |
|||
text-align: left; |
|||
margin: 0; |
|||
} |
|||
|
|||
.daterangepicker.show-calendar .ranges { |
|||
margin-top: 8px; |
|||
} |
|||
|
|||
.daterangepicker .ranges ul { |
|||
list-style: none; |
|||
margin: 0 auto; |
|||
padding: 0; |
|||
width: 100%; |
|||
} |
|||
|
|||
.daterangepicker .ranges li { |
|||
font-size: 12px; |
|||
padding: 8px 12px; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.daterangepicker .ranges li:hover { |
|||
background-color: #eee; |
|||
} |
|||
|
|||
.daterangepicker .ranges li.active { |
|||
background-color: #08c; |
|||
color: #fff; |
|||
} |
|||
|
|||
/* Larger Screen Styling */ |
|||
@media (min-width: 564px) { |
|||
.daterangepicker { |
|||
width: auto; |
|||
} |
|||
|
|||
.daterangepicker .ranges ul { |
|||
width: 140px; |
|||
} |
|||
|
|||
.daterangepicker.single .ranges ul { |
|||
width: 100%; |
|||
} |
|||
|
|||
.daterangepicker.single .drp-calendar.left { |
|||
clear: none; |
|||
} |
|||
|
|||
.daterangepicker.single .ranges, .daterangepicker.single .drp-calendar { |
|||
float: left; |
|||
} |
|||
|
|||
.daterangepicker { |
|||
direction: ltr; |
|||
text-align: left; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left { |
|||
clear: left; |
|||
margin-right: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left .calendar-table { |
|||
border-right: none; |
|||
border-top-right-radius: 0; |
|||
border-bottom-right-radius: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.right { |
|||
margin-left: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.right .calendar-table { |
|||
border-left: none; |
|||
border-top-left-radius: 0; |
|||
border-bottom-left-radius: 0; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left .calendar-table { |
|||
padding-right: 8px; |
|||
} |
|||
|
|||
.daterangepicker .ranges, .daterangepicker .drp-calendar { |
|||
float: left; |
|||
} |
|||
} |
|||
|
|||
@media (min-width: 730px) { |
|||
.daterangepicker .ranges { |
|||
width: auto; |
|||
} |
|||
|
|||
.daterangepicker .ranges { |
|||
float: left; |
|||
} |
|||
|
|||
.daterangepicker.rtl .ranges { |
|||
float: right; |
|||
} |
|||
|
|||
.daterangepicker .drp-calendar.left { |
|||
clear: none !important; |
|||
} |
|||
|
|||
} |
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,5 +0,0 @@ |
|||
(function () { |
|||
[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map(function (popoverTriggerEl) { |
|||
return new bootstrap.Popover(popoverTriggerEl) |
|||
}) |
|||
})(); |
@ -1,5 +0,0 @@ |
|||
(function () { |
|||
[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function (tooltipTriggerEl) { |
|||
return new bootstrap.Tooltip(tooltipTriggerEl) |
|||
}); |
|||
})(); |
@ -1,430 +0,0 @@ |
|||
@charset "UTF-8"; |
|||
:root { |
|||
--dt-row-selected: 13, 110, 253; |
|||
--dt-row-selected-text: 255, 255, 255; |
|||
--dt-row-selected-link: 9, 10, 11; |
|||
} |
|||
|
|||
table.dataTable td.dt-control { |
|||
text-align: center; |
|||
cursor: pointer; |
|||
} |
|||
table.dataTable td.dt-control:before { |
|||
height: 1em; |
|||
width: 1em; |
|||
margin-top: -9px; |
|||
display: inline-block; |
|||
color: white; |
|||
border: 0.15em solid white; |
|||
border-radius: 1em; |
|||
box-shadow: 0 0 0.2em #444; |
|||
box-sizing: content-box; |
|||
text-align: center; |
|||
text-indent: 0 !important; |
|||
font-family: "Courier New", Courier, monospace; |
|||
line-height: 1em; |
|||
content: "+"; |
|||
background-color: #31b131; |
|||
} |
|||
table.dataTable tr.dt-hasChild td.dt-control:before { |
|||
content: "-"; |
|||
background-color: #d33333; |
|||
} |
|||
|
|||
table.dataTable thead > tr > th.sorting, table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting_asc_disabled, table.dataTable thead > tr > th.sorting_desc_disabled, |
|||
table.dataTable thead > tr > td.sorting, |
|||
table.dataTable thead > tr > td.sorting_asc, |
|||
table.dataTable thead > tr > td.sorting_desc, |
|||
table.dataTable thead > tr > td.sorting_asc_disabled, |
|||
table.dataTable thead > tr > td.sorting_desc_disabled { |
|||
cursor: pointer; |
|||
position: relative; |
|||
padding-right: 26px; |
|||
} |
|||
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:after, |
|||
table.dataTable thead > tr > td.sorting:before, |
|||
table.dataTable thead > tr > td.sorting:after, |
|||
table.dataTable thead > tr > td.sorting_asc:before, |
|||
table.dataTable thead > tr > td.sorting_asc:after, |
|||
table.dataTable thead > tr > td.sorting_desc:before, |
|||
table.dataTable thead > tr > td.sorting_desc:after, |
|||
table.dataTable thead > tr > td.sorting_asc_disabled:before, |
|||
table.dataTable thead > tr > td.sorting_asc_disabled:after, |
|||
table.dataTable thead > tr > td.sorting_desc_disabled:before, |
|||
table.dataTable thead > tr > td.sorting_desc_disabled:after { |
|||
position: absolute; |
|||
display: block; |
|||
opacity: 0.125; |
|||
right: 10px; |
|||
line-height: 9px; |
|||
font-size: 0.8em; |
|||
} |
|||
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:before, |
|||
table.dataTable thead > tr > td.sorting:before, |
|||
table.dataTable thead > tr > td.sorting_asc:before, |
|||
table.dataTable thead > tr > td.sorting_desc:before, |
|||
table.dataTable thead > tr > td.sorting_asc_disabled:before, |
|||
table.dataTable thead > tr > td.sorting_desc_disabled:before { |
|||
bottom: 50%; |
|||
content: "▲"; |
|||
content: "▲"/""; |
|||
} |
|||
table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:after, |
|||
table.dataTable thead > tr > td.sorting:after, |
|||
table.dataTable thead > tr > td.sorting_asc:after, |
|||
table.dataTable thead > tr > td.sorting_desc:after, |
|||
table.dataTable thead > tr > td.sorting_asc_disabled:after, |
|||
table.dataTable thead > tr > td.sorting_desc_disabled:after { |
|||
top: 50%; |
|||
content: "▼"; |
|||
content: "▼"/""; |
|||
} |
|||
table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:after, |
|||
table.dataTable thead > tr > td.sorting_asc:before, |
|||
table.dataTable thead > tr > td.sorting_desc:after { |
|||
opacity: 0.6; |
|||
} |
|||
table.dataTable thead > tr > th.sorting_desc_disabled:after, table.dataTable thead > tr > th.sorting_asc_disabled:before, |
|||
table.dataTable thead > tr > td.sorting_desc_disabled:after, |
|||
table.dataTable thead > tr > td.sorting_asc_disabled:before { |
|||
display: none; |
|||
} |
|||
table.dataTable thead > tr > th:active, |
|||
table.dataTable thead > tr > td:active { |
|||
outline: none; |
|||
} |
|||
|
|||
div.dataTables_scrollBody > table.dataTable > thead > tr > th:before, div.dataTables_scrollBody > table.dataTable > thead > tr > th:after, |
|||
div.dataTables_scrollBody > table.dataTable > thead > tr > td:before, |
|||
div.dataTables_scrollBody > table.dataTable > thead > tr > td:after { |
|||
display: none; |
|||
} |
|||
|
|||
div.dataTables_processing { |
|||
position: absolute; |
|||
top: 50%; |
|||
left: 50%; |
|||
width: 200px; |
|||
margin-left: -100px; |
|||
margin-top: -26px; |
|||
text-align: center; |
|||
padding: 2px; |
|||
} |
|||
div.dataTables_processing > div:last-child { |
|||
position: relative; |
|||
width: 80px; |
|||
height: 15px; |
|||
margin: 1em auto; |
|||
} |
|||
div.dataTables_processing > div:last-child > div { |
|||
position: absolute; |
|||
top: 0; |
|||
width: 13px; |
|||
height: 13px; |
|||
border-radius: 50%; |
|||
background: #0d6efd; |
|||
background: rgb(var(--dt-row-selected)); |
|||
animation-timing-function: cubic-bezier(0, 1, 1, 0); |
|||
} |
|||
div.dataTables_processing > div:last-child > div:nth-child(1) { |
|||
left: 8px; |
|||
animation: datatables-loader-1 0.6s infinite; |
|||
} |
|||
div.dataTables_processing > div:last-child > div:nth-child(2) { |
|||
left: 8px; |
|||
animation: datatables-loader-2 0.6s infinite; |
|||
} |
|||
div.dataTables_processing > div:last-child > div:nth-child(3) { |
|||
left: 32px; |
|||
animation: datatables-loader-2 0.6s infinite; |
|||
} |
|||
div.dataTables_processing > div:last-child > div:nth-child(4) { |
|||
left: 56px; |
|||
animation: datatables-loader-3 0.6s infinite; |
|||
} |
|||
|
|||
@keyframes datatables-loader-1 { |
|||
0% { |
|||
transform: scale(0); |
|||
} |
|||
100% { |
|||
transform: scale(1); |
|||
} |
|||
} |
|||
@keyframes datatables-loader-3 { |
|||
0% { |
|||
transform: scale(1); |
|||
} |
|||
100% { |
|||
transform: scale(0); |
|||
} |
|||
} |
|||
@keyframes datatables-loader-2 { |
|||
0% { |
|||
transform: translate(0, 0); |
|||
} |
|||
100% { |
|||
transform: translate(24px, 0); |
|||
} |
|||
} |
|||
table.dataTable.nowrap th, table.dataTable.nowrap td { |
|||
white-space: nowrap; |
|||
} |
|||
table.dataTable th.dt-left, |
|||
table.dataTable td.dt-left { |
|||
text-align: left; |
|||
} |
|||
table.dataTable th.dt-center, |
|||
table.dataTable td.dt-center, |
|||
table.dataTable td.dataTables_empty { |
|||
text-align: center; |
|||
} |
|||
table.dataTable th.dt-right, |
|||
table.dataTable td.dt-right { |
|||
text-align: right; |
|||
} |
|||
table.dataTable th.dt-justify, |
|||
table.dataTable td.dt-justify { |
|||
text-align: justify; |
|||
} |
|||
table.dataTable th.dt-nowrap, |
|||
table.dataTable td.dt-nowrap { |
|||
white-space: nowrap; |
|||
} |
|||
table.dataTable thead th, |
|||
table.dataTable thead td, |
|||
table.dataTable tfoot th, |
|||
table.dataTable tfoot td { |
|||
text-align: left; |
|||
} |
|||
table.dataTable thead th.dt-head-left, |
|||
table.dataTable thead td.dt-head-left, |
|||
table.dataTable tfoot th.dt-head-left, |
|||
table.dataTable tfoot td.dt-head-left { |
|||
text-align: left; |
|||
} |
|||
table.dataTable thead th.dt-head-center, |
|||
table.dataTable thead td.dt-head-center, |
|||
table.dataTable tfoot th.dt-head-center, |
|||
table.dataTable tfoot td.dt-head-center { |
|||
text-align: center; |
|||
} |
|||
table.dataTable thead th.dt-head-right, |
|||
table.dataTable thead td.dt-head-right, |
|||
table.dataTable tfoot th.dt-head-right, |
|||
table.dataTable tfoot td.dt-head-right { |
|||
text-align: right; |
|||
} |
|||
table.dataTable thead th.dt-head-justify, |
|||
table.dataTable thead td.dt-head-justify, |
|||
table.dataTable tfoot th.dt-head-justify, |
|||
table.dataTable tfoot td.dt-head-justify { |
|||
text-align: justify; |
|||
} |
|||
table.dataTable thead th.dt-head-nowrap, |
|||
table.dataTable thead td.dt-head-nowrap, |
|||
table.dataTable tfoot th.dt-head-nowrap, |
|||
table.dataTable tfoot td.dt-head-nowrap { |
|||
white-space: nowrap; |
|||
} |
|||
table.dataTable tbody th.dt-body-left, |
|||
table.dataTable tbody td.dt-body-left { |
|||
text-align: left; |
|||
} |
|||
table.dataTable tbody th.dt-body-center, |
|||
table.dataTable tbody td.dt-body-center { |
|||
text-align: center; |
|||
} |
|||
table.dataTable tbody th.dt-body-right, |
|||
table.dataTable tbody td.dt-body-right { |
|||
text-align: right; |
|||
} |
|||
table.dataTable tbody th.dt-body-justify, |
|||
table.dataTable tbody td.dt-body-justify { |
|||
text-align: justify; |
|||
} |
|||
table.dataTable tbody th.dt-body-nowrap, |
|||
table.dataTable tbody td.dt-body-nowrap { |
|||
white-space: nowrap; |
|||
} |
|||
|
|||
/*! Bootstrap 5 integration for DataTables |
|||
* |
|||
* ©2020 SpryMedia Ltd, all rights reserved. |
|||
* License: MIT datatables.net/license/mit |
|||
*/ |
|||
table.dataTable { |
|||
clear: both; |
|||
margin-top: 6px !important; |
|||
margin-bottom: 6px !important; |
|||
max-width: none !important; |
|||
border-collapse: separate !important; |
|||
border-spacing: 0; |
|||
} |
|||
table.dataTable td, |
|||
table.dataTable th { |
|||
-webkit-box-sizing: content-box; |
|||
box-sizing: content-box; |
|||
} |
|||
table.dataTable td.dataTables_empty, |
|||
table.dataTable th.dataTables_empty { |
|||
text-align: center; |
|||
} |
|||
table.dataTable.nowrap th, |
|||
table.dataTable.nowrap td { |
|||
white-space: nowrap; |
|||
} |
|||
table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1) > * { |
|||
box-shadow: none; |
|||
} |
|||
table.dataTable > tbody > tr { |
|||
background-color: transparent; |
|||
} |
|||
table.dataTable > tbody > tr.selected > * { |
|||
box-shadow: inset 0 0 0 9999px #0d6efd; |
|||
box-shadow: inset 0 0 0 9999px rgb(var(--dt-row-selected)); |
|||
color: white; |
|||
color: rgb(var(--dt-row-selected-text)); |
|||
} |
|||
table.dataTable > tbody > tr.selected a { |
|||
color: #090a0b; |
|||
color: rgb(var(--dt-row-selected-link)); |
|||
} |
|||
table.dataTable.table-striped > tbody > tr.odd > * { |
|||
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.05); |
|||
} |
|||
table.dataTable.table-striped > tbody > tr.odd.selected > * { |
|||
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.95); |
|||
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.95); |
|||
} |
|||
table.dataTable.table-hover > tbody > tr:hover > * { |
|||
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.075); |
|||
} |
|||
table.dataTable.table-hover > tbody > tr.selected:hover > * { |
|||
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.975); |
|||
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.975); |
|||
} |
|||
|
|||
div.dataTables_wrapper div.dataTables_length label { |
|||
font-weight: normal; |
|||
text-align: left; |
|||
white-space: nowrap; |
|||
} |
|||
div.dataTables_wrapper div.dataTables_length select { |
|||
width: auto; |
|||
display: inline-block; |
|||
} |
|||
div.dataTables_wrapper div.dataTables_filter { |
|||
text-align: right; |
|||
} |
|||
div.dataTables_wrapper div.dataTables_filter label { |
|||
font-weight: normal; |
|||
white-space: nowrap; |
|||
text-align: left; |
|||
} |
|||
div.dataTables_wrapper div.dataTables_filter input { |
|||
margin-left: 0.5em; |
|||
display: inline-block; |
|||
width: auto; |
|||
} |
|||
div.dataTables_wrapper div.dataTables_info { |
|||
padding-top: 0.85em; |
|||
} |
|||
div.dataTables_wrapper div.dataTables_paginate { |
|||
margin: 0; |
|||
white-space: nowrap; |
|||
text-align: right; |
|||
} |
|||
div.dataTables_wrapper div.dataTables_paginate ul.pagination { |
|||
margin: 2px 0; |
|||
white-space: nowrap; |
|||
justify-content: flex-end; |
|||
} |
|||
div.dataTables_wrapper div.dt-row { |
|||
position: relative; |
|||
} |
|||
|
|||
div.dataTables_scrollHead table.dataTable { |
|||
margin-bottom: 0 !important; |
|||
} |
|||
|
|||
div.dataTables_scrollBody > table { |
|||
border-top: none; |
|||
margin-top: 0 !important; |
|||
margin-bottom: 0 !important; |
|||
} |
|||
div.dataTables_scrollBody > table > thead .sorting:before, |
|||
div.dataTables_scrollBody > table > thead .sorting_asc:before, |
|||
div.dataTables_scrollBody > table > thead .sorting_desc:before, |
|||
div.dataTables_scrollBody > table > thead .sorting:after, |
|||
div.dataTables_scrollBody > table > thead .sorting_asc:after, |
|||
div.dataTables_scrollBody > table > thead .sorting_desc:after { |
|||
display: none; |
|||
} |
|||
div.dataTables_scrollBody > table > tbody tr:first-child th, |
|||
div.dataTables_scrollBody > table > tbody tr:first-child td { |
|||
border-top: none; |
|||
} |
|||
|
|||
div.dataTables_scrollFoot > .dataTables_scrollFootInner { |
|||
box-sizing: content-box; |
|||
} |
|||
div.dataTables_scrollFoot > .dataTables_scrollFootInner > table { |
|||
margin-top: 0 !important; |
|||
border-top: none; |
|||
} |
|||
|
|||
@media screen and (max-width: 767px) { |
|||
div.dataTables_wrapper div.dataTables_length, |
|||
div.dataTables_wrapper div.dataTables_filter, |
|||
div.dataTables_wrapper div.dataTables_info, |
|||
div.dataTables_wrapper div.dataTables_paginate { |
|||
text-align: center; |
|||
} |
|||
div.dataTables_wrapper div.dataTables_paginate ul.pagination { |
|||
justify-content: center !important; |
|||
} |
|||
} |
|||
table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) { |
|||
padding-right: 20px; |
|||
} |
|||
|
|||
table.table-bordered.dataTable { |
|||
border-right-width: 0; |
|||
} |
|||
table.table-bordered.dataTable thead tr:first-child th, |
|||
table.table-bordered.dataTable thead tr:first-child td { |
|||
border-top-width: 1px; |
|||
} |
|||
table.table-bordered.dataTable th, |
|||
table.table-bordered.dataTable td { |
|||
border-left-width: 0; |
|||
} |
|||
table.table-bordered.dataTable th:first-child, table.table-bordered.dataTable th:first-child, |
|||
table.table-bordered.dataTable td:first-child, |
|||
table.table-bordered.dataTable td:first-child { |
|||
border-left-width: 1px; |
|||
} |
|||
table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child, |
|||
table.table-bordered.dataTable td:last-child, |
|||
table.table-bordered.dataTable td:last-child { |
|||
border-right-width: 1px; |
|||
} |
|||
table.table-bordered.dataTable th, |
|||
table.table-bordered.dataTable td { |
|||
border-bottom-width: 1px; |
|||
} |
|||
|
|||
div.dataTables_scrollHead table.table-bordered { |
|||
border-bottom-width: 0; |
|||
} |
|||
|
|||
div.table-responsive > div.dataTables_wrapper > div.row { |
|||
margin: 0; |
|||
} |
|||
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:first-child { |
|||
padding-left: 0; |
|||
} |
|||
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:last-child { |
|||
padding-right: 0; |
|||
} |
@ -1,212 +0,0 @@ |
|||
/*! DataTables Bootstrap 5 integration |
|||
* 2020 SpryMedia Ltd - datatables.net/license |
|||
*/ |
|||
|
|||
(function( factory ){ |
|||
if ( typeof define === 'function' && define.amd ) { |
|||
// AMD
|
|||
define( ['jquery', 'datatables.net'], function ( $ ) { |
|||
return factory( $, window, document ); |
|||
} ); |
|||
} |
|||
else if ( typeof exports === 'object' ) { |
|||
// CommonJS
|
|||
var jq = require('jquery'); |
|||
var cjsRequires = function (root, $) { |
|||
if ( ! $.fn.dataTable ) { |
|||
require('datatables.net')(root, $); |
|||
} |
|||
}; |
|||
|
|||
if (typeof window !== 'undefined') { |
|||
module.exports = function (root, $) { |
|||
if ( ! root ) { |
|||
// CommonJS environments without a window global must pass a
|
|||
// root. This will give an error otherwise
|
|||
root = window; |
|||
} |
|||
|
|||
if ( ! $ ) { |
|||
$ = jq( root ); |
|||
} |
|||
|
|||
cjsRequires( root, $ ); |
|||
return factory( $, root, root.document ); |
|||
}; |
|||
} |
|||
else { |
|||
cjsRequires( window, jq ); |
|||
module.exports = factory( jq, window, window.document ); |
|||
} |
|||
} |
|||
else { |
|||
// Browser
|
|||
factory( jQuery, window, document ); |
|||
} |
|||
}(function( $, window, document, undefined ) { |
|||
'use strict'; |
|||
var DataTable = $.fn.dataTable; |
|||
|
|||
|
|||
|
|||
/** |
|||
* DataTables integration for Bootstrap 5. This requires Bootstrap 5 and |
|||
* DataTables 1.10 or newer. |
|||
* |
|||
* This file sets the defaults and adds options to DataTables to style its |
|||
* controls using Bootstrap. See http://datatables.net/manual/styling/bootstrap
|
|||
* for further information. |
|||
*/ |
|||
|
|||
/* Set the defaults for DataTables initialisation */ |
|||
$.extend( true, DataTable.defaults, { |
|||
dom: |
|||
"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>>" + |
|||
"<'row dt-row'<'col-sm-12'tr>>" + |
|||
"<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>", |
|||
renderer: 'bootstrap' |
|||
} ); |
|||
|
|||
|
|||
/* Default class modification */ |
|||
$.extend( DataTable.ext.classes, { |
|||
sWrapper: "dataTables_wrapper dt-bootstrap5", |
|||
sFilterInput: "form-control form-control-sm", |
|||
sLengthSelect: "form-select form-select-sm", |
|||
sProcessing: "dataTables_processing card", |
|||
sPageButton: "paginate_button page-item" |
|||
} ); |
|||
|
|||
|
|||
/* Bootstrap paging button renderer */ |
|||
DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) { |
|||
var api = new DataTable.Api( settings ); |
|||
var classes = settings.oClasses; |
|||
var lang = settings.oLanguage.oPaginate; |
|||
var aria = settings.oLanguage.oAria.paginate || {}; |
|||
var btnDisplay, btnClass; |
|||
|
|||
var attach = function( container, buttons ) { |
|||
var i, ien, node, button; |
|||
var clickHandler = function ( e ) { |
|||
e.preventDefault(); |
|||
if ( !$(e.currentTarget).hasClass('disabled') && api.page() != e.data.action ) { |
|||
api.page( e.data.action ).draw( 'page' ); |
|||
} |
|||
}; |
|||
|
|||
for ( i=0, ien=buttons.length ; i<ien ; i++ ) { |
|||
button = buttons[i]; |
|||
|
|||
if ( Array.isArray( button ) ) { |
|||
attach( container, button ); |
|||
} |
|||
else { |
|||
btnDisplay = ''; |
|||
btnClass = ''; |
|||
|
|||
switch ( button ) { |
|||
case 'ellipsis': |
|||
btnDisplay = '…'; |
|||
btnClass = 'disabled'; |
|||
break; |
|||
|
|||
case 'first': |
|||
btnDisplay = lang.sFirst; |
|||
btnClass = button + (page > 0 ? |
|||
'' : ' disabled'); |
|||
break; |
|||
|
|||
case 'previous': |
|||
btnDisplay = lang.sPrevious; |
|||
btnClass = button + (page > 0 ? |
|||
'' : ' disabled'); |
|||
break; |
|||
|
|||
case 'next': |
|||
btnDisplay = lang.sNext; |
|||
btnClass = button + (page < pages-1 ? |
|||
'' : ' disabled'); |
|||
break; |
|||
|
|||
case 'last': |
|||
btnDisplay = lang.sLast; |
|||
btnClass = button + (page < pages-1 ? |
|||
'' : ' disabled'); |
|||
break; |
|||
|
|||
default: |
|||
btnDisplay = button + 1; |
|||
btnClass = page === button ? |
|||
'active' : ''; |
|||
break; |
|||
} |
|||
|
|||
if ( btnDisplay ) { |
|||
var disabled = btnClass.indexOf('disabled') !== -1; |
|||
|
|||
node = $('<li>', { |
|||
'class': classes.sPageButton+' '+btnClass, |
|||
'id': idx === 0 && typeof button === 'string' ? |
|||
settings.sTableId +'_'+ button : |
|||
null |
|||
} ) |
|||
.append( $('<a>', { |
|||
'href': disabled ? null : '#', |
|||
'aria-controls': settings.sTableId, |
|||
'aria-disabled': disabled ? 'true' : null, |
|||
'aria-label': aria[ button ], |
|||
'aria-role': 'link', |
|||
'aria-current': btnClass === 'active' ? 'page' : null, |
|||
'data-dt-idx': button, |
|||
'tabindex': settings.iTabIndex, |
|||
'class': 'page-link' |
|||
} ) |
|||
.html( btnDisplay ) |
|||
) |
|||
.appendTo( container ); |
|||
|
|||
settings.oApi._fnBindAction( |
|||
node, {action: button}, clickHandler |
|||
); |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
|
|||
var hostEl = $(host); |
|||
// IE9 throws an 'unknown error' if document.activeElement is used
|
|||
// inside an iframe or frame.
|
|||
var activeEl; |
|||
|
|||
try { |
|||
// Because this approach is destroying and recreating the paging
|
|||
// elements, focus is lost on the select button which is bad for
|
|||
// accessibility. So we want to restore focus once the draw has
|
|||
// completed
|
|||
activeEl = hostEl.find(document.activeElement).data('dt-idx'); |
|||
} |
|||
catch (e) {} |
|||
|
|||
var paginationEl = hostEl.children('ul.pagination'); |
|||
|
|||
if (paginationEl.length) { |
|||
paginationEl.empty(); |
|||
} |
|||
else { |
|||
paginationEl = hostEl.html('<ul/>').children('ul').addClass('pagination'); |
|||
} |
|||
|
|||
attach( |
|||
paginationEl, |
|||
buttons |
|||
); |
|||
|
|||
if ( activeEl !== undefined ) { |
|||
hostEl.find('[data-dt-idx='+activeEl+']').trigger('focus'); |
|||
} |
|||
}; |
|||
|
|||
|
|||
return DataTable; |
|||
})); |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue